certificatesigningrequestspec.go 5.7 KB

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