Files
sdk/model_compute_pool_scale.go

269 lines
7.1 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 ComputePoolScale type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputePoolScale{}
// ComputePoolScale struct for ComputePoolScale
type ComputePoolScale struct {
// ClusterID is the cluster holding the pool, from the URL path.
ClusterId *string `json:"clusterId,omitempty"`
// Count is the node count to scale TO — an absolute target, not a delta, and never negative.
Count *int64 `json:"count,omitempty"`
// PoolID is the pool to resize, from the URL path — the `poolId` a cluster read reports for it. Required.
PoolId *string `json:"poolId,omitempty"`
// Provider is the cloud the cluster lives on. Required; body or ?provider=.
Provider *string `json:"provider,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputePoolScale ComputePoolScale
// NewComputePoolScale instantiates a new ComputePoolScale 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 NewComputePoolScale() *ComputePoolScale {
this := ComputePoolScale{}
return &this
}
// NewComputePoolScaleWithDefaults instantiates a new ComputePoolScale 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 NewComputePoolScaleWithDefaults() *ComputePoolScale {
this := ComputePoolScale{}
return &this
}
// GetClusterId returns the ClusterId field value if set, zero value otherwise.
func (o *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) SetClusterId(v string) {
o.ClusterId = &v
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) SetCount(v int64) {
o.Count = &v
}
// GetPoolId returns the PoolId field value if set, zero value otherwise.
func (o *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) SetPoolId(v string) {
o.PoolId = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) 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 *ComputePoolScale) SetProvider(v string) {
o.Provider = &v
}
func (o ComputePoolScale) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputePoolScale) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ClusterId) {
toSerialize["clusterId"] = o.ClusterId
}
if !IsNil(o.Count) {
toSerialize["count"] = o.Count
}
if !IsNil(o.PoolId) {
toSerialize["poolId"] = o.PoolId
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputePoolScale) UnmarshalJSON(data []byte) (err error) {
varComputePoolScale := _ComputePoolScale{}
err = json.Unmarshal(data, &varComputePoolScale)
if err != nil {
return err
}
*o = ComputePoolScale(varComputePoolScale)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "clusterId")
delete(additionalProperties, "count")
delete(additionalProperties, "poolId")
delete(additionalProperties, "provider")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputePoolScale struct {
value *ComputePoolScale
isSet bool
}
func (v NullableComputePoolScale) Get() *ComputePoolScale {
return v.value
}
func (v *NullableComputePoolScale) Set(val *ComputePoolScale) {
v.value = val
v.isSet = true
}
func (v NullableComputePoolScale) IsSet() bool {
return v.isSet
}
func (v *NullableComputePoolScale) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputePoolScale(val *ComputePoolScale) *NullableComputePoolScale {
return &NullableComputePoolScale{value: val, isSet: true}
}
func (v NullableComputePoolScale) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputePoolScale) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}