mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
11 KiB
Go
421 lines
11 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 ComputePoolCreate type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ComputePoolCreate{}
|
|
|
|
// ComputePoolCreate struct for ComputePoolCreate
|
|
type ComputePoolCreate struct {
|
|
// AutoScale turns the provider's cluster autoscaler on for this pool.
|
|
AutoScale *bool `json:"autoScale,omitempty"`
|
|
// ClusterID is the cluster to add the pool to, from the URL path.
|
|
ClusterId *string `json:"clusterId,omitempty"`
|
|
// Count is how many nodes the pool starts with.
|
|
Count *int64 `json:"count,omitempty"`
|
|
// MaxNodes is the ceiling the autoscaler may not grow the pool past, and so the bound on what this pool can spend. Ignored unless AutoScale is set.
|
|
MaxNodes *int64 `json:"maxNodes,omitempty"`
|
|
// MinNodes is the floor the autoscaler may not shrink the pool below. Ignored unless AutoScale is set.
|
|
MinNodes *int64 `json:"minNodes,omitempty"`
|
|
// Name is the pool's name.
|
|
Name *string `json:"name,omitempty"`
|
|
// Provider is the cloud the cluster lives on (e.g. \"digitalocean\"). Required — Visor routes the create by it. Accepted from the body or ?provider=.
|
|
Provider *string `json:"provider,omitempty"`
|
|
// Size is the provider size slug for each node (e.g. \"s-4vcpu-8gb\").
|
|
Size *string `json:"size,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ComputePoolCreate ComputePoolCreate
|
|
|
|
// NewComputePoolCreate instantiates a new ComputePoolCreate 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 NewComputePoolCreate() *ComputePoolCreate {
|
|
this := ComputePoolCreate{}
|
|
return &this
|
|
}
|
|
|
|
// NewComputePoolCreateWithDefaults instantiates a new ComputePoolCreate 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 NewComputePoolCreateWithDefaults() *ComputePoolCreate {
|
|
this := ComputePoolCreate{}
|
|
return &this
|
|
}
|
|
|
|
// GetAutoScale returns the AutoScale field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) GetAutoScale() bool {
|
|
if o == nil || IsNil(o.AutoScale) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.AutoScale
|
|
}
|
|
|
|
// GetAutoScaleOk returns a tuple with the AutoScale field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputePoolCreate) GetAutoScaleOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.AutoScale) {
|
|
return nil, false
|
|
}
|
|
return o.AutoScale, true
|
|
}
|
|
|
|
// HasAutoScale returns a boolean if a field has been set.
|
|
func (o *ComputePoolCreate) HasAutoScale() bool {
|
|
if o != nil && !IsNil(o.AutoScale) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAutoScale gets a reference to the given bool and assigns it to the AutoScale field.
|
|
func (o *ComputePoolCreate) SetAutoScale(v bool) {
|
|
o.AutoScale = &v
|
|
}
|
|
|
|
// GetClusterId returns the ClusterId field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) GetClusterId() string {
|
|
if o == nil || IsNil(o.ClusterId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ClusterId
|
|
}
|
|
|
|
// GetClusterIdOk returns a tuple with the ClusterId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputePoolCreate) GetClusterIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ClusterId) {
|
|
return nil, false
|
|
}
|
|
return o.ClusterId, true
|
|
}
|
|
|
|
// HasClusterId returns a boolean if a field has been set.
|
|
func (o *ComputePoolCreate) HasClusterId() bool {
|
|
if o != nil && !IsNil(o.ClusterId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetClusterId gets a reference to the given string and assigns it to the ClusterId field.
|
|
func (o *ComputePoolCreate) SetClusterId(v string) {
|
|
o.ClusterId = &v
|
|
}
|
|
|
|
// GetCount returns the Count field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) GetCount() int64 {
|
|
if o == nil || IsNil(o.Count) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Count
|
|
}
|
|
|
|
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputePoolCreate) GetCountOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Count) {
|
|
return nil, false
|
|
}
|
|
return o.Count, true
|
|
}
|
|
|
|
// HasCount returns a boolean if a field has been set.
|
|
func (o *ComputePoolCreate) HasCount() bool {
|
|
if o != nil && !IsNil(o.Count) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCount gets a reference to the given int64 and assigns it to the Count field.
|
|
func (o *ComputePoolCreate) SetCount(v int64) {
|
|
o.Count = &v
|
|
}
|
|
|
|
// GetMaxNodes returns the MaxNodes field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) GetMaxNodes() int64 {
|
|
if o == nil || IsNil(o.MaxNodes) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.MaxNodes
|
|
}
|
|
|
|
// GetMaxNodesOk returns a tuple with the MaxNodes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputePoolCreate) GetMaxNodesOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.MaxNodes) {
|
|
return nil, false
|
|
}
|
|
return o.MaxNodes, true
|
|
}
|
|
|
|
// HasMaxNodes returns a boolean if a field has been set.
|
|
func (o *ComputePoolCreate) HasMaxNodes() bool {
|
|
if o != nil && !IsNil(o.MaxNodes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMaxNodes gets a reference to the given int64 and assigns it to the MaxNodes field.
|
|
func (o *ComputePoolCreate) SetMaxNodes(v int64) {
|
|
o.MaxNodes = &v
|
|
}
|
|
|
|
// GetMinNodes returns the MinNodes field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) GetMinNodes() int64 {
|
|
if o == nil || IsNil(o.MinNodes) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.MinNodes
|
|
}
|
|
|
|
// GetMinNodesOk returns a tuple with the MinNodes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputePoolCreate) GetMinNodesOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.MinNodes) {
|
|
return nil, false
|
|
}
|
|
return o.MinNodes, true
|
|
}
|
|
|
|
// HasMinNodes returns a boolean if a field has been set.
|
|
func (o *ComputePoolCreate) HasMinNodes() bool {
|
|
if o != nil && !IsNil(o.MinNodes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMinNodes gets a reference to the given int64 and assigns it to the MinNodes field.
|
|
func (o *ComputePoolCreate) SetMinNodes(v int64) {
|
|
o.MinNodes = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) 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 *ComputePoolCreate) 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 *ComputePoolCreate) 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 *ComputePoolCreate) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) 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 *ComputePoolCreate) 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 *ComputePoolCreate) 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 *ComputePoolCreate) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *ComputePoolCreate) GetSize() string {
|
|
if o == nil || IsNil(o.Size) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Size
|
|
}
|
|
|
|
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputePoolCreate) GetSizeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Size) {
|
|
return nil, false
|
|
}
|
|
return o.Size, true
|
|
}
|
|
|
|
// HasSize returns a boolean if a field has been set.
|
|
func (o *ComputePoolCreate) HasSize() bool {
|
|
if o != nil && !IsNil(o.Size) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSize gets a reference to the given string and assigns it to the Size field.
|
|
func (o *ComputePoolCreate) SetSize(v string) {
|
|
o.Size = &v
|
|
}
|
|
|
|
func (o ComputePoolCreate) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ComputePoolCreate) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AutoScale) {
|
|
toSerialize["autoScale"] = o.AutoScale
|
|
}
|
|
if !IsNil(o.ClusterId) {
|
|
toSerialize["clusterId"] = o.ClusterId
|
|
}
|
|
if !IsNil(o.Count) {
|
|
toSerialize["count"] = o.Count
|
|
}
|
|
if !IsNil(o.MaxNodes) {
|
|
toSerialize["maxNodes"] = o.MaxNodes
|
|
}
|
|
if !IsNil(o.MinNodes) {
|
|
toSerialize["minNodes"] = o.MinNodes
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Size) {
|
|
toSerialize["size"] = o.Size
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ComputePoolCreate) UnmarshalJSON(data []byte) (err error) {
|
|
varComputePoolCreate := _ComputePoolCreate{}
|
|
|
|
err = json.Unmarshal(data, &varComputePoolCreate)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ComputePoolCreate(varComputePoolCreate)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "autoScale")
|
|
delete(additionalProperties, "clusterId")
|
|
delete(additionalProperties, "count")
|
|
delete(additionalProperties, "maxNodes")
|
|
delete(additionalProperties, "minNodes")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "size")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableComputePoolCreate struct {
|
|
value *ComputePoolCreate
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableComputePoolCreate) Get() *ComputePoolCreate {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableComputePoolCreate) Set(val *ComputePoolCreate) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableComputePoolCreate) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableComputePoolCreate) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableComputePoolCreate(val *ComputePoolCreate) *NullableComputePoolCreate {
|
|
return &NullableComputePoolCreate{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableComputePoolCreate) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableComputePoolCreate) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|