Files
sdk/model_runner_need.go

231 lines
5.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 RunnerNeed type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RunnerNeed{}
// RunnerNeed struct for RunnerNeed
type RunnerNeed struct {
// Job is the depended-on job's id in the workflow.
Job *string `json:"job,omitempty"`
// Outputs are the values it published.
Outputs []RunnerPair `json:"outputs,omitempty"`
// Result is how it finished.
Result *string `json:"result,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RunnerNeed RunnerNeed
// NewRunnerNeed instantiates a new RunnerNeed 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 NewRunnerNeed() *RunnerNeed {
this := RunnerNeed{}
return &this
}
// NewRunnerNeedWithDefaults instantiates a new RunnerNeed 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 NewRunnerNeedWithDefaults() *RunnerNeed {
this := RunnerNeed{}
return &this
}
// GetJob returns the Job field value if set, zero value otherwise.
func (o *RunnerNeed) GetJob() string {
if o == nil || IsNil(o.Job) {
var ret string
return ret
}
return *o.Job
}
// GetJobOk returns a tuple with the Job field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerNeed) GetJobOk() (*string, bool) {
if o == nil || IsNil(o.Job) {
return nil, false
}
return o.Job, true
}
// HasJob returns a boolean if a field has been set.
func (o *RunnerNeed) HasJob() bool {
if o != nil && !IsNil(o.Job) {
return true
}
return false
}
// SetJob gets a reference to the given string and assigns it to the Job field.
func (o *RunnerNeed) SetJob(v string) {
o.Job = &v
}
// GetOutputs returns the Outputs field value if set, zero value otherwise.
func (o *RunnerNeed) 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 *RunnerNeed) 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 *RunnerNeed) 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 *RunnerNeed) SetOutputs(v []RunnerPair) {
o.Outputs = v
}
// GetResult returns the Result field value if set, zero value otherwise.
func (o *RunnerNeed) 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 *RunnerNeed) 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 *RunnerNeed) 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 *RunnerNeed) SetResult(v string) {
o.Result = &v
}
func (o RunnerNeed) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RunnerNeed) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Job) {
toSerialize["job"] = o.Job
}
if !IsNil(o.Outputs) {
toSerialize["outputs"] = o.Outputs
}
if !IsNil(o.Result) {
toSerialize["result"] = o.Result
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RunnerNeed) UnmarshalJSON(data []byte) (err error) {
varRunnerNeed := _RunnerNeed{}
err = json.Unmarshal(data, &varRunnerNeed)
if err != nil {
return err
}
*o = RunnerNeed(varRunnerNeed)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "job")
delete(additionalProperties, "outputs")
delete(additionalProperties, "result")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRunnerNeed struct {
value *RunnerNeed
isSet bool
}
func (v NullableRunnerNeed) Get() *RunnerNeed {
return v.value
}
func (v *NullableRunnerNeed) Set(val *RunnerNeed) {
v.value = val
v.isSet = true
}
func (v NullableRunnerNeed) IsSet() bool {
return v.isSet
}
func (v *NullableRunnerNeed) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRunnerNeed(val *RunnerNeed) *NullableRunnerNeed {
return &NullableRunnerNeed{value: val, isSet: true}
}
func (v NullableRunnerNeed) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRunnerNeed) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}