Files
sdk/model_runner_state_out.go

193 lines
5.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 RunnerStateOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RunnerStateOut{}
// RunnerStateOut struct for RunnerStateOut
type RunnerStateOut struct {
// State is the task's result AS THE FORGE HOLDS IT, which may differ from what was reported: that is how a runner learns it was cancelled.
State *RunnerState `json:"state,omitempty"`
// Stored names the outputs the forge has written down, so the runner stops resending them.
Stored []string `json:"stored,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RunnerStateOut RunnerStateOut
// NewRunnerStateOut instantiates a new RunnerStateOut 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 NewRunnerStateOut() *RunnerStateOut {
this := RunnerStateOut{}
return &this
}
// NewRunnerStateOutWithDefaults instantiates a new RunnerStateOut 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 NewRunnerStateOutWithDefaults() *RunnerStateOut {
this := RunnerStateOut{}
return &this
}
// GetState returns the State field value if set, zero value otherwise.
func (o *RunnerStateOut) GetState() RunnerState {
if o == nil || IsNil(o.State) {
var ret RunnerState
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerStateOut) GetStateOk() (*RunnerState, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *RunnerStateOut) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given RunnerState and assigns it to the State field.
func (o *RunnerStateOut) SetState(v RunnerState) {
o.State = &v
}
// GetStored returns the Stored field value if set, zero value otherwise.
func (o *RunnerStateOut) GetStored() []string {
if o == nil || IsNil(o.Stored) {
var ret []string
return ret
}
return o.Stored
}
// GetStoredOk returns a tuple with the Stored field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerStateOut) GetStoredOk() ([]string, bool) {
if o == nil || IsNil(o.Stored) {
return nil, false
}
return o.Stored, true
}
// HasStored returns a boolean if a field has been set.
func (o *RunnerStateOut) HasStored() bool {
if o != nil && !IsNil(o.Stored) {
return true
}
return false
}
// SetStored gets a reference to the given []string and assigns it to the Stored field.
func (o *RunnerStateOut) SetStored(v []string) {
o.Stored = v
}
func (o RunnerStateOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RunnerStateOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Stored) {
toSerialize["stored"] = o.Stored
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RunnerStateOut) UnmarshalJSON(data []byte) (err error) {
varRunnerStateOut := _RunnerStateOut{}
err = json.Unmarshal(data, &varRunnerStateOut)
if err != nil {
return err
}
*o = RunnerStateOut(varRunnerStateOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "state")
delete(additionalProperties, "stored")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRunnerStateOut struct {
value *RunnerStateOut
isSet bool
}
func (v NullableRunnerStateOut) Get() *RunnerStateOut {
return v.value
}
func (v *NullableRunnerStateOut) Set(val *RunnerStateOut) {
v.value = val
v.isSet = true
}
func (v NullableRunnerStateOut) IsSet() bool {
return v.isSet
}
func (v *NullableRunnerStateOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRunnerStateOut(val *RunnerStateOut) *NullableRunnerStateOut {
return &NullableRunnerStateOut{value: val, isSet: true}
}
func (v NullableRunnerStateOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRunnerStateOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}