bunnyshell.com/sdk@v0.16.0/model_simple_resource_config_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 SimpleResourceConfigItem type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &SimpleResourceConfigItem{} 20 21 // SimpleResourceConfigItem struct for SimpleResourceConfigItem 22 type SimpleResourceConfigItem struct { 23 Simple *bool `json:"simple,omitempty"` 24 // A list of container configs. 25 Containers *map[string]ContainerConfigItem `json:"containers,omitempty"` 26 } 27 28 // NewSimpleResourceConfigItem instantiates a new SimpleResourceConfigItem 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 NewSimpleResourceConfigItem() *SimpleResourceConfigItem { 33 this := SimpleResourceConfigItem{} 34 return &this 35 } 36 37 // NewSimpleResourceConfigItemWithDefaults instantiates a new SimpleResourceConfigItem object 38 // This constructor will only assign default values to properties that have it defined, 39 // but it doesn't guarantee that properties required by API are set 40 func NewSimpleResourceConfigItemWithDefaults() *SimpleResourceConfigItem { 41 this := SimpleResourceConfigItem{} 42 return &this 43 } 44 45 // GetSimple returns the Simple field value if set, zero value otherwise. 46 func (o *SimpleResourceConfigItem) GetSimple() bool { 47 if o == nil || IsNil(o.Simple) { 48 var ret bool 49 return ret 50 } 51 return *o.Simple 52 } 53 54 // GetSimpleOk returns a tuple with the Simple field value if set, nil otherwise 55 // and a boolean to check if the value has been set. 56 func (o *SimpleResourceConfigItem) GetSimpleOk() (*bool, bool) { 57 if o == nil || IsNil(o.Simple) { 58 return nil, false 59 } 60 return o.Simple, true 61 } 62 63 // HasSimple returns a boolean if a field has been set. 64 func (o *SimpleResourceConfigItem) HasSimple() bool { 65 if o != nil && !IsNil(o.Simple) { 66 return true 67 } 68 69 return false 70 } 71 72 // SetSimple gets a reference to the given bool and assigns it to the Simple field. 73 func (o *SimpleResourceConfigItem) SetSimple(v bool) { 74 o.Simple = &v 75 } 76 77 // GetContainers returns the Containers field value if set, zero value otherwise. 78 func (o *SimpleResourceConfigItem) GetContainers() map[string]ContainerConfigItem { 79 if o == nil || IsNil(o.Containers) { 80 var ret map[string]ContainerConfigItem 81 return ret 82 } 83 return *o.Containers 84 } 85 86 // GetContainersOk returns a tuple with the Containers field value if set, nil otherwise 87 // and a boolean to check if the value has been set. 88 func (o *SimpleResourceConfigItem) GetContainersOk() (*map[string]ContainerConfigItem, bool) { 89 if o == nil || IsNil(o.Containers) { 90 return nil, false 91 } 92 return o.Containers, true 93 } 94 95 // HasContainers returns a boolean if a field has been set. 96 func (o *SimpleResourceConfigItem) HasContainers() bool { 97 if o != nil && !IsNil(o.Containers) { 98 return true 99 } 100 101 return false 102 } 103 104 // SetContainers gets a reference to the given map[string]ContainerConfigItem and assigns it to the Containers field. 105 func (o *SimpleResourceConfigItem) SetContainers(v map[string]ContainerConfigItem) { 106 o.Containers = &v 107 } 108 109 func (o SimpleResourceConfigItem) MarshalJSON() ([]byte, error) { 110 toSerialize, err := o.ToMap() 111 if err != nil { 112 return []byte{}, err 113 } 114 return json.Marshal(toSerialize) 115 } 116 117 func (o SimpleResourceConfigItem) ToMap() (map[string]interface{}, error) { 118 toSerialize := map[string]interface{}{} 119 if !IsNil(o.Simple) { 120 toSerialize["simple"] = o.Simple 121 } 122 if !IsNil(o.Containers) { 123 toSerialize["containers"] = o.Containers 124 } 125 return toSerialize, nil 126 } 127 128 type NullableSimpleResourceConfigItem struct { 129 value *SimpleResourceConfigItem 130 isSet bool 131 } 132 133 func (v NullableSimpleResourceConfigItem) Get() *SimpleResourceConfigItem { 134 return v.value 135 } 136 137 func (v *NullableSimpleResourceConfigItem) Set(val *SimpleResourceConfigItem) { 138 v.value = val 139 v.isSet = true 140 } 141 142 func (v NullableSimpleResourceConfigItem) IsSet() bool { 143 return v.isSet 144 } 145 146 func (v *NullableSimpleResourceConfigItem) Unset() { 147 v.value = nil 148 v.isSet = false 149 } 150 151 func NewNullableSimpleResourceConfigItem(val *SimpleResourceConfigItem) *NullableSimpleResourceConfigItem { 152 return &NullableSimpleResourceConfigItem{value: val, isSet: true} 153 } 154 155 func (v NullableSimpleResourceConfigItem) MarshalJSON() ([]byte, error) { 156 return json.Marshal(v.value) 157 } 158 159 func (v *NullableSimpleResourceConfigItem) UnmarshalJSON(src []byte) error { 160 v.isSet = true 161 return json.Unmarshal(src, &v.value) 162 }