Files
sdk/model_train_chose.go

193 lines
4.5 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 TrainChose type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainChose{}
// TrainChose struct for TrainChose
type TrainChose struct {
// Mode is the mode the job runs.
Mode *string `json:"mode,omitempty"`
// Why says what decided it.
Why *string `json:"why,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainChose TrainChose
// NewTrainChose instantiates a new TrainChose 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 NewTrainChose() *TrainChose {
this := TrainChose{}
return &this
}
// NewTrainChoseWithDefaults instantiates a new TrainChose 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 NewTrainChoseWithDefaults() *TrainChose {
this := TrainChose{}
return &this
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *TrainChose) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainChose) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *TrainChose) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *TrainChose) SetMode(v string) {
o.Mode = &v
}
// GetWhy returns the Why field value if set, zero value otherwise.
func (o *TrainChose) GetWhy() string {
if o == nil || IsNil(o.Why) {
var ret string
return ret
}
return *o.Why
}
// GetWhyOk returns a tuple with the Why field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainChose) GetWhyOk() (*string, bool) {
if o == nil || IsNil(o.Why) {
return nil, false
}
return o.Why, true
}
// HasWhy returns a boolean if a field has been set.
func (o *TrainChose) HasWhy() bool {
if o != nil && !IsNil(o.Why) {
return true
}
return false
}
// SetWhy gets a reference to the given string and assigns it to the Why field.
func (o *TrainChose) SetWhy(v string) {
o.Why = &v
}
func (o TrainChose) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainChose) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Why) {
toSerialize["why"] = o.Why
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainChose) UnmarshalJSON(data []byte) (err error) {
varTrainChose := _TrainChose{}
err = json.Unmarshal(data, &varTrainChose)
if err != nil {
return err
}
*o = TrainChose(varTrainChose)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "mode")
delete(additionalProperties, "why")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainChose struct {
value *TrainChose
isSet bool
}
func (v NullableTrainChose) Get() *TrainChose {
return v.value
}
func (v *NullableTrainChose) Set(val *TrainChose) {
v.value = val
v.isSet = true
}
func (v NullableTrainChose) IsSet() bool {
return v.isSet
}
func (v *NullableTrainChose) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainChose(val *TrainChose) *NullableTrainChose {
return &NullableTrainChose{value: val, isSet: true}
}
func (v NullableTrainChose) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainChose) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}