mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.0 KiB
Go
307 lines
8.0 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 TrainClaimIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainClaimIn{}
|
|
|
|
// TrainClaimIn struct for TrainClaimIn
|
|
type TrainClaimIn struct {
|
|
// Bases are the base models its trainer runs.
|
|
Bases []string `json:"bases,omitempty"`
|
|
// Devices are its accelerators, one entry per device: cuda, rocm, metal, vulkan, cpu. A task runs on those of one kind its job allows.
|
|
Devices []string `json:"devices,omitempty"`
|
|
// Machine is the machine claiming, by name: one of the org's linked machines, or for a platform claim the Hanzo host.
|
|
Machine *string `json:"machine,omitempty"`
|
|
// Platform claims for Hanzo's executor: a task of any org's job that names no machines. A SuperAdmin's claim alone, and on the platform's audit trail.
|
|
Platform *bool `json:"platform,omitempty"`
|
|
// Supports is what its build runs.
|
|
Supports *TrainSupports `json:"supports,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainClaimIn TrainClaimIn
|
|
|
|
// NewTrainClaimIn instantiates a new TrainClaimIn 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 NewTrainClaimIn() *TrainClaimIn {
|
|
this := TrainClaimIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainClaimInWithDefaults instantiates a new TrainClaimIn 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 NewTrainClaimInWithDefaults() *TrainClaimIn {
|
|
this := TrainClaimIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetBases returns the Bases field value if set, zero value otherwise.
|
|
func (o *TrainClaimIn) GetBases() []string {
|
|
if o == nil || IsNil(o.Bases) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Bases
|
|
}
|
|
|
|
// GetBasesOk returns a tuple with the Bases field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainClaimIn) GetBasesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Bases) {
|
|
return nil, false
|
|
}
|
|
return o.Bases, true
|
|
}
|
|
|
|
// HasBases returns a boolean if a field has been set.
|
|
func (o *TrainClaimIn) HasBases() bool {
|
|
if o != nil && !IsNil(o.Bases) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBases gets a reference to the given []string and assigns it to the Bases field.
|
|
func (o *TrainClaimIn) SetBases(v []string) {
|
|
o.Bases = v
|
|
}
|
|
|
|
// GetDevices returns the Devices field value if set, zero value otherwise.
|
|
func (o *TrainClaimIn) GetDevices() []string {
|
|
if o == nil || IsNil(o.Devices) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Devices
|
|
}
|
|
|
|
// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainClaimIn) GetDevicesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Devices) {
|
|
return nil, false
|
|
}
|
|
return o.Devices, true
|
|
}
|
|
|
|
// HasDevices returns a boolean if a field has been set.
|
|
func (o *TrainClaimIn) HasDevices() bool {
|
|
if o != nil && !IsNil(o.Devices) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDevices gets a reference to the given []string and assigns it to the Devices field.
|
|
func (o *TrainClaimIn) SetDevices(v []string) {
|
|
o.Devices = v
|
|
}
|
|
|
|
// GetMachine returns the Machine field value if set, zero value otherwise.
|
|
func (o *TrainClaimIn) GetMachine() string {
|
|
if o == nil || IsNil(o.Machine) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Machine
|
|
}
|
|
|
|
// GetMachineOk returns a tuple with the Machine field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainClaimIn) GetMachineOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Machine) {
|
|
return nil, false
|
|
}
|
|
return o.Machine, true
|
|
}
|
|
|
|
// HasMachine returns a boolean if a field has been set.
|
|
func (o *TrainClaimIn) HasMachine() bool {
|
|
if o != nil && !IsNil(o.Machine) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMachine gets a reference to the given string and assigns it to the Machine field.
|
|
func (o *TrainClaimIn) SetMachine(v string) {
|
|
o.Machine = &v
|
|
}
|
|
|
|
// GetPlatform returns the Platform field value if set, zero value otherwise.
|
|
func (o *TrainClaimIn) GetPlatform() bool {
|
|
if o == nil || IsNil(o.Platform) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Platform
|
|
}
|
|
|
|
// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainClaimIn) GetPlatformOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Platform) {
|
|
return nil, false
|
|
}
|
|
return o.Platform, true
|
|
}
|
|
|
|
// HasPlatform returns a boolean if a field has been set.
|
|
func (o *TrainClaimIn) HasPlatform() bool {
|
|
if o != nil && !IsNil(o.Platform) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPlatform gets a reference to the given bool and assigns it to the Platform field.
|
|
func (o *TrainClaimIn) SetPlatform(v bool) {
|
|
o.Platform = &v
|
|
}
|
|
|
|
// GetSupports returns the Supports field value if set, zero value otherwise.
|
|
func (o *TrainClaimIn) GetSupports() TrainSupports {
|
|
if o == nil || IsNil(o.Supports) {
|
|
var ret TrainSupports
|
|
return ret
|
|
}
|
|
return *o.Supports
|
|
}
|
|
|
|
// GetSupportsOk returns a tuple with the Supports field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainClaimIn) GetSupportsOk() (*TrainSupports, bool) {
|
|
if o == nil || IsNil(o.Supports) {
|
|
return nil, false
|
|
}
|
|
return o.Supports, true
|
|
}
|
|
|
|
// HasSupports returns a boolean if a field has been set.
|
|
func (o *TrainClaimIn) HasSupports() bool {
|
|
if o != nil && !IsNil(o.Supports) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSupports gets a reference to the given TrainSupports and assigns it to the Supports field.
|
|
func (o *TrainClaimIn) SetSupports(v TrainSupports) {
|
|
o.Supports = &v
|
|
}
|
|
|
|
func (o TrainClaimIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainClaimIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Bases) {
|
|
toSerialize["bases"] = o.Bases
|
|
}
|
|
if !IsNil(o.Devices) {
|
|
toSerialize["devices"] = o.Devices
|
|
}
|
|
if !IsNil(o.Machine) {
|
|
toSerialize["machine"] = o.Machine
|
|
}
|
|
if !IsNil(o.Platform) {
|
|
toSerialize["platform"] = o.Platform
|
|
}
|
|
if !IsNil(o.Supports) {
|
|
toSerialize["supports"] = o.Supports
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainClaimIn) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainClaimIn := _TrainClaimIn{}
|
|
|
|
err = json.Unmarshal(data, &varTrainClaimIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainClaimIn(varTrainClaimIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "bases")
|
|
delete(additionalProperties, "devices")
|
|
delete(additionalProperties, "machine")
|
|
delete(additionalProperties, "platform")
|
|
delete(additionalProperties, "supports")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainClaimIn struct {
|
|
value *TrainClaimIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainClaimIn) Get() *TrainClaimIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainClaimIn) Set(val *TrainClaimIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainClaimIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainClaimIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainClaimIn(val *TrainClaimIn) *NullableTrainClaimIn {
|
|
return &NullableTrainClaimIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainClaimIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainClaimIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|