Files
sdk/model_compute_gpu_job.go

611 lines
17 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 ComputeGpuJob type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeGpuJob{}
// ComputeGpuJob struct for ComputeGpuJob
type ComputeGpuJob struct {
// Attempt is which try this is, counting from 1. Above 1 means the job was retried after a failed or abandoned run.
Attempt *int64 `json:"attempt,omitempty"`
// CloseTime is when the job reached a terminal state, RFC 3339. Empty means it is still live — queued, running or stalled.
CloseTime *string `json:"closeTime,omitempty"`
// FailureCause is the engine's reason the job failed. Empty unless it did.
FailureCause *string `json:"failureCause,omitempty"`
// GPU is the node this job is aimed AT — the lane \"gpu:<node>\" it was submitted on. Empty means the shared any-GPU lane: it was not aimed anywhere and the first free worker takes it.
Gpu *string `json:"gpu,omitempty"`
// ID is the job's id, and the id the cancel route takes. The dispatcher sets it equal to the render's prompt id, so it is the same value the studio knows the job by.
Id *string `json:"id,omitempty"`
// Label is the cheap human name for the render — the output filename prefix lifted out of the submitted graph. Empty when the graph carried none. The graph itself is never in this list; the tasks describe endpoint serves it.
Label *string `json:"label,omitempty"`
// LastHeartbeat is the claiming worker's most recent beat on this job, RFC 3339 — the evidence a long render is still alive rather than wedged.
LastHeartbeat *string `json:"lastHeartbeat,omitempty"`
// LeaseExpiry is when the worker's claim lapses, RFC 3339. Past it with the job still STARTED, the claimant is presumed dead and Status reads \"stalled\".
LeaseExpiry *string `json:"leaseExpiry,omitempty"`
// RunID identifies this execution of the job. It equals ID for a job the dispatcher submitted, which is why a cancel that omits it still works.
RunId *string `json:"runId,omitempty"`
// StartTime is when a worker began executing the job, RFC 3339. Empty while it is still queued.
StartTime *string `json:"startTime,omitempty"`
// Status is the job's lifecycle state: queued, running, completed, failed or canceled — plus \"stalled\", which is this surface's own reading of a job that is STARTED whose worker died: its lease has elapsed and no reaper has taken it back yet. Without it such a job reads \"running\" forever. An engine state this surface does not recognize passes through lower-cased rather than being coerced into one of these.
Status *string `json:"status,omitempty"`
// Type is the work being done (\"studio.render\") — what the claiming worker has to be able to execute.
Type *string `json:"type,omitempty"`
// Worker is the node that actually CLAIMED the job, which is not always the one it was aimed at: a shared-lane job has no GPU but does have a Worker once picked up. Empty while the job is still waiting.
Worker *string `json:"worker,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeGpuJob ComputeGpuJob
// NewComputeGpuJob instantiates a new ComputeGpuJob 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 NewComputeGpuJob() *ComputeGpuJob {
this := ComputeGpuJob{}
return &this
}
// NewComputeGpuJobWithDefaults instantiates a new ComputeGpuJob 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 NewComputeGpuJobWithDefaults() *ComputeGpuJob {
this := ComputeGpuJob{}
return &this
}
// GetAttempt returns the Attempt field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetAttempt() int64 {
if o == nil || IsNil(o.Attempt) {
var ret int64
return ret
}
return *o.Attempt
}
// GetAttemptOk returns a tuple with the Attempt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetAttemptOk() (*int64, bool) {
if o == nil || IsNil(o.Attempt) {
return nil, false
}
return o.Attempt, true
}
// HasAttempt returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasAttempt() bool {
if o != nil && !IsNil(o.Attempt) {
return true
}
return false
}
// SetAttempt gets a reference to the given int64 and assigns it to the Attempt field.
func (o *ComputeGpuJob) SetAttempt(v int64) {
o.Attempt = &v
}
// GetCloseTime returns the CloseTime field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetCloseTime() string {
if o == nil || IsNil(o.CloseTime) {
var ret string
return ret
}
return *o.CloseTime
}
// GetCloseTimeOk returns a tuple with the CloseTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetCloseTimeOk() (*string, bool) {
if o == nil || IsNil(o.CloseTime) {
return nil, false
}
return o.CloseTime, true
}
// HasCloseTime returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasCloseTime() bool {
if o != nil && !IsNil(o.CloseTime) {
return true
}
return false
}
// SetCloseTime gets a reference to the given string and assigns it to the CloseTime field.
func (o *ComputeGpuJob) SetCloseTime(v string) {
o.CloseTime = &v
}
// GetFailureCause returns the FailureCause field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetFailureCause() string {
if o == nil || IsNil(o.FailureCause) {
var ret string
return ret
}
return *o.FailureCause
}
// GetFailureCauseOk returns a tuple with the FailureCause field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetFailureCauseOk() (*string, bool) {
if o == nil || IsNil(o.FailureCause) {
return nil, false
}
return o.FailureCause, true
}
// HasFailureCause returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasFailureCause() bool {
if o != nil && !IsNil(o.FailureCause) {
return true
}
return false
}
// SetFailureCause gets a reference to the given string and assigns it to the FailureCause field.
func (o *ComputeGpuJob) SetFailureCause(v string) {
o.FailureCause = &v
}
// GetGpu returns the Gpu field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetGpu() string {
if o == nil || IsNil(o.Gpu) {
var ret string
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 *ComputeGpuJob) GetGpuOk() (*string, 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 *ComputeGpuJob) HasGpu() bool {
if o != nil && !IsNil(o.Gpu) {
return true
}
return false
}
// SetGpu gets a reference to the given string and assigns it to the Gpu field.
func (o *ComputeGpuJob) SetGpu(v string) {
o.Gpu = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
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 *ComputeGpuJob) GetIdOk() (*string, 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 *ComputeGpuJob) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *ComputeGpuJob) SetId(v string) {
o.Id = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetLabel() string {
if o == nil || IsNil(o.Label) {
var ret string
return ret
}
return *o.Label
}
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetLabelOk() (*string, bool) {
if o == nil || IsNil(o.Label) {
return nil, false
}
return o.Label, true
}
// HasLabel returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasLabel() bool {
if o != nil && !IsNil(o.Label) {
return true
}
return false
}
// SetLabel gets a reference to the given string and assigns it to the Label field.
func (o *ComputeGpuJob) SetLabel(v string) {
o.Label = &v
}
// GetLastHeartbeat returns the LastHeartbeat field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetLastHeartbeat() string {
if o == nil || IsNil(o.LastHeartbeat) {
var ret string
return ret
}
return *o.LastHeartbeat
}
// GetLastHeartbeatOk returns a tuple with the LastHeartbeat field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetLastHeartbeatOk() (*string, bool) {
if o == nil || IsNil(o.LastHeartbeat) {
return nil, false
}
return o.LastHeartbeat, true
}
// HasLastHeartbeat returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasLastHeartbeat() bool {
if o != nil && !IsNil(o.LastHeartbeat) {
return true
}
return false
}
// SetLastHeartbeat gets a reference to the given string and assigns it to the LastHeartbeat field.
func (o *ComputeGpuJob) SetLastHeartbeat(v string) {
o.LastHeartbeat = &v
}
// GetLeaseExpiry returns the LeaseExpiry field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetLeaseExpiry() string {
if o == nil || IsNil(o.LeaseExpiry) {
var ret string
return ret
}
return *o.LeaseExpiry
}
// GetLeaseExpiryOk returns a tuple with the LeaseExpiry field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetLeaseExpiryOk() (*string, bool) {
if o == nil || IsNil(o.LeaseExpiry) {
return nil, false
}
return o.LeaseExpiry, true
}
// HasLeaseExpiry returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasLeaseExpiry() bool {
if o != nil && !IsNil(o.LeaseExpiry) {
return true
}
return false
}
// SetLeaseExpiry gets a reference to the given string and assigns it to the LeaseExpiry field.
func (o *ComputeGpuJob) SetLeaseExpiry(v string) {
o.LeaseExpiry = &v
}
// GetRunId returns the RunId field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetRunId() string {
if o == nil || IsNil(o.RunId) {
var ret string
return ret
}
return *o.RunId
}
// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetRunIdOk() (*string, bool) {
if o == nil || IsNil(o.RunId) {
return nil, false
}
return o.RunId, true
}
// HasRunId returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasRunId() bool {
if o != nil && !IsNil(o.RunId) {
return true
}
return false
}
// SetRunId gets a reference to the given string and assigns it to the RunId field.
func (o *ComputeGpuJob) SetRunId(v string) {
o.RunId = &v
}
// GetStartTime returns the StartTime field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetStartTime() string {
if o == nil || IsNil(o.StartTime) {
var ret string
return ret
}
return *o.StartTime
}
// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetStartTimeOk() (*string, bool) {
if o == nil || IsNil(o.StartTime) {
return nil, false
}
return o.StartTime, true
}
// HasStartTime returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasStartTime() bool {
if o != nil && !IsNil(o.StartTime) {
return true
}
return false
}
// SetStartTime gets a reference to the given string and assigns it to the StartTime field.
func (o *ComputeGpuJob) SetStartTime(v string) {
o.StartTime = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *ComputeGpuJob) SetStatus(v string) {
o.Status = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *ComputeGpuJob) SetType(v string) {
o.Type = &v
}
// GetWorker returns the Worker field value if set, zero value otherwise.
func (o *ComputeGpuJob) GetWorker() string {
if o == nil || IsNil(o.Worker) {
var ret string
return ret
}
return *o.Worker
}
// GetWorkerOk returns a tuple with the Worker field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeGpuJob) GetWorkerOk() (*string, bool) {
if o == nil || IsNil(o.Worker) {
return nil, false
}
return o.Worker, true
}
// HasWorker returns a boolean if a field has been set.
func (o *ComputeGpuJob) HasWorker() bool {
if o != nil && !IsNil(o.Worker) {
return true
}
return false
}
// SetWorker gets a reference to the given string and assigns it to the Worker field.
func (o *ComputeGpuJob) SetWorker(v string) {
o.Worker = &v
}
func (o ComputeGpuJob) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeGpuJob) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Attempt) {
toSerialize["attempt"] = o.Attempt
}
if !IsNil(o.CloseTime) {
toSerialize["closeTime"] = o.CloseTime
}
if !IsNil(o.FailureCause) {
toSerialize["failureCause"] = o.FailureCause
}
if !IsNil(o.Gpu) {
toSerialize["gpu"] = o.Gpu
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
if !IsNil(o.LastHeartbeat) {
toSerialize["lastHeartbeat"] = o.LastHeartbeat
}
if !IsNil(o.LeaseExpiry) {
toSerialize["leaseExpiry"] = o.LeaseExpiry
}
if !IsNil(o.RunId) {
toSerialize["runId"] = o.RunId
}
if !IsNil(o.StartTime) {
toSerialize["startTime"] = o.StartTime
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Worker) {
toSerialize["worker"] = o.Worker
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeGpuJob) UnmarshalJSON(data []byte) (err error) {
varComputeGpuJob := _ComputeGpuJob{}
err = json.Unmarshal(data, &varComputeGpuJob)
if err != nil {
return err
}
*o = ComputeGpuJob(varComputeGpuJob)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "attempt")
delete(additionalProperties, "closeTime")
delete(additionalProperties, "failureCause")
delete(additionalProperties, "gpu")
delete(additionalProperties, "id")
delete(additionalProperties, "label")
delete(additionalProperties, "lastHeartbeat")
delete(additionalProperties, "leaseExpiry")
delete(additionalProperties, "runId")
delete(additionalProperties, "startTime")
delete(additionalProperties, "status")
delete(additionalProperties, "type")
delete(additionalProperties, "worker")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeGpuJob struct {
value *ComputeGpuJob
isSet bool
}
func (v NullableComputeGpuJob) Get() *ComputeGpuJob {
return v.value
}
func (v *NullableComputeGpuJob) Set(val *ComputeGpuJob) {
v.value = val
v.isSet = true
}
func (v NullableComputeGpuJob) IsSet() bool {
return v.isSet
}
func (v *NullableComputeGpuJob) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeGpuJob(val *ComputeGpuJob) *NullableComputeGpuJob {
return &NullableComputeGpuJob{value: val, isSet: true}
}
func (v NullableComputeGpuJob) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeGpuJob) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}