| 1 |
/* |
| 2 |
Copyright The Kubernetes Authors. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
// Code generated by applyconfiguration-gen. DO NOT EDIT. |
| 18 |
|
| 19 |
package v1beta1 |
| 20 |
|
| 21 |
import ( |
| 22 |
certificatesv1beta1 "k8s.io/api/certificates/v1beta1" |
| 23 |
) |
| 24 |
|
| 25 |
// CertificateSigningRequestSpecApplyConfiguration represents a declarative configuration of the CertificateSigningRequestSpec type for use |
| 26 |
// with apply. |
| 27 |
type CertificateSigningRequestSpecApplyConfiguration struct { |
| 28 |
Request []byte `json:"request,omitempty"` |
| 29 |
SignerName *string `json:"signerName,omitempty"` |
| 30 |
ExpirationSeconds *int32 `json:"expirationSeconds,omitempty"` |
| 31 |
Usages []certificatesv1beta1.KeyUsage `json:"usages,omitempty"` |
| 32 |
Username *string `json:"username,omitempty"` |
| 33 |
UID *string `json:"uid,omitempty"` |
| 34 |
Groups []string `json:"groups,omitempty"` |
| 35 |
Extra map[string]certificatesv1beta1.ExtraValue `json:"extra,omitempty"` |
| 36 |
} |
| 37 |
|
| 38 |
// CertificateSigningRequestSpecApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestSpec type for use with |
| 39 |
// apply. |
| 40 |
func CertificateSigningRequestSpec() *CertificateSigningRequestSpecApplyConfiguration { |
| 41 |
return &CertificateSigningRequestSpecApplyConfiguration{} |
| 42 |
} |
| 43 |
|
| 44 |
// WithRequest adds the given value to the Request field in the declarative configuration |
| 45 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 46 |
// If called multiple times, values provided by each call will be appended to the Request field. |
| 47 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithRequest(values ...byte) *CertificateSigningRequestSpecApplyConfiguration { |
| 48 |
for i := range values { |
| 49 |
b.Request = append(b.Request, values[i]) |
| 50 |
} |
| 51 |
return b |
| 52 |
} |
| 53 |
|
| 54 |
// WithSignerName sets the SignerName field in the declarative configuration to the given value |
| 55 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 56 |
// If called multiple times, the SignerName field is set to the value of the last call. |
| 57 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithSignerName(value string) *CertificateSigningRequestSpecApplyConfiguration { |
| 58 |
b.SignerName = &value |
| 59 |
return b |
| 60 |
} |
| 61 |
|
| 62 |
// WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value |
| 63 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 64 |
// If called multiple times, the ExpirationSeconds field is set to the value of the last call. |
| 65 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithExpirationSeconds(value int32) *CertificateSigningRequestSpecApplyConfiguration { |
| 66 |
b.ExpirationSeconds = &value |
| 67 |
return b |
| 68 |
} |
| 69 |
|
| 70 |
// WithUsages adds the given value to the Usages field in the declarative configuration |
| 71 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 72 |
// If called multiple times, values provided by each call will be appended to the Usages field. |
| 73 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithUsages(values ...certificatesv1beta1.KeyUsage) *CertificateSigningRequestSpecApplyConfiguration { |
| 74 |
for i := range values { |
| 75 |
b.Usages = append(b.Usages, values[i]) |
| 76 |
} |
| 77 |
return b |
| 78 |
} |
| 79 |
|
| 80 |
// WithUsername sets the Username field in the declarative configuration to the given value |
| 81 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 82 |
// If called multiple times, the Username field is set to the value of the last call. |
| 83 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithUsername(value string) *CertificateSigningRequestSpecApplyConfiguration { |
| 84 |
b.Username = &value |
| 85 |
return b |
| 86 |
} |
| 87 |
|
| 88 |
// WithUID sets the UID field in the declarative configuration to the given value |
| 89 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 90 |
// If called multiple times, the UID field is set to the value of the last call. |
| 91 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithUID(value string) *CertificateSigningRequestSpecApplyConfiguration { |
| 92 |
b.UID = &value |
| 93 |
return b |
| 94 |
} |
| 95 |
|
| 96 |
// WithGroups adds the given value to the Groups field in the declarative configuration |
| 97 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 98 |
// If called multiple times, values provided by each call will be appended to the Groups field. |
| 99 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithGroups(values ...string) *CertificateSigningRequestSpecApplyConfiguration { |
| 100 |
for i := range values { |
| 101 |
b.Groups = append(b.Groups, values[i]) |
| 102 |
} |
| 103 |
return b |
| 104 |
} |
| 105 |
|
| 106 |
// WithExtra puts the entries into the Extra field in the declarative configuration |
| 107 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 108 |
// If called multiple times, the entries provided by each call will be put on the Extra field, |
| 109 |
// overwriting an existing map entries in Extra field with the same key. |
| 110 |
func (b *CertificateSigningRequestSpecApplyConfiguration) WithExtra(entries map[string]certificatesv1beta1.ExtraValue) *CertificateSigningRequestSpecApplyConfiguration { |
| 111 |
if b.Extra == nil && len(entries) > 0 { |
| 112 |
b.Extra = make(map[string]certificatesv1beta1.ExtraValue, len(entries)) |
| 113 |
} |
| 114 |
for k, v := range entries { |
| 115 |
b.Extra[k] = v |
| 116 |
} |
| 117 |
return b |
| 118 |
} |