Files
sdk/model_compute_cluster_attach.go

269 lines
7.4 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the ComputeClusterAttach type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeClusterAttach{}
// ComputeClusterAttach struct for ComputeClusterAttach
type ComputeClusterAttach struct {
// Default marks this the org's default cluster for scheduling.
Default *bool `json:"default,omitempty"`
// Kubeconfig is the cluster's kubeconfig, verbatim. Required — a body without one is not an attach.
Kubeconfig *string `json:"kubeconfig,omitempty"`
// Name is the fleet-local name for the cluster; lower-cased, and the key the detach route addresses it by. Required.
Name *string `json:"name,omitempty"`
// Provider is a free-form label for where the cluster runs (\"gke\", \"on-prem\"); it is display only, not a routing key.
Provider *string `json:"provider,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeClusterAttach ComputeClusterAttach
// NewComputeClusterAttach instantiates a new ComputeClusterAttach object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewComputeClusterAttach() *ComputeClusterAttach {
this := ComputeClusterAttach{}
return &this
}
// NewComputeClusterAttachWithDefaults instantiates a new ComputeClusterAttach object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewComputeClusterAttachWithDefaults() *ComputeClusterAttach {
this := ComputeClusterAttach{}
return &this
}
// GetDefault returns the Default field value if set, zero value otherwise.
func (o *ComputeClusterAttach) GetDefault() bool {
if o == nil || IsNil(o.Default) {
var ret bool
return ret
}
return *o.Default
}
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeClusterAttach) GetDefaultOk() (*bool, bool) {
if o == nil || IsNil(o.Default) {
return nil, false
}
return o.Default, true
}
// HasDefault returns a boolean if a field has been set.
func (o *ComputeClusterAttach) HasDefault() bool {
if o != nil && !IsNil(o.Default) {
return true
}
return false
}
// SetDefault gets a reference to the given bool and assigns it to the Default field.
func (o *ComputeClusterAttach) SetDefault(v bool) {
o.Default = &v
}
// GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise.
func (o *ComputeClusterAttach) GetKubeconfig() string {
if o == nil || IsNil(o.Kubeconfig) {
var ret string
return ret
}
return *o.Kubeconfig
}
// GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeClusterAttach) GetKubeconfigOk() (*string, bool) {
if o == nil || IsNil(o.Kubeconfig) {
return nil, false
}
return o.Kubeconfig, true
}
// HasKubeconfig returns a boolean if a field has been set.
func (o *ComputeClusterAttach) HasKubeconfig() bool {
if o != nil && !IsNil(o.Kubeconfig) {
return true
}
return false
}
// SetKubeconfig gets a reference to the given string and assigns it to the Kubeconfig field.
func (o *ComputeClusterAttach) SetKubeconfig(v string) {
o.Kubeconfig = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ComputeClusterAttach) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeClusterAttach) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ComputeClusterAttach) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ComputeClusterAttach) SetName(v string) {
o.Name = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ComputeClusterAttach) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeClusterAttach) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *ComputeClusterAttach) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *ComputeClusterAttach) SetProvider(v string) {
o.Provider = &v
}
func (o ComputeClusterAttach) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeClusterAttach) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Default) {
toSerialize["default"] = o.Default
}
if !IsNil(o.Kubeconfig) {
toSerialize["kubeconfig"] = o.Kubeconfig
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeClusterAttach) UnmarshalJSON(data []byte) (err error) {
varComputeClusterAttach := _ComputeClusterAttach{}
err = json.Unmarshal(data, &varComputeClusterAttach)
if err != nil {
return err
}
*o = ComputeClusterAttach(varComputeClusterAttach)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "default")
delete(additionalProperties, "kubeconfig")
delete(additionalProperties, "name")
delete(additionalProperties, "provider")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeClusterAttach struct {
value *ComputeClusterAttach
isSet bool
}
func (v NullableComputeClusterAttach) Get() *ComputeClusterAttach {
return v.value
}
func (v *NullableComputeClusterAttach) Set(val *ComputeClusterAttach) {
v.value = val
v.isSet = true
}
func (v NullableComputeClusterAttach) IsSet() bool {
return v.isSet
}
func (v *NullableComputeClusterAttach) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeClusterAttach(val *ComputeClusterAttach) *NullableComputeClusterAttach {
return &NullableComputeClusterAttach{value: val, isSet: true}
}
func (v NullableComputeClusterAttach) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeClusterAttach) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}