github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apiextensions/v1beta1/customResourceDefinitionPatch.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  // CustomResourceDefinition represents a resource that should be exposed on the API server.  Its name MUST be in the format <.spec.name>.<.spec.group>. Deprecated in v1.16, planned for removal in v1.19. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead.
    21  type CustomResourceDefinitionPatch 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  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    29  	// spec describes how the user wants the resources to appear
    30  	Spec CustomResourceDefinitionSpecPatchPtrOutput `pulumi:"spec"`
    31  	// status indicates the actual state of the CustomResourceDefinition
    32  	Status CustomResourceDefinitionStatusPatchPtrOutput `pulumi:"status"`
    33  }
    34  
    35  // NewCustomResourceDefinitionPatch registers a new resource with the given unique name, arguments, and options.
    36  func NewCustomResourceDefinitionPatch(ctx *pulumi.Context,
    37  	name string, args *CustomResourceDefinitionPatchArgs, opts ...pulumi.ResourceOption) (*CustomResourceDefinitionPatch, error) {
    38  	if args == nil {
    39  		args = &CustomResourceDefinitionPatchArgs{}
    40  	}
    41  
    42  	args.ApiVersion = pulumi.StringPtr("apiextensions.k8s.io/v1beta1")
    43  	args.Kind = pulumi.StringPtr("CustomResourceDefinition")
    44  	aliases := pulumi.Aliases([]pulumi.Alias{
    45  		{
    46  			Type: pulumi.String("kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinitionPatch"),
    47  		},
    48  	})
    49  	opts = append(opts, aliases)
    50  	var resource CustomResourceDefinitionPatch
    51  	err := ctx.RegisterResource("kubernetes:apiextensions.k8s.io/v1beta1:CustomResourceDefinitionPatch", name, args, &resource, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return &resource, nil
    56  }
    57  
    58  // GetCustomResourceDefinitionPatch gets an existing CustomResourceDefinitionPatch resource's state with the given name, ID, and optional
    59  // state properties that are used to uniquely qualify the lookup (nil if not required).
    60  func GetCustomResourceDefinitionPatch(ctx *pulumi.Context,
    61  	name string, id pulumi.IDInput, state *CustomResourceDefinitionPatchState, opts ...pulumi.ResourceOption) (*CustomResourceDefinitionPatch, error) {
    62  	var resource CustomResourceDefinitionPatch
    63  	err := ctx.ReadResource("kubernetes:apiextensions.k8s.io/v1beta1:CustomResourceDefinitionPatch", name, id, state, &resource, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &resource, nil
    68  }
    69  
    70  // Input properties used for looking up and filtering CustomResourceDefinitionPatch resources.
    71  type customResourceDefinitionPatchState struct {
    72  }
    73  
    74  type CustomResourceDefinitionPatchState struct {
    75  }
    76  
    77  func (CustomResourceDefinitionPatchState) ElementType() reflect.Type {
    78  	return reflect.TypeOf((*customResourceDefinitionPatchState)(nil)).Elem()
    79  }
    80  
    81  type customResourceDefinitionPatchArgs struct {
    82  	// 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
    83  	ApiVersion *string `pulumi:"apiVersion"`
    84  	// 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
    85  	Kind     *string                 `pulumi:"kind"`
    86  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    87  	// spec describes how the user wants the resources to appear
    88  	Spec *CustomResourceDefinitionSpecPatch `pulumi:"spec"`
    89  }
    90  
    91  // The set of arguments for constructing a CustomResourceDefinitionPatch resource.
    92  type CustomResourceDefinitionPatchArgs 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  	Metadata metav1.ObjectMetaPatchPtrInput
    98  	// spec describes how the user wants the resources to appear
    99  	Spec CustomResourceDefinitionSpecPatchPtrInput
   100  }
   101  
   102  func (CustomResourceDefinitionPatchArgs) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*customResourceDefinitionPatchArgs)(nil)).Elem()
   104  }
   105  
   106  type CustomResourceDefinitionPatchInput interface {
   107  	pulumi.Input
   108  
   109  	ToCustomResourceDefinitionPatchOutput() CustomResourceDefinitionPatchOutput
   110  	ToCustomResourceDefinitionPatchOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchOutput
   111  }
   112  
   113  func (*CustomResourceDefinitionPatch) ElementType() reflect.Type {
   114  	return reflect.TypeOf((**CustomResourceDefinitionPatch)(nil)).Elem()
   115  }
   116  
   117  func (i *CustomResourceDefinitionPatch) ToCustomResourceDefinitionPatchOutput() CustomResourceDefinitionPatchOutput {
   118  	return i.ToCustomResourceDefinitionPatchOutputWithContext(context.Background())
   119  }
   120  
   121  func (i *CustomResourceDefinitionPatch) ToCustomResourceDefinitionPatchOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchOutput {
   122  	return pulumi.ToOutputWithContext(ctx, i).(CustomResourceDefinitionPatchOutput)
   123  }
   124  
   125  // CustomResourceDefinitionPatchArrayInput is an input type that accepts CustomResourceDefinitionPatchArray and CustomResourceDefinitionPatchArrayOutput values.
   126  // You can construct a concrete instance of `CustomResourceDefinitionPatchArrayInput` via:
   127  //
   128  //	CustomResourceDefinitionPatchArray{ CustomResourceDefinitionPatchArgs{...} }
   129  type CustomResourceDefinitionPatchArrayInput interface {
   130  	pulumi.Input
   131  
   132  	ToCustomResourceDefinitionPatchArrayOutput() CustomResourceDefinitionPatchArrayOutput
   133  	ToCustomResourceDefinitionPatchArrayOutputWithContext(context.Context) CustomResourceDefinitionPatchArrayOutput
   134  }
   135  
   136  type CustomResourceDefinitionPatchArray []CustomResourceDefinitionPatchInput
   137  
   138  func (CustomResourceDefinitionPatchArray) ElementType() reflect.Type {
   139  	return reflect.TypeOf((*[]*CustomResourceDefinitionPatch)(nil)).Elem()
   140  }
   141  
   142  func (i CustomResourceDefinitionPatchArray) ToCustomResourceDefinitionPatchArrayOutput() CustomResourceDefinitionPatchArrayOutput {
   143  	return i.ToCustomResourceDefinitionPatchArrayOutputWithContext(context.Background())
   144  }
   145  
   146  func (i CustomResourceDefinitionPatchArray) ToCustomResourceDefinitionPatchArrayOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchArrayOutput {
   147  	return pulumi.ToOutputWithContext(ctx, i).(CustomResourceDefinitionPatchArrayOutput)
   148  }
   149  
   150  // CustomResourceDefinitionPatchMapInput is an input type that accepts CustomResourceDefinitionPatchMap and CustomResourceDefinitionPatchMapOutput values.
   151  // You can construct a concrete instance of `CustomResourceDefinitionPatchMapInput` via:
   152  //
   153  //	CustomResourceDefinitionPatchMap{ "key": CustomResourceDefinitionPatchArgs{...} }
   154  type CustomResourceDefinitionPatchMapInput interface {
   155  	pulumi.Input
   156  
   157  	ToCustomResourceDefinitionPatchMapOutput() CustomResourceDefinitionPatchMapOutput
   158  	ToCustomResourceDefinitionPatchMapOutputWithContext(context.Context) CustomResourceDefinitionPatchMapOutput
   159  }
   160  
   161  type CustomResourceDefinitionPatchMap map[string]CustomResourceDefinitionPatchInput
   162  
   163  func (CustomResourceDefinitionPatchMap) ElementType() reflect.Type {
   164  	return reflect.TypeOf((*map[string]*CustomResourceDefinitionPatch)(nil)).Elem()
   165  }
   166  
   167  func (i CustomResourceDefinitionPatchMap) ToCustomResourceDefinitionPatchMapOutput() CustomResourceDefinitionPatchMapOutput {
   168  	return i.ToCustomResourceDefinitionPatchMapOutputWithContext(context.Background())
   169  }
   170  
   171  func (i CustomResourceDefinitionPatchMap) ToCustomResourceDefinitionPatchMapOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchMapOutput {
   172  	return pulumi.ToOutputWithContext(ctx, i).(CustomResourceDefinitionPatchMapOutput)
   173  }
   174  
   175  type CustomResourceDefinitionPatchOutput struct{ *pulumi.OutputState }
   176  
   177  func (CustomResourceDefinitionPatchOutput) ElementType() reflect.Type {
   178  	return reflect.TypeOf((**CustomResourceDefinitionPatch)(nil)).Elem()
   179  }
   180  
   181  func (o CustomResourceDefinitionPatchOutput) ToCustomResourceDefinitionPatchOutput() CustomResourceDefinitionPatchOutput {
   182  	return o
   183  }
   184  
   185  func (o CustomResourceDefinitionPatchOutput) ToCustomResourceDefinitionPatchOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchOutput {
   186  	return o
   187  }
   188  
   189  // 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
   190  func (o CustomResourceDefinitionPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   191  	return o.ApplyT(func(v *CustomResourceDefinitionPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   192  }
   193  
   194  // 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
   195  func (o CustomResourceDefinitionPatchOutput) Kind() pulumi.StringPtrOutput {
   196  	return o.ApplyT(func(v *CustomResourceDefinitionPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   197  }
   198  
   199  func (o CustomResourceDefinitionPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   200  	return o.ApplyT(func(v *CustomResourceDefinitionPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   201  }
   202  
   203  // spec describes how the user wants the resources to appear
   204  func (o CustomResourceDefinitionPatchOutput) Spec() CustomResourceDefinitionSpecPatchPtrOutput {
   205  	return o.ApplyT(func(v *CustomResourceDefinitionPatch) CustomResourceDefinitionSpecPatchPtrOutput { return v.Spec }).(CustomResourceDefinitionSpecPatchPtrOutput)
   206  }
   207  
   208  // status indicates the actual state of the CustomResourceDefinition
   209  func (o CustomResourceDefinitionPatchOutput) Status() CustomResourceDefinitionStatusPatchPtrOutput {
   210  	return o.ApplyT(func(v *CustomResourceDefinitionPatch) CustomResourceDefinitionStatusPatchPtrOutput { return v.Status }).(CustomResourceDefinitionStatusPatchPtrOutput)
   211  }
   212  
   213  type CustomResourceDefinitionPatchArrayOutput struct{ *pulumi.OutputState }
   214  
   215  func (CustomResourceDefinitionPatchArrayOutput) ElementType() reflect.Type {
   216  	return reflect.TypeOf((*[]*CustomResourceDefinitionPatch)(nil)).Elem()
   217  }
   218  
   219  func (o CustomResourceDefinitionPatchArrayOutput) ToCustomResourceDefinitionPatchArrayOutput() CustomResourceDefinitionPatchArrayOutput {
   220  	return o
   221  }
   222  
   223  func (o CustomResourceDefinitionPatchArrayOutput) ToCustomResourceDefinitionPatchArrayOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchArrayOutput {
   224  	return o
   225  }
   226  
   227  func (o CustomResourceDefinitionPatchArrayOutput) Index(i pulumi.IntInput) CustomResourceDefinitionPatchOutput {
   228  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomResourceDefinitionPatch {
   229  		return vs[0].([]*CustomResourceDefinitionPatch)[vs[1].(int)]
   230  	}).(CustomResourceDefinitionPatchOutput)
   231  }
   232  
   233  type CustomResourceDefinitionPatchMapOutput struct{ *pulumi.OutputState }
   234  
   235  func (CustomResourceDefinitionPatchMapOutput) ElementType() reflect.Type {
   236  	return reflect.TypeOf((*map[string]*CustomResourceDefinitionPatch)(nil)).Elem()
   237  }
   238  
   239  func (o CustomResourceDefinitionPatchMapOutput) ToCustomResourceDefinitionPatchMapOutput() CustomResourceDefinitionPatchMapOutput {
   240  	return o
   241  }
   242  
   243  func (o CustomResourceDefinitionPatchMapOutput) ToCustomResourceDefinitionPatchMapOutputWithContext(ctx context.Context) CustomResourceDefinitionPatchMapOutput {
   244  	return o
   245  }
   246  
   247  func (o CustomResourceDefinitionPatchMapOutput) MapIndex(k pulumi.StringInput) CustomResourceDefinitionPatchOutput {
   248  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomResourceDefinitionPatch {
   249  		return vs[0].(map[string]*CustomResourceDefinitionPatch)[vs[1].(string)]
   250  	}).(CustomResourceDefinitionPatchOutput)
   251  }
   252  
   253  func init() {
   254  	pulumi.RegisterInputType(reflect.TypeOf((*CustomResourceDefinitionPatchInput)(nil)).Elem(), &CustomResourceDefinitionPatch{})
   255  	pulumi.RegisterInputType(reflect.TypeOf((*CustomResourceDefinitionPatchArrayInput)(nil)).Elem(), CustomResourceDefinitionPatchArray{})
   256  	pulumi.RegisterInputType(reflect.TypeOf((*CustomResourceDefinitionPatchMapInput)(nil)).Elem(), CustomResourceDefinitionPatchMap{})
   257  	pulumi.RegisterOutputType(CustomResourceDefinitionPatchOutput{})
   258  	pulumi.RegisterOutputType(CustomResourceDefinitionPatchArrayOutput{})
   259  	pulumi.RegisterOutputType(CustomResourceDefinitionPatchMapOutput{})
   260  }