bunnyshell.com/sdk@v0.16.0/model_from_string.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 FromString type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &FromString{} 20 21 // FromString struct for FromString 22 type FromString struct { 23 Type *string `json:"type,omitempty"` 24 Yaml *string `json:"yaml,omitempty"` 25 } 26 27 // NewFromString instantiates a new FromString 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 NewFromString() *FromString { 32 this := FromString{} 33 var type_ string = "string" 34 this.Type = &type_ 35 return &this 36 } 37 38 // NewFromStringWithDefaults instantiates a new FromString 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 NewFromStringWithDefaults() *FromString { 42 this := FromString{} 43 var type_ string = "string" 44 this.Type = &type_ 45 return &this 46 } 47 48 // GetType returns the Type field value if set, zero value otherwise. 49 func (o *FromString) 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 *FromString) 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 *FromString) 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 *FromString) SetType(v string) { 77 o.Type = &v 78 } 79 80 // GetYaml returns the Yaml field value if set, zero value otherwise. 81 func (o *FromString) GetYaml() string { 82 if o == nil || IsNil(o.Yaml) { 83 var ret string 84 return ret 85 } 86 return *o.Yaml 87 } 88 89 // GetYamlOk returns a tuple with the Yaml field value if set, nil otherwise 90 // and a boolean to check if the value has been set. 91 func (o *FromString) GetYamlOk() (*string, bool) { 92 if o == nil || IsNil(o.Yaml) { 93 return nil, false 94 } 95 return o.Yaml, true 96 } 97 98 // HasYaml returns a boolean if a field has been set. 99 func (o *FromString) HasYaml() bool { 100 if o != nil && !IsNil(o.Yaml) { 101 return true 102 } 103 104 return false 105 } 106 107 // SetYaml gets a reference to the given string and assigns it to the Yaml field. 108 func (o *FromString) SetYaml(v string) { 109 o.Yaml = &v 110 } 111 112 func (o FromString) MarshalJSON() ([]byte, error) { 113 toSerialize, err := o.ToMap() 114 if err != nil { 115 return []byte{}, err 116 } 117 return json.Marshal(toSerialize) 118 } 119 120 func (o FromString) ToMap() (map[string]interface{}, error) { 121 toSerialize := map[string]interface{}{} 122 if !IsNil(o.Type) { 123 toSerialize["type"] = o.Type 124 } 125 if !IsNil(o.Yaml) { 126 toSerialize["yaml"] = o.Yaml 127 } 128 return toSerialize, nil 129 } 130 131 type NullableFromString struct { 132 value *FromString 133 isSet bool 134 } 135 136 func (v NullableFromString) Get() *FromString { 137 return v.value 138 } 139 140 func (v *NullableFromString) Set(val *FromString) { 141 v.value = val 142 v.isSet = true 143 } 144 145 func (v NullableFromString) IsSet() bool { 146 return v.isSet 147 } 148 149 func (v *NullableFromString) Unset() { 150 v.value = nil 151 v.isSet = false 152 } 153 154 func NewNullableFromString(val *FromString) *NullableFromString { 155 return &NullableFromString{value: val, isSet: true} 156 } 157 158 func (v NullableFromString) MarshalJSON() ([]byte, error) { 159 return json.Marshal(v.value) 160 } 161 162 func (v *NullableFromString) UnmarshalJSON(src []byte) error { 163 v.isSet = true 164 return json.Unmarshal(src, &v.value) 165 }