mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.8 KiB
Go
231 lines
5.8 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 TrainUsage type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainUsage{}
|
|
|
|
// TrainUsage struct for TrainUsage
|
|
type TrainUsage struct {
|
|
// CostMicroUSD is what Seconds were charged, in micro-USD: 0 on the org's own machines.
|
|
CostMicroUsd *int64 `json:"cost_micro_usd,omitempty"`
|
|
// Held are the device-seconds held beyond Seconds; 0 once it ended.
|
|
Held *int64 `json:"held,omitempty"`
|
|
// Seconds are the device-seconds used.
|
|
Seconds *int64 `json:"seconds,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainUsage TrainUsage
|
|
|
|
// NewTrainUsage instantiates a new TrainUsage 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 NewTrainUsage() *TrainUsage {
|
|
this := TrainUsage{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainUsageWithDefaults instantiates a new TrainUsage 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 NewTrainUsageWithDefaults() *TrainUsage {
|
|
this := TrainUsage{}
|
|
return &this
|
|
}
|
|
|
|
// GetCostMicroUsd returns the CostMicroUsd field value if set, zero value otherwise.
|
|
func (o *TrainUsage) GetCostMicroUsd() int64 {
|
|
if o == nil || IsNil(o.CostMicroUsd) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.CostMicroUsd
|
|
}
|
|
|
|
// GetCostMicroUsdOk returns a tuple with the CostMicroUsd field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainUsage) GetCostMicroUsdOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.CostMicroUsd) {
|
|
return nil, false
|
|
}
|
|
return o.CostMicroUsd, true
|
|
}
|
|
|
|
// HasCostMicroUsd returns a boolean if a field has been set.
|
|
func (o *TrainUsage) HasCostMicroUsd() bool {
|
|
if o != nil && !IsNil(o.CostMicroUsd) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCostMicroUsd gets a reference to the given int64 and assigns it to the CostMicroUsd field.
|
|
func (o *TrainUsage) SetCostMicroUsd(v int64) {
|
|
o.CostMicroUsd = &v
|
|
}
|
|
|
|
// GetHeld returns the Held field value if set, zero value otherwise.
|
|
func (o *TrainUsage) GetHeld() int64 {
|
|
if o == nil || IsNil(o.Held) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Held
|
|
}
|
|
|
|
// GetHeldOk returns a tuple with the Held field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainUsage) GetHeldOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Held) {
|
|
return nil, false
|
|
}
|
|
return o.Held, true
|
|
}
|
|
|
|
// HasHeld returns a boolean if a field has been set.
|
|
func (o *TrainUsage) HasHeld() bool {
|
|
if o != nil && !IsNil(o.Held) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHeld gets a reference to the given int64 and assigns it to the Held field.
|
|
func (o *TrainUsage) SetHeld(v int64) {
|
|
o.Held = &v
|
|
}
|
|
|
|
// GetSeconds returns the Seconds field value if set, zero value otherwise.
|
|
func (o *TrainUsage) GetSeconds() int64 {
|
|
if o == nil || IsNil(o.Seconds) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Seconds
|
|
}
|
|
|
|
// GetSecondsOk returns a tuple with the Seconds field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainUsage) GetSecondsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Seconds) {
|
|
return nil, false
|
|
}
|
|
return o.Seconds, true
|
|
}
|
|
|
|
// HasSeconds returns a boolean if a field has been set.
|
|
func (o *TrainUsage) HasSeconds() bool {
|
|
if o != nil && !IsNil(o.Seconds) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeconds gets a reference to the given int64 and assigns it to the Seconds field.
|
|
func (o *TrainUsage) SetSeconds(v int64) {
|
|
o.Seconds = &v
|
|
}
|
|
|
|
func (o TrainUsage) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainUsage) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CostMicroUsd) {
|
|
toSerialize["cost_micro_usd"] = o.CostMicroUsd
|
|
}
|
|
if !IsNil(o.Held) {
|
|
toSerialize["held"] = o.Held
|
|
}
|
|
if !IsNil(o.Seconds) {
|
|
toSerialize["seconds"] = o.Seconds
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainUsage) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainUsage := _TrainUsage{}
|
|
|
|
err = json.Unmarshal(data, &varTrainUsage)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainUsage(varTrainUsage)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "cost_micro_usd")
|
|
delete(additionalProperties, "held")
|
|
delete(additionalProperties, "seconds")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainUsage struct {
|
|
value *TrainUsage
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainUsage) Get() *TrainUsage {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainUsage) Set(val *TrainUsage) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainUsage) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainUsage) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainUsage(val *TrainUsage) *NullableTrainUsage {
|
|
return &NullableTrainUsage{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainUsage) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainUsage) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|