Files
sdk/model_runner_state_in.go

193 lines
4.9 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 RunnerStateIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RunnerStateIn{}
// RunnerStateIn struct for RunnerStateIn
type RunnerStateIn struct {
// Outputs are values the job has published since the last report.
Outputs []RunnerPair `json:"outputs,omitempty"`
// State is the task's progress and that of each of its steps.
State *RunnerState `json:"state,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RunnerStateIn RunnerStateIn
// NewRunnerStateIn instantiates a new RunnerStateIn 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 NewRunnerStateIn() *RunnerStateIn {
this := RunnerStateIn{}
return &this
}
// NewRunnerStateInWithDefaults instantiates a new RunnerStateIn 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 NewRunnerStateInWithDefaults() *RunnerStateIn {
this := RunnerStateIn{}
return &this
}
// GetOutputs returns the Outputs field value if set, zero value otherwise.
func (o *RunnerStateIn) GetOutputs() []RunnerPair {
if o == nil || IsNil(o.Outputs) {
var ret []RunnerPair
return ret
}
return o.Outputs
}
// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerStateIn) GetOutputsOk() ([]RunnerPair, bool) {
if o == nil || IsNil(o.Outputs) {
return nil, false
}
return o.Outputs, true
}
// HasOutputs returns a boolean if a field has been set.
func (o *RunnerStateIn) HasOutputs() bool {
if o != nil && !IsNil(o.Outputs) {
return true
}
return false
}
// SetOutputs gets a reference to the given []RunnerPair and assigns it to the Outputs field.
func (o *RunnerStateIn) SetOutputs(v []RunnerPair) {
o.Outputs = v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *RunnerStateIn) 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 *RunnerStateIn) 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 *RunnerStateIn) 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 *RunnerStateIn) SetState(v RunnerState) {
o.State = &v
}
func (o RunnerStateIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RunnerStateIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Outputs) {
toSerialize["outputs"] = o.Outputs
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RunnerStateIn) UnmarshalJSON(data []byte) (err error) {
varRunnerStateIn := _RunnerStateIn{}
err = json.Unmarshal(data, &varRunnerStateIn)
if err != nil {
return err
}
*o = RunnerStateIn(varRunnerStateIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "outputs")
delete(additionalProperties, "state")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRunnerStateIn struct {
value *RunnerStateIn
isSet bool
}
func (v NullableRunnerStateIn) Get() *RunnerStateIn {
return v.value
}
func (v *NullableRunnerStateIn) Set(val *RunnerStateIn) {
v.value = val
v.isSet = true
}
func (v NullableRunnerStateIn) IsSet() bool {
return v.isSet
}
func (v *NullableRunnerStateIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRunnerStateIn(val *RunnerStateIn) *NullableRunnerStateIn {
return &NullableRunnerStateIn{value: val, isSet: true}
}
func (v NullableRunnerStateIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRunnerStateIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}