bunnyshell.com/sdk@v0.16.0/model_environment_variable_edit.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 EnvironmentVariableEdit type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &EnvironmentVariableEdit{} 20 21 // EnvironmentVariableEdit An environment variable used during bunnyshell workflows. 22 type EnvironmentVariableEdit struct { 23 Value NullableString `json:"value,omitempty"` 24 } 25 26 // NewEnvironmentVariableEdit instantiates a new EnvironmentVariableEdit 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 NewEnvironmentVariableEdit() *EnvironmentVariableEdit { 31 this := EnvironmentVariableEdit{} 32 return &this 33 } 34 35 // NewEnvironmentVariableEditWithDefaults instantiates a new EnvironmentVariableEdit object 36 // This constructor will only assign default values to properties that have it defined, 37 // but it doesn't guarantee that properties required by API are set 38 func NewEnvironmentVariableEditWithDefaults() *EnvironmentVariableEdit { 39 this := EnvironmentVariableEdit{} 40 return &this 41 } 42 43 // GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null). 44 func (o *EnvironmentVariableEdit) GetValue() string { 45 if o == nil || IsNil(o.Value.Get()) { 46 var ret string 47 return ret 48 } 49 return *o.Value.Get() 50 } 51 52 // GetValueOk returns a tuple with the Value field value if set, nil otherwise 53 // and a boolean to check if the value has been set. 54 // NOTE: If the value is an explicit nil, `nil, true` will be returned 55 func (o *EnvironmentVariableEdit) GetValueOk() (*string, bool) { 56 if o == nil { 57 return nil, false 58 } 59 return o.Value.Get(), o.Value.IsSet() 60 } 61 62 // HasValue returns a boolean if a field has been set. 63 func (o *EnvironmentVariableEdit) HasValue() bool { 64 if o != nil && o.Value.IsSet() { 65 return true 66 } 67 68 return false 69 } 70 71 // SetValue gets a reference to the given NullableString and assigns it to the Value field. 72 func (o *EnvironmentVariableEdit) SetValue(v string) { 73 o.Value.Set(&v) 74 } 75 76 // SetValueNil sets the value for Value to be an explicit nil 77 func (o *EnvironmentVariableEdit) SetValueNil() { 78 o.Value.Set(nil) 79 } 80 81 // UnsetValue ensures that no value is present for Value, not even an explicit nil 82 func (o *EnvironmentVariableEdit) UnsetValue() { 83 o.Value.Unset() 84 } 85 86 func (o EnvironmentVariableEdit) MarshalJSON() ([]byte, error) { 87 toSerialize, err := o.ToMap() 88 if err != nil { 89 return []byte{}, err 90 } 91 return json.Marshal(toSerialize) 92 } 93 94 func (o EnvironmentVariableEdit) ToMap() (map[string]interface{}, error) { 95 toSerialize := map[string]interface{}{} 96 if o.Value.IsSet() { 97 toSerialize["value"] = o.Value.Get() 98 } 99 return toSerialize, nil 100 } 101 102 type NullableEnvironmentVariableEdit struct { 103 value *EnvironmentVariableEdit 104 isSet bool 105 } 106 107 func (v NullableEnvironmentVariableEdit) Get() *EnvironmentVariableEdit { 108 return v.value 109 } 110 111 func (v *NullableEnvironmentVariableEdit) Set(val *EnvironmentVariableEdit) { 112 v.value = val 113 v.isSet = true 114 } 115 116 func (v NullableEnvironmentVariableEdit) IsSet() bool { 117 return v.isSet 118 } 119 120 func (v *NullableEnvironmentVariableEdit) Unset() { 121 v.value = nil 122 v.isSet = false 123 } 124 125 func NewNullableEnvironmentVariableEdit(val *EnvironmentVariableEdit) *NullableEnvironmentVariableEdit { 126 return &NullableEnvironmentVariableEdit{value: val, isSet: true} 127 } 128 129 func (v NullableEnvironmentVariableEdit) MarshalJSON() ([]byte, error) { 130 return json.Marshal(v.value) 131 } 132 133 func (v *NullableEnvironmentVariableEdit) UnmarshalJSON(src []byte) error { 134 v.isSet = true 135 return json.Unmarshal(src, &v.value) 136 }