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 TrainObject type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainObject{}
|
|
|
|
// TrainObject struct for TrainObject
|
|
type TrainObject struct {
|
|
// Expires is when retention deletes it unless published, unix seconds; absent while it is published, pending, or retention keeps everything.
|
|
Expires *int64 `json:"expires,omitempty"`
|
|
// Jobs are the jobs that produced or hold it; none for an upload.
|
|
Jobs []string `json:"jobs,omitempty"`
|
|
// Kind is dataset for an upload, else the output kind a job produced it as.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Name labels it.
|
|
Name *string `json:"name,omitempty"`
|
|
// Published says a job of the org has it published.
|
|
Published *bool `json:"published,omitempty"`
|
|
// SHA256 names the bytes.
|
|
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.
|
|
State *string `json:"state,omitempty"`
|
|
// Stored is when its bytes were read back, unix seconds.
|
|
Stored *int64 `json:"stored,omitempty"`
|
|
// URL fetches the bytes for ten minutes, on a read of one stored object.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainObject TrainObject
|
|
|
|
// NewTrainObject instantiates a new TrainObject 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 NewTrainObject() *TrainObject {
|
|
this := TrainObject{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainObjectWithDefaults instantiates a new TrainObject 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 NewTrainObjectWithDefaults() *TrainObject {
|
|
this := TrainObject{}
|
|
return &this
|
|
}
|
|
|
|
// GetExpires returns the Expires field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetExpires(v int64) {
|
|
o.Expires = &v
|
|
}
|
|
|
|
// GetJobs returns the Jobs field value if set, zero value otherwise.
|
|
func (o *TrainObject) GetJobs() []string {
|
|
if o == nil || IsNil(o.Jobs) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Jobs
|
|
}
|
|
|
|
// GetJobsOk returns a tuple with the Jobs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainObject) GetJobsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Jobs) {
|
|
return nil, false
|
|
}
|
|
return o.Jobs, true
|
|
}
|
|
|
|
// HasJobs returns a boolean if a field has been set.
|
|
func (o *TrainObject) HasJobs() bool {
|
|
if o != nil && !IsNil(o.Jobs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetJobs gets a reference to the given []string and assigns it to the Jobs field.
|
|
func (o *TrainObject) SetJobs(v []string) {
|
|
o.Jobs = v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetPublished returns the Published field value if set, zero value otherwise.
|
|
func (o *TrainObject) GetPublished() bool {
|
|
if o == nil || IsNil(o.Published) {
|
|
var ret bool
|
|
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.
|
|
func (o *TrainObject) GetPublishedOk() (*bool, 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 *TrainObject) HasPublished() bool {
|
|
if o != nil && !IsNil(o.Published) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPublished gets a reference to the given bool and assigns it to the Published field.
|
|
func (o *TrainObject) SetPublished(v bool) {
|
|
o.Published = &v
|
|
}
|
|
|
|
// GetSha256 returns the Sha256 field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetSha256(v string) {
|
|
o.Sha256 = &v
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetSize(v int64) {
|
|
o.Size = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetStored returns the Stored field value if set, zero value otherwise.
|
|
func (o *TrainObject) GetStored() int64 {
|
|
if o == nil || IsNil(o.Stored) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Stored
|
|
}
|
|
|
|
// GetStoredOk returns a tuple with the Stored field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainObject) GetStoredOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Stored) {
|
|
return nil, false
|
|
}
|
|
return o.Stored, true
|
|
}
|
|
|
|
// HasStored returns a boolean if a field has been set.
|
|
func (o *TrainObject) HasStored() bool {
|
|
if o != nil && !IsNil(o.Stored) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStored gets a reference to the given int64 and assigns it to the Stored field.
|
|
func (o *TrainObject) SetStored(v int64) {
|
|
o.Stored = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *TrainObject) 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 *TrainObject) 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 *TrainObject) 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 *TrainObject) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o TrainObject) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainObject) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Expires) {
|
|
toSerialize["expires"] = o.Expires
|
|
}
|
|
if !IsNil(o.Jobs) {
|
|
toSerialize["jobs"] = o.Jobs
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Published) {
|
|
toSerialize["published"] = o.Published
|
|
}
|
|
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.Stored) {
|
|
toSerialize["stored"] = o.Stored
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainObject) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainObject := _TrainObject{}
|
|
|
|
err = json.Unmarshal(data, &varTrainObject)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainObject(varTrainObject)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "expires")
|
|
delete(additionalProperties, "jobs")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "published")
|
|
delete(additionalProperties, "sha256")
|
|
delete(additionalProperties, "size")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "stored")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainObject struct {
|
|
value *TrainObject
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainObject) Get() *TrainObject {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainObject) Set(val *TrainObject) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainObject) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainObject) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainObject(val *TrainObject) *NullableTrainObject {
|
|
return &NullableTrainObject{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainObject) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainObject) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|