bunnyshell.com/sdk@v0.16.0/model_environment_kube_config_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 EnvironmentKubeConfigKubeConfigRead type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &EnvironmentKubeConfigKubeConfigRead{}
    20  
    21  // EnvironmentKubeConfigKubeConfigRead An environment holds a collection of buildable and deployable components.
    22  type EnvironmentKubeConfigKubeConfigRead struct {
    23  	ApiVersion     *string                        `json:"apiVersion,omitempty"`
    24  	Kind           *string                        `json:"kind,omitempty"`
    25  	Preferences    map[string]interface{}         `json:"preferences,omitempty"`
    26  	Clusters       []ClusterWrapperKubeConfigRead `json:"clusters"`
    27  	Users          []UserWrapperKubeConfigRead    `json:"users"`
    28  	Contexts       []ContextWrapperKubeConfigRead `json:"contexts,omitempty"`
    29  	CurrentContext *string                        `json:"current-context,omitempty"`
    30  }
    31  
    32  // NewEnvironmentKubeConfigKubeConfigRead instantiates a new EnvironmentKubeConfigKubeConfigRead object
    33  // This constructor will assign default values to properties that have it defined,
    34  // and makes sure properties required by API are set, but the set of arguments
    35  // will change when the set of required properties is changed
    36  func NewEnvironmentKubeConfigKubeConfigRead(clusters []ClusterWrapperKubeConfigRead, users []UserWrapperKubeConfigRead) *EnvironmentKubeConfigKubeConfigRead {
    37  	this := EnvironmentKubeConfigKubeConfigRead{}
    38  	var apiVersion string = "v1"
    39  	this.ApiVersion = &apiVersion
    40  	var kind string = "Config"
    41  	this.Kind = &kind
    42  	this.Clusters = clusters
    43  	this.Users = users
    44  	return &this
    45  }
    46  
    47  // NewEnvironmentKubeConfigKubeConfigReadWithDefaults instantiates a new EnvironmentKubeConfigKubeConfigRead object
    48  // This constructor will only assign default values to properties that have it defined,
    49  // but it doesn't guarantee that properties required by API are set
    50  func NewEnvironmentKubeConfigKubeConfigReadWithDefaults() *EnvironmentKubeConfigKubeConfigRead {
    51  	this := EnvironmentKubeConfigKubeConfigRead{}
    52  	var apiVersion string = "v1"
    53  	this.ApiVersion = &apiVersion
    54  	var kind string = "Config"
    55  	this.Kind = &kind
    56  	return &this
    57  }
    58  
    59  // GetApiVersion returns the ApiVersion field value if set, zero value otherwise.
    60  func (o *EnvironmentKubeConfigKubeConfigRead) GetApiVersion() string {
    61  	if o == nil || IsNil(o.ApiVersion) {
    62  		var ret string
    63  		return ret
    64  	}
    65  	return *o.ApiVersion
    66  }
    67  
    68  // GetApiVersionOk returns a tuple with the ApiVersion field value if set, nil otherwise
    69  // and a boolean to check if the value has been set.
    70  func (o *EnvironmentKubeConfigKubeConfigRead) GetApiVersionOk() (*string, bool) {
    71  	if o == nil || IsNil(o.ApiVersion) {
    72  		return nil, false
    73  	}
    74  	return o.ApiVersion, true
    75  }
    76  
    77  // HasApiVersion returns a boolean if a field has been set.
    78  func (o *EnvironmentKubeConfigKubeConfigRead) HasApiVersion() bool {
    79  	if o != nil && !IsNil(o.ApiVersion) {
    80  		return true
    81  	}
    82  
    83  	return false
    84  }
    85  
    86  // SetApiVersion gets a reference to the given string and assigns it to the ApiVersion field.
    87  func (o *EnvironmentKubeConfigKubeConfigRead) SetApiVersion(v string) {
    88  	o.ApiVersion = &v
    89  }
    90  
    91  // GetKind returns the Kind field value if set, zero value otherwise.
    92  func (o *EnvironmentKubeConfigKubeConfigRead) GetKind() string {
    93  	if o == nil || IsNil(o.Kind) {
    94  		var ret string
    95  		return ret
    96  	}
    97  	return *o.Kind
    98  }
    99  
   100  // GetKindOk returns a tuple with the Kind field value if set, nil otherwise
   101  // and a boolean to check if the value has been set.
   102  func (o *EnvironmentKubeConfigKubeConfigRead) GetKindOk() (*string, bool) {
   103  	if o == nil || IsNil(o.Kind) {
   104  		return nil, false
   105  	}
   106  	return o.Kind, true
   107  }
   108  
   109  // HasKind returns a boolean if a field has been set.
   110  func (o *EnvironmentKubeConfigKubeConfigRead) HasKind() bool {
   111  	if o != nil && !IsNil(o.Kind) {
   112  		return true
   113  	}
   114  
   115  	return false
   116  }
   117  
   118  // SetKind gets a reference to the given string and assigns it to the Kind field.
   119  func (o *EnvironmentKubeConfigKubeConfigRead) SetKind(v string) {
   120  	o.Kind = &v
   121  }
   122  
   123  // GetPreferences returns the Preferences field value if set, zero value otherwise.
   124  func (o *EnvironmentKubeConfigKubeConfigRead) GetPreferences() map[string]interface{} {
   125  	if o == nil || IsNil(o.Preferences) {
   126  		var ret map[string]interface{}
   127  		return ret
   128  	}
   129  	return o.Preferences
   130  }
   131  
   132  // GetPreferencesOk returns a tuple with the Preferences field value if set, nil otherwise
   133  // and a boolean to check if the value has been set.
   134  func (o *EnvironmentKubeConfigKubeConfigRead) GetPreferencesOk() (map[string]interface{}, bool) {
   135  	if o == nil || IsNil(o.Preferences) {
   136  		return map[string]interface{}{}, false
   137  	}
   138  	return o.Preferences, true
   139  }
   140  
   141  // HasPreferences returns a boolean if a field has been set.
   142  func (o *EnvironmentKubeConfigKubeConfigRead) HasPreferences() bool {
   143  	if o != nil && !IsNil(o.Preferences) {
   144  		return true
   145  	}
   146  
   147  	return false
   148  }
   149  
   150  // SetPreferences gets a reference to the given map[string]interface{} and assigns it to the Preferences field.
   151  func (o *EnvironmentKubeConfigKubeConfigRead) SetPreferences(v map[string]interface{}) {
   152  	o.Preferences = v
   153  }
   154  
   155  // GetClusters returns the Clusters field value
   156  func (o *EnvironmentKubeConfigKubeConfigRead) GetClusters() []ClusterWrapperKubeConfigRead {
   157  	if o == nil {
   158  		var ret []ClusterWrapperKubeConfigRead
   159  		return ret
   160  	}
   161  
   162  	return o.Clusters
   163  }
   164  
   165  // GetClustersOk returns a tuple with the Clusters field value
   166  // and a boolean to check if the value has been set.
   167  func (o *EnvironmentKubeConfigKubeConfigRead) GetClustersOk() ([]ClusterWrapperKubeConfigRead, bool) {
   168  	if o == nil {
   169  		return nil, false
   170  	}
   171  	return o.Clusters, true
   172  }
   173  
   174  // SetClusters sets field value
   175  func (o *EnvironmentKubeConfigKubeConfigRead) SetClusters(v []ClusterWrapperKubeConfigRead) {
   176  	o.Clusters = v
   177  }
   178  
   179  // GetUsers returns the Users field value
   180  func (o *EnvironmentKubeConfigKubeConfigRead) GetUsers() []UserWrapperKubeConfigRead {
   181  	if o == nil {
   182  		var ret []UserWrapperKubeConfigRead
   183  		return ret
   184  	}
   185  
   186  	return o.Users
   187  }
   188  
   189  // GetUsersOk returns a tuple with the Users field value
   190  // and a boolean to check if the value has been set.
   191  func (o *EnvironmentKubeConfigKubeConfigRead) GetUsersOk() ([]UserWrapperKubeConfigRead, bool) {
   192  	if o == nil {
   193  		return nil, false
   194  	}
   195  	return o.Users, true
   196  }
   197  
   198  // SetUsers sets field value
   199  func (o *EnvironmentKubeConfigKubeConfigRead) SetUsers(v []UserWrapperKubeConfigRead) {
   200  	o.Users = v
   201  }
   202  
   203  // GetContexts returns the Contexts field value if set, zero value otherwise.
   204  func (o *EnvironmentKubeConfigKubeConfigRead) GetContexts() []ContextWrapperKubeConfigRead {
   205  	if o == nil || IsNil(o.Contexts) {
   206  		var ret []ContextWrapperKubeConfigRead
   207  		return ret
   208  	}
   209  	return o.Contexts
   210  }
   211  
   212  // GetContextsOk returns a tuple with the Contexts field value if set, nil otherwise
   213  // and a boolean to check if the value has been set.
   214  func (o *EnvironmentKubeConfigKubeConfigRead) GetContextsOk() ([]ContextWrapperKubeConfigRead, bool) {
   215  	if o == nil || IsNil(o.Contexts) {
   216  		return nil, false
   217  	}
   218  	return o.Contexts, true
   219  }
   220  
   221  // HasContexts returns a boolean if a field has been set.
   222  func (o *EnvironmentKubeConfigKubeConfigRead) HasContexts() bool {
   223  	if o != nil && !IsNil(o.Contexts) {
   224  		return true
   225  	}
   226  
   227  	return false
   228  }
   229  
   230  // SetContexts gets a reference to the given []ContextWrapperKubeConfigRead and assigns it to the Contexts field.
   231  func (o *EnvironmentKubeConfigKubeConfigRead) SetContexts(v []ContextWrapperKubeConfigRead) {
   232  	o.Contexts = v
   233  }
   234  
   235  // GetCurrentContext returns the CurrentContext field value if set, zero value otherwise.
   236  func (o *EnvironmentKubeConfigKubeConfigRead) GetCurrentContext() string {
   237  	if o == nil || IsNil(o.CurrentContext) {
   238  		var ret string
   239  		return ret
   240  	}
   241  	return *o.CurrentContext
   242  }
   243  
   244  // GetCurrentContextOk returns a tuple with the CurrentContext field value if set, nil otherwise
   245  // and a boolean to check if the value has been set.
   246  func (o *EnvironmentKubeConfigKubeConfigRead) GetCurrentContextOk() (*string, bool) {
   247  	if o == nil || IsNil(o.CurrentContext) {
   248  		return nil, false
   249  	}
   250  	return o.CurrentContext, true
   251  }
   252  
   253  // HasCurrentContext returns a boolean if a field has been set.
   254  func (o *EnvironmentKubeConfigKubeConfigRead) HasCurrentContext() bool {
   255  	if o != nil && !IsNil(o.CurrentContext) {
   256  		return true
   257  	}
   258  
   259  	return false
   260  }
   261  
   262  // SetCurrentContext gets a reference to the given string and assigns it to the CurrentContext field.
   263  func (o *EnvironmentKubeConfigKubeConfigRead) SetCurrentContext(v string) {
   264  	o.CurrentContext = &v
   265  }
   266  
   267  func (o EnvironmentKubeConfigKubeConfigRead) MarshalJSON() ([]byte, error) {
   268  	toSerialize, err := o.ToMap()
   269  	if err != nil {
   270  		return []byte{}, err
   271  	}
   272  	return json.Marshal(toSerialize)
   273  }
   274  
   275  func (o EnvironmentKubeConfigKubeConfigRead) ToMap() (map[string]interface{}, error) {
   276  	toSerialize := map[string]interface{}{}
   277  	if !IsNil(o.ApiVersion) {
   278  		toSerialize["apiVersion"] = o.ApiVersion
   279  	}
   280  	if !IsNil(o.Kind) {
   281  		toSerialize["kind"] = o.Kind
   282  	}
   283  	if !IsNil(o.Preferences) {
   284  		toSerialize["preferences"] = o.Preferences
   285  	}
   286  	toSerialize["clusters"] = o.Clusters
   287  	toSerialize["users"] = o.Users
   288  	if !IsNil(o.Contexts) {
   289  		toSerialize["contexts"] = o.Contexts
   290  	}
   291  	if !IsNil(o.CurrentContext) {
   292  		toSerialize["current-context"] = o.CurrentContext
   293  	}
   294  	return toSerialize, nil
   295  }
   296  
   297  type NullableEnvironmentKubeConfigKubeConfigRead struct {
   298  	value *EnvironmentKubeConfigKubeConfigRead
   299  	isSet bool
   300  }
   301  
   302  func (v NullableEnvironmentKubeConfigKubeConfigRead) Get() *EnvironmentKubeConfigKubeConfigRead {
   303  	return v.value
   304  }
   305  
   306  func (v *NullableEnvironmentKubeConfigKubeConfigRead) Set(val *EnvironmentKubeConfigKubeConfigRead) {
   307  	v.value = val
   308  	v.isSet = true
   309  }
   310  
   311  func (v NullableEnvironmentKubeConfigKubeConfigRead) IsSet() bool {
   312  	return v.isSet
   313  }
   314  
   315  func (v *NullableEnvironmentKubeConfigKubeConfigRead) Unset() {
   316  	v.value = nil
   317  	v.isSet = false
   318  }
   319  
   320  func NewNullableEnvironmentKubeConfigKubeConfigRead(val *EnvironmentKubeConfigKubeConfigRead) *NullableEnvironmentKubeConfigKubeConfigRead {
   321  	return &NullableEnvironmentKubeConfigKubeConfigRead{value: val, isSet: true}
   322  }
   323  
   324  func (v NullableEnvironmentKubeConfigKubeConfigRead) MarshalJSON() ([]byte, error) {
   325  	return json.Marshal(v.value)
   326  }
   327  
   328  func (v *NullableEnvironmentKubeConfigKubeConfigRead) UnmarshalJSON(src []byte) error {
   329  	v.isSet = true
   330  	return json.Unmarshal(src, &v.value)
   331  }