bunnyshell.com/sdk@v0.16.0/model_filter_name.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 FilterName type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &FilterName{} 20 21 // FilterName struct for FilterName 22 type FilterName struct { 23 Type *string `json:"type,omitempty"` 24 Name NullableString `json:"name,omitempty"` 25 } 26 27 // NewFilterName instantiates a new FilterName 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 NewFilterName() *FilterName { 32 this := FilterName{} 33 var type_ string = "name" 34 this.Type = &type_ 35 return &this 36 } 37 38 // NewFilterNameWithDefaults instantiates a new FilterName object 39 // This constructor will only assign default values to properties that have it defined, 40 // but it doesn't guarantee that properties required by API are set 41 func NewFilterNameWithDefaults() *FilterName { 42 this := FilterName{} 43 var type_ string = "name" 44 this.Type = &type_ 45 return &this 46 } 47 48 // GetType returns the Type field value if set, zero value otherwise. 49 func (o *FilterName) GetType() string { 50 if o == nil || IsNil(o.Type) { 51 var ret string 52 return ret 53 } 54 return *o.Type 55 } 56 57 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 58 // and a boolean to check if the value has been set. 59 func (o *FilterName) GetTypeOk() (*string, bool) { 60 if o == nil || IsNil(o.Type) { 61 return nil, false 62 } 63 return o.Type, true 64 } 65 66 // HasType returns a boolean if a field has been set. 67 func (o *FilterName) HasType() bool { 68 if o != nil && !IsNil(o.Type) { 69 return true 70 } 71 72 return false 73 } 74 75 // SetType gets a reference to the given string and assigns it to the Type field. 76 func (o *FilterName) SetType(v string) { 77 o.Type = &v 78 } 79 80 // GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). 81 func (o *FilterName) GetName() string { 82 if o == nil || IsNil(o.Name.Get()) { 83 var ret string 84 return ret 85 } 86 return *o.Name.Get() 87 } 88 89 // GetNameOk returns a tuple with the Name field value if set, nil otherwise 90 // and a boolean to check if the value has been set. 91 // NOTE: If the value is an explicit nil, `nil, true` will be returned 92 func (o *FilterName) GetNameOk() (*string, bool) { 93 if o == nil { 94 return nil, false 95 } 96 return o.Name.Get(), o.Name.IsSet() 97 } 98 99 // HasName returns a boolean if a field has been set. 100 func (o *FilterName) HasName() bool { 101 if o != nil && o.Name.IsSet() { 102 return true 103 } 104 105 return false 106 } 107 108 // SetName gets a reference to the given NullableString and assigns it to the Name field. 109 func (o *FilterName) SetName(v string) { 110 o.Name.Set(&v) 111 } 112 113 // SetNameNil sets the value for Name to be an explicit nil 114 func (o *FilterName) SetNameNil() { 115 o.Name.Set(nil) 116 } 117 118 // UnsetName ensures that no value is present for Name, not even an explicit nil 119 func (o *FilterName) UnsetName() { 120 o.Name.Unset() 121 } 122 123 func (o FilterName) MarshalJSON() ([]byte, error) { 124 toSerialize, err := o.ToMap() 125 if err != nil { 126 return []byte{}, err 127 } 128 return json.Marshal(toSerialize) 129 } 130 131 func (o FilterName) ToMap() (map[string]interface{}, error) { 132 toSerialize := map[string]interface{}{} 133 if !IsNil(o.Type) { 134 toSerialize["type"] = o.Type 135 } 136 if o.Name.IsSet() { 137 toSerialize["name"] = o.Name.Get() 138 } 139 return toSerialize, nil 140 } 141 142 type NullableFilterName struct { 143 value *FilterName 144 isSet bool 145 } 146 147 func (v NullableFilterName) Get() *FilterName { 148 return v.value 149 } 150 151 func (v *NullableFilterName) Set(val *FilterName) { 152 v.value = val 153 v.isSet = true 154 } 155 156 func (v NullableFilterName) IsSet() bool { 157 return v.isSet 158 } 159 160 func (v *NullableFilterName) Unset() { 161 v.value = nil 162 v.isSet = false 163 } 164 165 func NewNullableFilterName(val *FilterName) *NullableFilterName { 166 return &NullableFilterName{value: val, isSet: true} 167 } 168 169 func (v NullableFilterName) MarshalJSON() ([]byte, error) { 170 return json.Marshal(v.value) 171 } 172 173 func (v *NullableFilterName) UnmarshalJSON(src []byte) error { 174 v.isSet = true 175 return json.Unmarshal(src, &v.value) 176 }