Files
sdk/model_git_runner_view.go

383 lines
10 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 GitRunnerView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitRunnerView{}
// GitRunnerView struct for GitRunnerView
type GitRunnerView struct {
// Ephemeral means the daemon takes ONE job and exits, so it is not expected back and its absence is not a fault.
Ephemeral *bool `json:"ephemeral,omitempty"`
// Labels are what the daemon last said it can do.
Labels []string `json:"labels,omitempty"`
// LastActive is when it was last EXECUTING a job, in unix seconds. It lags LastOnline on an idle daemon, which is how the two differ.
LastActive *int64 `json:"lastActive,omitempty"`
// LastOnline is when it last called at all, in unix seconds.
LastOnline *int64 `json:"lastOnline,omitempty"`
// Name is what the daemon called itself when it registered.
Name *string `json:"name,omitempty"`
// Pool is the declared capacity it entered.
Pool *string `json:"pool,omitempty"`
// Version is the runner build the daemon last reported.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitRunnerView GitRunnerView
// NewGitRunnerView instantiates a new GitRunnerView 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 NewGitRunnerView() *GitRunnerView {
this := GitRunnerView{}
return &this
}
// NewGitRunnerViewWithDefaults instantiates a new GitRunnerView 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 NewGitRunnerViewWithDefaults() *GitRunnerView {
this := GitRunnerView{}
return &this
}
// GetEphemeral returns the Ephemeral field value if set, zero value otherwise.
func (o *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) SetEphemeral(v bool) {
o.Ephemeral = &v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) SetLabels(v []string) {
o.Labels = v
}
// GetLastActive returns the LastActive field value if set, zero value otherwise.
func (o *GitRunnerView) GetLastActive() int64 {
if o == nil || IsNil(o.LastActive) {
var ret int64
return ret
}
return *o.LastActive
}
// GetLastActiveOk returns a tuple with the LastActive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitRunnerView) GetLastActiveOk() (*int64, bool) {
if o == nil || IsNil(o.LastActive) {
return nil, false
}
return o.LastActive, true
}
// HasLastActive returns a boolean if a field has been set.
func (o *GitRunnerView) HasLastActive() bool {
if o != nil && !IsNil(o.LastActive) {
return true
}
return false
}
// SetLastActive gets a reference to the given int64 and assigns it to the LastActive field.
func (o *GitRunnerView) SetLastActive(v int64) {
o.LastActive = &v
}
// GetLastOnline returns the LastOnline field value if set, zero value otherwise.
func (o *GitRunnerView) GetLastOnline() int64 {
if o == nil || IsNil(o.LastOnline) {
var ret int64
return ret
}
return *o.LastOnline
}
// GetLastOnlineOk returns a tuple with the LastOnline field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitRunnerView) GetLastOnlineOk() (*int64, bool) {
if o == nil || IsNil(o.LastOnline) {
return nil, false
}
return o.LastOnline, true
}
// HasLastOnline returns a boolean if a field has been set.
func (o *GitRunnerView) HasLastOnline() bool {
if o != nil && !IsNil(o.LastOnline) {
return true
}
return false
}
// SetLastOnline gets a reference to the given int64 and assigns it to the LastOnline field.
func (o *GitRunnerView) SetLastOnline(v int64) {
o.LastOnline = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) SetName(v string) {
o.Name = &v
}
// GetPool returns the Pool field value if set, zero value otherwise.
func (o *GitRunnerView) GetPool() string {
if o == nil || IsNil(o.Pool) {
var ret string
return ret
}
return *o.Pool
}
// GetPoolOk returns a tuple with the Pool field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitRunnerView) GetPoolOk() (*string, bool) {
if o == nil || IsNil(o.Pool) {
return nil, false
}
return o.Pool, true
}
// HasPool returns a boolean if a field has been set.
func (o *GitRunnerView) HasPool() bool {
if o != nil && !IsNil(o.Pool) {
return true
}
return false
}
// SetPool gets a reference to the given string and assigns it to the Pool field.
func (o *GitRunnerView) SetPool(v string) {
o.Pool = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) 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 *GitRunnerView) SetVersion(v string) {
o.Version = &v
}
func (o GitRunnerView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitRunnerView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Ephemeral) {
toSerialize["ephemeral"] = o.Ephemeral
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.LastActive) {
toSerialize["lastActive"] = o.LastActive
}
if !IsNil(o.LastOnline) {
toSerialize["lastOnline"] = o.LastOnline
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Pool) {
toSerialize["pool"] = o.Pool
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitRunnerView) UnmarshalJSON(data []byte) (err error) {
varGitRunnerView := _GitRunnerView{}
err = json.Unmarshal(data, &varGitRunnerView)
if err != nil {
return err
}
*o = GitRunnerView(varGitRunnerView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ephemeral")
delete(additionalProperties, "labels")
delete(additionalProperties, "lastActive")
delete(additionalProperties, "lastOnline")
delete(additionalProperties, "name")
delete(additionalProperties, "pool")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitRunnerView struct {
value *GitRunnerView
isSet bool
}
func (v NullableGitRunnerView) Get() *GitRunnerView {
return v.value
}
func (v *NullableGitRunnerView) Set(val *GitRunnerView) {
v.value = val
v.isSet = true
}
func (v NullableGitRunnerView) IsSet() bool {
return v.isSet
}
func (v *NullableGitRunnerView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitRunnerView(val *GitRunnerView) *NullableGitRunnerView {
return &NullableGitRunnerView{value: val, isSet: true}
}
func (v NullableGitRunnerView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitRunnerView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}