github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/binding.go (about) 1 // Code generated by pulumigen DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package v1 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. 16 type Binding struct { 17 pulumi.CustomResourceState 18 19 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 20 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 21 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 22 Kind pulumi.StringPtrOutput `pulumi:"kind"` 23 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 24 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 25 // The target object that you want to bind to the standard object. 26 Target ObjectReferenceOutput `pulumi:"target"` 27 } 28 29 // NewBinding registers a new resource with the given unique name, arguments, and options. 30 func NewBinding(ctx *pulumi.Context, 31 name string, args *BindingArgs, opts ...pulumi.ResourceOption) (*Binding, error) { 32 if args == nil { 33 return nil, errors.New("missing one or more required arguments") 34 } 35 36 if args.Target == nil { 37 return nil, errors.New("invalid value for required argument 'Target'") 38 } 39 args.ApiVersion = pulumi.StringPtr("v1") 40 args.Kind = pulumi.StringPtr("Binding") 41 var resource Binding 42 err := ctx.RegisterResource("kubernetes:core/v1:Binding", name, args, &resource, opts...) 43 if err != nil { 44 return nil, err 45 } 46 return &resource, nil 47 } 48 49 // GetBinding gets an existing Binding resource's state with the given name, ID, and optional 50 // state properties that are used to uniquely qualify the lookup (nil if not required). 51 func GetBinding(ctx *pulumi.Context, 52 name string, id pulumi.IDInput, state *BindingState, opts ...pulumi.ResourceOption) (*Binding, error) { 53 var resource Binding 54 err := ctx.ReadResource("kubernetes:core/v1:Binding", name, id, state, &resource, opts...) 55 if err != nil { 56 return nil, err 57 } 58 return &resource, nil 59 } 60 61 // Input properties used for looking up and filtering Binding resources. 62 type bindingState struct { 63 } 64 65 type BindingState struct { 66 } 67 68 func (BindingState) ElementType() reflect.Type { 69 return reflect.TypeOf((*bindingState)(nil)).Elem() 70 } 71 72 type bindingArgs struct { 73 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 74 ApiVersion *string `pulumi:"apiVersion"` 75 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 76 Kind *string `pulumi:"kind"` 77 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 78 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 79 // The target object that you want to bind to the standard object. 80 Target ObjectReference `pulumi:"target"` 81 } 82 83 // The set of arguments for constructing a Binding resource. 84 type BindingArgs struct { 85 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 86 ApiVersion pulumi.StringPtrInput 87 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 88 Kind pulumi.StringPtrInput 89 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 90 Metadata metav1.ObjectMetaPtrInput 91 // The target object that you want to bind to the standard object. 92 Target ObjectReferenceInput 93 } 94 95 func (BindingArgs) ElementType() reflect.Type { 96 return reflect.TypeOf((*bindingArgs)(nil)).Elem() 97 } 98 99 type BindingInput interface { 100 pulumi.Input 101 102 ToBindingOutput() BindingOutput 103 ToBindingOutputWithContext(ctx context.Context) BindingOutput 104 } 105 106 func (*Binding) ElementType() reflect.Type { 107 return reflect.TypeOf((**Binding)(nil)).Elem() 108 } 109 110 func (i *Binding) ToBindingOutput() BindingOutput { 111 return i.ToBindingOutputWithContext(context.Background()) 112 } 113 114 func (i *Binding) ToBindingOutputWithContext(ctx context.Context) BindingOutput { 115 return pulumi.ToOutputWithContext(ctx, i).(BindingOutput) 116 } 117 118 // BindingArrayInput is an input type that accepts BindingArray and BindingArrayOutput values. 119 // You can construct a concrete instance of `BindingArrayInput` via: 120 // 121 // BindingArray{ BindingArgs{...} } 122 type BindingArrayInput interface { 123 pulumi.Input 124 125 ToBindingArrayOutput() BindingArrayOutput 126 ToBindingArrayOutputWithContext(context.Context) BindingArrayOutput 127 } 128 129 type BindingArray []BindingInput 130 131 func (BindingArray) ElementType() reflect.Type { 132 return reflect.TypeOf((*[]*Binding)(nil)).Elem() 133 } 134 135 func (i BindingArray) ToBindingArrayOutput() BindingArrayOutput { 136 return i.ToBindingArrayOutputWithContext(context.Background()) 137 } 138 139 func (i BindingArray) ToBindingArrayOutputWithContext(ctx context.Context) BindingArrayOutput { 140 return pulumi.ToOutputWithContext(ctx, i).(BindingArrayOutput) 141 } 142 143 // BindingMapInput is an input type that accepts BindingMap and BindingMapOutput values. 144 // You can construct a concrete instance of `BindingMapInput` via: 145 // 146 // BindingMap{ "key": BindingArgs{...} } 147 type BindingMapInput interface { 148 pulumi.Input 149 150 ToBindingMapOutput() BindingMapOutput 151 ToBindingMapOutputWithContext(context.Context) BindingMapOutput 152 } 153 154 type BindingMap map[string]BindingInput 155 156 func (BindingMap) ElementType() reflect.Type { 157 return reflect.TypeOf((*map[string]*Binding)(nil)).Elem() 158 } 159 160 func (i BindingMap) ToBindingMapOutput() BindingMapOutput { 161 return i.ToBindingMapOutputWithContext(context.Background()) 162 } 163 164 func (i BindingMap) ToBindingMapOutputWithContext(ctx context.Context) BindingMapOutput { 165 return pulumi.ToOutputWithContext(ctx, i).(BindingMapOutput) 166 } 167 168 type BindingOutput struct{ *pulumi.OutputState } 169 170 func (BindingOutput) ElementType() reflect.Type { 171 return reflect.TypeOf((**Binding)(nil)).Elem() 172 } 173 174 func (o BindingOutput) ToBindingOutput() BindingOutput { 175 return o 176 } 177 178 func (o BindingOutput) ToBindingOutputWithContext(ctx context.Context) BindingOutput { 179 return o 180 } 181 182 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 183 func (o BindingOutput) ApiVersion() pulumi.StringPtrOutput { 184 return o.ApplyT(func(v *Binding) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 185 } 186 187 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 188 func (o BindingOutput) Kind() pulumi.StringPtrOutput { 189 return o.ApplyT(func(v *Binding) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 190 } 191 192 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 193 func (o BindingOutput) Metadata() metav1.ObjectMetaPtrOutput { 194 return o.ApplyT(func(v *Binding) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 195 } 196 197 // The target object that you want to bind to the standard object. 198 func (o BindingOutput) Target() ObjectReferenceOutput { 199 return o.ApplyT(func(v *Binding) ObjectReferenceOutput { return v.Target }).(ObjectReferenceOutput) 200 } 201 202 type BindingArrayOutput struct{ *pulumi.OutputState } 203 204 func (BindingArrayOutput) ElementType() reflect.Type { 205 return reflect.TypeOf((*[]*Binding)(nil)).Elem() 206 } 207 208 func (o BindingArrayOutput) ToBindingArrayOutput() BindingArrayOutput { 209 return o 210 } 211 212 func (o BindingArrayOutput) ToBindingArrayOutputWithContext(ctx context.Context) BindingArrayOutput { 213 return o 214 } 215 216 func (o BindingArrayOutput) Index(i pulumi.IntInput) BindingOutput { 217 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Binding { 218 return vs[0].([]*Binding)[vs[1].(int)] 219 }).(BindingOutput) 220 } 221 222 type BindingMapOutput struct{ *pulumi.OutputState } 223 224 func (BindingMapOutput) ElementType() reflect.Type { 225 return reflect.TypeOf((*map[string]*Binding)(nil)).Elem() 226 } 227 228 func (o BindingMapOutput) ToBindingMapOutput() BindingMapOutput { 229 return o 230 } 231 232 func (o BindingMapOutput) ToBindingMapOutputWithContext(ctx context.Context) BindingMapOutput { 233 return o 234 } 235 236 func (o BindingMapOutput) MapIndex(k pulumi.StringInput) BindingOutput { 237 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Binding { 238 return vs[0].(map[string]*Binding)[vs[1].(string)] 239 }).(BindingOutput) 240 } 241 242 func init() { 243 pulumi.RegisterInputType(reflect.TypeOf((*BindingInput)(nil)).Elem(), &Binding{}) 244 pulumi.RegisterInputType(reflect.TypeOf((*BindingArrayInput)(nil)).Elem(), BindingArray{}) 245 pulumi.RegisterInputType(reflect.TypeOf((*BindingMapInput)(nil)).Elem(), BindingMap{}) 246 pulumi.RegisterOutputType(BindingOutput{}) 247 pulumi.RegisterOutputType(BindingArrayOutput{}) 248 pulumi.RegisterOutputType(BindingMapOutput{}) 249 }