Files
sdk/model_runner_declare_out.go

193 lines
5.3 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 RunnerDeclareOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RunnerDeclareOut{}
// RunnerDeclareOut struct for RunnerDeclareOut
type RunnerDeclareOut struct {
// Capabilities are what THIS FORGE understands, so a runner learns what the other side supports from the reply body rather than from a header.
Capabilities []string `json:"capabilities,omitempty"`
// Runner is the stored identity as the forge now holds it. Its Token is empty: the credential is minted once, by register.
Runner *RunnerIdentity `json:"runner,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RunnerDeclareOut RunnerDeclareOut
// NewRunnerDeclareOut instantiates a new RunnerDeclareOut 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 NewRunnerDeclareOut() *RunnerDeclareOut {
this := RunnerDeclareOut{}
return &this
}
// NewRunnerDeclareOutWithDefaults instantiates a new RunnerDeclareOut 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 NewRunnerDeclareOutWithDefaults() *RunnerDeclareOut {
this := RunnerDeclareOut{}
return &this
}
// GetCapabilities returns the Capabilities field value if set, zero value otherwise.
func (o *RunnerDeclareOut) GetCapabilities() []string {
if o == nil || IsNil(o.Capabilities) {
var ret []string
return ret
}
return o.Capabilities
}
// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerDeclareOut) GetCapabilitiesOk() ([]string, bool) {
if o == nil || IsNil(o.Capabilities) {
return nil, false
}
return o.Capabilities, true
}
// HasCapabilities returns a boolean if a field has been set.
func (o *RunnerDeclareOut) HasCapabilities() bool {
if o != nil && !IsNil(o.Capabilities) {
return true
}
return false
}
// SetCapabilities gets a reference to the given []string and assigns it to the Capabilities field.
func (o *RunnerDeclareOut) SetCapabilities(v []string) {
o.Capabilities = v
}
// GetRunner returns the Runner field value if set, zero value otherwise.
func (o *RunnerDeclareOut) GetRunner() RunnerIdentity {
if o == nil || IsNil(o.Runner) {
var ret RunnerIdentity
return ret
}
return *o.Runner
}
// GetRunnerOk returns a tuple with the Runner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerDeclareOut) GetRunnerOk() (*RunnerIdentity, bool) {
if o == nil || IsNil(o.Runner) {
return nil, false
}
return o.Runner, true
}
// HasRunner returns a boolean if a field has been set.
func (o *RunnerDeclareOut) HasRunner() bool {
if o != nil && !IsNil(o.Runner) {
return true
}
return false
}
// SetRunner gets a reference to the given RunnerIdentity and assigns it to the Runner field.
func (o *RunnerDeclareOut) SetRunner(v RunnerIdentity) {
o.Runner = &v
}
func (o RunnerDeclareOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RunnerDeclareOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Capabilities) {
toSerialize["capabilities"] = o.Capabilities
}
if !IsNil(o.Runner) {
toSerialize["runner"] = o.Runner
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RunnerDeclareOut) UnmarshalJSON(data []byte) (err error) {
varRunnerDeclareOut := _RunnerDeclareOut{}
err = json.Unmarshal(data, &varRunnerDeclareOut)
if err != nil {
return err
}
*o = RunnerDeclareOut(varRunnerDeclareOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "capabilities")
delete(additionalProperties, "runner")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRunnerDeclareOut struct {
value *RunnerDeclareOut
isSet bool
}
func (v NullableRunnerDeclareOut) Get() *RunnerDeclareOut {
return v.value
}
func (v *NullableRunnerDeclareOut) Set(val *RunnerDeclareOut) {
v.value = val
v.isSet = true
}
func (v NullableRunnerDeclareOut) IsSet() bool {
return v.isSet
}
func (v *NullableRunnerDeclareOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRunnerDeclareOut(val *RunnerDeclareOut) *NullableRunnerDeclareOut {
return &NullableRunnerDeclareOut{value: val, isSet: true}
}
func (v NullableRunnerDeclareOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRunnerDeclareOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}