mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.7 KiB
Go
269 lines
6.7 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 TrainReportOut type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainReportOut{}
|
|
|
|
// TrainReportOut struct for TrainReportOut
|
|
type TrainReportOut struct {
|
|
// Cancel says the job was cancelled, or stopped at what its payer or its own bounds could hold: kill the trainer, report nothing more.
|
|
Cancel *bool `json:"cancel,omitempty"`
|
|
// Held is the device-seconds held for the task now.
|
|
Held *int64 `json:"held,omitempty"`
|
|
// Seq is the job's last event seq.
|
|
Seq *int64 `json:"seq,omitempty"`
|
|
// Status is the job's status after this report.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainReportOut TrainReportOut
|
|
|
|
// NewTrainReportOut instantiates a new TrainReportOut 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 NewTrainReportOut() *TrainReportOut {
|
|
this := TrainReportOut{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainReportOutWithDefaults instantiates a new TrainReportOut 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 NewTrainReportOutWithDefaults() *TrainReportOut {
|
|
this := TrainReportOut{}
|
|
return &this
|
|
}
|
|
|
|
// GetCancel returns the Cancel field value if set, zero value otherwise.
|
|
func (o *TrainReportOut) GetCancel() bool {
|
|
if o == nil || IsNil(o.Cancel) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Cancel
|
|
}
|
|
|
|
// GetCancelOk returns a tuple with the Cancel field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainReportOut) GetCancelOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Cancel) {
|
|
return nil, false
|
|
}
|
|
return o.Cancel, true
|
|
}
|
|
|
|
// HasCancel returns a boolean if a field has been set.
|
|
func (o *TrainReportOut) HasCancel() bool {
|
|
if o != nil && !IsNil(o.Cancel) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCancel gets a reference to the given bool and assigns it to the Cancel field.
|
|
func (o *TrainReportOut) SetCancel(v bool) {
|
|
o.Cancel = &v
|
|
}
|
|
|
|
// GetHeld returns the Held field value if set, zero value otherwise.
|
|
func (o *TrainReportOut) 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 *TrainReportOut) 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 *TrainReportOut) 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 *TrainReportOut) SetHeld(v int64) {
|
|
o.Held = &v
|
|
}
|
|
|
|
// GetSeq returns the Seq field value if set, zero value otherwise.
|
|
func (o *TrainReportOut) GetSeq() int64 {
|
|
if o == nil || IsNil(o.Seq) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Seq
|
|
}
|
|
|
|
// GetSeqOk returns a tuple with the Seq field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainReportOut) GetSeqOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Seq) {
|
|
return nil, false
|
|
}
|
|
return o.Seq, true
|
|
}
|
|
|
|
// HasSeq returns a boolean if a field has been set.
|
|
func (o *TrainReportOut) HasSeq() bool {
|
|
if o != nil && !IsNil(o.Seq) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeq gets a reference to the given int64 and assigns it to the Seq field.
|
|
func (o *TrainReportOut) SetSeq(v int64) {
|
|
o.Seq = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *TrainReportOut) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainReportOut) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *TrainReportOut) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *TrainReportOut) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o TrainReportOut) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainReportOut) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Cancel) {
|
|
toSerialize["cancel"] = o.Cancel
|
|
}
|
|
if !IsNil(o.Held) {
|
|
toSerialize["held"] = o.Held
|
|
}
|
|
if !IsNil(o.Seq) {
|
|
toSerialize["seq"] = o.Seq
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainReportOut) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainReportOut := _TrainReportOut{}
|
|
|
|
err = json.Unmarshal(data, &varTrainReportOut)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainReportOut(varTrainReportOut)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "cancel")
|
|
delete(additionalProperties, "held")
|
|
delete(additionalProperties, "seq")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainReportOut struct {
|
|
value *TrainReportOut
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainReportOut) Get() *TrainReportOut {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainReportOut) Set(val *TrainReportOut) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainReportOut) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainReportOut) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainReportOut(val *TrainReportOut) *NullableTrainReportOut {
|
|
return &NullableTrainReportOut{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainReportOut) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainReportOut) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|