bunnyshell.com/sdk@v0.16.0/model_service_component_variable_create_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 ServiceComponentVariableCreateAction type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ServiceComponentVariableCreateAction{} 20 21 // ServiceComponentVariableCreateAction A component variable used during Bunnyshell workflows. 22 type ServiceComponentVariableCreateAction struct { 23 Name string `json:"name"` 24 Value string `json:"value"` 25 IsSecret NullableBool `json:"isSecret,omitempty"` 26 ServiceComponent string `json:"serviceComponent"` 27 } 28 29 // NewServiceComponentVariableCreateAction instantiates a new ServiceComponentVariableCreateAction object 30 // This constructor will assign default values to properties that have it defined, 31 // and makes sure properties required by API are set, but the set of arguments 32 // will change when the set of required properties is changed 33 func NewServiceComponentVariableCreateAction(name string, value string, serviceComponent string) *ServiceComponentVariableCreateAction { 34 this := ServiceComponentVariableCreateAction{} 35 this.Name = name 36 this.Value = value 37 this.ServiceComponent = serviceComponent 38 return &this 39 } 40 41 // NewServiceComponentVariableCreateActionWithDefaults instantiates a new ServiceComponentVariableCreateAction object 42 // This constructor will only assign default values to properties that have it defined, 43 // but it doesn't guarantee that properties required by API are set 44 func NewServiceComponentVariableCreateActionWithDefaults() *ServiceComponentVariableCreateAction { 45 this := ServiceComponentVariableCreateAction{} 46 return &this 47 } 48 49 // GetName returns the Name field value 50 func (o *ServiceComponentVariableCreateAction) GetName() string { 51 if o == nil { 52 var ret string 53 return ret 54 } 55 56 return o.Name 57 } 58 59 // GetNameOk returns a tuple with the Name field value 60 // and a boolean to check if the value has been set. 61 func (o *ServiceComponentVariableCreateAction) GetNameOk() (*string, bool) { 62 if o == nil { 63 return nil, false 64 } 65 return &o.Name, true 66 } 67 68 // SetName sets field value 69 func (o *ServiceComponentVariableCreateAction) SetName(v string) { 70 o.Name = v 71 } 72 73 // GetValue returns the Value field value 74 func (o *ServiceComponentVariableCreateAction) GetValue() string { 75 if o == nil { 76 var ret string 77 return ret 78 } 79 80 return o.Value 81 } 82 83 // GetValueOk returns a tuple with the Value field value 84 // and a boolean to check if the value has been set. 85 func (o *ServiceComponentVariableCreateAction) GetValueOk() (*string, bool) { 86 if o == nil { 87 return nil, false 88 } 89 return &o.Value, true 90 } 91 92 // SetValue sets field value 93 func (o *ServiceComponentVariableCreateAction) SetValue(v string) { 94 o.Value = v 95 } 96 97 // GetIsSecret returns the IsSecret field value if set, zero value otherwise (both if not set or set to explicit null). 98 func (o *ServiceComponentVariableCreateAction) GetIsSecret() bool { 99 if o == nil || IsNil(o.IsSecret.Get()) { 100 var ret bool 101 return ret 102 } 103 return *o.IsSecret.Get() 104 } 105 106 // GetIsSecretOk returns a tuple with the IsSecret field value if set, nil otherwise 107 // and a boolean to check if the value has been set. 108 // NOTE: If the value is an explicit nil, `nil, true` will be returned 109 func (o *ServiceComponentVariableCreateAction) GetIsSecretOk() (*bool, bool) { 110 if o == nil { 111 return nil, false 112 } 113 return o.IsSecret.Get(), o.IsSecret.IsSet() 114 } 115 116 // HasIsSecret returns a boolean if a field has been set. 117 func (o *ServiceComponentVariableCreateAction) HasIsSecret() bool { 118 if o != nil && o.IsSecret.IsSet() { 119 return true 120 } 121 122 return false 123 } 124 125 // SetIsSecret gets a reference to the given NullableBool and assigns it to the IsSecret field. 126 func (o *ServiceComponentVariableCreateAction) SetIsSecret(v bool) { 127 o.IsSecret.Set(&v) 128 } 129 130 // SetIsSecretNil sets the value for IsSecret to be an explicit nil 131 func (o *ServiceComponentVariableCreateAction) SetIsSecretNil() { 132 o.IsSecret.Set(nil) 133 } 134 135 // UnsetIsSecret ensures that no value is present for IsSecret, not even an explicit nil 136 func (o *ServiceComponentVariableCreateAction) UnsetIsSecret() { 137 o.IsSecret.Unset() 138 } 139 140 // GetServiceComponent returns the ServiceComponent field value 141 func (o *ServiceComponentVariableCreateAction) GetServiceComponent() string { 142 if o == nil { 143 var ret string 144 return ret 145 } 146 147 return o.ServiceComponent 148 } 149 150 // GetServiceComponentOk returns a tuple with the ServiceComponent field value 151 // and a boolean to check if the value has been set. 152 func (o *ServiceComponentVariableCreateAction) GetServiceComponentOk() (*string, bool) { 153 if o == nil { 154 return nil, false 155 } 156 return &o.ServiceComponent, true 157 } 158 159 // SetServiceComponent sets field value 160 func (o *ServiceComponentVariableCreateAction) SetServiceComponent(v string) { 161 o.ServiceComponent = v 162 } 163 164 func (o ServiceComponentVariableCreateAction) MarshalJSON() ([]byte, error) { 165 toSerialize, err := o.ToMap() 166 if err != nil { 167 return []byte{}, err 168 } 169 return json.Marshal(toSerialize) 170 } 171 172 func (o ServiceComponentVariableCreateAction) ToMap() (map[string]interface{}, error) { 173 toSerialize := map[string]interface{}{} 174 toSerialize["name"] = o.Name 175 toSerialize["value"] = o.Value 176 if o.IsSecret.IsSet() { 177 toSerialize["isSecret"] = o.IsSecret.Get() 178 } 179 toSerialize["serviceComponent"] = o.ServiceComponent 180 return toSerialize, nil 181 } 182 183 type NullableServiceComponentVariableCreateAction struct { 184 value *ServiceComponentVariableCreateAction 185 isSet bool 186 } 187 188 func (v NullableServiceComponentVariableCreateAction) Get() *ServiceComponentVariableCreateAction { 189 return v.value 190 } 191 192 func (v *NullableServiceComponentVariableCreateAction) Set(val *ServiceComponentVariableCreateAction) { 193 v.value = val 194 v.isSet = true 195 } 196 197 func (v NullableServiceComponentVariableCreateAction) IsSet() bool { 198 return v.isSet 199 } 200 201 func (v *NullableServiceComponentVariableCreateAction) Unset() { 202 v.value = nil 203 v.isSet = false 204 } 205 206 func NewNullableServiceComponentVariableCreateAction(val *ServiceComponentVariableCreateAction) *NullableServiceComponentVariableCreateAction { 207 return &NullableServiceComponentVariableCreateAction{value: val, isSet: true} 208 } 209 210 func (v NullableServiceComponentVariableCreateAction) MarshalJSON() ([]byte, error) { 211 return json.Marshal(v.value) 212 } 213 214 func (v *NullableServiceComponentVariableCreateAction) UnmarshalJSON(src []byte) error { 215 v.isSet = true 216 return json.Unmarshal(src, &v.value) 217 }