github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/resource/v1alpha2/resourceClaimPatch.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 v1alpha2
     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  // ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.
    21  //
    22  // This is an alpha type and requires enabling the DynamicResourceAllocation feature gate.
    23  type ResourceClaimPatch struct {
    24  	pulumi.CustomResourceState
    25  
    26  	// 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
    27  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    28  	// 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
    29  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    30  	// Standard object metadata
    31  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    32  	// Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.
    33  	Spec ResourceClaimSpecPatchPtrOutput `pulumi:"spec"`
    34  	// Status describes whether the resource is available and with which attributes.
    35  	Status ResourceClaimStatusPatchPtrOutput `pulumi:"status"`
    36  }
    37  
    38  // NewResourceClaimPatch registers a new resource with the given unique name, arguments, and options.
    39  func NewResourceClaimPatch(ctx *pulumi.Context,
    40  	name string, args *ResourceClaimPatchArgs, opts ...pulumi.ResourceOption) (*ResourceClaimPatch, error) {
    41  	if args == nil {
    42  		args = &ResourceClaimPatchArgs{}
    43  	}
    44  
    45  	args.ApiVersion = pulumi.StringPtr("resource.k8s.io/v1alpha2")
    46  	args.Kind = pulumi.StringPtr("ResourceClaim")
    47  	aliases := pulumi.Aliases([]pulumi.Alias{
    48  		{
    49  			Type: pulumi.String("kubernetes:resource.k8s.io/v1alpha1:ResourceClaimPatch"),
    50  		},
    51  	})
    52  	opts = append(opts, aliases)
    53  	var resource ResourceClaimPatch
    54  	err := ctx.RegisterResource("kubernetes:resource.k8s.io/v1alpha2:ResourceClaimPatch", name, args, &resource, opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	return &resource, nil
    59  }
    60  
    61  // GetResourceClaimPatch gets an existing ResourceClaimPatch resource's state with the given name, ID, and optional
    62  // state properties that are used to uniquely qualify the lookup (nil if not required).
    63  func GetResourceClaimPatch(ctx *pulumi.Context,
    64  	name string, id pulumi.IDInput, state *ResourceClaimPatchState, opts ...pulumi.ResourceOption) (*ResourceClaimPatch, error) {
    65  	var resource ResourceClaimPatch
    66  	err := ctx.ReadResource("kubernetes:resource.k8s.io/v1alpha2:ResourceClaimPatch", name, id, state, &resource, opts...)
    67  	if err != nil {
    68  		return nil, err
    69  	}
    70  	return &resource, nil
    71  }
    72  
    73  // Input properties used for looking up and filtering ResourceClaimPatch resources.
    74  type resourceClaimPatchState struct {
    75  }
    76  
    77  type ResourceClaimPatchState struct {
    78  }
    79  
    80  func (ResourceClaimPatchState) ElementType() reflect.Type {
    81  	return reflect.TypeOf((*resourceClaimPatchState)(nil)).Elem()
    82  }
    83  
    84  type resourceClaimPatchArgs 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 *string `pulumi:"apiVersion"`
    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 *string `pulumi:"kind"`
    89  	// Standard object metadata
    90  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    91  	// Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.
    92  	Spec *ResourceClaimSpecPatch `pulumi:"spec"`
    93  }
    94  
    95  // The set of arguments for constructing a ResourceClaimPatch resource.
    96  type ResourceClaimPatchArgs struct {
    97  	// 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
    98  	ApiVersion pulumi.StringPtrInput
    99  	// 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
   100  	Kind pulumi.StringPtrInput
   101  	// Standard object metadata
   102  	Metadata metav1.ObjectMetaPatchPtrInput
   103  	// Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.
   104  	Spec ResourceClaimSpecPatchPtrInput
   105  }
   106  
   107  func (ResourceClaimPatchArgs) ElementType() reflect.Type {
   108  	return reflect.TypeOf((*resourceClaimPatchArgs)(nil)).Elem()
   109  }
   110  
   111  type ResourceClaimPatchInput interface {
   112  	pulumi.Input
   113  
   114  	ToResourceClaimPatchOutput() ResourceClaimPatchOutput
   115  	ToResourceClaimPatchOutputWithContext(ctx context.Context) ResourceClaimPatchOutput
   116  }
   117  
   118  func (*ResourceClaimPatch) ElementType() reflect.Type {
   119  	return reflect.TypeOf((**ResourceClaimPatch)(nil)).Elem()
   120  }
   121  
   122  func (i *ResourceClaimPatch) ToResourceClaimPatchOutput() ResourceClaimPatchOutput {
   123  	return i.ToResourceClaimPatchOutputWithContext(context.Background())
   124  }
   125  
   126  func (i *ResourceClaimPatch) ToResourceClaimPatchOutputWithContext(ctx context.Context) ResourceClaimPatchOutput {
   127  	return pulumi.ToOutputWithContext(ctx, i).(ResourceClaimPatchOutput)
   128  }
   129  
   130  // ResourceClaimPatchArrayInput is an input type that accepts ResourceClaimPatchArray and ResourceClaimPatchArrayOutput values.
   131  // You can construct a concrete instance of `ResourceClaimPatchArrayInput` via:
   132  //
   133  //	ResourceClaimPatchArray{ ResourceClaimPatchArgs{...} }
   134  type ResourceClaimPatchArrayInput interface {
   135  	pulumi.Input
   136  
   137  	ToResourceClaimPatchArrayOutput() ResourceClaimPatchArrayOutput
   138  	ToResourceClaimPatchArrayOutputWithContext(context.Context) ResourceClaimPatchArrayOutput
   139  }
   140  
   141  type ResourceClaimPatchArray []ResourceClaimPatchInput
   142  
   143  func (ResourceClaimPatchArray) ElementType() reflect.Type {
   144  	return reflect.TypeOf((*[]*ResourceClaimPatch)(nil)).Elem()
   145  }
   146  
   147  func (i ResourceClaimPatchArray) ToResourceClaimPatchArrayOutput() ResourceClaimPatchArrayOutput {
   148  	return i.ToResourceClaimPatchArrayOutputWithContext(context.Background())
   149  }
   150  
   151  func (i ResourceClaimPatchArray) ToResourceClaimPatchArrayOutputWithContext(ctx context.Context) ResourceClaimPatchArrayOutput {
   152  	return pulumi.ToOutputWithContext(ctx, i).(ResourceClaimPatchArrayOutput)
   153  }
   154  
   155  // ResourceClaimPatchMapInput is an input type that accepts ResourceClaimPatchMap and ResourceClaimPatchMapOutput values.
   156  // You can construct a concrete instance of `ResourceClaimPatchMapInput` via:
   157  //
   158  //	ResourceClaimPatchMap{ "key": ResourceClaimPatchArgs{...} }
   159  type ResourceClaimPatchMapInput interface {
   160  	pulumi.Input
   161  
   162  	ToResourceClaimPatchMapOutput() ResourceClaimPatchMapOutput
   163  	ToResourceClaimPatchMapOutputWithContext(context.Context) ResourceClaimPatchMapOutput
   164  }
   165  
   166  type ResourceClaimPatchMap map[string]ResourceClaimPatchInput
   167  
   168  func (ResourceClaimPatchMap) ElementType() reflect.Type {
   169  	return reflect.TypeOf((*map[string]*ResourceClaimPatch)(nil)).Elem()
   170  }
   171  
   172  func (i ResourceClaimPatchMap) ToResourceClaimPatchMapOutput() ResourceClaimPatchMapOutput {
   173  	return i.ToResourceClaimPatchMapOutputWithContext(context.Background())
   174  }
   175  
   176  func (i ResourceClaimPatchMap) ToResourceClaimPatchMapOutputWithContext(ctx context.Context) ResourceClaimPatchMapOutput {
   177  	return pulumi.ToOutputWithContext(ctx, i).(ResourceClaimPatchMapOutput)
   178  }
   179  
   180  type ResourceClaimPatchOutput struct{ *pulumi.OutputState }
   181  
   182  func (ResourceClaimPatchOutput) ElementType() reflect.Type {
   183  	return reflect.TypeOf((**ResourceClaimPatch)(nil)).Elem()
   184  }
   185  
   186  func (o ResourceClaimPatchOutput) ToResourceClaimPatchOutput() ResourceClaimPatchOutput {
   187  	return o
   188  }
   189  
   190  func (o ResourceClaimPatchOutput) ToResourceClaimPatchOutputWithContext(ctx context.Context) ResourceClaimPatchOutput {
   191  	return o
   192  }
   193  
   194  // 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
   195  func (o ResourceClaimPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   196  	return o.ApplyT(func(v *ResourceClaimPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   197  }
   198  
   199  // 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
   200  func (o ResourceClaimPatchOutput) Kind() pulumi.StringPtrOutput {
   201  	return o.ApplyT(func(v *ResourceClaimPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   202  }
   203  
   204  // Standard object metadata
   205  func (o ResourceClaimPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   206  	return o.ApplyT(func(v *ResourceClaimPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   207  }
   208  
   209  // Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.
   210  func (o ResourceClaimPatchOutput) Spec() ResourceClaimSpecPatchPtrOutput {
   211  	return o.ApplyT(func(v *ResourceClaimPatch) ResourceClaimSpecPatchPtrOutput { return v.Spec }).(ResourceClaimSpecPatchPtrOutput)
   212  }
   213  
   214  // Status describes whether the resource is available and with which attributes.
   215  func (o ResourceClaimPatchOutput) Status() ResourceClaimStatusPatchPtrOutput {
   216  	return o.ApplyT(func(v *ResourceClaimPatch) ResourceClaimStatusPatchPtrOutput { return v.Status }).(ResourceClaimStatusPatchPtrOutput)
   217  }
   218  
   219  type ResourceClaimPatchArrayOutput struct{ *pulumi.OutputState }
   220  
   221  func (ResourceClaimPatchArrayOutput) ElementType() reflect.Type {
   222  	return reflect.TypeOf((*[]*ResourceClaimPatch)(nil)).Elem()
   223  }
   224  
   225  func (o ResourceClaimPatchArrayOutput) ToResourceClaimPatchArrayOutput() ResourceClaimPatchArrayOutput {
   226  	return o
   227  }
   228  
   229  func (o ResourceClaimPatchArrayOutput) ToResourceClaimPatchArrayOutputWithContext(ctx context.Context) ResourceClaimPatchArrayOutput {
   230  	return o
   231  }
   232  
   233  func (o ResourceClaimPatchArrayOutput) Index(i pulumi.IntInput) ResourceClaimPatchOutput {
   234  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResourceClaimPatch {
   235  		return vs[0].([]*ResourceClaimPatch)[vs[1].(int)]
   236  	}).(ResourceClaimPatchOutput)
   237  }
   238  
   239  type ResourceClaimPatchMapOutput struct{ *pulumi.OutputState }
   240  
   241  func (ResourceClaimPatchMapOutput) ElementType() reflect.Type {
   242  	return reflect.TypeOf((*map[string]*ResourceClaimPatch)(nil)).Elem()
   243  }
   244  
   245  func (o ResourceClaimPatchMapOutput) ToResourceClaimPatchMapOutput() ResourceClaimPatchMapOutput {
   246  	return o
   247  }
   248  
   249  func (o ResourceClaimPatchMapOutput) ToResourceClaimPatchMapOutputWithContext(ctx context.Context) ResourceClaimPatchMapOutput {
   250  	return o
   251  }
   252  
   253  func (o ResourceClaimPatchMapOutput) MapIndex(k pulumi.StringInput) ResourceClaimPatchOutput {
   254  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResourceClaimPatch {
   255  		return vs[0].(map[string]*ResourceClaimPatch)[vs[1].(string)]
   256  	}).(ResourceClaimPatchOutput)
   257  }
   258  
   259  func init() {
   260  	pulumi.RegisterInputType(reflect.TypeOf((*ResourceClaimPatchInput)(nil)).Elem(), &ResourceClaimPatch{})
   261  	pulumi.RegisterInputType(reflect.TypeOf((*ResourceClaimPatchArrayInput)(nil)).Elem(), ResourceClaimPatchArray{})
   262  	pulumi.RegisterInputType(reflect.TypeOf((*ResourceClaimPatchMapInput)(nil)).Elem(), ResourceClaimPatchMap{})
   263  	pulumi.RegisterOutputType(ResourceClaimPatchOutput{})
   264  	pulumi.RegisterOutputType(ResourceClaimPatchArrayOutput{})
   265  	pulumi.RegisterOutputType(ResourceClaimPatchMapOutput{})
   266  }