github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/bindingPatch.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  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Patch resources are used to modify existing Kubernetes resources by using
    15  // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than
    16  // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource.
    17  // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the
    18  // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for
    19  // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
    20  // 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.
    21  type BindingPatch struct {
    22  	pulumi.CustomResourceState
    23  
    24  	// 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
    25  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    26  	// 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
    27  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    28  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    29  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    30  	// The target object that you want to bind to the standard object.
    31  	Target ObjectReferencePatchPtrOutput `pulumi:"target"`
    32  }
    33  
    34  // NewBindingPatch registers a new resource with the given unique name, arguments, and options.
    35  func NewBindingPatch(ctx *pulumi.Context,
    36  	name string, args *BindingPatchArgs, opts ...pulumi.ResourceOption) (*BindingPatch, error) {
    37  	if args == nil {
    38  		args = &BindingPatchArgs{}
    39  	}
    40  
    41  	args.ApiVersion = pulumi.StringPtr("v1")
    42  	args.Kind = pulumi.StringPtr("Binding")
    43  	var resource BindingPatch
    44  	err := ctx.RegisterResource("kubernetes:core/v1:BindingPatch", name, args, &resource, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return &resource, nil
    49  }
    50  
    51  // GetBindingPatch gets an existing BindingPatch resource's state with the given name, ID, and optional
    52  // state properties that are used to uniquely qualify the lookup (nil if not required).
    53  func GetBindingPatch(ctx *pulumi.Context,
    54  	name string, id pulumi.IDInput, state *BindingPatchState, opts ...pulumi.ResourceOption) (*BindingPatch, error) {
    55  	var resource BindingPatch
    56  	err := ctx.ReadResource("kubernetes:core/v1:BindingPatch", name, id, state, &resource, opts...)
    57  	if err != nil {
    58  		return nil, err
    59  	}
    60  	return &resource, nil
    61  }
    62  
    63  // Input properties used for looking up and filtering BindingPatch resources.
    64  type bindingPatchState struct {
    65  }
    66  
    67  type BindingPatchState struct {
    68  }
    69  
    70  func (BindingPatchState) ElementType() reflect.Type {
    71  	return reflect.TypeOf((*bindingPatchState)(nil)).Elem()
    72  }
    73  
    74  type bindingPatchArgs struct {
    75  	// 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
    76  	ApiVersion *string `pulumi:"apiVersion"`
    77  	// 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
    78  	Kind *string `pulumi:"kind"`
    79  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    80  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    81  	// The target object that you want to bind to the standard object.
    82  	Target *ObjectReferencePatch `pulumi:"target"`
    83  }
    84  
    85  // The set of arguments for constructing a BindingPatch resource.
    86  type BindingPatchArgs struct {
    87  	// 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
    88  	ApiVersion pulumi.StringPtrInput
    89  	// 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
    90  	Kind pulumi.StringPtrInput
    91  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    92  	Metadata metav1.ObjectMetaPatchPtrInput
    93  	// The target object that you want to bind to the standard object.
    94  	Target ObjectReferencePatchPtrInput
    95  }
    96  
    97  func (BindingPatchArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*bindingPatchArgs)(nil)).Elem()
    99  }
   100  
   101  type BindingPatchInput interface {
   102  	pulumi.Input
   103  
   104  	ToBindingPatchOutput() BindingPatchOutput
   105  	ToBindingPatchOutputWithContext(ctx context.Context) BindingPatchOutput
   106  }
   107  
   108  func (*BindingPatch) ElementType() reflect.Type {
   109  	return reflect.TypeOf((**BindingPatch)(nil)).Elem()
   110  }
   111  
   112  func (i *BindingPatch) ToBindingPatchOutput() BindingPatchOutput {
   113  	return i.ToBindingPatchOutputWithContext(context.Background())
   114  }
   115  
   116  func (i *BindingPatch) ToBindingPatchOutputWithContext(ctx context.Context) BindingPatchOutput {
   117  	return pulumi.ToOutputWithContext(ctx, i).(BindingPatchOutput)
   118  }
   119  
   120  // BindingPatchArrayInput is an input type that accepts BindingPatchArray and BindingPatchArrayOutput values.
   121  // You can construct a concrete instance of `BindingPatchArrayInput` via:
   122  //
   123  //	BindingPatchArray{ BindingPatchArgs{...} }
   124  type BindingPatchArrayInput interface {
   125  	pulumi.Input
   126  
   127  	ToBindingPatchArrayOutput() BindingPatchArrayOutput
   128  	ToBindingPatchArrayOutputWithContext(context.Context) BindingPatchArrayOutput
   129  }
   130  
   131  type BindingPatchArray []BindingPatchInput
   132  
   133  func (BindingPatchArray) ElementType() reflect.Type {
   134  	return reflect.TypeOf((*[]*BindingPatch)(nil)).Elem()
   135  }
   136  
   137  func (i BindingPatchArray) ToBindingPatchArrayOutput() BindingPatchArrayOutput {
   138  	return i.ToBindingPatchArrayOutputWithContext(context.Background())
   139  }
   140  
   141  func (i BindingPatchArray) ToBindingPatchArrayOutputWithContext(ctx context.Context) BindingPatchArrayOutput {
   142  	return pulumi.ToOutputWithContext(ctx, i).(BindingPatchArrayOutput)
   143  }
   144  
   145  // BindingPatchMapInput is an input type that accepts BindingPatchMap and BindingPatchMapOutput values.
   146  // You can construct a concrete instance of `BindingPatchMapInput` via:
   147  //
   148  //	BindingPatchMap{ "key": BindingPatchArgs{...} }
   149  type BindingPatchMapInput interface {
   150  	pulumi.Input
   151  
   152  	ToBindingPatchMapOutput() BindingPatchMapOutput
   153  	ToBindingPatchMapOutputWithContext(context.Context) BindingPatchMapOutput
   154  }
   155  
   156  type BindingPatchMap map[string]BindingPatchInput
   157  
   158  func (BindingPatchMap) ElementType() reflect.Type {
   159  	return reflect.TypeOf((*map[string]*BindingPatch)(nil)).Elem()
   160  }
   161  
   162  func (i BindingPatchMap) ToBindingPatchMapOutput() BindingPatchMapOutput {
   163  	return i.ToBindingPatchMapOutputWithContext(context.Background())
   164  }
   165  
   166  func (i BindingPatchMap) ToBindingPatchMapOutputWithContext(ctx context.Context) BindingPatchMapOutput {
   167  	return pulumi.ToOutputWithContext(ctx, i).(BindingPatchMapOutput)
   168  }
   169  
   170  type BindingPatchOutput struct{ *pulumi.OutputState }
   171  
   172  func (BindingPatchOutput) ElementType() reflect.Type {
   173  	return reflect.TypeOf((**BindingPatch)(nil)).Elem()
   174  }
   175  
   176  func (o BindingPatchOutput) ToBindingPatchOutput() BindingPatchOutput {
   177  	return o
   178  }
   179  
   180  func (o BindingPatchOutput) ToBindingPatchOutputWithContext(ctx context.Context) BindingPatchOutput {
   181  	return o
   182  }
   183  
   184  // 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
   185  func (o BindingPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   186  	return o.ApplyT(func(v *BindingPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   187  }
   188  
   189  // 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
   190  func (o BindingPatchOutput) Kind() pulumi.StringPtrOutput {
   191  	return o.ApplyT(func(v *BindingPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   192  }
   193  
   194  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   195  func (o BindingPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   196  	return o.ApplyT(func(v *BindingPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   197  }
   198  
   199  // The target object that you want to bind to the standard object.
   200  func (o BindingPatchOutput) Target() ObjectReferencePatchPtrOutput {
   201  	return o.ApplyT(func(v *BindingPatch) ObjectReferencePatchPtrOutput { return v.Target }).(ObjectReferencePatchPtrOutput)
   202  }
   203  
   204  type BindingPatchArrayOutput struct{ *pulumi.OutputState }
   205  
   206  func (BindingPatchArrayOutput) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*[]*BindingPatch)(nil)).Elem()
   208  }
   209  
   210  func (o BindingPatchArrayOutput) ToBindingPatchArrayOutput() BindingPatchArrayOutput {
   211  	return o
   212  }
   213  
   214  func (o BindingPatchArrayOutput) ToBindingPatchArrayOutputWithContext(ctx context.Context) BindingPatchArrayOutput {
   215  	return o
   216  }
   217  
   218  func (o BindingPatchArrayOutput) Index(i pulumi.IntInput) BindingPatchOutput {
   219  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BindingPatch {
   220  		return vs[0].([]*BindingPatch)[vs[1].(int)]
   221  	}).(BindingPatchOutput)
   222  }
   223  
   224  type BindingPatchMapOutput struct{ *pulumi.OutputState }
   225  
   226  func (BindingPatchMapOutput) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*map[string]*BindingPatch)(nil)).Elem()
   228  }
   229  
   230  func (o BindingPatchMapOutput) ToBindingPatchMapOutput() BindingPatchMapOutput {
   231  	return o
   232  }
   233  
   234  func (o BindingPatchMapOutput) ToBindingPatchMapOutputWithContext(ctx context.Context) BindingPatchMapOutput {
   235  	return o
   236  }
   237  
   238  func (o BindingPatchMapOutput) MapIndex(k pulumi.StringInput) BindingPatchOutput {
   239  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BindingPatch {
   240  		return vs[0].(map[string]*BindingPatch)[vs[1].(string)]
   241  	}).(BindingPatchOutput)
   242  }
   243  
   244  func init() {
   245  	pulumi.RegisterInputType(reflect.TypeOf((*BindingPatchInput)(nil)).Elem(), &BindingPatch{})
   246  	pulumi.RegisterInputType(reflect.TypeOf((*BindingPatchArrayInput)(nil)).Elem(), BindingPatchArray{})
   247  	pulumi.RegisterInputType(reflect.TypeOf((*BindingPatchMapInput)(nil)).Elem(), BindingPatchMap{})
   248  	pulumi.RegisterOutputType(BindingPatchOutput{})
   249  	pulumi.RegisterOutputType(BindingPatchArrayOutput{})
   250  	pulumi.RegisterOutputType(BindingPatchMapOutput{})
   251  }