bunnyshell.com/sdk@v0.16.0/model_project_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 ProjectVariableCreateAction type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ProjectVariableCreateAction{}
    20  
    21  // ProjectVariableCreateAction A project variable used during Bunnyshell workflows.
    22  type ProjectVariableCreateAction struct {
    23  	Name     string       `json:"name"`
    24  	Value    string       `json:"value"`
    25  	IsSecret NullableBool `json:"isSecret,omitempty"`
    26  	Project  string       `json:"project"`
    27  }
    28  
    29  // NewProjectVariableCreateAction instantiates a new ProjectVariableCreateAction 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 NewProjectVariableCreateAction(name string, value string, project string) *ProjectVariableCreateAction {
    34  	this := ProjectVariableCreateAction{}
    35  	this.Name = name
    36  	this.Value = value
    37  	this.Project = project
    38  	return &this
    39  }
    40  
    41  // NewProjectVariableCreateActionWithDefaults instantiates a new ProjectVariableCreateAction 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 NewProjectVariableCreateActionWithDefaults() *ProjectVariableCreateAction {
    45  	this := ProjectVariableCreateAction{}
    46  	return &this
    47  }
    48  
    49  // GetName returns the Name field value
    50  func (o *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) SetName(v string) {
    70  	o.Name = v
    71  }
    72  
    73  // GetValue returns the Value field value
    74  func (o *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) 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 *ProjectVariableCreateAction) UnsetIsSecret() {
   137  	o.IsSecret.Unset()
   138  }
   139  
   140  // GetProject returns the Project field value
   141  func (o *ProjectVariableCreateAction) GetProject() string {
   142  	if o == nil {
   143  		var ret string
   144  		return ret
   145  	}
   146  
   147  	return o.Project
   148  }
   149  
   150  // GetProjectOk returns a tuple with the Project field value
   151  // and a boolean to check if the value has been set.
   152  func (o *ProjectVariableCreateAction) GetProjectOk() (*string, bool) {
   153  	if o == nil {
   154  		return nil, false
   155  	}
   156  	return &o.Project, true
   157  }
   158  
   159  // SetProject sets field value
   160  func (o *ProjectVariableCreateAction) SetProject(v string) {
   161  	o.Project = v
   162  }
   163  
   164  func (o ProjectVariableCreateAction) 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 ProjectVariableCreateAction) 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["project"] = o.Project
   180  	return toSerialize, nil
   181  }
   182  
   183  type NullableProjectVariableCreateAction struct {
   184  	value *ProjectVariableCreateAction
   185  	isSet bool
   186  }
   187  
   188  func (v NullableProjectVariableCreateAction) Get() *ProjectVariableCreateAction {
   189  	return v.value
   190  }
   191  
   192  func (v *NullableProjectVariableCreateAction) Set(val *ProjectVariableCreateAction) {
   193  	v.value = val
   194  	v.isSet = true
   195  }
   196  
   197  func (v NullableProjectVariableCreateAction) IsSet() bool {
   198  	return v.isSet
   199  }
   200  
   201  func (v *NullableProjectVariableCreateAction) Unset() {
   202  	v.value = nil
   203  	v.isSet = false
   204  }
   205  
   206  func NewNullableProjectVariableCreateAction(val *ProjectVariableCreateAction) *NullableProjectVariableCreateAction {
   207  	return &NullableProjectVariableCreateAction{value: val, isSet: true}
   208  }
   209  
   210  func (v NullableProjectVariableCreateAction) MarshalJSON() ([]byte, error) {
   211  	return json.Marshal(v.value)
   212  }
   213  
   214  func (v *NullableProjectVariableCreateAction) UnmarshalJSON(src []byte) error {
   215  	v.isSet = true
   216  	return json.Unmarshal(src, &v.value)
   217  }