Files
sdk/model_compute_node_pool_view.go

383 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 ComputeNodePoolView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeNodePoolView{}
// ComputeNodePoolView struct for ComputeNodePoolView
type ComputeNodePoolView struct {
// AutoScale reports whether the provider's cluster autoscaler owns this pool's size, moving Count between MinNodes and MaxNodes as workloads demand. False means Count changes only when someone scales the pool.
AutoScale *bool `json:"autoScale,omitempty"`
// Count is how many nodes the pool has right now. Always present, so 0 means a pool that is genuinely empty rather than a figure the provider withheld.
Count *int64 `json:"count,omitempty"`
// MaxNodes is the ceiling the autoscaler will not grow the pool past, and so the bound on what this pool can cost. Read it only with AutoScale set.
MaxNodes *int64 `json:"maxNodes,omitempty"`
// MinNodes is the floor the autoscaler will not shrink the pool below. Read it only with AutoScale set — the provider ignores it otherwise.
MinNodes *int64 `json:"minNodes,omitempty"`
// Name is the pool's name as the provider knows it.
Name *string `json:"name,omitempty"`
// PoolID is the provider's id for the pool — the value the scale and delete routes address it by. It falls back to the pool's name when the provider answered without one, so it is always something the routes accept.
PoolId *string `json:"poolId,omitempty"`
// Size is the provider size slug every node in the pool runs at (\"s-4vcpu-8gb\", \"gpu-h100x8-640gb\"). One pool is one size — a mixed cluster is several pools.
Size *string `json:"size,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeNodePoolView ComputeNodePoolView
// NewComputeNodePoolView instantiates a new ComputeNodePoolView 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 NewComputeNodePoolView() *ComputeNodePoolView {
this := ComputeNodePoolView{}
return &this
}
// NewComputeNodePoolViewWithDefaults instantiates a new ComputeNodePoolView 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 NewComputeNodePoolViewWithDefaults() *ComputeNodePoolView {
this := ComputeNodePoolView{}
return &this
}
// GetAutoScale returns the AutoScale field value if set, zero value otherwise.
func (o *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) SetAutoScale(v bool) {
o.AutoScale = &v
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) SetCount(v int64) {
o.Count = &v
}
// GetMaxNodes returns the MaxNodes field value if set, zero value otherwise.
func (o *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) SetMaxNodes(v int64) {
o.MaxNodes = &v
}
// GetMinNodes returns the MinNodes field value if set, zero value otherwise.
func (o *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) SetMinNodes(v int64) {
o.MinNodes = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) SetName(v string) {
o.Name = &v
}
// GetPoolId returns the PoolId field value if set, zero value otherwise.
func (o *ComputeNodePoolView) GetPoolId() string {
if o == nil || IsNil(o.PoolId) {
var ret string
return ret
}
return *o.PoolId
}
// GetPoolIdOk returns a tuple with the PoolId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeNodePoolView) GetPoolIdOk() (*string, bool) {
if o == nil || IsNil(o.PoolId) {
return nil, false
}
return o.PoolId, true
}
// HasPoolId returns a boolean if a field has been set.
func (o *ComputeNodePoolView) HasPoolId() bool {
if o != nil && !IsNil(o.PoolId) {
return true
}
return false
}
// SetPoolId gets a reference to the given string and assigns it to the PoolId field.
func (o *ComputeNodePoolView) SetPoolId(v string) {
o.PoolId = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) 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 *ComputeNodePoolView) SetSize(v string) {
o.Size = &v
}
func (o ComputeNodePoolView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeNodePoolView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AutoScale) {
toSerialize["autoScale"] = o.AutoScale
}
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.PoolId) {
toSerialize["poolId"] = o.PoolId
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeNodePoolView) UnmarshalJSON(data []byte) (err error) {
varComputeNodePoolView := _ComputeNodePoolView{}
err = json.Unmarshal(data, &varComputeNodePoolView)
if err != nil {
return err
}
*o = ComputeNodePoolView(varComputeNodePoolView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "autoScale")
delete(additionalProperties, "count")
delete(additionalProperties, "maxNodes")
delete(additionalProperties, "minNodes")
delete(additionalProperties, "name")
delete(additionalProperties, "poolId")
delete(additionalProperties, "size")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeNodePoolView struct {
value *ComputeNodePoolView
isSet bool
}
func (v NullableComputeNodePoolView) Get() *ComputeNodePoolView {
return v.value
}
func (v *NullableComputeNodePoolView) Set(val *ComputeNodePoolView) {
v.value = val
v.isSet = true
}
func (v NullableComputeNodePoolView) IsSet() bool {
return v.isSet
}
func (v *NullableComputeNodePoolView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeNodePoolView(val *ComputeNodePoolView) *NullableComputeNodePoolView {
return &NullableComputeNodePoolView{value: val, isSet: true}
}
func (v NullableComputeNodePoolView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeNodePoolView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}