mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
4.9 KiB
Go
193 lines
4.9 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 TrainRoute type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainRoute{}
|
|
|
|
// TrainRoute struct for TrainRoute
|
|
type TrainRoute struct {
|
|
// Keys are the question keys it answers.
|
|
Keys []string `json:"keys,omitempty"`
|
|
// Options narrows a key to one question: a question under that key routes here only when its type and option labels are exactly these. A key not named here routes whatever its question.
|
|
Options map[string]TrainOptions `json:"options,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainRoute TrainRoute
|
|
|
|
// NewTrainRoute instantiates a new TrainRoute 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 NewTrainRoute() *TrainRoute {
|
|
this := TrainRoute{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainRouteWithDefaults instantiates a new TrainRoute 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 NewTrainRouteWithDefaults() *TrainRoute {
|
|
this := TrainRoute{}
|
|
return &this
|
|
}
|
|
|
|
// GetKeys returns the Keys field value if set, zero value otherwise.
|
|
func (o *TrainRoute) GetKeys() []string {
|
|
if o == nil || IsNil(o.Keys) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Keys
|
|
}
|
|
|
|
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainRoute) GetKeysOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Keys) {
|
|
return nil, false
|
|
}
|
|
return o.Keys, true
|
|
}
|
|
|
|
// HasKeys returns a boolean if a field has been set.
|
|
func (o *TrainRoute) HasKeys() bool {
|
|
if o != nil && !IsNil(o.Keys) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKeys gets a reference to the given []string and assigns it to the Keys field.
|
|
func (o *TrainRoute) SetKeys(v []string) {
|
|
o.Keys = v
|
|
}
|
|
|
|
// GetOptions returns the Options field value if set, zero value otherwise.
|
|
func (o *TrainRoute) GetOptions() map[string]TrainOptions {
|
|
if o == nil || IsNil(o.Options) {
|
|
var ret map[string]TrainOptions
|
|
return ret
|
|
}
|
|
return o.Options
|
|
}
|
|
|
|
// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainRoute) GetOptionsOk() (map[string]TrainOptions, bool) {
|
|
if o == nil || IsNil(o.Options) {
|
|
return map[string]TrainOptions{}, false
|
|
}
|
|
return o.Options, true
|
|
}
|
|
|
|
// HasOptions returns a boolean if a field has been set.
|
|
func (o *TrainRoute) HasOptions() bool {
|
|
if o != nil && !IsNil(o.Options) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOptions gets a reference to the given map[string]TrainOptions and assigns it to the Options field.
|
|
func (o *TrainRoute) SetOptions(v map[string]TrainOptions) {
|
|
o.Options = v
|
|
}
|
|
|
|
func (o TrainRoute) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainRoute) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Keys) {
|
|
toSerialize["keys"] = o.Keys
|
|
}
|
|
if !IsNil(o.Options) {
|
|
toSerialize["options"] = o.Options
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainRoute) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainRoute := _TrainRoute{}
|
|
|
|
err = json.Unmarshal(data, &varTrainRoute)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainRoute(varTrainRoute)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "keys")
|
|
delete(additionalProperties, "options")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainRoute struct {
|
|
value *TrainRoute
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainRoute) Get() *TrainRoute {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainRoute) Set(val *TrainRoute) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainRoute) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainRoute) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainRoute(val *TrainRoute) *NullableTrainRoute {
|
|
return &NullableTrainRoute{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainRoute) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainRoute) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|