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