bunnyshell.com/sdk@v0.16.0/model_context_kube_config_read.go (about) 1 /* 2 API Bunnyshell Environments 3 4 Interact with Bunnyshell Platform 5 6 API version: 1.1.0 7 Contact: osi+support@bunnyshell.com 8 */ 9 10 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 12 package sdk 13 14 import ( 15 "encoding/json" 16 ) 17 18 // checks if the ContextKubeConfigRead type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ContextKubeConfigRead{} 20 21 // ContextKubeConfigRead struct for ContextKubeConfigRead 22 type ContextKubeConfigRead struct { 23 Cluster string `json:"cluster"` 24 Namespace *string `json:"namespace,omitempty"` 25 User string `json:"user"` 26 } 27 28 // NewContextKubeConfigRead instantiates a new ContextKubeConfigRead object 29 // This constructor will assign default values to properties that have it defined, 30 // and makes sure properties required by API are set, but the set of arguments 31 // will change when the set of required properties is changed 32 func NewContextKubeConfigRead(cluster string, user string) *ContextKubeConfigRead { 33 this := ContextKubeConfigRead{} 34 this.Cluster = cluster 35 this.User = user 36 return &this 37 } 38 39 // NewContextKubeConfigReadWithDefaults instantiates a new ContextKubeConfigRead object 40 // This constructor will only assign default values to properties that have it defined, 41 // but it doesn't guarantee that properties required by API are set 42 func NewContextKubeConfigReadWithDefaults() *ContextKubeConfigRead { 43 this := ContextKubeConfigRead{} 44 return &this 45 } 46 47 // GetCluster returns the Cluster field value 48 func (o *ContextKubeConfigRead) GetCluster() string { 49 if o == nil { 50 var ret string 51 return ret 52 } 53 54 return o.Cluster 55 } 56 57 // GetClusterOk returns a tuple with the Cluster field value 58 // and a boolean to check if the value has been set. 59 func (o *ContextKubeConfigRead) GetClusterOk() (*string, bool) { 60 if o == nil { 61 return nil, false 62 } 63 return &o.Cluster, true 64 } 65 66 // SetCluster sets field value 67 func (o *ContextKubeConfigRead) SetCluster(v string) { 68 o.Cluster = v 69 } 70 71 // GetNamespace returns the Namespace field value if set, zero value otherwise. 72 func (o *ContextKubeConfigRead) GetNamespace() string { 73 if o == nil || IsNil(o.Namespace) { 74 var ret string 75 return ret 76 } 77 return *o.Namespace 78 } 79 80 // GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise 81 // and a boolean to check if the value has been set. 82 func (o *ContextKubeConfigRead) GetNamespaceOk() (*string, bool) { 83 if o == nil || IsNil(o.Namespace) { 84 return nil, false 85 } 86 return o.Namespace, true 87 } 88 89 // HasNamespace returns a boolean if a field has been set. 90 func (o *ContextKubeConfigRead) HasNamespace() bool { 91 if o != nil && !IsNil(o.Namespace) { 92 return true 93 } 94 95 return false 96 } 97 98 // SetNamespace gets a reference to the given string and assigns it to the Namespace field. 99 func (o *ContextKubeConfigRead) SetNamespace(v string) { 100 o.Namespace = &v 101 } 102 103 // GetUser returns the User field value 104 func (o *ContextKubeConfigRead) GetUser() string { 105 if o == nil { 106 var ret string 107 return ret 108 } 109 110 return o.User 111 } 112 113 // GetUserOk returns a tuple with the User field value 114 // and a boolean to check if the value has been set. 115 func (o *ContextKubeConfigRead) GetUserOk() (*string, bool) { 116 if o == nil { 117 return nil, false 118 } 119 return &o.User, true 120 } 121 122 // SetUser sets field value 123 func (o *ContextKubeConfigRead) SetUser(v string) { 124 o.User = v 125 } 126 127 func (o ContextKubeConfigRead) MarshalJSON() ([]byte, error) { 128 toSerialize, err := o.ToMap() 129 if err != nil { 130 return []byte{}, err 131 } 132 return json.Marshal(toSerialize) 133 } 134 135 func (o ContextKubeConfigRead) ToMap() (map[string]interface{}, error) { 136 toSerialize := map[string]interface{}{} 137 toSerialize["cluster"] = o.Cluster 138 if !IsNil(o.Namespace) { 139 toSerialize["namespace"] = o.Namespace 140 } 141 toSerialize["user"] = o.User 142 return toSerialize, nil 143 } 144 145 type NullableContextKubeConfigRead struct { 146 value *ContextKubeConfigRead 147 isSet bool 148 } 149 150 func (v NullableContextKubeConfigRead) Get() *ContextKubeConfigRead { 151 return v.value 152 } 153 154 func (v *NullableContextKubeConfigRead) Set(val *ContextKubeConfigRead) { 155 v.value = val 156 v.isSet = true 157 } 158 159 func (v NullableContextKubeConfigRead) IsSet() bool { 160 return v.isSet 161 } 162 163 func (v *NullableContextKubeConfigRead) Unset() { 164 v.value = nil 165 v.isSet = false 166 } 167 168 func NewNullableContextKubeConfigRead(val *ContextKubeConfigRead) *NullableContextKubeConfigRead { 169 return &NullableContextKubeConfigRead{value: val, isSet: true} 170 } 171 172 func (v NullableContextKubeConfigRead) MarshalJSON() ([]byte, error) { 173 return json.Marshal(v.value) 174 } 175 176 func (v *NullableContextKubeConfigRead) UnmarshalJSON(src []byte) error { 177 v.isSet = true 178 return json.Unmarshal(src, &v.value) 179 }