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