bunnyshell.com/sdk@v0.16.0/model_project_variable_edit_action.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 ProjectVariableEditAction type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ProjectVariableEditAction{} 20 21 // ProjectVariableEditAction A project variable used during Bunnyshell workflows. 22 type ProjectVariableEditAction struct { 23 Value NullableString `json:"value"` 24 IsSecret NullableBool `json:"isSecret,omitempty"` 25 } 26 27 // NewProjectVariableEditAction instantiates a new ProjectVariableEditAction 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 NewProjectVariableEditAction(value NullableString) *ProjectVariableEditAction { 32 this := ProjectVariableEditAction{} 33 this.Value = value 34 return &this 35 } 36 37 // NewProjectVariableEditActionWithDefaults instantiates a new ProjectVariableEditAction 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 NewProjectVariableEditActionWithDefaults() *ProjectVariableEditAction { 41 this := ProjectVariableEditAction{} 42 return &this 43 } 44 45 // GetValue returns the Value field value 46 // If the value is explicit nil, the zero value for string will be returned 47 func (o *ProjectVariableEditAction) GetValue() string { 48 if o == nil || o.Value.Get() == nil { 49 var ret string 50 return ret 51 } 52 53 return *o.Value.Get() 54 } 55 56 // GetValueOk returns a tuple with the Value field value 57 // and a boolean to check if the value has been set. 58 // NOTE: If the value is an explicit nil, `nil, true` will be returned 59 func (o *ProjectVariableEditAction) GetValueOk() (*string, bool) { 60 if o == nil { 61 return nil, false 62 } 63 return o.Value.Get(), o.Value.IsSet() 64 } 65 66 // SetValue sets field value 67 func (o *ProjectVariableEditAction) SetValue(v string) { 68 o.Value.Set(&v) 69 } 70 71 // GetIsSecret returns the IsSecret field value if set, zero value otherwise (both if not set or set to explicit null). 72 func (o *ProjectVariableEditAction) GetIsSecret() bool { 73 if o == nil || IsNil(o.IsSecret.Get()) { 74 var ret bool 75 return ret 76 } 77 return *o.IsSecret.Get() 78 } 79 80 // GetIsSecretOk returns a tuple with the IsSecret field value if set, nil otherwise 81 // and a boolean to check if the value has been set. 82 // NOTE: If the value is an explicit nil, `nil, true` will be returned 83 func (o *ProjectVariableEditAction) GetIsSecretOk() (*bool, bool) { 84 if o == nil { 85 return nil, false 86 } 87 return o.IsSecret.Get(), o.IsSecret.IsSet() 88 } 89 90 // HasIsSecret returns a boolean if a field has been set. 91 func (o *ProjectVariableEditAction) HasIsSecret() bool { 92 if o != nil && o.IsSecret.IsSet() { 93 return true 94 } 95 96 return false 97 } 98 99 // SetIsSecret gets a reference to the given NullableBool and assigns it to the IsSecret field. 100 func (o *ProjectVariableEditAction) SetIsSecret(v bool) { 101 o.IsSecret.Set(&v) 102 } 103 104 // SetIsSecretNil sets the value for IsSecret to be an explicit nil 105 func (o *ProjectVariableEditAction) SetIsSecretNil() { 106 o.IsSecret.Set(nil) 107 } 108 109 // UnsetIsSecret ensures that no value is present for IsSecret, not even an explicit nil 110 func (o *ProjectVariableEditAction) UnsetIsSecret() { 111 o.IsSecret.Unset() 112 } 113 114 func (o ProjectVariableEditAction) MarshalJSON() ([]byte, error) { 115 toSerialize, err := o.ToMap() 116 if err != nil { 117 return []byte{}, err 118 } 119 return json.Marshal(toSerialize) 120 } 121 122 func (o ProjectVariableEditAction) ToMap() (map[string]interface{}, error) { 123 toSerialize := map[string]interface{}{} 124 toSerialize["value"] = o.Value.Get() 125 if o.IsSecret.IsSet() { 126 toSerialize["isSecret"] = o.IsSecret.Get() 127 } 128 return toSerialize, nil 129 } 130 131 type NullableProjectVariableEditAction struct { 132 value *ProjectVariableEditAction 133 isSet bool 134 } 135 136 func (v NullableProjectVariableEditAction) Get() *ProjectVariableEditAction { 137 return v.value 138 } 139 140 func (v *NullableProjectVariableEditAction) Set(val *ProjectVariableEditAction) { 141 v.value = val 142 v.isSet = true 143 } 144 145 func (v NullableProjectVariableEditAction) IsSet() bool { 146 return v.isSet 147 } 148 149 func (v *NullableProjectVariableEditAction) Unset() { 150 v.value = nil 151 v.isSet = false 152 } 153 154 func NewNullableProjectVariableEditAction(val *ProjectVariableEditAction) *NullableProjectVariableEditAction { 155 return &NullableProjectVariableEditAction{value: val, isSet: true} 156 } 157 158 func (v NullableProjectVariableEditAction) MarshalJSON() ([]byte, error) { 159 return json.Marshal(v.value) 160 } 161 162 func (v *NullableProjectVariableEditAction) UnmarshalJSON(src []byte) error { 163 v.isSet = true 164 return json.Unmarshal(src, &v.value) 165 }