github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/coordination/v1beta1/leasePatch.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 v1beta1
     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  // Lease defines a lease concept.
    21  type LeasePatch 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  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    29  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    30  	// Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    31  	Spec LeaseSpecPatchPtrOutput `pulumi:"spec"`
    32  }
    33  
    34  // NewLeasePatch registers a new resource with the given unique name, arguments, and options.
    35  func NewLeasePatch(ctx *pulumi.Context,
    36  	name string, args *LeasePatchArgs, opts ...pulumi.ResourceOption) (*LeasePatch, error) {
    37  	if args == nil {
    38  		args = &LeasePatchArgs{}
    39  	}
    40  
    41  	args.ApiVersion = pulumi.StringPtr("coordination.k8s.io/v1beta1")
    42  	args.Kind = pulumi.StringPtr("Lease")
    43  	aliases := pulumi.Aliases([]pulumi.Alias{
    44  		{
    45  			Type: pulumi.String("kubernetes:coordination.k8s.io/v1:LeasePatch"),
    46  		},
    47  	})
    48  	opts = append(opts, aliases)
    49  	var resource LeasePatch
    50  	err := ctx.RegisterResource("kubernetes:coordination.k8s.io/v1beta1:LeasePatch", name, args, &resource, opts...)
    51  	if err != nil {
    52  		return nil, err
    53  	}
    54  	return &resource, nil
    55  }
    56  
    57  // GetLeasePatch gets an existing LeasePatch resource's state with the given name, ID, and optional
    58  // state properties that are used to uniquely qualify the lookup (nil if not required).
    59  func GetLeasePatch(ctx *pulumi.Context,
    60  	name string, id pulumi.IDInput, state *LeasePatchState, opts ...pulumi.ResourceOption) (*LeasePatch, error) {
    61  	var resource LeasePatch
    62  	err := ctx.ReadResource("kubernetes:coordination.k8s.io/v1beta1:LeasePatch", name, id, state, &resource, opts...)
    63  	if err != nil {
    64  		return nil, err
    65  	}
    66  	return &resource, nil
    67  }
    68  
    69  // Input properties used for looking up and filtering LeasePatch resources.
    70  type leasePatchState struct {
    71  }
    72  
    73  type LeasePatchState struct {
    74  }
    75  
    76  func (LeasePatchState) ElementType() reflect.Type {
    77  	return reflect.TypeOf((*leasePatchState)(nil)).Elem()
    78  }
    79  
    80  type leasePatchArgs struct {
    81  	// 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
    82  	ApiVersion *string `pulumi:"apiVersion"`
    83  	// 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
    84  	Kind *string `pulumi:"kind"`
    85  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    86  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    87  	// Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    88  	Spec *LeaseSpecPatch `pulumi:"spec"`
    89  }
    90  
    91  // The set of arguments for constructing a LeasePatch resource.
    92  type LeasePatchArgs struct {
    93  	// 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
    94  	ApiVersion pulumi.StringPtrInput
    95  	// 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
    96  	Kind pulumi.StringPtrInput
    97  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    98  	Metadata metav1.ObjectMetaPatchPtrInput
    99  	// Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   100  	Spec LeaseSpecPatchPtrInput
   101  }
   102  
   103  func (LeasePatchArgs) ElementType() reflect.Type {
   104  	return reflect.TypeOf((*leasePatchArgs)(nil)).Elem()
   105  }
   106  
   107  type LeasePatchInput interface {
   108  	pulumi.Input
   109  
   110  	ToLeasePatchOutput() LeasePatchOutput
   111  	ToLeasePatchOutputWithContext(ctx context.Context) LeasePatchOutput
   112  }
   113  
   114  func (*LeasePatch) ElementType() reflect.Type {
   115  	return reflect.TypeOf((**LeasePatch)(nil)).Elem()
   116  }
   117  
   118  func (i *LeasePatch) ToLeasePatchOutput() LeasePatchOutput {
   119  	return i.ToLeasePatchOutputWithContext(context.Background())
   120  }
   121  
   122  func (i *LeasePatch) ToLeasePatchOutputWithContext(ctx context.Context) LeasePatchOutput {
   123  	return pulumi.ToOutputWithContext(ctx, i).(LeasePatchOutput)
   124  }
   125  
   126  // LeasePatchArrayInput is an input type that accepts LeasePatchArray and LeasePatchArrayOutput values.
   127  // You can construct a concrete instance of `LeasePatchArrayInput` via:
   128  //
   129  //	LeasePatchArray{ LeasePatchArgs{...} }
   130  type LeasePatchArrayInput interface {
   131  	pulumi.Input
   132  
   133  	ToLeasePatchArrayOutput() LeasePatchArrayOutput
   134  	ToLeasePatchArrayOutputWithContext(context.Context) LeasePatchArrayOutput
   135  }
   136  
   137  type LeasePatchArray []LeasePatchInput
   138  
   139  func (LeasePatchArray) ElementType() reflect.Type {
   140  	return reflect.TypeOf((*[]*LeasePatch)(nil)).Elem()
   141  }
   142  
   143  func (i LeasePatchArray) ToLeasePatchArrayOutput() LeasePatchArrayOutput {
   144  	return i.ToLeasePatchArrayOutputWithContext(context.Background())
   145  }
   146  
   147  func (i LeasePatchArray) ToLeasePatchArrayOutputWithContext(ctx context.Context) LeasePatchArrayOutput {
   148  	return pulumi.ToOutputWithContext(ctx, i).(LeasePatchArrayOutput)
   149  }
   150  
   151  // LeasePatchMapInput is an input type that accepts LeasePatchMap and LeasePatchMapOutput values.
   152  // You can construct a concrete instance of `LeasePatchMapInput` via:
   153  //
   154  //	LeasePatchMap{ "key": LeasePatchArgs{...} }
   155  type LeasePatchMapInput interface {
   156  	pulumi.Input
   157  
   158  	ToLeasePatchMapOutput() LeasePatchMapOutput
   159  	ToLeasePatchMapOutputWithContext(context.Context) LeasePatchMapOutput
   160  }
   161  
   162  type LeasePatchMap map[string]LeasePatchInput
   163  
   164  func (LeasePatchMap) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*map[string]*LeasePatch)(nil)).Elem()
   166  }
   167  
   168  func (i LeasePatchMap) ToLeasePatchMapOutput() LeasePatchMapOutput {
   169  	return i.ToLeasePatchMapOutputWithContext(context.Background())
   170  }
   171  
   172  func (i LeasePatchMap) ToLeasePatchMapOutputWithContext(ctx context.Context) LeasePatchMapOutput {
   173  	return pulumi.ToOutputWithContext(ctx, i).(LeasePatchMapOutput)
   174  }
   175  
   176  type LeasePatchOutput struct{ *pulumi.OutputState }
   177  
   178  func (LeasePatchOutput) ElementType() reflect.Type {
   179  	return reflect.TypeOf((**LeasePatch)(nil)).Elem()
   180  }
   181  
   182  func (o LeasePatchOutput) ToLeasePatchOutput() LeasePatchOutput {
   183  	return o
   184  }
   185  
   186  func (o LeasePatchOutput) ToLeasePatchOutputWithContext(ctx context.Context) LeasePatchOutput {
   187  	return o
   188  }
   189  
   190  // 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
   191  func (o LeasePatchOutput) ApiVersion() pulumi.StringPtrOutput {
   192  	return o.ApplyT(func(v *LeasePatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   193  }
   194  
   195  // 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
   196  func (o LeasePatchOutput) Kind() pulumi.StringPtrOutput {
   197  	return o.ApplyT(func(v *LeasePatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   198  }
   199  
   200  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   201  func (o LeasePatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   202  	return o.ApplyT(func(v *LeasePatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   203  }
   204  
   205  // Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   206  func (o LeasePatchOutput) Spec() LeaseSpecPatchPtrOutput {
   207  	return o.ApplyT(func(v *LeasePatch) LeaseSpecPatchPtrOutput { return v.Spec }).(LeaseSpecPatchPtrOutput)
   208  }
   209  
   210  type LeasePatchArrayOutput struct{ *pulumi.OutputState }
   211  
   212  func (LeasePatchArrayOutput) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*[]*LeasePatch)(nil)).Elem()
   214  }
   215  
   216  func (o LeasePatchArrayOutput) ToLeasePatchArrayOutput() LeasePatchArrayOutput {
   217  	return o
   218  }
   219  
   220  func (o LeasePatchArrayOutput) ToLeasePatchArrayOutputWithContext(ctx context.Context) LeasePatchArrayOutput {
   221  	return o
   222  }
   223  
   224  func (o LeasePatchArrayOutput) Index(i pulumi.IntInput) LeasePatchOutput {
   225  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LeasePatch {
   226  		return vs[0].([]*LeasePatch)[vs[1].(int)]
   227  	}).(LeasePatchOutput)
   228  }
   229  
   230  type LeasePatchMapOutput struct{ *pulumi.OutputState }
   231  
   232  func (LeasePatchMapOutput) ElementType() reflect.Type {
   233  	return reflect.TypeOf((*map[string]*LeasePatch)(nil)).Elem()
   234  }
   235  
   236  func (o LeasePatchMapOutput) ToLeasePatchMapOutput() LeasePatchMapOutput {
   237  	return o
   238  }
   239  
   240  func (o LeasePatchMapOutput) ToLeasePatchMapOutputWithContext(ctx context.Context) LeasePatchMapOutput {
   241  	return o
   242  }
   243  
   244  func (o LeasePatchMapOutput) MapIndex(k pulumi.StringInput) LeasePatchOutput {
   245  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LeasePatch {
   246  		return vs[0].(map[string]*LeasePatch)[vs[1].(string)]
   247  	}).(LeasePatchOutput)
   248  }
   249  
   250  func init() {
   251  	pulumi.RegisterInputType(reflect.TypeOf((*LeasePatchInput)(nil)).Elem(), &LeasePatch{})
   252  	pulumi.RegisterInputType(reflect.TypeOf((*LeasePatchArrayInput)(nil)).Elem(), LeasePatchArray{})
   253  	pulumi.RegisterInputType(reflect.TypeOf((*LeasePatchMapInput)(nil)).Elem(), LeasePatchMap{})
   254  	pulumi.RegisterOutputType(LeasePatchOutput{})
   255  	pulumi.RegisterOutputType(LeasePatchArrayOutput{})
   256  	pulumi.RegisterOutputType(LeasePatchMapOutput{})
   257  }