bunnyshell.com/sdk@v0.16.0/model_edit.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 Edit type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &Edit{}
    20  
    21  // Edit struct for Edit
    22  type Edit struct {
    23  	Values   *map[string]string `json:"values,omitempty"`
    24  	Strategy *string            `json:"strategy,omitempty"`
    25  }
    26  
    27  // NewEdit instantiates a new Edit 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 NewEdit() *Edit {
    32  	this := Edit{}
    33  	var strategy string = "merge"
    34  	this.Strategy = &strategy
    35  	return &this
    36  }
    37  
    38  // NewEditWithDefaults instantiates a new Edit object
    39  // This constructor will only assign default values to properties that have it defined,
    40  // but it doesn't guarantee that properties required by API are set
    41  func NewEditWithDefaults() *Edit {
    42  	this := Edit{}
    43  	var strategy string = "merge"
    44  	this.Strategy = &strategy
    45  	return &this
    46  }
    47  
    48  // GetValues returns the Values field value if set, zero value otherwise.
    49  func (o *Edit) GetValues() map[string]string {
    50  	if o == nil || IsNil(o.Values) {
    51  		var ret map[string]string
    52  		return ret
    53  	}
    54  	return *o.Values
    55  }
    56  
    57  // GetValuesOk returns a tuple with the Values field value if set, nil otherwise
    58  // and a boolean to check if the value has been set.
    59  func (o *Edit) GetValuesOk() (*map[string]string, bool) {
    60  	if o == nil || IsNil(o.Values) {
    61  		return nil, false
    62  	}
    63  	return o.Values, true
    64  }
    65  
    66  // HasValues returns a boolean if a field has been set.
    67  func (o *Edit) HasValues() bool {
    68  	if o != nil && !IsNil(o.Values) {
    69  		return true
    70  	}
    71  
    72  	return false
    73  }
    74  
    75  // SetValues gets a reference to the given map[string]string and assigns it to the Values field.
    76  func (o *Edit) SetValues(v map[string]string) {
    77  	o.Values = &v
    78  }
    79  
    80  // GetStrategy returns the Strategy field value if set, zero value otherwise.
    81  func (o *Edit) GetStrategy() string {
    82  	if o == nil || IsNil(o.Strategy) {
    83  		var ret string
    84  		return ret
    85  	}
    86  	return *o.Strategy
    87  }
    88  
    89  // GetStrategyOk returns a tuple with the Strategy field value if set, nil otherwise
    90  // and a boolean to check if the value has been set.
    91  func (o *Edit) GetStrategyOk() (*string, bool) {
    92  	if o == nil || IsNil(o.Strategy) {
    93  		return nil, false
    94  	}
    95  	return o.Strategy, true
    96  }
    97  
    98  // HasStrategy returns a boolean if a field has been set.
    99  func (o *Edit) HasStrategy() bool {
   100  	if o != nil && !IsNil(o.Strategy) {
   101  		return true
   102  	}
   103  
   104  	return false
   105  }
   106  
   107  // SetStrategy gets a reference to the given string and assigns it to the Strategy field.
   108  func (o *Edit) SetStrategy(v string) {
   109  	o.Strategy = &v
   110  }
   111  
   112  func (o Edit) MarshalJSON() ([]byte, error) {
   113  	toSerialize, err := o.ToMap()
   114  	if err != nil {
   115  		return []byte{}, err
   116  	}
   117  	return json.Marshal(toSerialize)
   118  }
   119  
   120  func (o Edit) ToMap() (map[string]interface{}, error) {
   121  	toSerialize := map[string]interface{}{}
   122  	if !IsNil(o.Values) {
   123  		toSerialize["values"] = o.Values
   124  	}
   125  	if !IsNil(o.Strategy) {
   126  		toSerialize["strategy"] = o.Strategy
   127  	}
   128  	return toSerialize, nil
   129  }
   130  
   131  type NullableEdit struct {
   132  	value *Edit
   133  	isSet bool
   134  }
   135  
   136  func (v NullableEdit) Get() *Edit {
   137  	return v.value
   138  }
   139  
   140  func (v *NullableEdit) Set(val *Edit) {
   141  	v.value = val
   142  	v.isSet = true
   143  }
   144  
   145  func (v NullableEdit) IsSet() bool {
   146  	return v.isSet
   147  }
   148  
   149  func (v *NullableEdit) Unset() {
   150  	v.value = nil
   151  	v.isSet = false
   152  }
   153  
   154  func NewNullableEdit(val *Edit) *NullableEdit {
   155  	return &NullableEdit{value: val, isSet: true}
   156  }
   157  
   158  func (v NullableEdit) MarshalJSON() ([]byte, error) {
   159  	return json.Marshal(v.value)
   160  }
   161  
   162  func (v *NullableEdit) UnmarshalJSON(src []byte) error {
   163  	v.isSet = true
   164  	return json.Unmarshal(src, &v.value)
   165  }