mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.6 KiB
Go
307 lines
7.6 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 RunnerState type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &RunnerState{}
|
|
|
|
// RunnerState struct for RunnerState
|
|
type RunnerState struct {
|
|
// ID is the task this is about.
|
|
Id *int64 `json:"id,omitempty"`
|
|
// Result is how it finished; empty means it has not.
|
|
Result *string `json:"result,omitempty"`
|
|
// Started is when it began, in unix nanoseconds; 0 is unset.
|
|
Started *int64 `json:"started,omitempty"`
|
|
// Steps is each step's own progress, in the order the workflow declares.
|
|
Steps []RunnerStep `json:"steps,omitempty"`
|
|
// Stopped is when it finished, in unix nanoseconds; 0 is unset.
|
|
Stopped *int64 `json:"stopped,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _RunnerState RunnerState
|
|
|
|
// NewRunnerState instantiates a new RunnerState 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 NewRunnerState() *RunnerState {
|
|
this := RunnerState{}
|
|
return &this
|
|
}
|
|
|
|
// NewRunnerStateWithDefaults instantiates a new RunnerState 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 NewRunnerStateWithDefaults() *RunnerState {
|
|
this := RunnerState{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *RunnerState) GetId() int64 {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerState) GetIdOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *RunnerState) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given int64 and assigns it to the Id field.
|
|
func (o *RunnerState) SetId(v int64) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetResult returns the Result field value if set, zero value otherwise.
|
|
func (o *RunnerState) GetResult() string {
|
|
if o == nil || IsNil(o.Result) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Result
|
|
}
|
|
|
|
// GetResultOk returns a tuple with the Result field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerState) GetResultOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Result) {
|
|
return nil, false
|
|
}
|
|
return o.Result, true
|
|
}
|
|
|
|
// HasResult returns a boolean if a field has been set.
|
|
func (o *RunnerState) HasResult() bool {
|
|
if o != nil && !IsNil(o.Result) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResult gets a reference to the given string and assigns it to the Result field.
|
|
func (o *RunnerState) SetResult(v string) {
|
|
o.Result = &v
|
|
}
|
|
|
|
// GetStarted returns the Started field value if set, zero value otherwise.
|
|
func (o *RunnerState) GetStarted() int64 {
|
|
if o == nil || IsNil(o.Started) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Started
|
|
}
|
|
|
|
// GetStartedOk returns a tuple with the Started field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerState) GetStartedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Started) {
|
|
return nil, false
|
|
}
|
|
return o.Started, true
|
|
}
|
|
|
|
// HasStarted returns a boolean if a field has been set.
|
|
func (o *RunnerState) HasStarted() bool {
|
|
if o != nil && !IsNil(o.Started) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStarted gets a reference to the given int64 and assigns it to the Started field.
|
|
func (o *RunnerState) SetStarted(v int64) {
|
|
o.Started = &v
|
|
}
|
|
|
|
// GetSteps returns the Steps field value if set, zero value otherwise.
|
|
func (o *RunnerState) GetSteps() []RunnerStep {
|
|
if o == nil || IsNil(o.Steps) {
|
|
var ret []RunnerStep
|
|
return ret
|
|
}
|
|
return o.Steps
|
|
}
|
|
|
|
// GetStepsOk returns a tuple with the Steps field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerState) GetStepsOk() ([]RunnerStep, bool) {
|
|
if o == nil || IsNil(o.Steps) {
|
|
return nil, false
|
|
}
|
|
return o.Steps, true
|
|
}
|
|
|
|
// HasSteps returns a boolean if a field has been set.
|
|
func (o *RunnerState) HasSteps() bool {
|
|
if o != nil && !IsNil(o.Steps) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSteps gets a reference to the given []RunnerStep and assigns it to the Steps field.
|
|
func (o *RunnerState) SetSteps(v []RunnerStep) {
|
|
o.Steps = v
|
|
}
|
|
|
|
// GetStopped returns the Stopped field value if set, zero value otherwise.
|
|
func (o *RunnerState) GetStopped() int64 {
|
|
if o == nil || IsNil(o.Stopped) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Stopped
|
|
}
|
|
|
|
// GetStoppedOk returns a tuple with the Stopped field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerState) GetStoppedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Stopped) {
|
|
return nil, false
|
|
}
|
|
return o.Stopped, true
|
|
}
|
|
|
|
// HasStopped returns a boolean if a field has been set.
|
|
func (o *RunnerState) HasStopped() bool {
|
|
if o != nil && !IsNil(o.Stopped) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStopped gets a reference to the given int64 and assigns it to the Stopped field.
|
|
func (o *RunnerState) SetStopped(v int64) {
|
|
o.Stopped = &v
|
|
}
|
|
|
|
func (o RunnerState) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o RunnerState) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Result) {
|
|
toSerialize["result"] = o.Result
|
|
}
|
|
if !IsNil(o.Started) {
|
|
toSerialize["started"] = o.Started
|
|
}
|
|
if !IsNil(o.Steps) {
|
|
toSerialize["steps"] = o.Steps
|
|
}
|
|
if !IsNil(o.Stopped) {
|
|
toSerialize["stopped"] = o.Stopped
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *RunnerState) UnmarshalJSON(data []byte) (err error) {
|
|
varRunnerState := _RunnerState{}
|
|
|
|
err = json.Unmarshal(data, &varRunnerState)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = RunnerState(varRunnerState)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "result")
|
|
delete(additionalProperties, "started")
|
|
delete(additionalProperties, "steps")
|
|
delete(additionalProperties, "stopped")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableRunnerState struct {
|
|
value *RunnerState
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableRunnerState) Get() *RunnerState {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableRunnerState) Set(val *RunnerState) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableRunnerState) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableRunnerState) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableRunnerState(val *RunnerState) *NullableRunnerState {
|
|
return &NullableRunnerState{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableRunnerState) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableRunnerState) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|