bunnyshell.com/sdk@v0.16.0/model_environment_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 EnvironmentVariableEditAction type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &EnvironmentVariableEditAction{}
    20  
    21  // EnvironmentVariableEditAction An environment variable used during Bunnyshell workflows.
    22  type EnvironmentVariableEditAction struct {
    23  	Value    NullableString `json:"value"`
    24  	IsSecret NullableBool   `json:"isSecret,omitempty"`
    25  }
    26  
    27  // NewEnvironmentVariableEditAction instantiates a new EnvironmentVariableEditAction 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 NewEnvironmentVariableEditAction(value NullableString) *EnvironmentVariableEditAction {
    32  	this := EnvironmentVariableEditAction{}
    33  	this.Value = value
    34  	return &this
    35  }
    36  
    37  // NewEnvironmentVariableEditActionWithDefaults instantiates a new EnvironmentVariableEditAction 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 NewEnvironmentVariableEditActionWithDefaults() *EnvironmentVariableEditAction {
    41  	this := EnvironmentVariableEditAction{}
    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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) 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 *EnvironmentVariableEditAction) UnsetIsSecret() {
   111  	o.IsSecret.Unset()
   112  }
   113  
   114  func (o EnvironmentVariableEditAction) 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 EnvironmentVariableEditAction) 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 NullableEnvironmentVariableEditAction struct {
   132  	value *EnvironmentVariableEditAction
   133  	isSet bool
   134  }
   135  
   136  func (v NullableEnvironmentVariableEditAction) Get() *EnvironmentVariableEditAction {
   137  	return v.value
   138  }
   139  
   140  func (v *NullableEnvironmentVariableEditAction) Set(val *EnvironmentVariableEditAction) {
   141  	v.value = val
   142  	v.isSet = true
   143  }
   144  
   145  func (v NullableEnvironmentVariableEditAction) IsSet() bool {
   146  	return v.isSet
   147  }
   148  
   149  func (v *NullableEnvironmentVariableEditAction) Unset() {
   150  	v.value = nil
   151  	v.isSet = false
   152  }
   153  
   154  func NewNullableEnvironmentVariableEditAction(val *EnvironmentVariableEditAction) *NullableEnvironmentVariableEditAction {
   155  	return &NullableEnvironmentVariableEditAction{value: val, isSet: true}
   156  }
   157  
   158  func (v NullableEnvironmentVariableEditAction) MarshalJSON() ([]byte, error) {
   159  	return json.Marshal(v.value)
   160  }
   161  
   162  func (v *NullableEnvironmentVariableEditAction) UnmarshalJSON(src []byte) error {
   163  	v.isSet = true
   164  	return json.Unmarshal(src, &v.value)
   165  }