/*
Daytona

Daytona AI platform API Docs

API version: 1.0
Contact: support@daytona.com
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package apiclient

import (
	"encoding/json"
	"fmt"
)

// checks if the Runner type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Runner{}

// Runner struct for Runner
type Runner struct {
	// The ID of the runner
	Id string `json:"id"`
	// The domain of the runner
	Domain *string `json:"domain,omitempty"`
	// The API URL of the runner
	ApiUrl *string `json:"apiUrl,omitempty"`
	// The proxy URL of the runner
	ProxyUrl *string `json:"proxyUrl,omitempty"`
	// The CPU capacity of the runner
	Cpu float32 `json:"cpu"`
	// The memory capacity of the runner in GiB
	Memory float32 `json:"memory"`
	// The disk capacity of the runner in GiB
	Disk float32 `json:"disk"`
	// The GPU capacity of the runner
	Gpu *float32 `json:"gpu,omitempty"`
	// The type of GPU
	GpuType *string `json:"gpuType,omitempty"`
	// The class of the runner
	Class SandboxClass `json:"class"`
	// Current CPU usage percentage
	CurrentCpuUsagePercentage *float32 `json:"currentCpuUsagePercentage,omitempty"`
	// Current RAM usage percentage
	CurrentMemoryUsagePercentage *float32 `json:"currentMemoryUsagePercentage,omitempty"`
	// Current disk usage percentage
	CurrentDiskUsagePercentage *float32 `json:"currentDiskUsagePercentage,omitempty"`
	// Current allocated CPU
	CurrentAllocatedCpu *float32 `json:"currentAllocatedCpu,omitempty"`
	// Current allocated memory in GiB
	CurrentAllocatedMemoryGiB *float32 `json:"currentAllocatedMemoryGiB,omitempty"`
	// Current allocated disk in GiB
	CurrentAllocatedDiskGiB *float32 `json:"currentAllocatedDiskGiB,omitempty"`
	// Current snapshot count
	CurrentSnapshotCount *float32 `json:"currentSnapshotCount,omitempty"`
	// Current number of started sandboxes
	CurrentStartedSandboxes *float32 `json:"currentStartedSandboxes,omitempty"`
	// Runner availability score
	AvailabilityScore *float32 `json:"availabilityScore,omitempty"`
	// The region of the runner
	Region string `json:"region"`
	// The name of the runner
	Name string `json:"name"`
	// The state of the runner
	State RunnerState `json:"state"`
	// The last time the runner was checked
	LastChecked *string `json:"lastChecked,omitempty"`
	// Whether the runner is unschedulable
	Unschedulable bool `json:"unschedulable"`
	// The creation timestamp of the runner
	CreatedAt string `json:"createdAt"`
	// The last update timestamp of the runner
	UpdatedAt string `json:"updatedAt"`
	// The version of the runner (deprecated in favor of apiVersion)
	// Deprecated
	Version string `json:"version"`
	// The api version of the runner
	// Deprecated
	ApiVersion string `json:"apiVersion"`
	// The class of the runner
	RunnerClass RunnerClass `json:"runnerClass"`
	// The app version of the runner
	// Deprecated
	AppVersion *string `json:"appVersion,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _Runner Runner

// NewRunner instantiates a new Runner 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 NewRunner(id string, cpu float32, memory float32, disk float32, class SandboxClass, region string, name string, state RunnerState, unschedulable bool, createdAt string, updatedAt string, version string, apiVersion string, runnerClass RunnerClass) *Runner {
	this := Runner{}
	this.Id = id
	this.Cpu = cpu
	this.Memory = memory
	this.Disk = disk
	this.Class = class
	this.Region = region
	this.Name = name
	this.State = state
	this.Unschedulable = unschedulable
	this.CreatedAt = createdAt
	this.UpdatedAt = updatedAt
	this.Version = version
	this.ApiVersion = apiVersion
	this.RunnerClass = runnerClass
	return &this
}

// NewRunnerWithDefaults instantiates a new Runner 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 NewRunnerWithDefaults() *Runner {
	this := Runner{}
	return &this
}

// GetId returns the Id field value
func (o *Runner) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Runner) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

// SetId sets field value
func (o *Runner) SetId(v string) {
	o.Id = v
}

// GetDomain returns the Domain field value if set, zero value otherwise.
func (o *Runner) GetDomain() string {
	if o == nil || IsNil(o.Domain) {
		var ret string
		return ret
	}
	return *o.Domain
}

// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetDomainOk() (*string, bool) {
	if o == nil || IsNil(o.Domain) {
		return nil, false
	}
	return o.Domain, true
}

// HasDomain returns a boolean if a field has been set.
func (o *Runner) HasDomain() bool {
	if o != nil && !IsNil(o.Domain) {
		return true
	}

	return false
}

// SetDomain gets a reference to the given string and assigns it to the Domain field.
func (o *Runner) SetDomain(v string) {
	o.Domain = &v
}

// GetApiUrl returns the ApiUrl field value if set, zero value otherwise.
func (o *Runner) GetApiUrl() string {
	if o == nil || IsNil(o.ApiUrl) {
		var ret string
		return ret
	}
	return *o.ApiUrl
}

// GetApiUrlOk returns a tuple with the ApiUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetApiUrlOk() (*string, bool) {
	if o == nil || IsNil(o.ApiUrl) {
		return nil, false
	}
	return o.ApiUrl, true
}

// HasApiUrl returns a boolean if a field has been set.
func (o *Runner) HasApiUrl() bool {
	if o != nil && !IsNil(o.ApiUrl) {
		return true
	}

	return false
}

// SetApiUrl gets a reference to the given string and assigns it to the ApiUrl field.
func (o *Runner) SetApiUrl(v string) {
	o.ApiUrl = &v
}

// GetProxyUrl returns the ProxyUrl field value if set, zero value otherwise.
func (o *Runner) GetProxyUrl() string {
	if o == nil || IsNil(o.ProxyUrl) {
		var ret string
		return ret
	}
	return *o.ProxyUrl
}

// GetProxyUrlOk returns a tuple with the ProxyUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetProxyUrlOk() (*string, bool) {
	if o == nil || IsNil(o.ProxyUrl) {
		return nil, false
	}
	return o.ProxyUrl, true
}

// HasProxyUrl returns a boolean if a field has been set.
func (o *Runner) HasProxyUrl() bool {
	if o != nil && !IsNil(o.ProxyUrl) {
		return true
	}

	return false
}

// SetProxyUrl gets a reference to the given string and assigns it to the ProxyUrl field.
func (o *Runner) SetProxyUrl(v string) {
	o.ProxyUrl = &v
}

// GetCpu returns the Cpu field value
func (o *Runner) GetCpu() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Cpu
}

// GetCpuOk returns a tuple with the Cpu field value
// and a boolean to check if the value has been set.
func (o *Runner) GetCpuOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Cpu, true
}

// SetCpu sets field value
func (o *Runner) SetCpu(v float32) {
	o.Cpu = v
}

// GetMemory returns the Memory field value
func (o *Runner) GetMemory() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Memory
}

// GetMemoryOk returns a tuple with the Memory field value
// and a boolean to check if the value has been set.
func (o *Runner) GetMemoryOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Memory, true
}

// SetMemory sets field value
func (o *Runner) SetMemory(v float32) {
	o.Memory = v
}

// GetDisk returns the Disk field value
func (o *Runner) GetDisk() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Disk
}

// GetDiskOk returns a tuple with the Disk field value
// and a boolean to check if the value has been set.
func (o *Runner) GetDiskOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Disk, true
}

// SetDisk sets field value
func (o *Runner) SetDisk(v float32) {
	o.Disk = v
}

// GetGpu returns the Gpu field value if set, zero value otherwise.
func (o *Runner) GetGpu() float32 {
	if o == nil || IsNil(o.Gpu) {
		var ret float32
		return ret
	}
	return *o.Gpu
}

// GetGpuOk returns a tuple with the Gpu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetGpuOk() (*float32, bool) {
	if o == nil || IsNil(o.Gpu) {
		return nil, false
	}
	return o.Gpu, true
}

// HasGpu returns a boolean if a field has been set.
func (o *Runner) HasGpu() bool {
	if o != nil && !IsNil(o.Gpu) {
		return true
	}

	return false
}

// SetGpu gets a reference to the given float32 and assigns it to the Gpu field.
func (o *Runner) SetGpu(v float32) {
	o.Gpu = &v
}

// GetGpuType returns the GpuType field value if set, zero value otherwise.
func (o *Runner) GetGpuType() string {
	if o == nil || IsNil(o.GpuType) {
		var ret string
		return ret
	}
	return *o.GpuType
}

// GetGpuTypeOk returns a tuple with the GpuType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetGpuTypeOk() (*string, bool) {
	if o == nil || IsNil(o.GpuType) {
		return nil, false
	}
	return o.GpuType, true
}

// HasGpuType returns a boolean if a field has been set.
func (o *Runner) HasGpuType() bool {
	if o != nil && !IsNil(o.GpuType) {
		return true
	}

	return false
}

// SetGpuType gets a reference to the given string and assigns it to the GpuType field.
func (o *Runner) SetGpuType(v string) {
	o.GpuType = &v
}

// GetClass returns the Class field value
func (o *Runner) GetClass() SandboxClass {
	if o == nil {
		var ret SandboxClass
		return ret
	}

	return o.Class
}

// GetClassOk returns a tuple with the Class field value
// and a boolean to check if the value has been set.
func (o *Runner) GetClassOk() (*SandboxClass, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Class, true
}

// SetClass sets field value
func (o *Runner) SetClass(v SandboxClass) {
	o.Class = v
}

// GetCurrentCpuUsagePercentage returns the CurrentCpuUsagePercentage field value if set, zero value otherwise.
func (o *Runner) GetCurrentCpuUsagePercentage() float32 {
	if o == nil || IsNil(o.CurrentCpuUsagePercentage) {
		var ret float32
		return ret
	}
	return *o.CurrentCpuUsagePercentage
}

// GetCurrentCpuUsagePercentageOk returns a tuple with the CurrentCpuUsagePercentage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentCpuUsagePercentageOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentCpuUsagePercentage) {
		return nil, false
	}
	return o.CurrentCpuUsagePercentage, true
}

// HasCurrentCpuUsagePercentage returns a boolean if a field has been set.
func (o *Runner) HasCurrentCpuUsagePercentage() bool {
	if o != nil && !IsNil(o.CurrentCpuUsagePercentage) {
		return true
	}

	return false
}

// SetCurrentCpuUsagePercentage gets a reference to the given float32 and assigns it to the CurrentCpuUsagePercentage field.
func (o *Runner) SetCurrentCpuUsagePercentage(v float32) {
	o.CurrentCpuUsagePercentage = &v
}

// GetCurrentMemoryUsagePercentage returns the CurrentMemoryUsagePercentage field value if set, zero value otherwise.
func (o *Runner) GetCurrentMemoryUsagePercentage() float32 {
	if o == nil || IsNil(o.CurrentMemoryUsagePercentage) {
		var ret float32
		return ret
	}
	return *o.CurrentMemoryUsagePercentage
}

// GetCurrentMemoryUsagePercentageOk returns a tuple with the CurrentMemoryUsagePercentage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentMemoryUsagePercentageOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentMemoryUsagePercentage) {
		return nil, false
	}
	return o.CurrentMemoryUsagePercentage, true
}

// HasCurrentMemoryUsagePercentage returns a boolean if a field has been set.
func (o *Runner) HasCurrentMemoryUsagePercentage() bool {
	if o != nil && !IsNil(o.CurrentMemoryUsagePercentage) {
		return true
	}

	return false
}

// SetCurrentMemoryUsagePercentage gets a reference to the given float32 and assigns it to the CurrentMemoryUsagePercentage field.
func (o *Runner) SetCurrentMemoryUsagePercentage(v float32) {
	o.CurrentMemoryUsagePercentage = &v
}

// GetCurrentDiskUsagePercentage returns the CurrentDiskUsagePercentage field value if set, zero value otherwise.
func (o *Runner) GetCurrentDiskUsagePercentage() float32 {
	if o == nil || IsNil(o.CurrentDiskUsagePercentage) {
		var ret float32
		return ret
	}
	return *o.CurrentDiskUsagePercentage
}

// GetCurrentDiskUsagePercentageOk returns a tuple with the CurrentDiskUsagePercentage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentDiskUsagePercentageOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentDiskUsagePercentage) {
		return nil, false
	}
	return o.CurrentDiskUsagePercentage, true
}

// HasCurrentDiskUsagePercentage returns a boolean if a field has been set.
func (o *Runner) HasCurrentDiskUsagePercentage() bool {
	if o != nil && !IsNil(o.CurrentDiskUsagePercentage) {
		return true
	}

	return false
}

// SetCurrentDiskUsagePercentage gets a reference to the given float32 and assigns it to the CurrentDiskUsagePercentage field.
func (o *Runner) SetCurrentDiskUsagePercentage(v float32) {
	o.CurrentDiskUsagePercentage = &v
}

// GetCurrentAllocatedCpu returns the CurrentAllocatedCpu field value if set, zero value otherwise.
func (o *Runner) GetCurrentAllocatedCpu() float32 {
	if o == nil || IsNil(o.CurrentAllocatedCpu) {
		var ret float32
		return ret
	}
	return *o.CurrentAllocatedCpu
}

// GetCurrentAllocatedCpuOk returns a tuple with the CurrentAllocatedCpu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentAllocatedCpuOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentAllocatedCpu) {
		return nil, false
	}
	return o.CurrentAllocatedCpu, true
}

// HasCurrentAllocatedCpu returns a boolean if a field has been set.
func (o *Runner) HasCurrentAllocatedCpu() bool {
	if o != nil && !IsNil(o.CurrentAllocatedCpu) {
		return true
	}

	return false
}

// SetCurrentAllocatedCpu gets a reference to the given float32 and assigns it to the CurrentAllocatedCpu field.
func (o *Runner) SetCurrentAllocatedCpu(v float32) {
	o.CurrentAllocatedCpu = &v
}

// GetCurrentAllocatedMemoryGiB returns the CurrentAllocatedMemoryGiB field value if set, zero value otherwise.
func (o *Runner) GetCurrentAllocatedMemoryGiB() float32 {
	if o == nil || IsNil(o.CurrentAllocatedMemoryGiB) {
		var ret float32
		return ret
	}
	return *o.CurrentAllocatedMemoryGiB
}

// GetCurrentAllocatedMemoryGiBOk returns a tuple with the CurrentAllocatedMemoryGiB field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentAllocatedMemoryGiBOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentAllocatedMemoryGiB) {
		return nil, false
	}
	return o.CurrentAllocatedMemoryGiB, true
}

// HasCurrentAllocatedMemoryGiB returns a boolean if a field has been set.
func (o *Runner) HasCurrentAllocatedMemoryGiB() bool {
	if o != nil && !IsNil(o.CurrentAllocatedMemoryGiB) {
		return true
	}

	return false
}

// SetCurrentAllocatedMemoryGiB gets a reference to the given float32 and assigns it to the CurrentAllocatedMemoryGiB field.
func (o *Runner) SetCurrentAllocatedMemoryGiB(v float32) {
	o.CurrentAllocatedMemoryGiB = &v
}

// GetCurrentAllocatedDiskGiB returns the CurrentAllocatedDiskGiB field value if set, zero value otherwise.
func (o *Runner) GetCurrentAllocatedDiskGiB() float32 {
	if o == nil || IsNil(o.CurrentAllocatedDiskGiB) {
		var ret float32
		return ret
	}
	return *o.CurrentAllocatedDiskGiB
}

// GetCurrentAllocatedDiskGiBOk returns a tuple with the CurrentAllocatedDiskGiB field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentAllocatedDiskGiBOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentAllocatedDiskGiB) {
		return nil, false
	}
	return o.CurrentAllocatedDiskGiB, true
}

// HasCurrentAllocatedDiskGiB returns a boolean if a field has been set.
func (o *Runner) HasCurrentAllocatedDiskGiB() bool {
	if o != nil && !IsNil(o.CurrentAllocatedDiskGiB) {
		return true
	}

	return false
}

// SetCurrentAllocatedDiskGiB gets a reference to the given float32 and assigns it to the CurrentAllocatedDiskGiB field.
func (o *Runner) SetCurrentAllocatedDiskGiB(v float32) {
	o.CurrentAllocatedDiskGiB = &v
}

// GetCurrentSnapshotCount returns the CurrentSnapshotCount field value if set, zero value otherwise.
func (o *Runner) GetCurrentSnapshotCount() float32 {
	if o == nil || IsNil(o.CurrentSnapshotCount) {
		var ret float32
		return ret
	}
	return *o.CurrentSnapshotCount
}

// GetCurrentSnapshotCountOk returns a tuple with the CurrentSnapshotCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentSnapshotCountOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentSnapshotCount) {
		return nil, false
	}
	return o.CurrentSnapshotCount, true
}

// HasCurrentSnapshotCount returns a boolean if a field has been set.
func (o *Runner) HasCurrentSnapshotCount() bool {
	if o != nil && !IsNil(o.CurrentSnapshotCount) {
		return true
	}

	return false
}

// SetCurrentSnapshotCount gets a reference to the given float32 and assigns it to the CurrentSnapshotCount field.
func (o *Runner) SetCurrentSnapshotCount(v float32) {
	o.CurrentSnapshotCount = &v
}

// GetCurrentStartedSandboxes returns the CurrentStartedSandboxes field value if set, zero value otherwise.
func (o *Runner) GetCurrentStartedSandboxes() float32 {
	if o == nil || IsNil(o.CurrentStartedSandboxes) {
		var ret float32
		return ret
	}
	return *o.CurrentStartedSandboxes
}

// GetCurrentStartedSandboxesOk returns a tuple with the CurrentStartedSandboxes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetCurrentStartedSandboxesOk() (*float32, bool) {
	if o == nil || IsNil(o.CurrentStartedSandboxes) {
		return nil, false
	}
	return o.CurrentStartedSandboxes, true
}

// HasCurrentStartedSandboxes returns a boolean if a field has been set.
func (o *Runner) HasCurrentStartedSandboxes() bool {
	if o != nil && !IsNil(o.CurrentStartedSandboxes) {
		return true
	}

	return false
}

// SetCurrentStartedSandboxes gets a reference to the given float32 and assigns it to the CurrentStartedSandboxes field.
func (o *Runner) SetCurrentStartedSandboxes(v float32) {
	o.CurrentStartedSandboxes = &v
}

// GetAvailabilityScore returns the AvailabilityScore field value if set, zero value otherwise.
func (o *Runner) GetAvailabilityScore() float32 {
	if o == nil || IsNil(o.AvailabilityScore) {
		var ret float32
		return ret
	}
	return *o.AvailabilityScore
}

// GetAvailabilityScoreOk returns a tuple with the AvailabilityScore field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetAvailabilityScoreOk() (*float32, bool) {
	if o == nil || IsNil(o.AvailabilityScore) {
		return nil, false
	}
	return o.AvailabilityScore, true
}

// HasAvailabilityScore returns a boolean if a field has been set.
func (o *Runner) HasAvailabilityScore() bool {
	if o != nil && !IsNil(o.AvailabilityScore) {
		return true
	}

	return false
}

// SetAvailabilityScore gets a reference to the given float32 and assigns it to the AvailabilityScore field.
func (o *Runner) SetAvailabilityScore(v float32) {
	o.AvailabilityScore = &v
}

// GetRegion returns the Region field value
func (o *Runner) GetRegion() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Region
}

// GetRegionOk returns a tuple with the Region field value
// and a boolean to check if the value has been set.
func (o *Runner) GetRegionOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Region, true
}

// SetRegion sets field value
func (o *Runner) SetRegion(v string) {
	o.Region = v
}

// GetName returns the Name field value
func (o *Runner) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Runner) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

// SetName sets field value
func (o *Runner) SetName(v string) {
	o.Name = v
}

// GetState returns the State field value
func (o *Runner) GetState() RunnerState {
	if o == nil {
		var ret RunnerState
		return ret
	}

	return o.State
}

// GetStateOk returns a tuple with the State field value
// and a boolean to check if the value has been set.
func (o *Runner) GetStateOk() (*RunnerState, bool) {
	if o == nil {
		return nil, false
	}
	return &o.State, true
}

// SetState sets field value
func (o *Runner) SetState(v RunnerState) {
	o.State = v
}

// GetLastChecked returns the LastChecked field value if set, zero value otherwise.
func (o *Runner) GetLastChecked() string {
	if o == nil || IsNil(o.LastChecked) {
		var ret string
		return ret
	}
	return *o.LastChecked
}

// GetLastCheckedOk returns a tuple with the LastChecked field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Runner) GetLastCheckedOk() (*string, bool) {
	if o == nil || IsNil(o.LastChecked) {
		return nil, false
	}
	return o.LastChecked, true
}

// HasLastChecked returns a boolean if a field has been set.
func (o *Runner) HasLastChecked() bool {
	if o != nil && !IsNil(o.LastChecked) {
		return true
	}

	return false
}

// SetLastChecked gets a reference to the given string and assigns it to the LastChecked field.
func (o *Runner) SetLastChecked(v string) {
	o.LastChecked = &v
}

// GetUnschedulable returns the Unschedulable field value
func (o *Runner) GetUnschedulable() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.Unschedulable
}

// GetUnschedulableOk returns a tuple with the Unschedulable field value
// and a boolean to check if the value has been set.
func (o *Runner) GetUnschedulableOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Unschedulable, true
}

// SetUnschedulable sets field value
func (o *Runner) SetUnschedulable(v bool) {
	o.Unschedulable = v
}

// GetCreatedAt returns the CreatedAt field value
func (o *Runner) GetCreatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CreatedAt
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *Runner) GetCreatedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.CreatedAt, true
}

// SetCreatedAt sets field value
func (o *Runner) SetCreatedAt(v string) {
	o.CreatedAt = v
}

// GetUpdatedAt returns the UpdatedAt field value
func (o *Runner) GetUpdatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.UpdatedAt
}

// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *Runner) GetUpdatedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.UpdatedAt, true
}

// SetUpdatedAt sets field value
func (o *Runner) SetUpdatedAt(v string) {
	o.UpdatedAt = v
}

// GetVersion returns the Version field value
// Deprecated
func (o *Runner) GetVersion() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Version
}

// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
// Deprecated
func (o *Runner) GetVersionOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Version, true
}

// SetVersion sets field value
// Deprecated
func (o *Runner) SetVersion(v string) {
	o.Version = v
}

// GetApiVersion returns the ApiVersion field value
// Deprecated
func (o *Runner) GetApiVersion() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ApiVersion
}

// GetApiVersionOk returns a tuple with the ApiVersion field value
// and a boolean to check if the value has been set.
// Deprecated
func (o *Runner) GetApiVersionOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ApiVersion, true
}

// SetApiVersion sets field value
// Deprecated
func (o *Runner) SetApiVersion(v string) {
	o.ApiVersion = v
}

// GetRunnerClass returns the RunnerClass field value
func (o *Runner) GetRunnerClass() RunnerClass {
	if o == nil {
		var ret RunnerClass
		return ret
	}

	return o.RunnerClass
}

// GetRunnerClassOk returns a tuple with the RunnerClass field value
// and a boolean to check if the value has been set.
func (o *Runner) GetRunnerClassOk() (*RunnerClass, bool) {
	if o == nil {
		return nil, false
	}
	return &o.RunnerClass, true
}

// SetRunnerClass sets field value
func (o *Runner) SetRunnerClass(v RunnerClass) {
	o.RunnerClass = v
}

// GetAppVersion returns the AppVersion field value if set, zero value otherwise.
// Deprecated
func (o *Runner) GetAppVersion() string {
	if o == nil || IsNil(o.AppVersion) {
		var ret string
		return ret
	}
	return *o.AppVersion
}

// GetAppVersionOk returns a tuple with the AppVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *Runner) GetAppVersionOk() (*string, bool) {
	if o == nil || IsNil(o.AppVersion) {
		return nil, false
	}
	return o.AppVersion, true
}

// HasAppVersion returns a boolean if a field has been set.
func (o *Runner) HasAppVersion() bool {
	if o != nil && !IsNil(o.AppVersion) {
		return true
	}

	return false
}

// SetAppVersion gets a reference to the given string and assigns it to the AppVersion field.
// Deprecated
func (o *Runner) SetAppVersion(v string) {
	o.AppVersion = &v
}

func (o Runner) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o Runner) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	if !IsNil(o.Domain) {
		toSerialize["domain"] = o.Domain
	}
	if !IsNil(o.ApiUrl) {
		toSerialize["apiUrl"] = o.ApiUrl
	}
	if !IsNil(o.ProxyUrl) {
		toSerialize["proxyUrl"] = o.ProxyUrl
	}
	toSerialize["cpu"] = o.Cpu
	toSerialize["memory"] = o.Memory
	toSerialize["disk"] = o.Disk
	if !IsNil(o.Gpu) {
		toSerialize["gpu"] = o.Gpu
	}
	if !IsNil(o.GpuType) {
		toSerialize["gpuType"] = o.GpuType
	}
	toSerialize["class"] = o.Class
	if !IsNil(o.CurrentCpuUsagePercentage) {
		toSerialize["currentCpuUsagePercentage"] = o.CurrentCpuUsagePercentage
	}
	if !IsNil(o.CurrentMemoryUsagePercentage) {
		toSerialize["currentMemoryUsagePercentage"] = o.CurrentMemoryUsagePercentage
	}
	if !IsNil(o.CurrentDiskUsagePercentage) {
		toSerialize["currentDiskUsagePercentage"] = o.CurrentDiskUsagePercentage
	}
	if !IsNil(o.CurrentAllocatedCpu) {
		toSerialize["currentAllocatedCpu"] = o.CurrentAllocatedCpu
	}
	if !IsNil(o.CurrentAllocatedMemoryGiB) {
		toSerialize["currentAllocatedMemoryGiB"] = o.CurrentAllocatedMemoryGiB
	}
	if !IsNil(o.CurrentAllocatedDiskGiB) {
		toSerialize["currentAllocatedDiskGiB"] = o.CurrentAllocatedDiskGiB
	}
	if !IsNil(o.CurrentSnapshotCount) {
		toSerialize["currentSnapshotCount"] = o.CurrentSnapshotCount
	}
	if !IsNil(o.CurrentStartedSandboxes) {
		toSerialize["currentStartedSandboxes"] = o.CurrentStartedSandboxes
	}
	if !IsNil(o.AvailabilityScore) {
		toSerialize["availabilityScore"] = o.AvailabilityScore
	}
	toSerialize["region"] = o.Region
	toSerialize["name"] = o.Name
	toSerialize["state"] = o.State
	if !IsNil(o.LastChecked) {
		toSerialize["lastChecked"] = o.LastChecked
	}
	toSerialize["unschedulable"] = o.Unschedulable
	toSerialize["createdAt"] = o.CreatedAt
	toSerialize["updatedAt"] = o.UpdatedAt
	toSerialize["version"] = o.Version
	toSerialize["apiVersion"] = o.ApiVersion
	toSerialize["runnerClass"] = o.RunnerClass
	if !IsNil(o.AppVersion) {
		toSerialize["appVersion"] = o.AppVersion
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *Runner) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"id",
		"cpu",
		"memory",
		"disk",
		"class",
		"region",
		"name",
		"state",
		"unschedulable",
		"createdAt",
		"updatedAt",
		"version",
		"apiVersion",
		"runnerClass",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varRunner := _Runner{}

	err = json.Unmarshal(data, &varRunner)

	if err != nil {
		return err
	}

	*o = Runner(varRunner)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "domain")
		delete(additionalProperties, "apiUrl")
		delete(additionalProperties, "proxyUrl")
		delete(additionalProperties, "cpu")
		delete(additionalProperties, "memory")
		delete(additionalProperties, "disk")
		delete(additionalProperties, "gpu")
		delete(additionalProperties, "gpuType")
		delete(additionalProperties, "class")
		delete(additionalProperties, "currentCpuUsagePercentage")
		delete(additionalProperties, "currentMemoryUsagePercentage")
		delete(additionalProperties, "currentDiskUsagePercentage")
		delete(additionalProperties, "currentAllocatedCpu")
		delete(additionalProperties, "currentAllocatedMemoryGiB")
		delete(additionalProperties, "currentAllocatedDiskGiB")
		delete(additionalProperties, "currentSnapshotCount")
		delete(additionalProperties, "currentStartedSandboxes")
		delete(additionalProperties, "availabilityScore")
		delete(additionalProperties, "region")
		delete(additionalProperties, "name")
		delete(additionalProperties, "state")
		delete(additionalProperties, "lastChecked")
		delete(additionalProperties, "unschedulable")
		delete(additionalProperties, "createdAt")
		delete(additionalProperties, "updatedAt")
		delete(additionalProperties, "version")
		delete(additionalProperties, "apiVersion")
		delete(additionalProperties, "runnerClass")
		delete(additionalProperties, "appVersion")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableRunner struct {
	value *Runner
	isSet bool
}

func (v NullableRunner) Get() *Runner {
	return v.value
}

func (v *NullableRunner) Set(val *Runner) {
	v.value = val
	v.isSet = true
}

func (v NullableRunner) IsSet() bool {
	return v.isSet
}

func (v *NullableRunner) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableRunner(val *Runner) *NullableRunner {
	return &NullableRunner{value: val, isSet: true}
}

func (v NullableRunner) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableRunner) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


