volumeattachmentstatus.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. // VolumeAttachmentStatusApplyConfiguration represents an declarative configuration of the VolumeAttachmentStatus type for use
  16. // with apply.
  17. type VolumeAttachmentStatusApplyConfiguration struct {
  18. Attached *bool `json:"attached,omitempty"`
  19. AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty"`
  20. AttachError *VolumeErrorApplyConfiguration `json:"attachError,omitempty"`
  21. DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"`
  22. }
  23. // VolumeAttachmentStatusApplyConfiguration constructs an declarative configuration of the VolumeAttachmentStatus type for use with
  24. // apply.
  25. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration {
  26. return &VolumeAttachmentStatusApplyConfiguration{}
  27. }
  28. // WithAttached sets the Attached field in the declarative configuration to the given value
  29. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  30. // If called multiple times, the Attached field is set to the value of the last call.
  31. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttached(value bool) *VolumeAttachmentStatusApplyConfiguration {
  32. b.Attached = &value
  33. return b
  34. }
  35. // WithAttachmentMetadata puts the entries into the AttachmentMetadata 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, the entries provided by each call will be put on the AttachmentMetadata field,
  38. // overwriting an existing map entries in AttachmentMetadata field with the same key.
  39. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachmentMetadata(entries map[string]string) *VolumeAttachmentStatusApplyConfiguration {
  40. if b.AttachmentMetadata == nil && len(entries) > 0 {
  41. b.AttachmentMetadata = make(map[string]string, len(entries))
  42. }
  43. for k, v := range entries {
  44. b.AttachmentMetadata[k] = v
  45. }
  46. return b
  47. }
  48. // WithAttachError sets the AttachError field in the declarative configuration to the given value
  49. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  50. // If called multiple times, the AttachError field is set to the value of the last call.
  51. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration {
  52. b.AttachError = value
  53. return b
  54. }
  55. // WithDetachError sets the DetachError field in the declarative configuration to the given value
  56. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  57. // If called multiple times, the DetachError field is set to the value of the last call.
  58. func (b *VolumeAttachmentStatusApplyConfiguration) WithDetachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration {
  59. b.DetachError = value
  60. return b
  61. }