bunnyshell.com/sdk@v0.16.0/model_project_edit_settings_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 ProjectEditSettingsAction type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ProjectEditSettingsAction{}
    20  
    21  // ProjectEditSettingsAction A project holds multiple environments and shared secrets and settings.
    22  type ProjectEditSettingsAction struct {
    23  	Name   NullableString `json:"name"`
    24  	Labels NullableEdit   `json:"labels,omitempty"`
    25  }
    26  
    27  // NewProjectEditSettingsAction instantiates a new ProjectEditSettingsAction 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 NewProjectEditSettingsAction(name NullableString) *ProjectEditSettingsAction {
    32  	this := ProjectEditSettingsAction{}
    33  	this.Name = name
    34  	return &this
    35  }
    36  
    37  // NewProjectEditSettingsActionWithDefaults instantiates a new ProjectEditSettingsAction 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 NewProjectEditSettingsActionWithDefaults() *ProjectEditSettingsAction {
    41  	this := ProjectEditSettingsAction{}
    42  	return &this
    43  }
    44  
    45  // GetName returns the Name field value
    46  // If the value is explicit nil, the zero value for string will be returned
    47  func (o *ProjectEditSettingsAction) GetName() string {
    48  	if o == nil || o.Name.Get() == nil {
    49  		var ret string
    50  		return ret
    51  	}
    52  
    53  	return *o.Name.Get()
    54  }
    55  
    56  // GetNameOk returns a tuple with the Name 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 *ProjectEditSettingsAction) GetNameOk() (*string, bool) {
    60  	if o == nil {
    61  		return nil, false
    62  	}
    63  	return o.Name.Get(), o.Name.IsSet()
    64  }
    65  
    66  // SetName sets field value
    67  func (o *ProjectEditSettingsAction) SetName(v string) {
    68  	o.Name.Set(&v)
    69  }
    70  
    71  // GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null).
    72  func (o *ProjectEditSettingsAction) GetLabels() Edit {
    73  	if o == nil || IsNil(o.Labels.Get()) {
    74  		var ret Edit
    75  		return ret
    76  	}
    77  	return *o.Labels.Get()
    78  }
    79  
    80  // GetLabelsOk returns a tuple with the Labels 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 *ProjectEditSettingsAction) GetLabelsOk() (*Edit, bool) {
    84  	if o == nil {
    85  		return nil, false
    86  	}
    87  	return o.Labels.Get(), o.Labels.IsSet()
    88  }
    89  
    90  // HasLabels returns a boolean if a field has been set.
    91  func (o *ProjectEditSettingsAction) HasLabels() bool {
    92  	if o != nil && o.Labels.IsSet() {
    93  		return true
    94  	}
    95  
    96  	return false
    97  }
    98  
    99  // SetLabels gets a reference to the given NullableEdit and assigns it to the Labels field.
   100  func (o *ProjectEditSettingsAction) SetLabels(v Edit) {
   101  	o.Labels.Set(&v)
   102  }
   103  
   104  // SetLabelsNil sets the value for Labels to be an explicit nil
   105  func (o *ProjectEditSettingsAction) SetLabelsNil() {
   106  	o.Labels.Set(nil)
   107  }
   108  
   109  // UnsetLabels ensures that no value is present for Labels, not even an explicit nil
   110  func (o *ProjectEditSettingsAction) UnsetLabels() {
   111  	o.Labels.Unset()
   112  }
   113  
   114  func (o ProjectEditSettingsAction) 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 ProjectEditSettingsAction) ToMap() (map[string]interface{}, error) {
   123  	toSerialize := map[string]interface{}{}
   124  	toSerialize["name"] = o.Name.Get()
   125  	if o.Labels.IsSet() {
   126  		toSerialize["labels"] = o.Labels.Get()
   127  	}
   128  	return toSerialize, nil
   129  }
   130  
   131  type NullableProjectEditSettingsAction struct {
   132  	value *ProjectEditSettingsAction
   133  	isSet bool
   134  }
   135  
   136  func (v NullableProjectEditSettingsAction) Get() *ProjectEditSettingsAction {
   137  	return v.value
   138  }
   139  
   140  func (v *NullableProjectEditSettingsAction) Set(val *ProjectEditSettingsAction) {
   141  	v.value = val
   142  	v.isSet = true
   143  }
   144  
   145  func (v NullableProjectEditSettingsAction) IsSet() bool {
   146  	return v.isSet
   147  }
   148  
   149  func (v *NullableProjectEditSettingsAction) Unset() {
   150  	v.value = nil
   151  	v.isSet = false
   152  }
   153  
   154  func NewNullableProjectEditSettingsAction(val *ProjectEditSettingsAction) *NullableProjectEditSettingsAction {
   155  	return &NullableProjectEditSettingsAction{value: val, isSet: true}
   156  }
   157  
   158  func (v NullableProjectEditSettingsAction) MarshalJSON() ([]byte, error) {
   159  	return json.Marshal(v.value)
   160  }
   161  
   162  func (v *NullableProjectEditSettingsAction) UnmarshalJSON(src []byte) error {
   163  	v.isSet = true
   164  	return json.Unmarshal(src, &v.value)
   165  }