github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/resource/v1alpha2/resourceClaimTemplate.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 "errors" 11 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // ResourceClaimTemplate is used to produce ResourceClaim objects. 16 type ResourceClaimTemplate struct { 17 pulumi.CustomResourceState 18 19 // 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 20 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 21 // 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 22 Kind pulumi.StringPtrOutput `pulumi:"kind"` 23 // Standard object metadata 24 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 25 // Describes the ResourceClaim that is to be generated. 26 // 27 // This field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore. 28 Spec ResourceClaimTemplateSpecOutput `pulumi:"spec"` 29 } 30 31 // NewResourceClaimTemplate registers a new resource with the given unique name, arguments, and options. 32 func NewResourceClaimTemplate(ctx *pulumi.Context, 33 name string, args *ResourceClaimTemplateArgs, opts ...pulumi.ResourceOption) (*ResourceClaimTemplate, error) { 34 if args == nil { 35 return nil, errors.New("missing one or more required arguments") 36 } 37 38 if args.Spec == nil { 39 return nil, errors.New("invalid value for required argument 'Spec'") 40 } 41 args.ApiVersion = pulumi.StringPtr("resource.k8s.io/v1alpha2") 42 args.Kind = pulumi.StringPtr("ResourceClaimTemplate") 43 aliases := pulumi.Aliases([]pulumi.Alias{ 44 { 45 Type: pulumi.String("kubernetes:resource.k8s.io/v1alpha1:ResourceClaimTemplate"), 46 }, 47 }) 48 opts = append(opts, aliases) 49 var resource ResourceClaimTemplate 50 err := ctx.RegisterResource("kubernetes:resource.k8s.io/v1alpha2:ResourceClaimTemplate", name, args, &resource, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &resource, nil 55 } 56 57 // GetResourceClaimTemplate gets an existing ResourceClaimTemplate 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 GetResourceClaimTemplate(ctx *pulumi.Context, 60 name string, id pulumi.IDInput, state *ResourceClaimTemplateState, opts ...pulumi.ResourceOption) (*ResourceClaimTemplate, error) { 61 var resource ResourceClaimTemplate 62 err := ctx.ReadResource("kubernetes:resource.k8s.io/v1alpha2:ResourceClaimTemplate", 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 ResourceClaimTemplate resources. 70 type resourceClaimTemplateState struct { 71 } 72 73 type ResourceClaimTemplateState struct { 74 } 75 76 func (ResourceClaimTemplateState) ElementType() reflect.Type { 77 return reflect.TypeOf((*resourceClaimTemplateState)(nil)).Elem() 78 } 79 80 type resourceClaimTemplateArgs 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 // Standard object metadata 86 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 87 // Describes the ResourceClaim that is to be generated. 88 // 89 // This field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore. 90 Spec ResourceClaimTemplateSpec `pulumi:"spec"` 91 } 92 93 // The set of arguments for constructing a ResourceClaimTemplate resource. 94 type ResourceClaimTemplateArgs struct { 95 // 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 96 ApiVersion pulumi.StringPtrInput 97 // 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 98 Kind pulumi.StringPtrInput 99 // Standard object metadata 100 Metadata metav1.ObjectMetaPtrInput 101 // Describes the ResourceClaim that is to be generated. 102 // 103 // This field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore. 104 Spec ResourceClaimTemplateSpecInput 105 } 106 107 func (ResourceClaimTemplateArgs) ElementType() reflect.Type { 108 return reflect.TypeOf((*resourceClaimTemplateArgs)(nil)).Elem() 109 } 110 111 type ResourceClaimTemplateInput interface { 112 pulumi.Input 113 114 ToResourceClaimTemplateOutput() ResourceClaimTemplateOutput 115 ToResourceClaimTemplateOutputWithContext(ctx context.Context) ResourceClaimTemplateOutput 116 } 117 118 func (*ResourceClaimTemplate) ElementType() reflect.Type { 119 return reflect.TypeOf((**ResourceClaimTemplate)(nil)).Elem() 120 } 121 122 func (i *ResourceClaimTemplate) ToResourceClaimTemplateOutput() ResourceClaimTemplateOutput { 123 return i.ToResourceClaimTemplateOutputWithContext(context.Background()) 124 } 125 126 func (i *ResourceClaimTemplate) ToResourceClaimTemplateOutputWithContext(ctx context.Context) ResourceClaimTemplateOutput { 127 return pulumi.ToOutputWithContext(ctx, i).(ResourceClaimTemplateOutput) 128 } 129 130 // ResourceClaimTemplateArrayInput is an input type that accepts ResourceClaimTemplateArray and ResourceClaimTemplateArrayOutput values. 131 // You can construct a concrete instance of `ResourceClaimTemplateArrayInput` via: 132 // 133 // ResourceClaimTemplateArray{ ResourceClaimTemplateArgs{...} } 134 type ResourceClaimTemplateArrayInput interface { 135 pulumi.Input 136 137 ToResourceClaimTemplateArrayOutput() ResourceClaimTemplateArrayOutput 138 ToResourceClaimTemplateArrayOutputWithContext(context.Context) ResourceClaimTemplateArrayOutput 139 } 140 141 type ResourceClaimTemplateArray []ResourceClaimTemplateInput 142 143 func (ResourceClaimTemplateArray) ElementType() reflect.Type { 144 return reflect.TypeOf((*[]*ResourceClaimTemplate)(nil)).Elem() 145 } 146 147 func (i ResourceClaimTemplateArray) ToResourceClaimTemplateArrayOutput() ResourceClaimTemplateArrayOutput { 148 return i.ToResourceClaimTemplateArrayOutputWithContext(context.Background()) 149 } 150 151 func (i ResourceClaimTemplateArray) ToResourceClaimTemplateArrayOutputWithContext(ctx context.Context) ResourceClaimTemplateArrayOutput { 152 return pulumi.ToOutputWithContext(ctx, i).(ResourceClaimTemplateArrayOutput) 153 } 154 155 // ResourceClaimTemplateMapInput is an input type that accepts ResourceClaimTemplateMap and ResourceClaimTemplateMapOutput values. 156 // You can construct a concrete instance of `ResourceClaimTemplateMapInput` via: 157 // 158 // ResourceClaimTemplateMap{ "key": ResourceClaimTemplateArgs{...} } 159 type ResourceClaimTemplateMapInput interface { 160 pulumi.Input 161 162 ToResourceClaimTemplateMapOutput() ResourceClaimTemplateMapOutput 163 ToResourceClaimTemplateMapOutputWithContext(context.Context) ResourceClaimTemplateMapOutput 164 } 165 166 type ResourceClaimTemplateMap map[string]ResourceClaimTemplateInput 167 168 func (ResourceClaimTemplateMap) ElementType() reflect.Type { 169 return reflect.TypeOf((*map[string]*ResourceClaimTemplate)(nil)).Elem() 170 } 171 172 func (i ResourceClaimTemplateMap) ToResourceClaimTemplateMapOutput() ResourceClaimTemplateMapOutput { 173 return i.ToResourceClaimTemplateMapOutputWithContext(context.Background()) 174 } 175 176 func (i ResourceClaimTemplateMap) ToResourceClaimTemplateMapOutputWithContext(ctx context.Context) ResourceClaimTemplateMapOutput { 177 return pulumi.ToOutputWithContext(ctx, i).(ResourceClaimTemplateMapOutput) 178 } 179 180 type ResourceClaimTemplateOutput struct{ *pulumi.OutputState } 181 182 func (ResourceClaimTemplateOutput) ElementType() reflect.Type { 183 return reflect.TypeOf((**ResourceClaimTemplate)(nil)).Elem() 184 } 185 186 func (o ResourceClaimTemplateOutput) ToResourceClaimTemplateOutput() ResourceClaimTemplateOutput { 187 return o 188 } 189 190 func (o ResourceClaimTemplateOutput) ToResourceClaimTemplateOutputWithContext(ctx context.Context) ResourceClaimTemplateOutput { 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 ResourceClaimTemplateOutput) ApiVersion() pulumi.StringPtrOutput { 196 return o.ApplyT(func(v *ResourceClaimTemplate) 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 ResourceClaimTemplateOutput) Kind() pulumi.StringPtrOutput { 201 return o.ApplyT(func(v *ResourceClaimTemplate) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 202 } 203 204 // Standard object metadata 205 func (o ResourceClaimTemplateOutput) Metadata() metav1.ObjectMetaPtrOutput { 206 return o.ApplyT(func(v *ResourceClaimTemplate) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 207 } 208 209 // Describes the ResourceClaim that is to be generated. 210 // 211 // This field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore. 212 func (o ResourceClaimTemplateOutput) Spec() ResourceClaimTemplateSpecOutput { 213 return o.ApplyT(func(v *ResourceClaimTemplate) ResourceClaimTemplateSpecOutput { return v.Spec }).(ResourceClaimTemplateSpecOutput) 214 } 215 216 type ResourceClaimTemplateArrayOutput struct{ *pulumi.OutputState } 217 218 func (ResourceClaimTemplateArrayOutput) ElementType() reflect.Type { 219 return reflect.TypeOf((*[]*ResourceClaimTemplate)(nil)).Elem() 220 } 221 222 func (o ResourceClaimTemplateArrayOutput) ToResourceClaimTemplateArrayOutput() ResourceClaimTemplateArrayOutput { 223 return o 224 } 225 226 func (o ResourceClaimTemplateArrayOutput) ToResourceClaimTemplateArrayOutputWithContext(ctx context.Context) ResourceClaimTemplateArrayOutput { 227 return o 228 } 229 230 func (o ResourceClaimTemplateArrayOutput) Index(i pulumi.IntInput) ResourceClaimTemplateOutput { 231 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResourceClaimTemplate { 232 return vs[0].([]*ResourceClaimTemplate)[vs[1].(int)] 233 }).(ResourceClaimTemplateOutput) 234 } 235 236 type ResourceClaimTemplateMapOutput struct{ *pulumi.OutputState } 237 238 func (ResourceClaimTemplateMapOutput) ElementType() reflect.Type { 239 return reflect.TypeOf((*map[string]*ResourceClaimTemplate)(nil)).Elem() 240 } 241 242 func (o ResourceClaimTemplateMapOutput) ToResourceClaimTemplateMapOutput() ResourceClaimTemplateMapOutput { 243 return o 244 } 245 246 func (o ResourceClaimTemplateMapOutput) ToResourceClaimTemplateMapOutputWithContext(ctx context.Context) ResourceClaimTemplateMapOutput { 247 return o 248 } 249 250 func (o ResourceClaimTemplateMapOutput) MapIndex(k pulumi.StringInput) ResourceClaimTemplateOutput { 251 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResourceClaimTemplate { 252 return vs[0].(map[string]*ResourceClaimTemplate)[vs[1].(string)] 253 }).(ResourceClaimTemplateOutput) 254 } 255 256 func init() { 257 pulumi.RegisterInputType(reflect.TypeOf((*ResourceClaimTemplateInput)(nil)).Elem(), &ResourceClaimTemplate{}) 258 pulumi.RegisterInputType(reflect.TypeOf((*ResourceClaimTemplateArrayInput)(nil)).Elem(), ResourceClaimTemplateArray{}) 259 pulumi.RegisterInputType(reflect.TypeOf((*ResourceClaimTemplateMapInput)(nil)).Elem(), ResourceClaimTemplateMap{}) 260 pulumi.RegisterOutputType(ResourceClaimTemplateOutput{}) 261 pulumi.RegisterOutputType(ResourceClaimTemplateArrayOutput{}) 262 pulumi.RegisterOutputType(ResourceClaimTemplateMapOutput{}) 263 }