github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/namespacePatch.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 // Namespace provides a scope for Names. Use of multiple namespaces is optional. 21 type NamespacePatch 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 defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 31 Spec NamespaceSpecPatchPtrOutput `pulumi:"spec"` 32 // Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 33 Status NamespaceStatusPatchPtrOutput `pulumi:"status"` 34 } 35 36 // NewNamespacePatch registers a new resource with the given unique name, arguments, and options. 37 func NewNamespacePatch(ctx *pulumi.Context, 38 name string, args *NamespacePatchArgs, opts ...pulumi.ResourceOption) (*NamespacePatch, error) { 39 if args == nil { 40 args = &NamespacePatchArgs{} 41 } 42 43 args.ApiVersion = pulumi.StringPtr("v1") 44 args.Kind = pulumi.StringPtr("Namespace") 45 var resource NamespacePatch 46 err := ctx.RegisterResource("kubernetes:core/v1:NamespacePatch", name, args, &resource, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &resource, nil 51 } 52 53 // GetNamespacePatch gets an existing NamespacePatch resource's state with the given name, ID, and optional 54 // state properties that are used to uniquely qualify the lookup (nil if not required). 55 func GetNamespacePatch(ctx *pulumi.Context, 56 name string, id pulumi.IDInput, state *NamespacePatchState, opts ...pulumi.ResourceOption) (*NamespacePatch, error) { 57 var resource NamespacePatch 58 err := ctx.ReadResource("kubernetes:core/v1:NamespacePatch", name, id, state, &resource, opts...) 59 if err != nil { 60 return nil, err 61 } 62 return &resource, nil 63 } 64 65 // Input properties used for looking up and filtering NamespacePatch resources. 66 type namespacePatchState struct { 67 } 68 69 type NamespacePatchState struct { 70 } 71 72 func (NamespacePatchState) ElementType() reflect.Type { 73 return reflect.TypeOf((*namespacePatchState)(nil)).Elem() 74 } 75 76 type namespacePatchArgs 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 *string `pulumi:"apiVersion"` 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 *string `pulumi:"kind"` 81 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 82 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 83 // Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 84 Spec *NamespaceSpecPatch `pulumi:"spec"` 85 } 86 87 // The set of arguments for constructing a NamespacePatch resource. 88 type NamespacePatchArgs struct { 89 // 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 90 ApiVersion pulumi.StringPtrInput 91 // 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 92 Kind pulumi.StringPtrInput 93 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 94 Metadata metav1.ObjectMetaPatchPtrInput 95 // Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 96 Spec NamespaceSpecPatchPtrInput 97 } 98 99 func (NamespacePatchArgs) ElementType() reflect.Type { 100 return reflect.TypeOf((*namespacePatchArgs)(nil)).Elem() 101 } 102 103 type NamespacePatchInput interface { 104 pulumi.Input 105 106 ToNamespacePatchOutput() NamespacePatchOutput 107 ToNamespacePatchOutputWithContext(ctx context.Context) NamespacePatchOutput 108 } 109 110 func (*NamespacePatch) ElementType() reflect.Type { 111 return reflect.TypeOf((**NamespacePatch)(nil)).Elem() 112 } 113 114 func (i *NamespacePatch) ToNamespacePatchOutput() NamespacePatchOutput { 115 return i.ToNamespacePatchOutputWithContext(context.Background()) 116 } 117 118 func (i *NamespacePatch) ToNamespacePatchOutputWithContext(ctx context.Context) NamespacePatchOutput { 119 return pulumi.ToOutputWithContext(ctx, i).(NamespacePatchOutput) 120 } 121 122 // NamespacePatchArrayInput is an input type that accepts NamespacePatchArray and NamespacePatchArrayOutput values. 123 // You can construct a concrete instance of `NamespacePatchArrayInput` via: 124 // 125 // NamespacePatchArray{ NamespacePatchArgs{...} } 126 type NamespacePatchArrayInput interface { 127 pulumi.Input 128 129 ToNamespacePatchArrayOutput() NamespacePatchArrayOutput 130 ToNamespacePatchArrayOutputWithContext(context.Context) NamespacePatchArrayOutput 131 } 132 133 type NamespacePatchArray []NamespacePatchInput 134 135 func (NamespacePatchArray) ElementType() reflect.Type { 136 return reflect.TypeOf((*[]*NamespacePatch)(nil)).Elem() 137 } 138 139 func (i NamespacePatchArray) ToNamespacePatchArrayOutput() NamespacePatchArrayOutput { 140 return i.ToNamespacePatchArrayOutputWithContext(context.Background()) 141 } 142 143 func (i NamespacePatchArray) ToNamespacePatchArrayOutputWithContext(ctx context.Context) NamespacePatchArrayOutput { 144 return pulumi.ToOutputWithContext(ctx, i).(NamespacePatchArrayOutput) 145 } 146 147 // NamespacePatchMapInput is an input type that accepts NamespacePatchMap and NamespacePatchMapOutput values. 148 // You can construct a concrete instance of `NamespacePatchMapInput` via: 149 // 150 // NamespacePatchMap{ "key": NamespacePatchArgs{...} } 151 type NamespacePatchMapInput interface { 152 pulumi.Input 153 154 ToNamespacePatchMapOutput() NamespacePatchMapOutput 155 ToNamespacePatchMapOutputWithContext(context.Context) NamespacePatchMapOutput 156 } 157 158 type NamespacePatchMap map[string]NamespacePatchInput 159 160 func (NamespacePatchMap) ElementType() reflect.Type { 161 return reflect.TypeOf((*map[string]*NamespacePatch)(nil)).Elem() 162 } 163 164 func (i NamespacePatchMap) ToNamespacePatchMapOutput() NamespacePatchMapOutput { 165 return i.ToNamespacePatchMapOutputWithContext(context.Background()) 166 } 167 168 func (i NamespacePatchMap) ToNamespacePatchMapOutputWithContext(ctx context.Context) NamespacePatchMapOutput { 169 return pulumi.ToOutputWithContext(ctx, i).(NamespacePatchMapOutput) 170 } 171 172 type NamespacePatchOutput struct{ *pulumi.OutputState } 173 174 func (NamespacePatchOutput) ElementType() reflect.Type { 175 return reflect.TypeOf((**NamespacePatch)(nil)).Elem() 176 } 177 178 func (o NamespacePatchOutput) ToNamespacePatchOutput() NamespacePatchOutput { 179 return o 180 } 181 182 func (o NamespacePatchOutput) ToNamespacePatchOutputWithContext(ctx context.Context) NamespacePatchOutput { 183 return o 184 } 185 186 // 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 187 func (o NamespacePatchOutput) ApiVersion() pulumi.StringPtrOutput { 188 return o.ApplyT(func(v *NamespacePatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 189 } 190 191 // 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 192 func (o NamespacePatchOutput) Kind() pulumi.StringPtrOutput { 193 return o.ApplyT(func(v *NamespacePatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 194 } 195 196 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 197 func (o NamespacePatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 198 return o.ApplyT(func(v *NamespacePatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 199 } 200 201 // Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 202 func (o NamespacePatchOutput) Spec() NamespaceSpecPatchPtrOutput { 203 return o.ApplyT(func(v *NamespacePatch) NamespaceSpecPatchPtrOutput { return v.Spec }).(NamespaceSpecPatchPtrOutput) 204 } 205 206 // Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 207 func (o NamespacePatchOutput) Status() NamespaceStatusPatchPtrOutput { 208 return o.ApplyT(func(v *NamespacePatch) NamespaceStatusPatchPtrOutput { return v.Status }).(NamespaceStatusPatchPtrOutput) 209 } 210 211 type NamespacePatchArrayOutput struct{ *pulumi.OutputState } 212 213 func (NamespacePatchArrayOutput) ElementType() reflect.Type { 214 return reflect.TypeOf((*[]*NamespacePatch)(nil)).Elem() 215 } 216 217 func (o NamespacePatchArrayOutput) ToNamespacePatchArrayOutput() NamespacePatchArrayOutput { 218 return o 219 } 220 221 func (o NamespacePatchArrayOutput) ToNamespacePatchArrayOutputWithContext(ctx context.Context) NamespacePatchArrayOutput { 222 return o 223 } 224 225 func (o NamespacePatchArrayOutput) Index(i pulumi.IntInput) NamespacePatchOutput { 226 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NamespacePatch { 227 return vs[0].([]*NamespacePatch)[vs[1].(int)] 228 }).(NamespacePatchOutput) 229 } 230 231 type NamespacePatchMapOutput struct{ *pulumi.OutputState } 232 233 func (NamespacePatchMapOutput) ElementType() reflect.Type { 234 return reflect.TypeOf((*map[string]*NamespacePatch)(nil)).Elem() 235 } 236 237 func (o NamespacePatchMapOutput) ToNamespacePatchMapOutput() NamespacePatchMapOutput { 238 return o 239 } 240 241 func (o NamespacePatchMapOutput) ToNamespacePatchMapOutputWithContext(ctx context.Context) NamespacePatchMapOutput { 242 return o 243 } 244 245 func (o NamespacePatchMapOutput) MapIndex(k pulumi.StringInput) NamespacePatchOutput { 246 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NamespacePatch { 247 return vs[0].(map[string]*NamespacePatch)[vs[1].(string)] 248 }).(NamespacePatchOutput) 249 } 250 251 func init() { 252 pulumi.RegisterInputType(reflect.TypeOf((*NamespacePatchInput)(nil)).Elem(), &NamespacePatch{}) 253 pulumi.RegisterInputType(reflect.TypeOf((*NamespacePatchArrayInput)(nil)).Elem(), NamespacePatchArray{}) 254 pulumi.RegisterInputType(reflect.TypeOf((*NamespacePatchMapInput)(nil)).Elem(), NamespacePatchMap{}) 255 pulumi.RegisterOutputType(NamespacePatchOutput{}) 256 pulumi.RegisterOutputType(NamespacePatchArrayOutput{}) 257 pulumi.RegisterOutputType(NamespacePatchMapOutput{}) 258 }