mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
268 lines
7.5 KiB
Go
268 lines
7.5 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 ComputeCreateClusterReq type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ComputeCreateClusterReq{}
|
|
|
|
// ComputeCreateClusterReq struct for ComputeCreateClusterReq
|
|
type ComputeCreateClusterReq struct {
|
|
// Name is the cluster's name. Required.
|
|
Name *string `json:"name,omitempty"`
|
|
NodePool *ComputeCreateClusterReqNodePool `json:"nodePool,omitempty"`
|
|
// Region is the provider region slug (e.g. \"nyc3\"). Required.
|
|
Region *string `json:"region,omitempty"`
|
|
// Version is the Kubernetes version slug; empty takes the provider default.
|
|
Version *string `json:"version,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ComputeCreateClusterReq ComputeCreateClusterReq
|
|
|
|
// NewComputeCreateClusterReq instantiates a new ComputeCreateClusterReq 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 NewComputeCreateClusterReq() *ComputeCreateClusterReq {
|
|
this := ComputeCreateClusterReq{}
|
|
return &this
|
|
}
|
|
|
|
// NewComputeCreateClusterReqWithDefaults instantiates a new ComputeCreateClusterReq 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 NewComputeCreateClusterReqWithDefaults() *ComputeCreateClusterReq {
|
|
this := ComputeCreateClusterReq{}
|
|
return &this
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ComputeCreateClusterReq) 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 *ComputeCreateClusterReq) 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 *ComputeCreateClusterReq) 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 *ComputeCreateClusterReq) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetNodePool returns the NodePool field value if set, zero value otherwise.
|
|
func (o *ComputeCreateClusterReq) GetNodePool() ComputeCreateClusterReqNodePool {
|
|
if o == nil || IsNil(o.NodePool) {
|
|
var ret ComputeCreateClusterReqNodePool
|
|
return ret
|
|
}
|
|
return *o.NodePool
|
|
}
|
|
|
|
// GetNodePoolOk returns a tuple with the NodePool field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeCreateClusterReq) GetNodePoolOk() (*ComputeCreateClusterReqNodePool, bool) {
|
|
if o == nil || IsNil(o.NodePool) {
|
|
return nil, false
|
|
}
|
|
return o.NodePool, true
|
|
}
|
|
|
|
// HasNodePool returns a boolean if a field has been set.
|
|
func (o *ComputeCreateClusterReq) HasNodePool() bool {
|
|
if o != nil && !IsNil(o.NodePool) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNodePool gets a reference to the given ComputeCreateClusterReqNodePool and assigns it to the NodePool field.
|
|
func (o *ComputeCreateClusterReq) SetNodePool(v ComputeCreateClusterReqNodePool) {
|
|
o.NodePool = &v
|
|
}
|
|
|
|
// GetRegion returns the Region field value if set, zero value otherwise.
|
|
func (o *ComputeCreateClusterReq) GetRegion() string {
|
|
if o == nil || IsNil(o.Region) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Region
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeCreateClusterReq) GetRegionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Region) {
|
|
return nil, false
|
|
}
|
|
return o.Region, true
|
|
}
|
|
|
|
// HasRegion returns a boolean if a field has been set.
|
|
func (o *ComputeCreateClusterReq) HasRegion() bool {
|
|
if o != nil && !IsNil(o.Region) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
|
func (o *ComputeCreateClusterReq) SetRegion(v string) {
|
|
o.Region = &v
|
|
}
|
|
|
|
// GetVersion returns the Version field value if set, zero value otherwise.
|
|
func (o *ComputeCreateClusterReq) GetVersion() string {
|
|
if o == nil || IsNil(o.Version) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Version
|
|
}
|
|
|
|
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeCreateClusterReq) GetVersionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Version) {
|
|
return nil, false
|
|
}
|
|
return o.Version, true
|
|
}
|
|
|
|
// HasVersion returns a boolean if a field has been set.
|
|
func (o *ComputeCreateClusterReq) HasVersion() bool {
|
|
if o != nil && !IsNil(o.Version) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVersion gets a reference to the given string and assigns it to the Version field.
|
|
func (o *ComputeCreateClusterReq) SetVersion(v string) {
|
|
o.Version = &v
|
|
}
|
|
|
|
func (o ComputeCreateClusterReq) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ComputeCreateClusterReq) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.NodePool) {
|
|
toSerialize["nodePool"] = o.NodePool
|
|
}
|
|
if !IsNil(o.Region) {
|
|
toSerialize["region"] = o.Region
|
|
}
|
|
if !IsNil(o.Version) {
|
|
toSerialize["version"] = o.Version
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ComputeCreateClusterReq) UnmarshalJSON(data []byte) (err error) {
|
|
varComputeCreateClusterReq := _ComputeCreateClusterReq{}
|
|
|
|
err = json.Unmarshal(data, &varComputeCreateClusterReq)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ComputeCreateClusterReq(varComputeCreateClusterReq)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "nodePool")
|
|
delete(additionalProperties, "region")
|
|
delete(additionalProperties, "version")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableComputeCreateClusterReq struct {
|
|
value *ComputeCreateClusterReq
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableComputeCreateClusterReq) Get() *ComputeCreateClusterReq {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableComputeCreateClusterReq) Set(val *ComputeCreateClusterReq) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableComputeCreateClusterReq) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableComputeCreateClusterReq) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableComputeCreateClusterReq(val *ComputeCreateClusterReq) *NullableComputeCreateClusterReq {
|
|
return &NullableComputeCreateClusterReq{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableComputeCreateClusterReq) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableComputeCreateClusterReq) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|