bunnyshell.com/sdk@v0.16.0/model_enum_type_item.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 EnumTypeItem type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &EnumTypeItem{} 20 21 // EnumTypeItem struct for EnumTypeItem 22 type EnumTypeItem struct { 23 DefaultValue *EnumTypeItemDefaultValue `json:"defaultValue,omitempty"` 24 // The available values for the enum. 25 Values []EnumTypeItemValuesInner `json:"values,omitempty"` 26 // A variable used within the template. 27 Name *string `json:"name,omitempty"` 28 // The variable description 29 Description *string `json:"description,omitempty"` 30 Type *string `json:"type,omitempty"` 31 } 32 33 // NewEnumTypeItem instantiates a new EnumTypeItem object 34 // This constructor will assign default values to properties that have it defined, 35 // and makes sure properties required by API are set, but the set of arguments 36 // will change when the set of required properties is changed 37 func NewEnumTypeItem() *EnumTypeItem { 38 this := EnumTypeItem{} 39 return &this 40 } 41 42 // NewEnumTypeItemWithDefaults instantiates a new EnumTypeItem object 43 // This constructor will only assign default values to properties that have it defined, 44 // but it doesn't guarantee that properties required by API are set 45 func NewEnumTypeItemWithDefaults() *EnumTypeItem { 46 this := EnumTypeItem{} 47 return &this 48 } 49 50 // GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. 51 func (o *EnumTypeItem) GetDefaultValue() EnumTypeItemDefaultValue { 52 if o == nil || IsNil(o.DefaultValue) { 53 var ret EnumTypeItemDefaultValue 54 return ret 55 } 56 return *o.DefaultValue 57 } 58 59 // GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise 60 // and a boolean to check if the value has been set. 61 func (o *EnumTypeItem) GetDefaultValueOk() (*EnumTypeItemDefaultValue, bool) { 62 if o == nil || IsNil(o.DefaultValue) { 63 return nil, false 64 } 65 return o.DefaultValue, true 66 } 67 68 // HasDefaultValue returns a boolean if a field has been set. 69 func (o *EnumTypeItem) HasDefaultValue() bool { 70 if o != nil && !IsNil(o.DefaultValue) { 71 return true 72 } 73 74 return false 75 } 76 77 // SetDefaultValue gets a reference to the given EnumTypeItemDefaultValue and assigns it to the DefaultValue field. 78 func (o *EnumTypeItem) SetDefaultValue(v EnumTypeItemDefaultValue) { 79 o.DefaultValue = &v 80 } 81 82 // GetValues returns the Values field value if set, zero value otherwise. 83 func (o *EnumTypeItem) GetValues() []EnumTypeItemValuesInner { 84 if o == nil || IsNil(o.Values) { 85 var ret []EnumTypeItemValuesInner 86 return ret 87 } 88 return o.Values 89 } 90 91 // GetValuesOk returns a tuple with the Values field value if set, nil otherwise 92 // and a boolean to check if the value has been set. 93 func (o *EnumTypeItem) GetValuesOk() ([]EnumTypeItemValuesInner, bool) { 94 if o == nil || IsNil(o.Values) { 95 return nil, false 96 } 97 return o.Values, true 98 } 99 100 // HasValues returns a boolean if a field has been set. 101 func (o *EnumTypeItem) HasValues() bool { 102 if o != nil && !IsNil(o.Values) { 103 return true 104 } 105 106 return false 107 } 108 109 // SetValues gets a reference to the given []EnumTypeItemValuesInner and assigns it to the Values field. 110 func (o *EnumTypeItem) SetValues(v []EnumTypeItemValuesInner) { 111 o.Values = v 112 } 113 114 // GetName returns the Name field value if set, zero value otherwise. 115 func (o *EnumTypeItem) GetName() string { 116 if o == nil || IsNil(o.Name) { 117 var ret string 118 return ret 119 } 120 return *o.Name 121 } 122 123 // GetNameOk returns a tuple with the Name field value if set, nil otherwise 124 // and a boolean to check if the value has been set. 125 func (o *EnumTypeItem) GetNameOk() (*string, bool) { 126 if o == nil || IsNil(o.Name) { 127 return nil, false 128 } 129 return o.Name, true 130 } 131 132 // HasName returns a boolean if a field has been set. 133 func (o *EnumTypeItem) HasName() bool { 134 if o != nil && !IsNil(o.Name) { 135 return true 136 } 137 138 return false 139 } 140 141 // SetName gets a reference to the given string and assigns it to the Name field. 142 func (o *EnumTypeItem) SetName(v string) { 143 o.Name = &v 144 } 145 146 // GetDescription returns the Description field value if set, zero value otherwise. 147 func (o *EnumTypeItem) GetDescription() string { 148 if o == nil || IsNil(o.Description) { 149 var ret string 150 return ret 151 } 152 return *o.Description 153 } 154 155 // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise 156 // and a boolean to check if the value has been set. 157 func (o *EnumTypeItem) GetDescriptionOk() (*string, bool) { 158 if o == nil || IsNil(o.Description) { 159 return nil, false 160 } 161 return o.Description, true 162 } 163 164 // HasDescription returns a boolean if a field has been set. 165 func (o *EnumTypeItem) HasDescription() bool { 166 if o != nil && !IsNil(o.Description) { 167 return true 168 } 169 170 return false 171 } 172 173 // SetDescription gets a reference to the given string and assigns it to the Description field. 174 func (o *EnumTypeItem) SetDescription(v string) { 175 o.Description = &v 176 } 177 178 // GetType returns the Type field value if set, zero value otherwise. 179 func (o *EnumTypeItem) GetType() string { 180 if o == nil || IsNil(o.Type) { 181 var ret string 182 return ret 183 } 184 return *o.Type 185 } 186 187 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 188 // and a boolean to check if the value has been set. 189 func (o *EnumTypeItem) GetTypeOk() (*string, bool) { 190 if o == nil || IsNil(o.Type) { 191 return nil, false 192 } 193 return o.Type, true 194 } 195 196 // HasType returns a boolean if a field has been set. 197 func (o *EnumTypeItem) HasType() bool { 198 if o != nil && !IsNil(o.Type) { 199 return true 200 } 201 202 return false 203 } 204 205 // SetType gets a reference to the given string and assigns it to the Type field. 206 func (o *EnumTypeItem) SetType(v string) { 207 o.Type = &v 208 } 209 210 func (o EnumTypeItem) MarshalJSON() ([]byte, error) { 211 toSerialize, err := o.ToMap() 212 if err != nil { 213 return []byte{}, err 214 } 215 return json.Marshal(toSerialize) 216 } 217 218 func (o EnumTypeItem) ToMap() (map[string]interface{}, error) { 219 toSerialize := map[string]interface{}{} 220 if !IsNil(o.DefaultValue) { 221 toSerialize["defaultValue"] = o.DefaultValue 222 } 223 if !IsNil(o.Values) { 224 toSerialize["values"] = o.Values 225 } 226 if !IsNil(o.Name) { 227 toSerialize["name"] = o.Name 228 } 229 if !IsNil(o.Description) { 230 toSerialize["description"] = o.Description 231 } 232 if !IsNil(o.Type) { 233 toSerialize["type"] = o.Type 234 } 235 return toSerialize, nil 236 } 237 238 type NullableEnumTypeItem struct { 239 value *EnumTypeItem 240 isSet bool 241 } 242 243 func (v NullableEnumTypeItem) Get() *EnumTypeItem { 244 return v.value 245 } 246 247 func (v *NullableEnumTypeItem) Set(val *EnumTypeItem) { 248 v.value = val 249 v.isSet = true 250 } 251 252 func (v NullableEnumTypeItem) IsSet() bool { 253 return v.isSet 254 } 255 256 func (v *NullableEnumTypeItem) Unset() { 257 v.value = nil 258 v.isSet = false 259 } 260 261 func NewNullableEnumTypeItem(val *EnumTypeItem) *NullableEnumTypeItem { 262 return &NullableEnumTypeItem{value: val, isSet: true} 263 } 264 265 func (v NullableEnumTypeItem) MarshalJSON() ([]byte, error) { 266 return json.Marshal(v.value) 267 } 268 269 func (v *NullableEnumTypeItem) UnmarshalJSON(src []byte) error { 270 v.isSet = true 271 return json.Unmarshal(src, &v.value) 272 }