bunnyshell.com/sdk@v0.16.0/model_ephemeral.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 Ephemeral type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &Ephemeral{} 20 21 // Ephemeral struct for Ephemeral 22 type Ephemeral struct { 23 Type *string `json:"type,omitempty"` 24 } 25 26 // NewEphemeral instantiates a new Ephemeral object 27 // This constructor will assign default values to properties that have it defined, 28 // and makes sure properties required by API are set, but the set of arguments 29 // will change when the set of required properties is changed 30 func NewEphemeral() *Ephemeral { 31 this := Ephemeral{} 32 var type_ string = "ephemeral" 33 this.Type = &type_ 34 return &this 35 } 36 37 // NewEphemeralWithDefaults instantiates a new Ephemeral 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 NewEphemeralWithDefaults() *Ephemeral { 41 this := Ephemeral{} 42 var type_ string = "ephemeral" 43 this.Type = &type_ 44 return &this 45 } 46 47 // GetType returns the Type field value if set, zero value otherwise. 48 func (o *Ephemeral) GetType() string { 49 if o == nil || IsNil(o.Type) { 50 var ret string 51 return ret 52 } 53 return *o.Type 54 } 55 56 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 57 // and a boolean to check if the value has been set. 58 func (o *Ephemeral) GetTypeOk() (*string, bool) { 59 if o == nil || IsNil(o.Type) { 60 return nil, false 61 } 62 return o.Type, true 63 } 64 65 // HasType returns a boolean if a field has been set. 66 func (o *Ephemeral) HasType() bool { 67 if o != nil && !IsNil(o.Type) { 68 return true 69 } 70 71 return false 72 } 73 74 // SetType gets a reference to the given string and assigns it to the Type field. 75 func (o *Ephemeral) SetType(v string) { 76 o.Type = &v 77 } 78 79 func (o Ephemeral) MarshalJSON() ([]byte, error) { 80 toSerialize, err := o.ToMap() 81 if err != nil { 82 return []byte{}, err 83 } 84 return json.Marshal(toSerialize) 85 } 86 87 func (o Ephemeral) ToMap() (map[string]interface{}, error) { 88 toSerialize := map[string]interface{}{} 89 if !IsNil(o.Type) { 90 toSerialize["type"] = o.Type 91 } 92 return toSerialize, nil 93 } 94 95 type NullableEphemeral struct { 96 value *Ephemeral 97 isSet bool 98 } 99 100 func (v NullableEphemeral) Get() *Ephemeral { 101 return v.value 102 } 103 104 func (v *NullableEphemeral) Set(val *Ephemeral) { 105 v.value = val 106 v.isSet = true 107 } 108 109 func (v NullableEphemeral) IsSet() bool { 110 return v.isSet 111 } 112 113 func (v *NullableEphemeral) Unset() { 114 v.value = nil 115 v.isSet = false 116 } 117 118 func NewNullableEphemeral(val *Ephemeral) *NullableEphemeral { 119 return &NullableEphemeral{value: val, isSet: true} 120 } 121 122 func (v NullableEphemeral) MarshalJSON() ([]byte, error) { 123 return json.Marshal(v.value) 124 } 125 126 func (v *NullableEphemeral) UnmarshalJSON(src []byte) error { 127 v.isSet = true 128 return json.Unmarshal(src, &v.value) 129 }