mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
532 lines
14 KiB
Go
532 lines
14 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 TrainCapability type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainCapability{}
|
|
|
|
// TrainCapability struct for TrainCapability
|
|
type TrainCapability struct {
|
|
By *string `json:"by,omitempty"`
|
|
// Corrections are the corrections it is taught from.
|
|
Corrections []string `json:"corrections,omitempty"`
|
|
Created *int64 `json:"created,omitempty"`
|
|
// Installed is the version in the org's published set, 0 when none.
|
|
Installed *int64 `json:"installed,omitempty"`
|
|
// Live is what its installed version did since it went in.
|
|
Live *TrainLive `json:"live,omitempty"`
|
|
// Name is its name, one per org; it is the name its versions install under.
|
|
Name *string `json:"name,omitempty"`
|
|
// Question is what it answers: the route it is installed behind.
|
|
Question *TrainQuestion `json:"question,omitempty"`
|
|
// State is where it is in its life: draft, trained, evaluated, publishable, installed, active, disabled or needs_validation.
|
|
State *string `json:"state,omitempty"`
|
|
Updated *int64 `json:"updated,omitempty"`
|
|
// Version is its latest version, 0 in draft.
|
|
Version *int64 `json:"version,omitempty"`
|
|
// Versions are its versions, newest first (one capability read).
|
|
Versions []TrainVersion `json:"versions,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainCapability TrainCapability
|
|
|
|
// NewTrainCapability instantiates a new TrainCapability 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 NewTrainCapability() *TrainCapability {
|
|
this := TrainCapability{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainCapabilityWithDefaults instantiates a new TrainCapability 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 NewTrainCapabilityWithDefaults() *TrainCapability {
|
|
this := TrainCapability{}
|
|
return &this
|
|
}
|
|
|
|
// GetBy returns the By field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetBy() string {
|
|
if o == nil || IsNil(o.By) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.By
|
|
}
|
|
|
|
// GetByOk returns a tuple with the By field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetByOk() (*string, bool) {
|
|
if o == nil || IsNil(o.By) {
|
|
return nil, false
|
|
}
|
|
return o.By, true
|
|
}
|
|
|
|
// HasBy returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasBy() bool {
|
|
if o != nil && !IsNil(o.By) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBy gets a reference to the given string and assigns it to the By field.
|
|
func (o *TrainCapability) SetBy(v string) {
|
|
o.By = &v
|
|
}
|
|
|
|
// GetCorrections returns the Corrections field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetCorrections() []string {
|
|
if o == nil || IsNil(o.Corrections) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Corrections
|
|
}
|
|
|
|
// GetCorrectionsOk returns a tuple with the Corrections field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetCorrectionsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Corrections) {
|
|
return nil, false
|
|
}
|
|
return o.Corrections, true
|
|
}
|
|
|
|
// HasCorrections returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasCorrections() bool {
|
|
if o != nil && !IsNil(o.Corrections) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCorrections gets a reference to the given []string and assigns it to the Corrections field.
|
|
func (o *TrainCapability) SetCorrections(v []string) {
|
|
o.Corrections = v
|
|
}
|
|
|
|
// GetCreated returns the Created field value if set, zero value otherwise.
|
|
func (o *TrainCapability) 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 *TrainCapability) 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 *TrainCapability) 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 *TrainCapability) SetCreated(v int64) {
|
|
o.Created = &v
|
|
}
|
|
|
|
// GetInstalled returns the Installed field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetInstalled() int64 {
|
|
if o == nil || IsNil(o.Installed) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Installed
|
|
}
|
|
|
|
// GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetInstalledOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Installed) {
|
|
return nil, false
|
|
}
|
|
return o.Installed, true
|
|
}
|
|
|
|
// HasInstalled returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasInstalled() bool {
|
|
if o != nil && !IsNil(o.Installed) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetInstalled gets a reference to the given int64 and assigns it to the Installed field.
|
|
func (o *TrainCapability) SetInstalled(v int64) {
|
|
o.Installed = &v
|
|
}
|
|
|
|
// GetLive returns the Live field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetLive() TrainLive {
|
|
if o == nil || IsNil(o.Live) {
|
|
var ret TrainLive
|
|
return ret
|
|
}
|
|
return *o.Live
|
|
}
|
|
|
|
// GetLiveOk returns a tuple with the Live field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetLiveOk() (*TrainLive, bool) {
|
|
if o == nil || IsNil(o.Live) {
|
|
return nil, false
|
|
}
|
|
return o.Live, true
|
|
}
|
|
|
|
// HasLive returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasLive() bool {
|
|
if o != nil && !IsNil(o.Live) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLive gets a reference to the given TrainLive and assigns it to the Live field.
|
|
func (o *TrainCapability) SetLive(v TrainLive) {
|
|
o.Live = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *TrainCapability) 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 *TrainCapability) 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 *TrainCapability) 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 *TrainCapability) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetQuestion returns the Question field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetQuestion() TrainQuestion {
|
|
if o == nil || IsNil(o.Question) {
|
|
var ret TrainQuestion
|
|
return ret
|
|
}
|
|
return *o.Question
|
|
}
|
|
|
|
// GetQuestionOk returns a tuple with the Question field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetQuestionOk() (*TrainQuestion, bool) {
|
|
if o == nil || IsNil(o.Question) {
|
|
return nil, false
|
|
}
|
|
return o.Question, true
|
|
}
|
|
|
|
// HasQuestion returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasQuestion() bool {
|
|
if o != nil && !IsNil(o.Question) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetQuestion gets a reference to the given TrainQuestion and assigns it to the Question field.
|
|
func (o *TrainCapability) SetQuestion(v TrainQuestion) {
|
|
o.Question = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *TrainCapability) 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 *TrainCapability) 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 *TrainCapability) 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 *TrainCapability) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetUpdated returns the Updated field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetUpdated() int64 {
|
|
if o == nil || IsNil(o.Updated) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Updated
|
|
}
|
|
|
|
// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetUpdatedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Updated) {
|
|
return nil, false
|
|
}
|
|
return o.Updated, true
|
|
}
|
|
|
|
// HasUpdated returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasUpdated() bool {
|
|
if o != nil && !IsNil(o.Updated) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUpdated gets a reference to the given int64 and assigns it to the Updated field.
|
|
func (o *TrainCapability) SetUpdated(v int64) {
|
|
o.Updated = &v
|
|
}
|
|
|
|
// GetVersion returns the Version field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetVersion() int64 {
|
|
if o == nil || IsNil(o.Version) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Version
|
|
}
|
|
|
|
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetVersionOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Version) {
|
|
return nil, false
|
|
}
|
|
return o.Version, true
|
|
}
|
|
|
|
// HasVersion returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasVersion() bool {
|
|
if o != nil && !IsNil(o.Version) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
|
|
func (o *TrainCapability) SetVersion(v int64) {
|
|
o.Version = &v
|
|
}
|
|
|
|
// GetVersions returns the Versions field value if set, zero value otherwise.
|
|
func (o *TrainCapability) GetVersions() []TrainVersion {
|
|
if o == nil || IsNil(o.Versions) {
|
|
var ret []TrainVersion
|
|
return ret
|
|
}
|
|
return o.Versions
|
|
}
|
|
|
|
// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapability) GetVersionsOk() ([]TrainVersion, bool) {
|
|
if o == nil || IsNil(o.Versions) {
|
|
return nil, false
|
|
}
|
|
return o.Versions, true
|
|
}
|
|
|
|
// HasVersions returns a boolean if a field has been set.
|
|
func (o *TrainCapability) HasVersions() bool {
|
|
if o != nil && !IsNil(o.Versions) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVersions gets a reference to the given []TrainVersion and assigns it to the Versions field.
|
|
func (o *TrainCapability) SetVersions(v []TrainVersion) {
|
|
o.Versions = v
|
|
}
|
|
|
|
func (o TrainCapability) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainCapability) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.By) {
|
|
toSerialize["by"] = o.By
|
|
}
|
|
if !IsNil(o.Corrections) {
|
|
toSerialize["corrections"] = o.Corrections
|
|
}
|
|
if !IsNil(o.Created) {
|
|
toSerialize["created"] = o.Created
|
|
}
|
|
if !IsNil(o.Installed) {
|
|
toSerialize["installed"] = o.Installed
|
|
}
|
|
if !IsNil(o.Live) {
|
|
toSerialize["live"] = o.Live
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Question) {
|
|
toSerialize["question"] = o.Question
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Updated) {
|
|
toSerialize["updated"] = o.Updated
|
|
}
|
|
if !IsNil(o.Version) {
|
|
toSerialize["version"] = o.Version
|
|
}
|
|
if !IsNil(o.Versions) {
|
|
toSerialize["versions"] = o.Versions
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainCapability) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainCapability := _TrainCapability{}
|
|
|
|
err = json.Unmarshal(data, &varTrainCapability)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainCapability(varTrainCapability)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "by")
|
|
delete(additionalProperties, "corrections")
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "installed")
|
|
delete(additionalProperties, "live")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "question")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "updated")
|
|
delete(additionalProperties, "version")
|
|
delete(additionalProperties, "versions")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainCapability struct {
|
|
value *TrainCapability
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainCapability) Get() *TrainCapability {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainCapability) Set(val *TrainCapability) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainCapability) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainCapability) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainCapability(val *TrainCapability) *NullableTrainCapability {
|
|
return &NullableTrainCapability{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainCapability) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainCapability) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|