Files
sdk/model_train_supports.go

269 lines
6.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 TrainSupports type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainSupports{}
// TrainSupports struct for TrainSupports
type TrainSupports struct {
// Adaptations are the modes it runs.
Adaptations []string `json:"adaptations,omitempty"`
// Outputs are the output kinds it produces.
Outputs []string `json:"outputs,omitempty"`
// Protect are the protections it runs: projection, distillation, capabilities.
Protect []string `json:"protect,omitempty"`
// Terms are the objective terms it runs.
Terms []string `json:"terms,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainSupports TrainSupports
// NewTrainSupports instantiates a new TrainSupports 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 NewTrainSupports() *TrainSupports {
this := TrainSupports{}
return &this
}
// NewTrainSupportsWithDefaults instantiates a new TrainSupports 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 NewTrainSupportsWithDefaults() *TrainSupports {
this := TrainSupports{}
return &this
}
// GetAdaptations returns the Adaptations field value if set, zero value otherwise.
func (o *TrainSupports) GetAdaptations() []string {
if o == nil || IsNil(o.Adaptations) {
var ret []string
return ret
}
return o.Adaptations
}
// GetAdaptationsOk returns a tuple with the Adaptations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainSupports) GetAdaptationsOk() ([]string, bool) {
if o == nil || IsNil(o.Adaptations) {
return nil, false
}
return o.Adaptations, true
}
// HasAdaptations returns a boolean if a field has been set.
func (o *TrainSupports) HasAdaptations() bool {
if o != nil && !IsNil(o.Adaptations) {
return true
}
return false
}
// SetAdaptations gets a reference to the given []string and assigns it to the Adaptations field.
func (o *TrainSupports) SetAdaptations(v []string) {
o.Adaptations = v
}
// GetOutputs returns the Outputs field value if set, zero value otherwise.
func (o *TrainSupports) GetOutputs() []string {
if o == nil || IsNil(o.Outputs) {
var ret []string
return ret
}
return o.Outputs
}
// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainSupports) GetOutputsOk() ([]string, bool) {
if o == nil || IsNil(o.Outputs) {
return nil, false
}
return o.Outputs, true
}
// HasOutputs returns a boolean if a field has been set.
func (o *TrainSupports) HasOutputs() bool {
if o != nil && !IsNil(o.Outputs) {
return true
}
return false
}
// SetOutputs gets a reference to the given []string and assigns it to the Outputs field.
func (o *TrainSupports) SetOutputs(v []string) {
o.Outputs = v
}
// GetProtect returns the Protect field value if set, zero value otherwise.
func (o *TrainSupports) GetProtect() []string {
if o == nil || IsNil(o.Protect) {
var ret []string
return ret
}
return o.Protect
}
// GetProtectOk returns a tuple with the Protect field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainSupports) GetProtectOk() ([]string, bool) {
if o == nil || IsNil(o.Protect) {
return nil, false
}
return o.Protect, true
}
// HasProtect returns a boolean if a field has been set.
func (o *TrainSupports) HasProtect() bool {
if o != nil && !IsNil(o.Protect) {
return true
}
return false
}
// SetProtect gets a reference to the given []string and assigns it to the Protect field.
func (o *TrainSupports) SetProtect(v []string) {
o.Protect = v
}
// GetTerms returns the Terms field value if set, zero value otherwise.
func (o *TrainSupports) GetTerms() []string {
if o == nil || IsNil(o.Terms) {
var ret []string
return ret
}
return o.Terms
}
// GetTermsOk returns a tuple with the Terms field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainSupports) GetTermsOk() ([]string, bool) {
if o == nil || IsNil(o.Terms) {
return nil, false
}
return o.Terms, true
}
// HasTerms returns a boolean if a field has been set.
func (o *TrainSupports) HasTerms() bool {
if o != nil && !IsNil(o.Terms) {
return true
}
return false
}
// SetTerms gets a reference to the given []string and assigns it to the Terms field.
func (o *TrainSupports) SetTerms(v []string) {
o.Terms = v
}
func (o TrainSupports) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainSupports) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Adaptations) {
toSerialize["adaptations"] = o.Adaptations
}
if !IsNil(o.Outputs) {
toSerialize["outputs"] = o.Outputs
}
if !IsNil(o.Protect) {
toSerialize["protect"] = o.Protect
}
if !IsNil(o.Terms) {
toSerialize["terms"] = o.Terms
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainSupports) UnmarshalJSON(data []byte) (err error) {
varTrainSupports := _TrainSupports{}
err = json.Unmarshal(data, &varTrainSupports)
if err != nil {
return err
}
*o = TrainSupports(varTrainSupports)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "adaptations")
delete(additionalProperties, "outputs")
delete(additionalProperties, "protect")
delete(additionalProperties, "terms")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainSupports struct {
value *TrainSupports
isSet bool
}
func (v NullableTrainSupports) Get() *TrainSupports {
return v.value
}
func (v *NullableTrainSupports) Set(val *TrainSupports) {
v.value = val
v.isSet = true
}
func (v NullableTrainSupports) IsSet() bool {
return v.isSet
}
func (v *NullableTrainSupports) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainSupports(val *TrainSupports) *NullableTrainSupports {
return &NullableTrainSupports{value: val, isSet: true}
}
func (v NullableTrainSupports) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainSupports) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}