mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
155 lines
4.1 KiB
Go
155 lines
4.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 ComputeFleetBoard type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ComputeFleetBoard{}
|
|
|
|
// ComputeFleetBoard struct for ComputeFleetBoard
|
|
type ComputeFleetBoard struct {
|
|
// Units is the union across sources — agent run-targets, BYO workers, BYO clusters and Visor machines — each row naming the source it came from.
|
|
Units []ComputeFleetUnit `json:"units,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ComputeFleetBoard ComputeFleetBoard
|
|
|
|
// NewComputeFleetBoard instantiates a new ComputeFleetBoard 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 NewComputeFleetBoard() *ComputeFleetBoard {
|
|
this := ComputeFleetBoard{}
|
|
return &this
|
|
}
|
|
|
|
// NewComputeFleetBoardWithDefaults instantiates a new ComputeFleetBoard 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 NewComputeFleetBoardWithDefaults() *ComputeFleetBoard {
|
|
this := ComputeFleetBoard{}
|
|
return &this
|
|
}
|
|
|
|
// GetUnits returns the Units field value if set, zero value otherwise.
|
|
func (o *ComputeFleetBoard) GetUnits() []ComputeFleetUnit {
|
|
if o == nil || IsNil(o.Units) {
|
|
var ret []ComputeFleetUnit
|
|
return ret
|
|
}
|
|
return o.Units
|
|
}
|
|
|
|
// GetUnitsOk returns a tuple with the Units field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeFleetBoard) GetUnitsOk() ([]ComputeFleetUnit, bool) {
|
|
if o == nil || IsNil(o.Units) {
|
|
return nil, false
|
|
}
|
|
return o.Units, true
|
|
}
|
|
|
|
// HasUnits returns a boolean if a field has been set.
|
|
func (o *ComputeFleetBoard) HasUnits() bool {
|
|
if o != nil && !IsNil(o.Units) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUnits gets a reference to the given []ComputeFleetUnit and assigns it to the Units field.
|
|
func (o *ComputeFleetBoard) SetUnits(v []ComputeFleetUnit) {
|
|
o.Units = v
|
|
}
|
|
|
|
func (o ComputeFleetBoard) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ComputeFleetBoard) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Units) {
|
|
toSerialize["units"] = o.Units
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ComputeFleetBoard) UnmarshalJSON(data []byte) (err error) {
|
|
varComputeFleetBoard := _ComputeFleetBoard{}
|
|
|
|
err = json.Unmarshal(data, &varComputeFleetBoard)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ComputeFleetBoard(varComputeFleetBoard)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "units")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableComputeFleetBoard struct {
|
|
value *ComputeFleetBoard
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableComputeFleetBoard) Get() *ComputeFleetBoard {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableComputeFleetBoard) Set(val *ComputeFleetBoard) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableComputeFleetBoard) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableComputeFleetBoard) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableComputeFleetBoard(val *ComputeFleetBoard) *NullableComputeFleetBoard {
|
|
return &NullableComputeFleetBoard{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableComputeFleetBoard) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableComputeFleetBoard) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|