github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apiextensions/v1beta1/customResourceDefinition.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 "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 // 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. 16 type CustomResourceDefinition 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 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 24 // spec describes how the user wants the resources to appear 25 Spec CustomResourceDefinitionSpecOutput `pulumi:"spec"` 26 // status indicates the actual state of the CustomResourceDefinition 27 Status CustomResourceDefinitionStatusPtrOutput `pulumi:"status"` 28 } 29 30 // NewCustomResourceDefinition registers a new resource with the given unique name, arguments, and options. 31 func NewCustomResourceDefinition(ctx *pulumi.Context, 32 name string, args *CustomResourceDefinitionArgs, opts ...pulumi.ResourceOption) (*CustomResourceDefinition, error) { 33 if args == nil { 34 return nil, errors.New("missing one or more required arguments") 35 } 36 37 if args.Spec == nil { 38 return nil, errors.New("invalid value for required argument 'Spec'") 39 } 40 args.ApiVersion = pulumi.StringPtr("apiextensions.k8s.io/v1beta1") 41 args.Kind = pulumi.StringPtr("CustomResourceDefinition") 42 aliases := pulumi.Aliases([]pulumi.Alias{ 43 { 44 Type: pulumi.String("kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition"), 45 }, 46 }) 47 opts = append(opts, aliases) 48 var resource CustomResourceDefinition 49 err := ctx.RegisterResource("kubernetes:apiextensions.k8s.io/v1beta1:CustomResourceDefinition", name, args, &resource, opts...) 50 if err != nil { 51 return nil, err 52 } 53 return &resource, nil 54 } 55 56 // GetCustomResourceDefinition gets an existing CustomResourceDefinition resource's state with the given name, ID, and optional 57 // state properties that are used to uniquely qualify the lookup (nil if not required). 58 func GetCustomResourceDefinition(ctx *pulumi.Context, 59 name string, id pulumi.IDInput, state *CustomResourceDefinitionState, opts ...pulumi.ResourceOption) (*CustomResourceDefinition, error) { 60 var resource CustomResourceDefinition 61 err := ctx.ReadResource("kubernetes:apiextensions.k8s.io/v1beta1:CustomResourceDefinition", name, id, state, &resource, opts...) 62 if err != nil { 63 return nil, err 64 } 65 return &resource, nil 66 } 67 68 // Input properties used for looking up and filtering CustomResourceDefinition resources. 69 type customResourceDefinitionState struct { 70 } 71 72 type CustomResourceDefinitionState struct { 73 } 74 75 func (CustomResourceDefinitionState) ElementType() reflect.Type { 76 return reflect.TypeOf((*customResourceDefinitionState)(nil)).Elem() 77 } 78 79 type customResourceDefinitionArgs struct { 80 // 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 81 ApiVersion *string `pulumi:"apiVersion"` 82 // 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 83 Kind *string `pulumi:"kind"` 84 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 85 // spec describes how the user wants the resources to appear 86 Spec CustomResourceDefinitionSpec `pulumi:"spec"` 87 } 88 89 // The set of arguments for constructing a CustomResourceDefinition resource. 90 type CustomResourceDefinitionArgs struct { 91 // 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 92 ApiVersion pulumi.StringPtrInput 93 // 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 94 Kind pulumi.StringPtrInput 95 Metadata metav1.ObjectMetaPtrInput 96 // spec describes how the user wants the resources to appear 97 Spec CustomResourceDefinitionSpecInput 98 } 99 100 func (CustomResourceDefinitionArgs) ElementType() reflect.Type { 101 return reflect.TypeOf((*customResourceDefinitionArgs)(nil)).Elem() 102 } 103 104 type CustomResourceDefinitionInput interface { 105 pulumi.Input 106 107 ToCustomResourceDefinitionOutput() CustomResourceDefinitionOutput 108 ToCustomResourceDefinitionOutputWithContext(ctx context.Context) CustomResourceDefinitionOutput 109 } 110 111 func (*CustomResourceDefinition) ElementType() reflect.Type { 112 return reflect.TypeOf((**CustomResourceDefinition)(nil)).Elem() 113 } 114 115 func (i *CustomResourceDefinition) ToCustomResourceDefinitionOutput() CustomResourceDefinitionOutput { 116 return i.ToCustomResourceDefinitionOutputWithContext(context.Background()) 117 } 118 119 func (i *CustomResourceDefinition) ToCustomResourceDefinitionOutputWithContext(ctx context.Context) CustomResourceDefinitionOutput { 120 return pulumi.ToOutputWithContext(ctx, i).(CustomResourceDefinitionOutput) 121 } 122 123 // CustomResourceDefinitionArrayInput is an input type that accepts CustomResourceDefinitionArray and CustomResourceDefinitionArrayOutput values. 124 // You can construct a concrete instance of `CustomResourceDefinitionArrayInput` via: 125 // 126 // CustomResourceDefinitionArray{ CustomResourceDefinitionArgs{...} } 127 type CustomResourceDefinitionArrayInput interface { 128 pulumi.Input 129 130 ToCustomResourceDefinitionArrayOutput() CustomResourceDefinitionArrayOutput 131 ToCustomResourceDefinitionArrayOutputWithContext(context.Context) CustomResourceDefinitionArrayOutput 132 } 133 134 type CustomResourceDefinitionArray []CustomResourceDefinitionInput 135 136 func (CustomResourceDefinitionArray) ElementType() reflect.Type { 137 return reflect.TypeOf((*[]*CustomResourceDefinition)(nil)).Elem() 138 } 139 140 func (i CustomResourceDefinitionArray) ToCustomResourceDefinitionArrayOutput() CustomResourceDefinitionArrayOutput { 141 return i.ToCustomResourceDefinitionArrayOutputWithContext(context.Background()) 142 } 143 144 func (i CustomResourceDefinitionArray) ToCustomResourceDefinitionArrayOutputWithContext(ctx context.Context) CustomResourceDefinitionArrayOutput { 145 return pulumi.ToOutputWithContext(ctx, i).(CustomResourceDefinitionArrayOutput) 146 } 147 148 // CustomResourceDefinitionMapInput is an input type that accepts CustomResourceDefinitionMap and CustomResourceDefinitionMapOutput values. 149 // You can construct a concrete instance of `CustomResourceDefinitionMapInput` via: 150 // 151 // CustomResourceDefinitionMap{ "key": CustomResourceDefinitionArgs{...} } 152 type CustomResourceDefinitionMapInput interface { 153 pulumi.Input 154 155 ToCustomResourceDefinitionMapOutput() CustomResourceDefinitionMapOutput 156 ToCustomResourceDefinitionMapOutputWithContext(context.Context) CustomResourceDefinitionMapOutput 157 } 158 159 type CustomResourceDefinitionMap map[string]CustomResourceDefinitionInput 160 161 func (CustomResourceDefinitionMap) ElementType() reflect.Type { 162 return reflect.TypeOf((*map[string]*CustomResourceDefinition)(nil)).Elem() 163 } 164 165 func (i CustomResourceDefinitionMap) ToCustomResourceDefinitionMapOutput() CustomResourceDefinitionMapOutput { 166 return i.ToCustomResourceDefinitionMapOutputWithContext(context.Background()) 167 } 168 169 func (i CustomResourceDefinitionMap) ToCustomResourceDefinitionMapOutputWithContext(ctx context.Context) CustomResourceDefinitionMapOutput { 170 return pulumi.ToOutputWithContext(ctx, i).(CustomResourceDefinitionMapOutput) 171 } 172 173 type CustomResourceDefinitionOutput struct{ *pulumi.OutputState } 174 175 func (CustomResourceDefinitionOutput) ElementType() reflect.Type { 176 return reflect.TypeOf((**CustomResourceDefinition)(nil)).Elem() 177 } 178 179 func (o CustomResourceDefinitionOutput) ToCustomResourceDefinitionOutput() CustomResourceDefinitionOutput { 180 return o 181 } 182 183 func (o CustomResourceDefinitionOutput) ToCustomResourceDefinitionOutputWithContext(ctx context.Context) CustomResourceDefinitionOutput { 184 return o 185 } 186 187 // 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 188 func (o CustomResourceDefinitionOutput) ApiVersion() pulumi.StringPtrOutput { 189 return o.ApplyT(func(v *CustomResourceDefinition) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 190 } 191 192 // 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 193 func (o CustomResourceDefinitionOutput) Kind() pulumi.StringPtrOutput { 194 return o.ApplyT(func(v *CustomResourceDefinition) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 195 } 196 197 func (o CustomResourceDefinitionOutput) Metadata() metav1.ObjectMetaPtrOutput { 198 return o.ApplyT(func(v *CustomResourceDefinition) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 199 } 200 201 // spec describes how the user wants the resources to appear 202 func (o CustomResourceDefinitionOutput) Spec() CustomResourceDefinitionSpecOutput { 203 return o.ApplyT(func(v *CustomResourceDefinition) CustomResourceDefinitionSpecOutput { return v.Spec }).(CustomResourceDefinitionSpecOutput) 204 } 205 206 // status indicates the actual state of the CustomResourceDefinition 207 func (o CustomResourceDefinitionOutput) Status() CustomResourceDefinitionStatusPtrOutput { 208 return o.ApplyT(func(v *CustomResourceDefinition) CustomResourceDefinitionStatusPtrOutput { return v.Status }).(CustomResourceDefinitionStatusPtrOutput) 209 } 210 211 type CustomResourceDefinitionArrayOutput struct{ *pulumi.OutputState } 212 213 func (CustomResourceDefinitionArrayOutput) ElementType() reflect.Type { 214 return reflect.TypeOf((*[]*CustomResourceDefinition)(nil)).Elem() 215 } 216 217 func (o CustomResourceDefinitionArrayOutput) ToCustomResourceDefinitionArrayOutput() CustomResourceDefinitionArrayOutput { 218 return o 219 } 220 221 func (o CustomResourceDefinitionArrayOutput) ToCustomResourceDefinitionArrayOutputWithContext(ctx context.Context) CustomResourceDefinitionArrayOutput { 222 return o 223 } 224 225 func (o CustomResourceDefinitionArrayOutput) Index(i pulumi.IntInput) CustomResourceDefinitionOutput { 226 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomResourceDefinition { 227 return vs[0].([]*CustomResourceDefinition)[vs[1].(int)] 228 }).(CustomResourceDefinitionOutput) 229 } 230 231 type CustomResourceDefinitionMapOutput struct{ *pulumi.OutputState } 232 233 func (CustomResourceDefinitionMapOutput) ElementType() reflect.Type { 234 return reflect.TypeOf((*map[string]*CustomResourceDefinition)(nil)).Elem() 235 } 236 237 func (o CustomResourceDefinitionMapOutput) ToCustomResourceDefinitionMapOutput() CustomResourceDefinitionMapOutput { 238 return o 239 } 240 241 func (o CustomResourceDefinitionMapOutput) ToCustomResourceDefinitionMapOutputWithContext(ctx context.Context) CustomResourceDefinitionMapOutput { 242 return o 243 } 244 245 func (o CustomResourceDefinitionMapOutput) MapIndex(k pulumi.StringInput) CustomResourceDefinitionOutput { 246 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomResourceDefinition { 247 return vs[0].(map[string]*CustomResourceDefinition)[vs[1].(string)] 248 }).(CustomResourceDefinitionOutput) 249 } 250 251 func init() { 252 pulumi.RegisterInputType(reflect.TypeOf((*CustomResourceDefinitionInput)(nil)).Elem(), &CustomResourceDefinition{}) 253 pulumi.RegisterInputType(reflect.TypeOf((*CustomResourceDefinitionArrayInput)(nil)).Elem(), CustomResourceDefinitionArray{}) 254 pulumi.RegisterInputType(reflect.TypeOf((*CustomResourceDefinitionMapInput)(nil)).Elem(), CustomResourceDefinitionMap{}) 255 pulumi.RegisterOutputType(CustomResourceDefinitionOutput{}) 256 pulumi.RegisterOutputType(CustomResourceDefinitionArrayOutput{}) 257 pulumi.RegisterOutputType(CustomResourceDefinitionMapOutput{}) 258 }