Files
sdk/model_runner_identity.go

383 lines
9.8 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 RunnerIdentity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RunnerIdentity{}
// RunnerIdentity struct for RunnerIdentity
type RunnerIdentity struct {
// Ephemeral means the runner takes ONE job and exits, so the forge must not expect it back.
Ephemeral *bool `json:"ephemeral,omitempty"`
// ID is the forge's own row id for this runner.
Id *int64 `json:"id,omitempty"`
// Labels are what a workflow's `runs-on:` selects this runner by.
Labels []string `json:"labels,omitempty"`
// Name is what a person calls this runner in the forge's UI.
Name *string `json:"name,omitempty"`
// Token is the secret that authenticates that handle. It is in cleartext here and nowhere else; the forge stores only a digest of it.
Token *string `json:"token,omitempty"`
// UUID is the handle the runner presents on every later op.
Uuid *string `json:"uuid,omitempty"`
// Version is the runner build the forge last heard from.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RunnerIdentity RunnerIdentity
// NewRunnerIdentity instantiates a new RunnerIdentity 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 NewRunnerIdentity() *RunnerIdentity {
this := RunnerIdentity{}
return &this
}
// NewRunnerIdentityWithDefaults instantiates a new RunnerIdentity 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 NewRunnerIdentityWithDefaults() *RunnerIdentity {
this := RunnerIdentity{}
return &this
}
// GetEphemeral returns the Ephemeral field value if set, zero value otherwise.
func (o *RunnerIdentity) GetEphemeral() bool {
if o == nil || IsNil(o.Ephemeral) {
var ret bool
return ret
}
return *o.Ephemeral
}
// GetEphemeralOk returns a tuple with the Ephemeral field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerIdentity) GetEphemeralOk() (*bool, bool) {
if o == nil || IsNil(o.Ephemeral) {
return nil, false
}
return o.Ephemeral, true
}
// HasEphemeral returns a boolean if a field has been set.
func (o *RunnerIdentity) HasEphemeral() bool {
if o != nil && !IsNil(o.Ephemeral) {
return true
}
return false
}
// SetEphemeral gets a reference to the given bool and assigns it to the Ephemeral field.
func (o *RunnerIdentity) SetEphemeral(v bool) {
o.Ephemeral = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *RunnerIdentity) 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 *RunnerIdentity) 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 *RunnerIdentity) 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 *RunnerIdentity) SetId(v int64) {
o.Id = &v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *RunnerIdentity) 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 *RunnerIdentity) 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 *RunnerIdentity) 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 *RunnerIdentity) SetLabels(v []string) {
o.Labels = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *RunnerIdentity) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerIdentity) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *RunnerIdentity) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *RunnerIdentity) SetName(v string) {
o.Name = &v
}
// GetToken returns the Token field value if set, zero value otherwise.
func (o *RunnerIdentity) GetToken() string {
if o == nil || IsNil(o.Token) {
var ret string
return ret
}
return *o.Token
}
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerIdentity) GetTokenOk() (*string, bool) {
if o == nil || IsNil(o.Token) {
return nil, false
}
return o.Token, true
}
// HasToken returns a boolean if a field has been set.
func (o *RunnerIdentity) HasToken() bool {
if o != nil && !IsNil(o.Token) {
return true
}
return false
}
// SetToken gets a reference to the given string and assigns it to the Token field.
func (o *RunnerIdentity) SetToken(v string) {
o.Token = &v
}
// GetUuid returns the Uuid field value if set, zero value otherwise.
func (o *RunnerIdentity) GetUuid() string {
if o == nil || IsNil(o.Uuid) {
var ret string
return ret
}
return *o.Uuid
}
// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RunnerIdentity) GetUuidOk() (*string, bool) {
if o == nil || IsNil(o.Uuid) {
return nil, false
}
return o.Uuid, true
}
// HasUuid returns a boolean if a field has been set.
func (o *RunnerIdentity) HasUuid() bool {
if o != nil && !IsNil(o.Uuid) {
return true
}
return false
}
// SetUuid gets a reference to the given string and assigns it to the Uuid field.
func (o *RunnerIdentity) SetUuid(v string) {
o.Uuid = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *RunnerIdentity) 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 *RunnerIdentity) 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 *RunnerIdentity) 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 *RunnerIdentity) SetVersion(v string) {
o.Version = &v
}
func (o RunnerIdentity) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RunnerIdentity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Ephemeral) {
toSerialize["ephemeral"] = o.Ephemeral
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Token) {
toSerialize["token"] = o.Token
}
if !IsNil(o.Uuid) {
toSerialize["uuid"] = o.Uuid
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RunnerIdentity) UnmarshalJSON(data []byte) (err error) {
varRunnerIdentity := _RunnerIdentity{}
err = json.Unmarshal(data, &varRunnerIdentity)
if err != nil {
return err
}
*o = RunnerIdentity(varRunnerIdentity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ephemeral")
delete(additionalProperties, "id")
delete(additionalProperties, "labels")
delete(additionalProperties, "name")
delete(additionalProperties, "token")
delete(additionalProperties, "uuid")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRunnerIdentity struct {
value *RunnerIdentity
isSet bool
}
func (v NullableRunnerIdentity) Get() *RunnerIdentity {
return v.value
}
func (v *NullableRunnerIdentity) Set(val *RunnerIdentity) {
v.value = val
v.isSet = true
}
func (v NullableRunnerIdentity) IsSet() bool {
return v.isSet
}
func (v *NullableRunnerIdentity) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRunnerIdentity(val *RunnerIdentity) *NullableRunnerIdentity {
return &NullableRunnerIdentity{value: val, isSet: true}
}
func (v NullableRunnerIdentity) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRunnerIdentity) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}