Files
sdk/model_runner_declare_in.go

231 lines
6.1 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 RunnerDeclareIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RunnerDeclareIn{}
// RunnerDeclareIn struct for RunnerDeclareIn
type RunnerDeclareIn struct {
// Capabilities are the optional protocol behaviours this runner understands, e.g. \"cancelling\".
Capabilities []string `json:"capabilities,omitempty"`
// Labels replace what the forge holds, so a relabelled runner follows its configuration without re-registering.
Labels []string `json:"labels,omitempty"`
// Version is the runner build now running.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RunnerDeclareIn RunnerDeclareIn
// NewRunnerDeclareIn instantiates a new RunnerDeclareIn 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 NewRunnerDeclareIn() *RunnerDeclareIn {
this := RunnerDeclareIn{}
return &this
}
// NewRunnerDeclareInWithDefaults instantiates a new RunnerDeclareIn 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 NewRunnerDeclareInWithDefaults() *RunnerDeclareIn {
this := RunnerDeclareIn{}
return &this
}
// GetCapabilities returns the Capabilities field value if set, zero value otherwise.
func (o *RunnerDeclareIn) 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 *RunnerDeclareIn) 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 *RunnerDeclareIn) 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 *RunnerDeclareIn) SetCapabilities(v []string) {
o.Capabilities = v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *RunnerDeclareIn) GetLabels() []string {
if o == nil || IsNil(o.Labels) {
var ret []string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerDeclareIn) GetLabelsOk() ([]string, bool) {
if o == nil || IsNil(o.Labels) {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *RunnerDeclareIn) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
func (o *RunnerDeclareIn) SetLabels(v []string) {
o.Labels = v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *RunnerDeclareIn) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerDeclareIn) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *RunnerDeclareIn) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *RunnerDeclareIn) SetVersion(v string) {
o.Version = &v
}
func (o RunnerDeclareIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RunnerDeclareIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Capabilities) {
toSerialize["capabilities"] = o.Capabilities
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RunnerDeclareIn) UnmarshalJSON(data []byte) (err error) {
varRunnerDeclareIn := _RunnerDeclareIn{}
err = json.Unmarshal(data, &varRunnerDeclareIn)
if err != nil {
return err
}
*o = RunnerDeclareIn(varRunnerDeclareIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "capabilities")
delete(additionalProperties, "labels")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRunnerDeclareIn struct {
value *RunnerDeclareIn
isSet bool
}
func (v NullableRunnerDeclareIn) Get() *RunnerDeclareIn {
return v.value
}
func (v *NullableRunnerDeclareIn) Set(val *RunnerDeclareIn) {
v.value = val
v.isSet = true
}
func (v NullableRunnerDeclareIn) IsSet() bool {
return v.isSet
}
func (v *NullableRunnerDeclareIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRunnerDeclareIn(val *RunnerDeclareIn) *NullableRunnerDeclareIn {
return &NullableRunnerDeclareIn{value: val, isSet: true}
}
func (v NullableRunnerDeclareIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRunnerDeclareIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}