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