Files
sdk/model_train_job.go

989 lines
26 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 TrainJob type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainJob{}
// TrainJob struct for TrainJob
type TrainJob struct {
// Adaptation is how the update is parameterized.
Adaptation *TrainAdaptation `json:"adaptation,omitempty"`
// Artifacts are its outputs.
Artifacts []TrainArtifact `json:"artifacts,omitempty"`
// BaseModel is the base the capability is taught to: `kai`, or a model the engine loads for a client.
BaseModel *string `json:"base_model,omitempty"`
// Created, Started and Ended are unix seconds; 0 is not yet.
Created *int64 `json:"created,omitempty"`
// CreatedBy is the principal that created it.
CreatedBy *string `json:"created_by,omitempty"`
// Dataset is what the job trains on.
Dataset *TrainDataset `json:"dataset,omitempty"`
Ended *int64 `json:"ended,omitempty"`
// Error says why a job failed or stopped. A job stopped at what its payer or its own bounds could hold says budget, max_seconds, insufficient_balance, spend_cap, balance_unavailable or no_payer.
Error *string `json:"error,omitempty"`
// Evaluation names the target suites the result reports.
Evaluation *TrainEvaluation `json:"evaluation,omitempty"`
// From is an artifact the job starts from, by sha256.
From *string `json:"from,omitempty"`
// ID names the job.
Id *string `json:"id,omitempty"`
// Objective is the loss and the terms beside it.
Objective *TrainObjective `json:"objective,omitempty"`
// Output is what the job produces.
Output *TrainOutput `json:"output,omitempty"`
// Project is the creator's project scope.
Project *string `json:"project,omitempty"`
// Protect names what the base already does that must hold, and the budget.
Protect *TrainProtect `json:"protect,omitempty"`
Published interface{} `json:"published,omitempty"`
// Resources places and bounds the run.
Resources *TrainResources `json:"resources,omitempty"`
Result interface{} `json:"result,omitempty"`
// Revision pins the base. For kai: a finished run's name on the executor, or `hub:<repo>@<rev>`.
Revision *string `json:"revision,omitempty"`
Started *int64 `json:"started,omitempty"`
// Status is queued, running, evaluating, succeeded, rejected, failed, cancelled or stopped.
Status *string `json:"status,omitempty"`
// Tasks are its units of execution.
Tasks []TrainTaskView `json:"tasks,omitempty"`
// Usage is what its tasks used and what that cost.
Usage *TrainUsage `json:"usage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainJob TrainJob
// NewTrainJob instantiates a new TrainJob 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 NewTrainJob() *TrainJob {
this := TrainJob{}
return &this
}
// NewTrainJobWithDefaults instantiates a new TrainJob 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 NewTrainJobWithDefaults() *TrainJob {
this := TrainJob{}
return &this
}
// GetAdaptation returns the Adaptation field value if set, zero value otherwise.
func (o *TrainJob) GetAdaptation() TrainAdaptation {
if o == nil || IsNil(o.Adaptation) {
var ret TrainAdaptation
return ret
}
return *o.Adaptation
}
// GetAdaptationOk returns a tuple with the Adaptation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetAdaptationOk() (*TrainAdaptation, bool) {
if o == nil || IsNil(o.Adaptation) {
return nil, false
}
return o.Adaptation, true
}
// HasAdaptation returns a boolean if a field has been set.
func (o *TrainJob) HasAdaptation() bool {
if o != nil && !IsNil(o.Adaptation) {
return true
}
return false
}
// SetAdaptation gets a reference to the given TrainAdaptation and assigns it to the Adaptation field.
func (o *TrainJob) SetAdaptation(v TrainAdaptation) {
o.Adaptation = &v
}
// GetArtifacts returns the Artifacts field value if set, zero value otherwise.
func (o *TrainJob) GetArtifacts() []TrainArtifact {
if o == nil || IsNil(o.Artifacts) {
var ret []TrainArtifact
return ret
}
return o.Artifacts
}
// GetArtifactsOk returns a tuple with the Artifacts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetArtifactsOk() ([]TrainArtifact, bool) {
if o == nil || IsNil(o.Artifacts) {
return nil, false
}
return o.Artifacts, true
}
// HasArtifacts returns a boolean if a field has been set.
func (o *TrainJob) HasArtifacts() bool {
if o != nil && !IsNil(o.Artifacts) {
return true
}
return false
}
// SetArtifacts gets a reference to the given []TrainArtifact and assigns it to the Artifacts field.
func (o *TrainJob) SetArtifacts(v []TrainArtifact) {
o.Artifacts = v
}
// GetBaseModel returns the BaseModel field value if set, zero value otherwise.
func (o *TrainJob) GetBaseModel() string {
if o == nil || IsNil(o.BaseModel) {
var ret string
return ret
}
return *o.BaseModel
}
// GetBaseModelOk returns a tuple with the BaseModel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetBaseModelOk() (*string, bool) {
if o == nil || IsNil(o.BaseModel) {
return nil, false
}
return o.BaseModel, true
}
// HasBaseModel returns a boolean if a field has been set.
func (o *TrainJob) HasBaseModel() bool {
if o != nil && !IsNil(o.BaseModel) {
return true
}
return false
}
// SetBaseModel gets a reference to the given string and assigns it to the BaseModel field.
func (o *TrainJob) SetBaseModel(v string) {
o.BaseModel = &v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *TrainJob) GetCreated() int64 {
if o == nil || IsNil(o.Created) {
var ret int64
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetCreatedOk() (*int64, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *TrainJob) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given int64 and assigns it to the Created field.
func (o *TrainJob) SetCreated(v int64) {
o.Created = &v
}
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
func (o *TrainJob) GetCreatedBy() string {
if o == nil || IsNil(o.CreatedBy) {
var ret string
return ret
}
return *o.CreatedBy
}
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetCreatedByOk() (*string, bool) {
if o == nil || IsNil(o.CreatedBy) {
return nil, false
}
return o.CreatedBy, true
}
// HasCreatedBy returns a boolean if a field has been set.
func (o *TrainJob) HasCreatedBy() bool {
if o != nil && !IsNil(o.CreatedBy) {
return true
}
return false
}
// SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field.
func (o *TrainJob) SetCreatedBy(v string) {
o.CreatedBy = &v
}
// GetDataset returns the Dataset field value if set, zero value otherwise.
func (o *TrainJob) GetDataset() TrainDataset {
if o == nil || IsNil(o.Dataset) {
var ret TrainDataset
return ret
}
return *o.Dataset
}
// GetDatasetOk returns a tuple with the Dataset field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetDatasetOk() (*TrainDataset, bool) {
if o == nil || IsNil(o.Dataset) {
return nil, false
}
return o.Dataset, true
}
// HasDataset returns a boolean if a field has been set.
func (o *TrainJob) HasDataset() bool {
if o != nil && !IsNil(o.Dataset) {
return true
}
return false
}
// SetDataset gets a reference to the given TrainDataset and assigns it to the Dataset field.
func (o *TrainJob) SetDataset(v TrainDataset) {
o.Dataset = &v
}
// GetEnded returns the Ended field value if set, zero value otherwise.
func (o *TrainJob) GetEnded() int64 {
if o == nil || IsNil(o.Ended) {
var ret int64
return ret
}
return *o.Ended
}
// GetEndedOk returns a tuple with the Ended field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetEndedOk() (*int64, bool) {
if o == nil || IsNil(o.Ended) {
return nil, false
}
return o.Ended, true
}
// HasEnded returns a boolean if a field has been set.
func (o *TrainJob) HasEnded() bool {
if o != nil && !IsNil(o.Ended) {
return true
}
return false
}
// SetEnded gets a reference to the given int64 and assigns it to the Ended field.
func (o *TrainJob) SetEnded(v int64) {
o.Ended = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *TrainJob) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *TrainJob) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *TrainJob) SetError(v string) {
o.Error = &v
}
// GetEvaluation returns the Evaluation field value if set, zero value otherwise.
func (o *TrainJob) GetEvaluation() TrainEvaluation {
if o == nil || IsNil(o.Evaluation) {
var ret TrainEvaluation
return ret
}
return *o.Evaluation
}
// GetEvaluationOk returns a tuple with the Evaluation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetEvaluationOk() (*TrainEvaluation, bool) {
if o == nil || IsNil(o.Evaluation) {
return nil, false
}
return o.Evaluation, true
}
// HasEvaluation returns a boolean if a field has been set.
func (o *TrainJob) HasEvaluation() bool {
if o != nil && !IsNil(o.Evaluation) {
return true
}
return false
}
// SetEvaluation gets a reference to the given TrainEvaluation and assigns it to the Evaluation field.
func (o *TrainJob) SetEvaluation(v TrainEvaluation) {
o.Evaluation = &v
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *TrainJob) GetFrom() string {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
return *o.From
}
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetFromOk() (*string, bool) {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
}
// HasFrom returns a boolean if a field has been set.
func (o *TrainJob) HasFrom() bool {
if o != nil && !IsNil(o.From) {
return true
}
return false
}
// SetFrom gets a reference to the given string and assigns it to the From field.
func (o *TrainJob) SetFrom(v string) {
o.From = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TrainJob) 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 *TrainJob) 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 *TrainJob) 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 *TrainJob) SetId(v string) {
o.Id = &v
}
// GetObjective returns the Objective field value if set, zero value otherwise.
func (o *TrainJob) GetObjective() TrainObjective {
if o == nil || IsNil(o.Objective) {
var ret TrainObjective
return ret
}
return *o.Objective
}
// GetObjectiveOk returns a tuple with the Objective field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetObjectiveOk() (*TrainObjective, bool) {
if o == nil || IsNil(o.Objective) {
return nil, false
}
return o.Objective, true
}
// HasObjective returns a boolean if a field has been set.
func (o *TrainJob) HasObjective() bool {
if o != nil && !IsNil(o.Objective) {
return true
}
return false
}
// SetObjective gets a reference to the given TrainObjective and assigns it to the Objective field.
func (o *TrainJob) SetObjective(v TrainObjective) {
o.Objective = &v
}
// GetOutput returns the Output field value if set, zero value otherwise.
func (o *TrainJob) GetOutput() TrainOutput {
if o == nil || IsNil(o.Output) {
var ret TrainOutput
return ret
}
return *o.Output
}
// GetOutputOk returns a tuple with the Output field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetOutputOk() (*TrainOutput, bool) {
if o == nil || IsNil(o.Output) {
return nil, false
}
return o.Output, true
}
// HasOutput returns a boolean if a field has been set.
func (o *TrainJob) HasOutput() bool {
if o != nil && !IsNil(o.Output) {
return true
}
return false
}
// SetOutput gets a reference to the given TrainOutput and assigns it to the Output field.
func (o *TrainJob) SetOutput(v TrainOutput) {
o.Output = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *TrainJob) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *TrainJob) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *TrainJob) SetProject(v string) {
o.Project = &v
}
// GetProtect returns the Protect field value if set, zero value otherwise.
func (o *TrainJob) GetProtect() TrainProtect {
if o == nil || IsNil(o.Protect) {
var ret TrainProtect
return ret
}
return *o.Protect
}
// GetProtectOk returns a tuple with the Protect field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetProtectOk() (*TrainProtect, bool) {
if o == nil || IsNil(o.Protect) {
return nil, false
}
return o.Protect, true
}
// HasProtect returns a boolean if a field has been set.
func (o *TrainJob) HasProtect() bool {
if o != nil && !IsNil(o.Protect) {
return true
}
return false
}
// SetProtect gets a reference to the given TrainProtect and assigns it to the Protect field.
func (o *TrainJob) SetProtect(v TrainProtect) {
o.Protect = &v
}
// GetPublished returns the Published field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TrainJob) GetPublished() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Published
}
// GetPublishedOk returns a tuple with the Published field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *TrainJob) GetPublishedOk() (*interface{}, bool) {
if o == nil || IsNil(o.Published) {
return nil, false
}
return &o.Published, true
}
// HasPublished returns a boolean if a field has been set.
func (o *TrainJob) HasPublished() bool {
if o != nil && !IsNil(o.Published) {
return true
}
return false
}
// SetPublished gets a reference to the given interface{} and assigns it to the Published field.
func (o *TrainJob) SetPublished(v interface{}) {
o.Published = v
}
// GetResources returns the Resources field value if set, zero value otherwise.
func (o *TrainJob) GetResources() TrainResources {
if o == nil || IsNil(o.Resources) {
var ret TrainResources
return ret
}
return *o.Resources
}
// GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetResourcesOk() (*TrainResources, bool) {
if o == nil || IsNil(o.Resources) {
return nil, false
}
return o.Resources, true
}
// HasResources returns a boolean if a field has been set.
func (o *TrainJob) HasResources() bool {
if o != nil && !IsNil(o.Resources) {
return true
}
return false
}
// SetResources gets a reference to the given TrainResources and assigns it to the Resources field.
func (o *TrainJob) SetResources(v TrainResources) {
o.Resources = &v
}
// GetResult returns the Result field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TrainJob) GetResult() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Result
}
// GetResultOk returns a tuple with the Result field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *TrainJob) GetResultOk() (*interface{}, bool) {
if o == nil || IsNil(o.Result) {
return nil, false
}
return &o.Result, true
}
// HasResult returns a boolean if a field has been set.
func (o *TrainJob) HasResult() bool {
if o != nil && !IsNil(o.Result) {
return true
}
return false
}
// SetResult gets a reference to the given interface{} and assigns it to the Result field.
func (o *TrainJob) SetResult(v interface{}) {
o.Result = v
}
// GetRevision returns the Revision field value if set, zero value otherwise.
func (o *TrainJob) GetRevision() string {
if o == nil || IsNil(o.Revision) {
var ret string
return ret
}
return *o.Revision
}
// GetRevisionOk returns a tuple with the Revision field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetRevisionOk() (*string, bool) {
if o == nil || IsNil(o.Revision) {
return nil, false
}
return o.Revision, true
}
// HasRevision returns a boolean if a field has been set.
func (o *TrainJob) HasRevision() bool {
if o != nil && !IsNil(o.Revision) {
return true
}
return false
}
// SetRevision gets a reference to the given string and assigns it to the Revision field.
func (o *TrainJob) SetRevision(v string) {
o.Revision = &v
}
// GetStarted returns the Started field value if set, zero value otherwise.
func (o *TrainJob) GetStarted() int64 {
if o == nil || IsNil(o.Started) {
var ret int64
return ret
}
return *o.Started
}
// GetStartedOk returns a tuple with the Started field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetStartedOk() (*int64, bool) {
if o == nil || IsNil(o.Started) {
return nil, false
}
return o.Started, true
}
// HasStarted returns a boolean if a field has been set.
func (o *TrainJob) HasStarted() bool {
if o != nil && !IsNil(o.Started) {
return true
}
return false
}
// SetStarted gets a reference to the given int64 and assigns it to the Started field.
func (o *TrainJob) SetStarted(v int64) {
o.Started = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *TrainJob) 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 *TrainJob) 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 *TrainJob) 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 *TrainJob) SetStatus(v string) {
o.Status = &v
}
// GetTasks returns the Tasks field value if set, zero value otherwise.
func (o *TrainJob) GetTasks() []TrainTaskView {
if o == nil || IsNil(o.Tasks) {
var ret []TrainTaskView
return ret
}
return o.Tasks
}
// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetTasksOk() ([]TrainTaskView, bool) {
if o == nil || IsNil(o.Tasks) {
return nil, false
}
return o.Tasks, true
}
// HasTasks returns a boolean if a field has been set.
func (o *TrainJob) HasTasks() bool {
if o != nil && !IsNil(o.Tasks) {
return true
}
return false
}
// SetTasks gets a reference to the given []TrainTaskView and assigns it to the Tasks field.
func (o *TrainJob) SetTasks(v []TrainTaskView) {
o.Tasks = v
}
// GetUsage returns the Usage field value if set, zero value otherwise.
func (o *TrainJob) GetUsage() TrainUsage {
if o == nil || IsNil(o.Usage) {
var ret TrainUsage
return ret
}
return *o.Usage
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainJob) GetUsageOk() (*TrainUsage, bool) {
if o == nil || IsNil(o.Usage) {
return nil, false
}
return o.Usage, true
}
// HasUsage returns a boolean if a field has been set.
func (o *TrainJob) HasUsage() bool {
if o != nil && !IsNil(o.Usage) {
return true
}
return false
}
// SetUsage gets a reference to the given TrainUsage and assigns it to the Usage field.
func (o *TrainJob) SetUsage(v TrainUsage) {
o.Usage = &v
}
func (o TrainJob) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainJob) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Adaptation) {
toSerialize["adaptation"] = o.Adaptation
}
if !IsNil(o.Artifacts) {
toSerialize["artifacts"] = o.Artifacts
}
if !IsNil(o.BaseModel) {
toSerialize["base_model"] = o.BaseModel
}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.CreatedBy) {
toSerialize["created_by"] = o.CreatedBy
}
if !IsNil(o.Dataset) {
toSerialize["dataset"] = o.Dataset
}
if !IsNil(o.Ended) {
toSerialize["ended"] = o.Ended
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.Evaluation) {
toSerialize["evaluation"] = o.Evaluation
}
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Objective) {
toSerialize["objective"] = o.Objective
}
if !IsNil(o.Output) {
toSerialize["output"] = o.Output
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Protect) {
toSerialize["protect"] = o.Protect
}
if o.Published != nil {
toSerialize["published"] = o.Published
}
if !IsNil(o.Resources) {
toSerialize["resources"] = o.Resources
}
if o.Result != nil {
toSerialize["result"] = o.Result
}
if !IsNil(o.Revision) {
toSerialize["revision"] = o.Revision
}
if !IsNil(o.Started) {
toSerialize["started"] = o.Started
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Tasks) {
toSerialize["tasks"] = o.Tasks
}
if !IsNil(o.Usage) {
toSerialize["usage"] = o.Usage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainJob) UnmarshalJSON(data []byte) (err error) {
varTrainJob := _TrainJob{}
err = json.Unmarshal(data, &varTrainJob)
if err != nil {
return err
}
*o = TrainJob(varTrainJob)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "adaptation")
delete(additionalProperties, "artifacts")
delete(additionalProperties, "base_model")
delete(additionalProperties, "created")
delete(additionalProperties, "created_by")
delete(additionalProperties, "dataset")
delete(additionalProperties, "ended")
delete(additionalProperties, "error")
delete(additionalProperties, "evaluation")
delete(additionalProperties, "from")
delete(additionalProperties, "id")
delete(additionalProperties, "objective")
delete(additionalProperties, "output")
delete(additionalProperties, "project")
delete(additionalProperties, "protect")
delete(additionalProperties, "published")
delete(additionalProperties, "resources")
delete(additionalProperties, "result")
delete(additionalProperties, "revision")
delete(additionalProperties, "started")
delete(additionalProperties, "status")
delete(additionalProperties, "tasks")
delete(additionalProperties, "usage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainJob struct {
value *TrainJob
isSet bool
}
func (v NullableTrainJob) Get() *TrainJob {
return v.value
}
func (v *NullableTrainJob) Set(val *TrainJob) {
v.value = val
v.isSet = true
}
func (v NullableTrainJob) IsSet() bool {
return v.isSet
}
func (v *NullableTrainJob) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainJob(val *TrainJob) *NullableTrainJob {
return &NullableTrainJob{value: val, isSet: true}
}
func (v NullableTrainJob) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainJob) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}