bunnyshell.com/sdk@v0.16.0/model_context_wrapper_kube_config_read.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 ContextWrapperKubeConfigRead type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ContextWrapperKubeConfigRead{}
    20  
    21  // ContextWrapperKubeConfigRead struct for ContextWrapperKubeConfigRead
    22  type ContextWrapperKubeConfigRead struct {
    23  	Name    string                 `json:"name"`
    24  	Context *ContextKubeConfigRead `json:"context,omitempty"`
    25  }
    26  
    27  // NewContextWrapperKubeConfigRead instantiates a new ContextWrapperKubeConfigRead 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 NewContextWrapperKubeConfigRead(name string) *ContextWrapperKubeConfigRead {
    32  	this := ContextWrapperKubeConfigRead{}
    33  	this.Name = name
    34  	return &this
    35  }
    36  
    37  // NewContextWrapperKubeConfigReadWithDefaults instantiates a new ContextWrapperKubeConfigRead 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 NewContextWrapperKubeConfigReadWithDefaults() *ContextWrapperKubeConfigRead {
    41  	this := ContextWrapperKubeConfigRead{}
    42  	return &this
    43  }
    44  
    45  // GetName returns the Name field value
    46  func (o *ContextWrapperKubeConfigRead) GetName() string {
    47  	if o == nil {
    48  		var ret string
    49  		return ret
    50  	}
    51  
    52  	return o.Name
    53  }
    54  
    55  // GetNameOk returns a tuple with the Name field value
    56  // and a boolean to check if the value has been set.
    57  func (o *ContextWrapperKubeConfigRead) GetNameOk() (*string, bool) {
    58  	if o == nil {
    59  		return nil, false
    60  	}
    61  	return &o.Name, true
    62  }
    63  
    64  // SetName sets field value
    65  func (o *ContextWrapperKubeConfigRead) SetName(v string) {
    66  	o.Name = v
    67  }
    68  
    69  // GetContext returns the Context field value if set, zero value otherwise.
    70  func (o *ContextWrapperKubeConfigRead) GetContext() ContextKubeConfigRead {
    71  	if o == nil || IsNil(o.Context) {
    72  		var ret ContextKubeConfigRead
    73  		return ret
    74  	}
    75  	return *o.Context
    76  }
    77  
    78  // GetContextOk returns a tuple with the Context field value if set, nil otherwise
    79  // and a boolean to check if the value has been set.
    80  func (o *ContextWrapperKubeConfigRead) GetContextOk() (*ContextKubeConfigRead, bool) {
    81  	if o == nil || IsNil(o.Context) {
    82  		return nil, false
    83  	}
    84  	return o.Context, true
    85  }
    86  
    87  // HasContext returns a boolean if a field has been set.
    88  func (o *ContextWrapperKubeConfigRead) HasContext() bool {
    89  	if o != nil && !IsNil(o.Context) {
    90  		return true
    91  	}
    92  
    93  	return false
    94  }
    95  
    96  // SetContext gets a reference to the given ContextKubeConfigRead and assigns it to the Context field.
    97  func (o *ContextWrapperKubeConfigRead) SetContext(v ContextKubeConfigRead) {
    98  	o.Context = &v
    99  }
   100  
   101  func (o ContextWrapperKubeConfigRead) MarshalJSON() ([]byte, error) {
   102  	toSerialize, err := o.ToMap()
   103  	if err != nil {
   104  		return []byte{}, err
   105  	}
   106  	return json.Marshal(toSerialize)
   107  }
   108  
   109  func (o ContextWrapperKubeConfigRead) ToMap() (map[string]interface{}, error) {
   110  	toSerialize := map[string]interface{}{}
   111  	toSerialize["name"] = o.Name
   112  	if !IsNil(o.Context) {
   113  		toSerialize["context"] = o.Context
   114  	}
   115  	return toSerialize, nil
   116  }
   117  
   118  type NullableContextWrapperKubeConfigRead struct {
   119  	value *ContextWrapperKubeConfigRead
   120  	isSet bool
   121  }
   122  
   123  func (v NullableContextWrapperKubeConfigRead) Get() *ContextWrapperKubeConfigRead {
   124  	return v.value
   125  }
   126  
   127  func (v *NullableContextWrapperKubeConfigRead) Set(val *ContextWrapperKubeConfigRead) {
   128  	v.value = val
   129  	v.isSet = true
   130  }
   131  
   132  func (v NullableContextWrapperKubeConfigRead) IsSet() bool {
   133  	return v.isSet
   134  }
   135  
   136  func (v *NullableContextWrapperKubeConfigRead) Unset() {
   137  	v.value = nil
   138  	v.isSet = false
   139  }
   140  
   141  func NewNullableContextWrapperKubeConfigRead(val *ContextWrapperKubeConfigRead) *NullableContextWrapperKubeConfigRead {
   142  	return &NullableContextWrapperKubeConfigRead{value: val, isSet: true}
   143  }
   144  
   145  func (v NullableContextWrapperKubeConfigRead) MarshalJSON() ([]byte, error) {
   146  	return json.Marshal(v.value)
   147  }
   148  
   149  func (v *NullableContextWrapperKubeConfigRead) UnmarshalJSON(src []byte) error {
   150  	v.isSet = true
   151  	return json.Unmarshal(src, &v.value)
   152  }