bunnyshell.com/sdk@v0.16.0/model_environment_variable_collection.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 EnvironmentVariableCollection type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &EnvironmentVariableCollection{}
    20  
    21  // EnvironmentVariableCollection An environment variable used during Bunnyshell workflows.
    22  type EnvironmentVariableCollection struct {
    23  	// Environment variable identifier.
    24  	Id *string `json:"id,omitempty"`
    25  	// Environment variable name.
    26  	Name *string `json:"name,omitempty"`
    27  	// Environment variable value.
    28  	Value NullableString `json:"value,omitempty"`
    29  	// Environment variable marked as secret.
    30  	Secret *bool `json:"secret,omitempty"`
    31  	// Environment identifier.
    32  	Environment *string `json:"environment,omitempty"`
    33  	// Organization identifier.
    34  	Organization *string `json:"organization,omitempty"`
    35  }
    36  
    37  // NewEnvironmentVariableCollection instantiates a new EnvironmentVariableCollection object
    38  // This constructor will assign default values to properties that have it defined,
    39  // and makes sure properties required by API are set, but the set of arguments
    40  // will change when the set of required properties is changed
    41  func NewEnvironmentVariableCollection() *EnvironmentVariableCollection {
    42  	this := EnvironmentVariableCollection{}
    43  	return &this
    44  }
    45  
    46  // NewEnvironmentVariableCollectionWithDefaults instantiates a new EnvironmentVariableCollection object
    47  // This constructor will only assign default values to properties that have it defined,
    48  // but it doesn't guarantee that properties required by API are set
    49  func NewEnvironmentVariableCollectionWithDefaults() *EnvironmentVariableCollection {
    50  	this := EnvironmentVariableCollection{}
    51  	return &this
    52  }
    53  
    54  // GetId returns the Id field value if set, zero value otherwise.
    55  func (o *EnvironmentVariableCollection) GetId() string {
    56  	if o == nil || IsNil(o.Id) {
    57  		var ret string
    58  		return ret
    59  	}
    60  	return *o.Id
    61  }
    62  
    63  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    64  // and a boolean to check if the value has been set.
    65  func (o *EnvironmentVariableCollection) GetIdOk() (*string, bool) {
    66  	if o == nil || IsNil(o.Id) {
    67  		return nil, false
    68  	}
    69  	return o.Id, true
    70  }
    71  
    72  // HasId returns a boolean if a field has been set.
    73  func (o *EnvironmentVariableCollection) HasId() bool {
    74  	if o != nil && !IsNil(o.Id) {
    75  		return true
    76  	}
    77  
    78  	return false
    79  }
    80  
    81  // SetId gets a reference to the given string and assigns it to the Id field.
    82  func (o *EnvironmentVariableCollection) SetId(v string) {
    83  	o.Id = &v
    84  }
    85  
    86  // GetName returns the Name field value if set, zero value otherwise.
    87  func (o *EnvironmentVariableCollection) GetName() string {
    88  	if o == nil || IsNil(o.Name) {
    89  		var ret string
    90  		return ret
    91  	}
    92  	return *o.Name
    93  }
    94  
    95  // GetNameOk returns a tuple with the Name field value if set, nil otherwise
    96  // and a boolean to check if the value has been set.
    97  func (o *EnvironmentVariableCollection) GetNameOk() (*string, bool) {
    98  	if o == nil || IsNil(o.Name) {
    99  		return nil, false
   100  	}
   101  	return o.Name, true
   102  }
   103  
   104  // HasName returns a boolean if a field has been set.
   105  func (o *EnvironmentVariableCollection) HasName() bool {
   106  	if o != nil && !IsNil(o.Name) {
   107  		return true
   108  	}
   109  
   110  	return false
   111  }
   112  
   113  // SetName gets a reference to the given string and assigns it to the Name field.
   114  func (o *EnvironmentVariableCollection) SetName(v string) {
   115  	o.Name = &v
   116  }
   117  
   118  // GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null).
   119  func (o *EnvironmentVariableCollection) GetValue() string {
   120  	if o == nil || IsNil(o.Value.Get()) {
   121  		var ret string
   122  		return ret
   123  	}
   124  	return *o.Value.Get()
   125  }
   126  
   127  // GetValueOk returns a tuple with the Value field value if set, nil otherwise
   128  // and a boolean to check if the value has been set.
   129  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   130  func (o *EnvironmentVariableCollection) GetValueOk() (*string, bool) {
   131  	if o == nil {
   132  		return nil, false
   133  	}
   134  	return o.Value.Get(), o.Value.IsSet()
   135  }
   136  
   137  // HasValue returns a boolean if a field has been set.
   138  func (o *EnvironmentVariableCollection) HasValue() bool {
   139  	if o != nil && o.Value.IsSet() {
   140  		return true
   141  	}
   142  
   143  	return false
   144  }
   145  
   146  // SetValue gets a reference to the given NullableString and assigns it to the Value field.
   147  func (o *EnvironmentVariableCollection) SetValue(v string) {
   148  	o.Value.Set(&v)
   149  }
   150  
   151  // SetValueNil sets the value for Value to be an explicit nil
   152  func (o *EnvironmentVariableCollection) SetValueNil() {
   153  	o.Value.Set(nil)
   154  }
   155  
   156  // UnsetValue ensures that no value is present for Value, not even an explicit nil
   157  func (o *EnvironmentVariableCollection) UnsetValue() {
   158  	o.Value.Unset()
   159  }
   160  
   161  // GetSecret returns the Secret field value if set, zero value otherwise.
   162  func (o *EnvironmentVariableCollection) GetSecret() bool {
   163  	if o == nil || IsNil(o.Secret) {
   164  		var ret bool
   165  		return ret
   166  	}
   167  	return *o.Secret
   168  }
   169  
   170  // GetSecretOk returns a tuple with the Secret field value if set, nil otherwise
   171  // and a boolean to check if the value has been set.
   172  func (o *EnvironmentVariableCollection) GetSecretOk() (*bool, bool) {
   173  	if o == nil || IsNil(o.Secret) {
   174  		return nil, false
   175  	}
   176  	return o.Secret, true
   177  }
   178  
   179  // HasSecret returns a boolean if a field has been set.
   180  func (o *EnvironmentVariableCollection) HasSecret() bool {
   181  	if o != nil && !IsNil(o.Secret) {
   182  		return true
   183  	}
   184  
   185  	return false
   186  }
   187  
   188  // SetSecret gets a reference to the given bool and assigns it to the Secret field.
   189  func (o *EnvironmentVariableCollection) SetSecret(v bool) {
   190  	o.Secret = &v
   191  }
   192  
   193  // GetEnvironment returns the Environment field value if set, zero value otherwise.
   194  func (o *EnvironmentVariableCollection) GetEnvironment() string {
   195  	if o == nil || IsNil(o.Environment) {
   196  		var ret string
   197  		return ret
   198  	}
   199  	return *o.Environment
   200  }
   201  
   202  // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise
   203  // and a boolean to check if the value has been set.
   204  func (o *EnvironmentVariableCollection) GetEnvironmentOk() (*string, bool) {
   205  	if o == nil || IsNil(o.Environment) {
   206  		return nil, false
   207  	}
   208  	return o.Environment, true
   209  }
   210  
   211  // HasEnvironment returns a boolean if a field has been set.
   212  func (o *EnvironmentVariableCollection) HasEnvironment() bool {
   213  	if o != nil && !IsNil(o.Environment) {
   214  		return true
   215  	}
   216  
   217  	return false
   218  }
   219  
   220  // SetEnvironment gets a reference to the given string and assigns it to the Environment field.
   221  func (o *EnvironmentVariableCollection) SetEnvironment(v string) {
   222  	o.Environment = &v
   223  }
   224  
   225  // GetOrganization returns the Organization field value if set, zero value otherwise.
   226  func (o *EnvironmentVariableCollection) GetOrganization() string {
   227  	if o == nil || IsNil(o.Organization) {
   228  		var ret string
   229  		return ret
   230  	}
   231  	return *o.Organization
   232  }
   233  
   234  // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise
   235  // and a boolean to check if the value has been set.
   236  func (o *EnvironmentVariableCollection) GetOrganizationOk() (*string, bool) {
   237  	if o == nil || IsNil(o.Organization) {
   238  		return nil, false
   239  	}
   240  	return o.Organization, true
   241  }
   242  
   243  // HasOrganization returns a boolean if a field has been set.
   244  func (o *EnvironmentVariableCollection) HasOrganization() bool {
   245  	if o != nil && !IsNil(o.Organization) {
   246  		return true
   247  	}
   248  
   249  	return false
   250  }
   251  
   252  // SetOrganization gets a reference to the given string and assigns it to the Organization field.
   253  func (o *EnvironmentVariableCollection) SetOrganization(v string) {
   254  	o.Organization = &v
   255  }
   256  
   257  func (o EnvironmentVariableCollection) MarshalJSON() ([]byte, error) {
   258  	toSerialize, err := o.ToMap()
   259  	if err != nil {
   260  		return []byte{}, err
   261  	}
   262  	return json.Marshal(toSerialize)
   263  }
   264  
   265  func (o EnvironmentVariableCollection) ToMap() (map[string]interface{}, error) {
   266  	toSerialize := map[string]interface{}{}
   267  	if !IsNil(o.Id) {
   268  		toSerialize["id"] = o.Id
   269  	}
   270  	if !IsNil(o.Name) {
   271  		toSerialize["name"] = o.Name
   272  	}
   273  	if o.Value.IsSet() {
   274  		toSerialize["value"] = o.Value.Get()
   275  	}
   276  	if !IsNil(o.Secret) {
   277  		toSerialize["secret"] = o.Secret
   278  	}
   279  	if !IsNil(o.Environment) {
   280  		toSerialize["environment"] = o.Environment
   281  	}
   282  	if !IsNil(o.Organization) {
   283  		toSerialize["organization"] = o.Organization
   284  	}
   285  	return toSerialize, nil
   286  }
   287  
   288  type NullableEnvironmentVariableCollection struct {
   289  	value *EnvironmentVariableCollection
   290  	isSet bool
   291  }
   292  
   293  func (v NullableEnvironmentVariableCollection) Get() *EnvironmentVariableCollection {
   294  	return v.value
   295  }
   296  
   297  func (v *NullableEnvironmentVariableCollection) Set(val *EnvironmentVariableCollection) {
   298  	v.value = val
   299  	v.isSet = true
   300  }
   301  
   302  func (v NullableEnvironmentVariableCollection) IsSet() bool {
   303  	return v.isSet
   304  }
   305  
   306  func (v *NullableEnvironmentVariableCollection) Unset() {
   307  	v.value = nil
   308  	v.isSet = false
   309  }
   310  
   311  func NewNullableEnvironmentVariableCollection(val *EnvironmentVariableCollection) *NullableEnvironmentVariableCollection {
   312  	return &NullableEnvironmentVariableCollection{value: val, isSet: true}
   313  }
   314  
   315  func (v NullableEnvironmentVariableCollection) MarshalJSON() ([]byte, error) {
   316  	return json.Marshal(v.value)
   317  }
   318  
   319  func (v *NullableEnvironmentVariableCollection) UnmarshalJSON(src []byte) error {
   320  	v.isSet = true
   321  	return json.Unmarshal(src, &v.value)
   322  }