github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/settings/v1alpha1/podPresetPatch.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 v1alpha1
     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  // PodPreset is a policy resource that defines additional runtime requirements for a Pod.
    21  type PodPresetPatch 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     PodPresetSpecPatchPtrOutput     `pulumi:"spec"`
    30  }
    31  
    32  // NewPodPresetPatch registers a new resource with the given unique name, arguments, and options.
    33  func NewPodPresetPatch(ctx *pulumi.Context,
    34  	name string, args *PodPresetPatchArgs, opts ...pulumi.ResourceOption) (*PodPresetPatch, error) {
    35  	if args == nil {
    36  		args = &PodPresetPatchArgs{}
    37  	}
    38  
    39  	args.ApiVersion = pulumi.StringPtr("settings.k8s.io/v1alpha1")
    40  	args.Kind = pulumi.StringPtr("PodPreset")
    41  	var resource PodPresetPatch
    42  	err := ctx.RegisterResource("kubernetes:settings.k8s.io/v1alpha1:PodPresetPatch", name, args, &resource, opts...)
    43  	if err != nil {
    44  		return nil, err
    45  	}
    46  	return &resource, nil
    47  }
    48  
    49  // GetPodPresetPatch gets an existing PodPresetPatch 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 GetPodPresetPatch(ctx *pulumi.Context,
    52  	name string, id pulumi.IDInput, state *PodPresetPatchState, opts ...pulumi.ResourceOption) (*PodPresetPatch, error) {
    53  	var resource PodPresetPatch
    54  	err := ctx.ReadResource("kubernetes:settings.k8s.io/v1alpha1:PodPresetPatch", 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 PodPresetPatch resources.
    62  type podPresetPatchState struct {
    63  }
    64  
    65  type PodPresetPatchState struct {
    66  }
    67  
    68  func (PodPresetPatchState) ElementType() reflect.Type {
    69  	return reflect.TypeOf((*podPresetPatchState)(nil)).Elem()
    70  }
    71  
    72  type podPresetPatchArgs 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  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    78  	Spec     *PodPresetSpecPatch     `pulumi:"spec"`
    79  }
    80  
    81  // The set of arguments for constructing a PodPresetPatch resource.
    82  type PodPresetPatchArgs struct {
    83  	// 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
    84  	ApiVersion pulumi.StringPtrInput
    85  	// 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
    86  	Kind     pulumi.StringPtrInput
    87  	Metadata metav1.ObjectMetaPatchPtrInput
    88  	Spec     PodPresetSpecPatchPtrInput
    89  }
    90  
    91  func (PodPresetPatchArgs) ElementType() reflect.Type {
    92  	return reflect.TypeOf((*podPresetPatchArgs)(nil)).Elem()
    93  }
    94  
    95  type PodPresetPatchInput interface {
    96  	pulumi.Input
    97  
    98  	ToPodPresetPatchOutput() PodPresetPatchOutput
    99  	ToPodPresetPatchOutputWithContext(ctx context.Context) PodPresetPatchOutput
   100  }
   101  
   102  func (*PodPresetPatch) ElementType() reflect.Type {
   103  	return reflect.TypeOf((**PodPresetPatch)(nil)).Elem()
   104  }
   105  
   106  func (i *PodPresetPatch) ToPodPresetPatchOutput() PodPresetPatchOutput {
   107  	return i.ToPodPresetPatchOutputWithContext(context.Background())
   108  }
   109  
   110  func (i *PodPresetPatch) ToPodPresetPatchOutputWithContext(ctx context.Context) PodPresetPatchOutput {
   111  	return pulumi.ToOutputWithContext(ctx, i).(PodPresetPatchOutput)
   112  }
   113  
   114  // PodPresetPatchArrayInput is an input type that accepts PodPresetPatchArray and PodPresetPatchArrayOutput values.
   115  // You can construct a concrete instance of `PodPresetPatchArrayInput` via:
   116  //
   117  //	PodPresetPatchArray{ PodPresetPatchArgs{...} }
   118  type PodPresetPatchArrayInput interface {
   119  	pulumi.Input
   120  
   121  	ToPodPresetPatchArrayOutput() PodPresetPatchArrayOutput
   122  	ToPodPresetPatchArrayOutputWithContext(context.Context) PodPresetPatchArrayOutput
   123  }
   124  
   125  type PodPresetPatchArray []PodPresetPatchInput
   126  
   127  func (PodPresetPatchArray) ElementType() reflect.Type {
   128  	return reflect.TypeOf((*[]*PodPresetPatch)(nil)).Elem()
   129  }
   130  
   131  func (i PodPresetPatchArray) ToPodPresetPatchArrayOutput() PodPresetPatchArrayOutput {
   132  	return i.ToPodPresetPatchArrayOutputWithContext(context.Background())
   133  }
   134  
   135  func (i PodPresetPatchArray) ToPodPresetPatchArrayOutputWithContext(ctx context.Context) PodPresetPatchArrayOutput {
   136  	return pulumi.ToOutputWithContext(ctx, i).(PodPresetPatchArrayOutput)
   137  }
   138  
   139  // PodPresetPatchMapInput is an input type that accepts PodPresetPatchMap and PodPresetPatchMapOutput values.
   140  // You can construct a concrete instance of `PodPresetPatchMapInput` via:
   141  //
   142  //	PodPresetPatchMap{ "key": PodPresetPatchArgs{...} }
   143  type PodPresetPatchMapInput interface {
   144  	pulumi.Input
   145  
   146  	ToPodPresetPatchMapOutput() PodPresetPatchMapOutput
   147  	ToPodPresetPatchMapOutputWithContext(context.Context) PodPresetPatchMapOutput
   148  }
   149  
   150  type PodPresetPatchMap map[string]PodPresetPatchInput
   151  
   152  func (PodPresetPatchMap) ElementType() reflect.Type {
   153  	return reflect.TypeOf((*map[string]*PodPresetPatch)(nil)).Elem()
   154  }
   155  
   156  func (i PodPresetPatchMap) ToPodPresetPatchMapOutput() PodPresetPatchMapOutput {
   157  	return i.ToPodPresetPatchMapOutputWithContext(context.Background())
   158  }
   159  
   160  func (i PodPresetPatchMap) ToPodPresetPatchMapOutputWithContext(ctx context.Context) PodPresetPatchMapOutput {
   161  	return pulumi.ToOutputWithContext(ctx, i).(PodPresetPatchMapOutput)
   162  }
   163  
   164  type PodPresetPatchOutput struct{ *pulumi.OutputState }
   165  
   166  func (PodPresetPatchOutput) ElementType() reflect.Type {
   167  	return reflect.TypeOf((**PodPresetPatch)(nil)).Elem()
   168  }
   169  
   170  func (o PodPresetPatchOutput) ToPodPresetPatchOutput() PodPresetPatchOutput {
   171  	return o
   172  }
   173  
   174  func (o PodPresetPatchOutput) ToPodPresetPatchOutputWithContext(ctx context.Context) PodPresetPatchOutput {
   175  	return o
   176  }
   177  
   178  // 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
   179  func (o PodPresetPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   180  	return o.ApplyT(func(v *PodPresetPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   181  }
   182  
   183  // 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
   184  func (o PodPresetPatchOutput) Kind() pulumi.StringPtrOutput {
   185  	return o.ApplyT(func(v *PodPresetPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   186  }
   187  
   188  func (o PodPresetPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   189  	return o.ApplyT(func(v *PodPresetPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   190  }
   191  
   192  func (o PodPresetPatchOutput) Spec() PodPresetSpecPatchPtrOutput {
   193  	return o.ApplyT(func(v *PodPresetPatch) PodPresetSpecPatchPtrOutput { return v.Spec }).(PodPresetSpecPatchPtrOutput)
   194  }
   195  
   196  type PodPresetPatchArrayOutput struct{ *pulumi.OutputState }
   197  
   198  func (PodPresetPatchArrayOutput) ElementType() reflect.Type {
   199  	return reflect.TypeOf((*[]*PodPresetPatch)(nil)).Elem()
   200  }
   201  
   202  func (o PodPresetPatchArrayOutput) ToPodPresetPatchArrayOutput() PodPresetPatchArrayOutput {
   203  	return o
   204  }
   205  
   206  func (o PodPresetPatchArrayOutput) ToPodPresetPatchArrayOutputWithContext(ctx context.Context) PodPresetPatchArrayOutput {
   207  	return o
   208  }
   209  
   210  func (o PodPresetPatchArrayOutput) Index(i pulumi.IntInput) PodPresetPatchOutput {
   211  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodPresetPatch {
   212  		return vs[0].([]*PodPresetPatch)[vs[1].(int)]
   213  	}).(PodPresetPatchOutput)
   214  }
   215  
   216  type PodPresetPatchMapOutput struct{ *pulumi.OutputState }
   217  
   218  func (PodPresetPatchMapOutput) ElementType() reflect.Type {
   219  	return reflect.TypeOf((*map[string]*PodPresetPatch)(nil)).Elem()
   220  }
   221  
   222  func (o PodPresetPatchMapOutput) ToPodPresetPatchMapOutput() PodPresetPatchMapOutput {
   223  	return o
   224  }
   225  
   226  func (o PodPresetPatchMapOutput) ToPodPresetPatchMapOutputWithContext(ctx context.Context) PodPresetPatchMapOutput {
   227  	return o
   228  }
   229  
   230  func (o PodPresetPatchMapOutput) MapIndex(k pulumi.StringInput) PodPresetPatchOutput {
   231  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodPresetPatch {
   232  		return vs[0].(map[string]*PodPresetPatch)[vs[1].(string)]
   233  	}).(PodPresetPatchOutput)
   234  }
   235  
   236  func init() {
   237  	pulumi.RegisterInputType(reflect.TypeOf((*PodPresetPatchInput)(nil)).Elem(), &PodPresetPatch{})
   238  	pulumi.RegisterInputType(reflect.TypeOf((*PodPresetPatchArrayInput)(nil)).Elem(), PodPresetPatchArray{})
   239  	pulumi.RegisterInputType(reflect.TypeOf((*PodPresetPatchMapInput)(nil)).Elem(), PodPresetPatchMap{})
   240  	pulumi.RegisterOutputType(PodPresetPatchOutput{})
   241  	pulumi.RegisterOutputType(PodPresetPatchArrayOutput{})
   242  	pulumi.RegisterOutputType(PodPresetPatchMapOutput{})
   243  }