github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apiregistration/v1/apiservicePatch.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 // APIService represents a server for a particular GroupVersion. Name must be "version.group". 21 type APIServicePatch 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 contains information for locating and communicating with a server 31 Spec APIServiceSpecPatchPtrOutput `pulumi:"spec"` 32 // Status contains derived information about an API server 33 Status APIServiceStatusPatchPtrOutput `pulumi:"status"` 34 } 35 36 // NewAPIServicePatch registers a new resource with the given unique name, arguments, and options. 37 func NewAPIServicePatch(ctx *pulumi.Context, 38 name string, args *APIServicePatchArgs, opts ...pulumi.ResourceOption) (*APIServicePatch, error) { 39 if args == nil { 40 args = &APIServicePatchArgs{} 41 } 42 43 args.ApiVersion = pulumi.StringPtr("apiregistration.k8s.io/v1") 44 args.Kind = pulumi.StringPtr("APIService") 45 aliases := pulumi.Aliases([]pulumi.Alias{ 46 { 47 Type: pulumi.String("kubernetes:apiregistration.k8s.io/v1beta1:APIServicePatch"), 48 }, 49 { 50 Type: pulumi.String("kubernetes:apiregistration/v1beta1:APIServicePatch"), 51 }, 52 { 53 Type: pulumi.String("kubernetes:apiregistration/v1:APIServicePatch"), 54 }, 55 }) 56 opts = append(opts, aliases) 57 var resource APIServicePatch 58 err := ctx.RegisterResource("kubernetes:apiregistration.k8s.io/v1:APIServicePatch", name, args, &resource, opts...) 59 if err != nil { 60 return nil, err 61 } 62 return &resource, nil 63 } 64 65 // GetAPIServicePatch gets an existing APIServicePatch resource's state with the given name, ID, and optional 66 // state properties that are used to uniquely qualify the lookup (nil if not required). 67 func GetAPIServicePatch(ctx *pulumi.Context, 68 name string, id pulumi.IDInput, state *APIServicePatchState, opts ...pulumi.ResourceOption) (*APIServicePatch, error) { 69 var resource APIServicePatch 70 err := ctx.ReadResource("kubernetes:apiregistration.k8s.io/v1:APIServicePatch", name, id, state, &resource, opts...) 71 if err != nil { 72 return nil, err 73 } 74 return &resource, nil 75 } 76 77 // Input properties used for looking up and filtering APIServicePatch resources. 78 type apiservicePatchState struct { 79 } 80 81 type APIServicePatchState struct { 82 } 83 84 func (APIServicePatchState) ElementType() reflect.Type { 85 return reflect.TypeOf((*apiservicePatchState)(nil)).Elem() 86 } 87 88 type apiservicePatchArgs 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 *string `pulumi:"apiVersion"` 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 *string `pulumi:"kind"` 93 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 94 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 95 // Spec contains information for locating and communicating with a server 96 Spec *APIServiceSpecPatch `pulumi:"spec"` 97 } 98 99 // The set of arguments for constructing a APIServicePatch resource. 100 type APIServicePatchArgs struct { 101 // 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 102 ApiVersion pulumi.StringPtrInput 103 // 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 104 Kind pulumi.StringPtrInput 105 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 106 Metadata metav1.ObjectMetaPatchPtrInput 107 // Spec contains information for locating and communicating with a server 108 Spec APIServiceSpecPatchPtrInput 109 } 110 111 func (APIServicePatchArgs) ElementType() reflect.Type { 112 return reflect.TypeOf((*apiservicePatchArgs)(nil)).Elem() 113 } 114 115 type APIServicePatchInput interface { 116 pulumi.Input 117 118 ToAPIServicePatchOutput() APIServicePatchOutput 119 ToAPIServicePatchOutputWithContext(ctx context.Context) APIServicePatchOutput 120 } 121 122 func (*APIServicePatch) ElementType() reflect.Type { 123 return reflect.TypeOf((**APIServicePatch)(nil)).Elem() 124 } 125 126 func (i *APIServicePatch) ToAPIServicePatchOutput() APIServicePatchOutput { 127 return i.ToAPIServicePatchOutputWithContext(context.Background()) 128 } 129 130 func (i *APIServicePatch) ToAPIServicePatchOutputWithContext(ctx context.Context) APIServicePatchOutput { 131 return pulumi.ToOutputWithContext(ctx, i).(APIServicePatchOutput) 132 } 133 134 // APIServicePatchArrayInput is an input type that accepts APIServicePatchArray and APIServicePatchArrayOutput values. 135 // You can construct a concrete instance of `APIServicePatchArrayInput` via: 136 // 137 // APIServicePatchArray{ APIServicePatchArgs{...} } 138 type APIServicePatchArrayInput interface { 139 pulumi.Input 140 141 ToAPIServicePatchArrayOutput() APIServicePatchArrayOutput 142 ToAPIServicePatchArrayOutputWithContext(context.Context) APIServicePatchArrayOutput 143 } 144 145 type APIServicePatchArray []APIServicePatchInput 146 147 func (APIServicePatchArray) ElementType() reflect.Type { 148 return reflect.TypeOf((*[]*APIServicePatch)(nil)).Elem() 149 } 150 151 func (i APIServicePatchArray) ToAPIServicePatchArrayOutput() APIServicePatchArrayOutput { 152 return i.ToAPIServicePatchArrayOutputWithContext(context.Background()) 153 } 154 155 func (i APIServicePatchArray) ToAPIServicePatchArrayOutputWithContext(ctx context.Context) APIServicePatchArrayOutput { 156 return pulumi.ToOutputWithContext(ctx, i).(APIServicePatchArrayOutput) 157 } 158 159 // APIServicePatchMapInput is an input type that accepts APIServicePatchMap and APIServicePatchMapOutput values. 160 // You can construct a concrete instance of `APIServicePatchMapInput` via: 161 // 162 // APIServicePatchMap{ "key": APIServicePatchArgs{...} } 163 type APIServicePatchMapInput interface { 164 pulumi.Input 165 166 ToAPIServicePatchMapOutput() APIServicePatchMapOutput 167 ToAPIServicePatchMapOutputWithContext(context.Context) APIServicePatchMapOutput 168 } 169 170 type APIServicePatchMap map[string]APIServicePatchInput 171 172 func (APIServicePatchMap) ElementType() reflect.Type { 173 return reflect.TypeOf((*map[string]*APIServicePatch)(nil)).Elem() 174 } 175 176 func (i APIServicePatchMap) ToAPIServicePatchMapOutput() APIServicePatchMapOutput { 177 return i.ToAPIServicePatchMapOutputWithContext(context.Background()) 178 } 179 180 func (i APIServicePatchMap) ToAPIServicePatchMapOutputWithContext(ctx context.Context) APIServicePatchMapOutput { 181 return pulumi.ToOutputWithContext(ctx, i).(APIServicePatchMapOutput) 182 } 183 184 type APIServicePatchOutput struct{ *pulumi.OutputState } 185 186 func (APIServicePatchOutput) ElementType() reflect.Type { 187 return reflect.TypeOf((**APIServicePatch)(nil)).Elem() 188 } 189 190 func (o APIServicePatchOutput) ToAPIServicePatchOutput() APIServicePatchOutput { 191 return o 192 } 193 194 func (o APIServicePatchOutput) ToAPIServicePatchOutputWithContext(ctx context.Context) APIServicePatchOutput { 195 return o 196 } 197 198 // 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 199 func (o APIServicePatchOutput) ApiVersion() pulumi.StringPtrOutput { 200 return o.ApplyT(func(v *APIServicePatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 201 } 202 203 // 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 204 func (o APIServicePatchOutput) Kind() pulumi.StringPtrOutput { 205 return o.ApplyT(func(v *APIServicePatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 206 } 207 208 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 209 func (o APIServicePatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 210 return o.ApplyT(func(v *APIServicePatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 211 } 212 213 // Spec contains information for locating and communicating with a server 214 func (o APIServicePatchOutput) Spec() APIServiceSpecPatchPtrOutput { 215 return o.ApplyT(func(v *APIServicePatch) APIServiceSpecPatchPtrOutput { return v.Spec }).(APIServiceSpecPatchPtrOutput) 216 } 217 218 // Status contains derived information about an API server 219 func (o APIServicePatchOutput) Status() APIServiceStatusPatchPtrOutput { 220 return o.ApplyT(func(v *APIServicePatch) APIServiceStatusPatchPtrOutput { return v.Status }).(APIServiceStatusPatchPtrOutput) 221 } 222 223 type APIServicePatchArrayOutput struct{ *pulumi.OutputState } 224 225 func (APIServicePatchArrayOutput) ElementType() reflect.Type { 226 return reflect.TypeOf((*[]*APIServicePatch)(nil)).Elem() 227 } 228 229 func (o APIServicePatchArrayOutput) ToAPIServicePatchArrayOutput() APIServicePatchArrayOutput { 230 return o 231 } 232 233 func (o APIServicePatchArrayOutput) ToAPIServicePatchArrayOutputWithContext(ctx context.Context) APIServicePatchArrayOutput { 234 return o 235 } 236 237 func (o APIServicePatchArrayOutput) Index(i pulumi.IntInput) APIServicePatchOutput { 238 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *APIServicePatch { 239 return vs[0].([]*APIServicePatch)[vs[1].(int)] 240 }).(APIServicePatchOutput) 241 } 242 243 type APIServicePatchMapOutput struct{ *pulumi.OutputState } 244 245 func (APIServicePatchMapOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((*map[string]*APIServicePatch)(nil)).Elem() 247 } 248 249 func (o APIServicePatchMapOutput) ToAPIServicePatchMapOutput() APIServicePatchMapOutput { 250 return o 251 } 252 253 func (o APIServicePatchMapOutput) ToAPIServicePatchMapOutputWithContext(ctx context.Context) APIServicePatchMapOutput { 254 return o 255 } 256 257 func (o APIServicePatchMapOutput) MapIndex(k pulumi.StringInput) APIServicePatchOutput { 258 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *APIServicePatch { 259 return vs[0].(map[string]*APIServicePatch)[vs[1].(string)] 260 }).(APIServicePatchOutput) 261 } 262 263 func init() { 264 pulumi.RegisterInputType(reflect.TypeOf((*APIServicePatchInput)(nil)).Elem(), &APIServicePatch{}) 265 pulumi.RegisterInputType(reflect.TypeOf((*APIServicePatchArrayInput)(nil)).Elem(), APIServicePatchArray{}) 266 pulumi.RegisterInputType(reflect.TypeOf((*APIServicePatchMapInput)(nil)).Elem(), APIServicePatchMap{}) 267 pulumi.RegisterOutputType(APIServicePatchOutput{}) 268 pulumi.RegisterOutputType(APIServicePatchArrayOutput{}) 269 pulumi.RegisterOutputType(APIServicePatchMapOutput{}) 270 }