mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
497 lines
12 KiB
Go
497 lines
12 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 TrainDownload type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainDownload{}
|
|
|
|
// TrainDownload struct for TrainDownload
|
|
type TrainDownload struct {
|
|
// Created is when it was registered, unix seconds.
|
|
Created *int64 `json:"created,omitempty"`
|
|
// Expires is when URL stops working, unix seconds.
|
|
Expires *int64 `json:"expires,omitempty"`
|
|
// Job is the job that produced it; empty for an upload.
|
|
Job *string `json:"job,omitempty"`
|
|
// Kind is checkpoint, lora, capability, basis or merged, or dataset for an upload.
|
|
Kind *string `json:"kind,omitempty"`
|
|
Meta interface{} `json:"meta,omitempty"`
|
|
// Name labels it.
|
|
Name *string `json:"name,omitempty"`
|
|
// SHA256 is the hex digest of its bytes, and its name in the object store.
|
|
Sha256 *string `json:"sha256,omitempty"`
|
|
// Size is its byte count.
|
|
Size *int64 `json:"size,omitempty"`
|
|
// State is pending until its bytes are read back, then stored; deleted once the org deleted it or it outlived its retention unpublished.
|
|
State *string `json:"state,omitempty"`
|
|
// URL fetches the bytes until Expires; absent until the artifact is stored.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainDownload TrainDownload
|
|
|
|
// NewTrainDownload instantiates a new TrainDownload 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 NewTrainDownload() *TrainDownload {
|
|
this := TrainDownload{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainDownloadWithDefaults instantiates a new TrainDownload 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 NewTrainDownloadWithDefaults() *TrainDownload {
|
|
this := TrainDownload{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreated returns the Created field value if set, zero value otherwise.
|
|
func (o *TrainDownload) 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 *TrainDownload) 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 *TrainDownload) 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 *TrainDownload) SetCreated(v int64) {
|
|
o.Created = &v
|
|
}
|
|
|
|
// GetExpires returns the Expires field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetExpires() int64 {
|
|
if o == nil || IsNil(o.Expires) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Expires
|
|
}
|
|
|
|
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetExpiresOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Expires) {
|
|
return nil, false
|
|
}
|
|
return o.Expires, true
|
|
}
|
|
|
|
// HasExpires returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasExpires() bool {
|
|
if o != nil && !IsNil(o.Expires) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpires gets a reference to the given int64 and assigns it to the Expires field.
|
|
func (o *TrainDownload) SetExpires(v int64) {
|
|
o.Expires = &v
|
|
}
|
|
|
|
// GetJob returns the Job field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetJob() string {
|
|
if o == nil || IsNil(o.Job) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Job
|
|
}
|
|
|
|
// GetJobOk returns a tuple with the Job field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetJobOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Job) {
|
|
return nil, false
|
|
}
|
|
return o.Job, true
|
|
}
|
|
|
|
// HasJob returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasJob() bool {
|
|
if o != nil && !IsNil(o.Job) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetJob gets a reference to the given string and assigns it to the Job field.
|
|
func (o *TrainDownload) SetJob(v string) {
|
|
o.Job = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *TrainDownload) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetMeta returns the Meta field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *TrainDownload) GetMeta() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Meta
|
|
}
|
|
|
|
// GetMetaOk returns a tuple with the Meta 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 *TrainDownload) GetMetaOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Meta) {
|
|
return nil, false
|
|
}
|
|
return &o.Meta, true
|
|
}
|
|
|
|
// HasMeta returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasMeta() bool {
|
|
if o != nil && !IsNil(o.Meta) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMeta gets a reference to the given interface{} and assigns it to the Meta field.
|
|
func (o *TrainDownload) SetMeta(v interface{}) {
|
|
o.Meta = v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *TrainDownload) 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 *TrainDownload) 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 *TrainDownload) 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 *TrainDownload) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetSha256 returns the Sha256 field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetSha256() string {
|
|
if o == nil || IsNil(o.Sha256) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Sha256
|
|
}
|
|
|
|
// GetSha256Ok returns a tuple with the Sha256 field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetSha256Ok() (*string, bool) {
|
|
if o == nil || IsNil(o.Sha256) {
|
|
return nil, false
|
|
}
|
|
return o.Sha256, true
|
|
}
|
|
|
|
// HasSha256 returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasSha256() bool {
|
|
if o != nil && !IsNil(o.Sha256) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSha256 gets a reference to the given string and assigns it to the Sha256 field.
|
|
func (o *TrainDownload) SetSha256(v string) {
|
|
o.Sha256 = &v
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetSize() int64 {
|
|
if o == nil || IsNil(o.Size) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Size
|
|
}
|
|
|
|
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetSizeOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Size) {
|
|
return nil, false
|
|
}
|
|
return o.Size, true
|
|
}
|
|
|
|
// HasSize returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasSize() bool {
|
|
if o != nil && !IsNil(o.Size) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSize gets a reference to the given int64 and assigns it to the Size field.
|
|
func (o *TrainDownload) SetSize(v int64) {
|
|
o.Size = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetState() string {
|
|
if o == nil || IsNil(o.State) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetStateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.State) {
|
|
return nil, false
|
|
}
|
|
return o.State, true
|
|
}
|
|
|
|
// HasState returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasState() bool {
|
|
if o != nil && !IsNil(o.State) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetState gets a reference to the given string and assigns it to the State field.
|
|
func (o *TrainDownload) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *TrainDownload) GetUrl() string {
|
|
if o == nil || IsNil(o.Url) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Url
|
|
}
|
|
|
|
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainDownload) GetUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Url) {
|
|
return nil, false
|
|
}
|
|
return o.Url, true
|
|
}
|
|
|
|
// HasUrl returns a boolean if a field has been set.
|
|
func (o *TrainDownload) HasUrl() bool {
|
|
if o != nil && !IsNil(o.Url) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUrl gets a reference to the given string and assigns it to the Url field.
|
|
func (o *TrainDownload) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o TrainDownload) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainDownload) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Created) {
|
|
toSerialize["created"] = o.Created
|
|
}
|
|
if !IsNil(o.Expires) {
|
|
toSerialize["expires"] = o.Expires
|
|
}
|
|
if !IsNil(o.Job) {
|
|
toSerialize["job"] = o.Job
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if o.Meta != nil {
|
|
toSerialize["meta"] = o.Meta
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Sha256) {
|
|
toSerialize["sha256"] = o.Sha256
|
|
}
|
|
if !IsNil(o.Size) {
|
|
toSerialize["size"] = o.Size
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainDownload) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainDownload := _TrainDownload{}
|
|
|
|
err = json.Unmarshal(data, &varTrainDownload)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainDownload(varTrainDownload)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "expires")
|
|
delete(additionalProperties, "job")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "meta")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "sha256")
|
|
delete(additionalProperties, "size")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainDownload struct {
|
|
value *TrainDownload
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainDownload) Get() *TrainDownload {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainDownload) Set(val *TrainDownload) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainDownload) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainDownload) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainDownload(val *TrainDownload) *NullableTrainDownload {
|
|
return &NullableTrainDownload{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainDownload) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainDownload) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|