Files
sdk/model_train_forward_in.go

193 lines
4.7 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 TrainForwardIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainForwardIn{}
// TrainForwardIn struct for TrainForwardIn
type TrainForwardIn struct {
// Data are the examples: {prompt, completion} text, or tokenized datums.
Data []interface{} `json:"data,omitempty"`
// ID names the client.
Id *string `json:"id,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainForwardIn TrainForwardIn
// NewTrainForwardIn instantiates a new TrainForwardIn 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 NewTrainForwardIn() *TrainForwardIn {
this := TrainForwardIn{}
return &this
}
// NewTrainForwardInWithDefaults instantiates a new TrainForwardIn 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 NewTrainForwardInWithDefaults() *TrainForwardIn {
this := TrainForwardIn{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *TrainForwardIn) GetData() []interface{} {
if o == nil || IsNil(o.Data) {
var ret []interface{}
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainForwardIn) GetDataOk() ([]interface{}, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *TrainForwardIn) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given []interface{} and assigns it to the Data field.
func (o *TrainForwardIn) SetData(v []interface{}) {
o.Data = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TrainForwardIn) 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 *TrainForwardIn) 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 *TrainForwardIn) 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 *TrainForwardIn) SetId(v string) {
o.Id = &v
}
func (o TrainForwardIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainForwardIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainForwardIn) UnmarshalJSON(data []byte) (err error) {
varTrainForwardIn := _TrainForwardIn{}
err = json.Unmarshal(data, &varTrainForwardIn)
if err != nil {
return err
}
*o = TrainForwardIn(varTrainForwardIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainForwardIn struct {
value *TrainForwardIn
isSet bool
}
func (v NullableTrainForwardIn) Get() *TrainForwardIn {
return v.value
}
func (v *NullableTrainForwardIn) Set(val *TrainForwardIn) {
v.value = val
v.isSet = true
}
func (v NullableTrainForwardIn) IsSet() bool {
return v.isSet
}
func (v *NullableTrainForwardIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainForwardIn(val *TrainForwardIn) *NullableTrainForwardIn {
return &NullableTrainForwardIn{value: val, isSet: true}
}
func (v NullableTrainForwardIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainForwardIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}