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