github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/settings/v1alpha1/podPreset.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  // PodPreset is a policy resource that defines additional runtime requirements for a Pod.
    15  type PodPreset struct {
    16  	pulumi.CustomResourceState
    17  
    18  	// 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
    19  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    20  	// 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
    21  	Kind     pulumi.StringPtrOutput     `pulumi:"kind"`
    22  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    23  	Spec     PodPresetSpecPtrOutput     `pulumi:"spec"`
    24  }
    25  
    26  // NewPodPreset registers a new resource with the given unique name, arguments, and options.
    27  func NewPodPreset(ctx *pulumi.Context,
    28  	name string, args *PodPresetArgs, opts ...pulumi.ResourceOption) (*PodPreset, error) {
    29  	if args == nil {
    30  		args = &PodPresetArgs{}
    31  	}
    32  
    33  	args.ApiVersion = pulumi.StringPtr("settings.k8s.io/v1alpha1")
    34  	args.Kind = pulumi.StringPtr("PodPreset")
    35  	var resource PodPreset
    36  	err := ctx.RegisterResource("kubernetes:settings.k8s.io/v1alpha1:PodPreset", name, args, &resource, opts...)
    37  	if err != nil {
    38  		return nil, err
    39  	}
    40  	return &resource, nil
    41  }
    42  
    43  // GetPodPreset gets an existing PodPreset resource's state with the given name, ID, and optional
    44  // state properties that are used to uniquely qualify the lookup (nil if not required).
    45  func GetPodPreset(ctx *pulumi.Context,
    46  	name string, id pulumi.IDInput, state *PodPresetState, opts ...pulumi.ResourceOption) (*PodPreset, error) {
    47  	var resource PodPreset
    48  	err := ctx.ReadResource("kubernetes:settings.k8s.io/v1alpha1:PodPreset", name, id, state, &resource, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &resource, nil
    53  }
    54  
    55  // Input properties used for looking up and filtering PodPreset resources.
    56  type podPresetState struct {
    57  }
    58  
    59  type PodPresetState struct {
    60  }
    61  
    62  func (PodPresetState) ElementType() reflect.Type {
    63  	return reflect.TypeOf((*podPresetState)(nil)).Elem()
    64  }
    65  
    66  type podPresetArgs struct {
    67  	// 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
    68  	ApiVersion *string `pulumi:"apiVersion"`
    69  	// 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
    70  	Kind     *string            `pulumi:"kind"`
    71  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    72  	Spec     *PodPresetSpec     `pulumi:"spec"`
    73  }
    74  
    75  // The set of arguments for constructing a PodPreset resource.
    76  type PodPresetArgs struct {
    77  	// 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
    78  	ApiVersion pulumi.StringPtrInput
    79  	// 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
    80  	Kind     pulumi.StringPtrInput
    81  	Metadata metav1.ObjectMetaPtrInput
    82  	Spec     PodPresetSpecPtrInput
    83  }
    84  
    85  func (PodPresetArgs) ElementType() reflect.Type {
    86  	return reflect.TypeOf((*podPresetArgs)(nil)).Elem()
    87  }
    88  
    89  type PodPresetInput interface {
    90  	pulumi.Input
    91  
    92  	ToPodPresetOutput() PodPresetOutput
    93  	ToPodPresetOutputWithContext(ctx context.Context) PodPresetOutput
    94  }
    95  
    96  func (*PodPreset) ElementType() reflect.Type {
    97  	return reflect.TypeOf((**PodPreset)(nil)).Elem()
    98  }
    99  
   100  func (i *PodPreset) ToPodPresetOutput() PodPresetOutput {
   101  	return i.ToPodPresetOutputWithContext(context.Background())
   102  }
   103  
   104  func (i *PodPreset) ToPodPresetOutputWithContext(ctx context.Context) PodPresetOutput {
   105  	return pulumi.ToOutputWithContext(ctx, i).(PodPresetOutput)
   106  }
   107  
   108  // PodPresetArrayInput is an input type that accepts PodPresetArray and PodPresetArrayOutput values.
   109  // You can construct a concrete instance of `PodPresetArrayInput` via:
   110  //
   111  //	PodPresetArray{ PodPresetArgs{...} }
   112  type PodPresetArrayInput interface {
   113  	pulumi.Input
   114  
   115  	ToPodPresetArrayOutput() PodPresetArrayOutput
   116  	ToPodPresetArrayOutputWithContext(context.Context) PodPresetArrayOutput
   117  }
   118  
   119  type PodPresetArray []PodPresetInput
   120  
   121  func (PodPresetArray) ElementType() reflect.Type {
   122  	return reflect.TypeOf((*[]*PodPreset)(nil)).Elem()
   123  }
   124  
   125  func (i PodPresetArray) ToPodPresetArrayOutput() PodPresetArrayOutput {
   126  	return i.ToPodPresetArrayOutputWithContext(context.Background())
   127  }
   128  
   129  func (i PodPresetArray) ToPodPresetArrayOutputWithContext(ctx context.Context) PodPresetArrayOutput {
   130  	return pulumi.ToOutputWithContext(ctx, i).(PodPresetArrayOutput)
   131  }
   132  
   133  // PodPresetMapInput is an input type that accepts PodPresetMap and PodPresetMapOutput values.
   134  // You can construct a concrete instance of `PodPresetMapInput` via:
   135  //
   136  //	PodPresetMap{ "key": PodPresetArgs{...} }
   137  type PodPresetMapInput interface {
   138  	pulumi.Input
   139  
   140  	ToPodPresetMapOutput() PodPresetMapOutput
   141  	ToPodPresetMapOutputWithContext(context.Context) PodPresetMapOutput
   142  }
   143  
   144  type PodPresetMap map[string]PodPresetInput
   145  
   146  func (PodPresetMap) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*map[string]*PodPreset)(nil)).Elem()
   148  }
   149  
   150  func (i PodPresetMap) ToPodPresetMapOutput() PodPresetMapOutput {
   151  	return i.ToPodPresetMapOutputWithContext(context.Background())
   152  }
   153  
   154  func (i PodPresetMap) ToPodPresetMapOutputWithContext(ctx context.Context) PodPresetMapOutput {
   155  	return pulumi.ToOutputWithContext(ctx, i).(PodPresetMapOutput)
   156  }
   157  
   158  type PodPresetOutput struct{ *pulumi.OutputState }
   159  
   160  func (PodPresetOutput) ElementType() reflect.Type {
   161  	return reflect.TypeOf((**PodPreset)(nil)).Elem()
   162  }
   163  
   164  func (o PodPresetOutput) ToPodPresetOutput() PodPresetOutput {
   165  	return o
   166  }
   167  
   168  func (o PodPresetOutput) ToPodPresetOutputWithContext(ctx context.Context) PodPresetOutput {
   169  	return o
   170  }
   171  
   172  // 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
   173  func (o PodPresetOutput) ApiVersion() pulumi.StringPtrOutput {
   174  	return o.ApplyT(func(v *PodPreset) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   175  }
   176  
   177  // 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
   178  func (o PodPresetOutput) Kind() pulumi.StringPtrOutput {
   179  	return o.ApplyT(func(v *PodPreset) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   180  }
   181  
   182  func (o PodPresetOutput) Metadata() metav1.ObjectMetaPtrOutput {
   183  	return o.ApplyT(func(v *PodPreset) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   184  }
   185  
   186  func (o PodPresetOutput) Spec() PodPresetSpecPtrOutput {
   187  	return o.ApplyT(func(v *PodPreset) PodPresetSpecPtrOutput { return v.Spec }).(PodPresetSpecPtrOutput)
   188  }
   189  
   190  type PodPresetArrayOutput struct{ *pulumi.OutputState }
   191  
   192  func (PodPresetArrayOutput) ElementType() reflect.Type {
   193  	return reflect.TypeOf((*[]*PodPreset)(nil)).Elem()
   194  }
   195  
   196  func (o PodPresetArrayOutput) ToPodPresetArrayOutput() PodPresetArrayOutput {
   197  	return o
   198  }
   199  
   200  func (o PodPresetArrayOutput) ToPodPresetArrayOutputWithContext(ctx context.Context) PodPresetArrayOutput {
   201  	return o
   202  }
   203  
   204  func (o PodPresetArrayOutput) Index(i pulumi.IntInput) PodPresetOutput {
   205  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodPreset {
   206  		return vs[0].([]*PodPreset)[vs[1].(int)]
   207  	}).(PodPresetOutput)
   208  }
   209  
   210  type PodPresetMapOutput struct{ *pulumi.OutputState }
   211  
   212  func (PodPresetMapOutput) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*map[string]*PodPreset)(nil)).Elem()
   214  }
   215  
   216  func (o PodPresetMapOutput) ToPodPresetMapOutput() PodPresetMapOutput {
   217  	return o
   218  }
   219  
   220  func (o PodPresetMapOutput) ToPodPresetMapOutputWithContext(ctx context.Context) PodPresetMapOutput {
   221  	return o
   222  }
   223  
   224  func (o PodPresetMapOutput) MapIndex(k pulumi.StringInput) PodPresetOutput {
   225  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodPreset {
   226  		return vs[0].(map[string]*PodPreset)[vs[1].(string)]
   227  	}).(PodPresetOutput)
   228  }
   229  
   230  func init() {
   231  	pulumi.RegisterInputType(reflect.TypeOf((*PodPresetInput)(nil)).Elem(), &PodPreset{})
   232  	pulumi.RegisterInputType(reflect.TypeOf((*PodPresetArrayInput)(nil)).Elem(), PodPresetArray{})
   233  	pulumi.RegisterInputType(reflect.TypeOf((*PodPresetMapInput)(nil)).Elem(), PodPresetMap{})
   234  	pulumi.RegisterOutputType(PodPresetOutput{})
   235  	pulumi.RegisterOutputType(PodPresetArrayOutput{})
   236  	pulumi.RegisterOutputType(PodPresetMapOutput{})
   237  }