Files
sdk/model_train_save_in.go

231 lines
5.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 TrainSaveIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainSaveIn{}
// TrainSaveIn struct for TrainSaveIn
type TrainSaveIn struct {
// ID names the client.
Id *string `json:"id,omitempty"`
// Name is the adapter's name.
Name *string `json:"name,omitempty"`
// Output is lora, the one kind a client writes.
Output *TrainOutput `json:"output,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainSaveIn TrainSaveIn
// NewTrainSaveIn instantiates a new TrainSaveIn 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 NewTrainSaveIn() *TrainSaveIn {
this := TrainSaveIn{}
return &this
}
// NewTrainSaveInWithDefaults instantiates a new TrainSaveIn 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 NewTrainSaveInWithDefaults() *TrainSaveIn {
this := TrainSaveIn{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TrainSaveIn) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainSaveIn) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *TrainSaveIn) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *TrainSaveIn) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *TrainSaveIn) 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 *TrainSaveIn) 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 *TrainSaveIn) 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 *TrainSaveIn) SetName(v string) {
o.Name = &v
}
// GetOutput returns the Output field value if set, zero value otherwise.
func (o *TrainSaveIn) GetOutput() TrainOutput {
if o == nil || IsNil(o.Output) {
var ret TrainOutput
return ret
}
return *o.Output
}
// GetOutputOk returns a tuple with the Output field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainSaveIn) GetOutputOk() (*TrainOutput, bool) {
if o == nil || IsNil(o.Output) {
return nil, false
}
return o.Output, true
}
// HasOutput returns a boolean if a field has been set.
func (o *TrainSaveIn) HasOutput() bool {
if o != nil && !IsNil(o.Output) {
return true
}
return false
}
// SetOutput gets a reference to the given TrainOutput and assigns it to the Output field.
func (o *TrainSaveIn) SetOutput(v TrainOutput) {
o.Output = &v
}
func (o TrainSaveIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainSaveIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Output) {
toSerialize["output"] = o.Output
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainSaveIn) UnmarshalJSON(data []byte) (err error) {
varTrainSaveIn := _TrainSaveIn{}
err = json.Unmarshal(data, &varTrainSaveIn)
if err != nil {
return err
}
*o = TrainSaveIn(varTrainSaveIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "output")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainSaveIn struct {
value *TrainSaveIn
isSet bool
}
func (v NullableTrainSaveIn) Get() *TrainSaveIn {
return v.value
}
func (v *NullableTrainSaveIn) Set(val *TrainSaveIn) {
v.value = val
v.isSet = true
}
func (v NullableTrainSaveIn) IsSet() bool {
return v.isSet
}
func (v *NullableTrainSaveIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainSaveIn(val *TrainSaveIn) *NullableTrainSaveIn {
return &NullableTrainSaveIn{value: val, isSet: true}
}
func (v NullableTrainSaveIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainSaveIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}