Files
sdk/model_train_dataset.go

193 lines
4.8 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 TrainDataset type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainDataset{}
// TrainDataset struct for TrainDataset
type TrainDataset struct {
// Splits maps a role (train, validation) to the dataset's own split name.
Splits map[string]string `json:"splits,omitempty"`
// URI names the data.
Uri *string `json:"uri,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainDataset TrainDataset
// NewTrainDataset instantiates a new TrainDataset 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 NewTrainDataset() *TrainDataset {
this := TrainDataset{}
return &this
}
// NewTrainDatasetWithDefaults instantiates a new TrainDataset 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 NewTrainDatasetWithDefaults() *TrainDataset {
this := TrainDataset{}
return &this
}
// GetSplits returns the Splits field value if set, zero value otherwise.
func (o *TrainDataset) GetSplits() map[string]string {
if o == nil || IsNil(o.Splits) {
var ret map[string]string
return ret
}
return o.Splits
}
// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainDataset) GetSplitsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Splits) {
return map[string]string{}, false
}
return o.Splits, true
}
// HasSplits returns a boolean if a field has been set.
func (o *TrainDataset) HasSplits() bool {
if o != nil && !IsNil(o.Splits) {
return true
}
return false
}
// SetSplits gets a reference to the given map[string]string and assigns it to the Splits field.
func (o *TrainDataset) SetSplits(v map[string]string) {
o.Splits = v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *TrainDataset) GetUri() string {
if o == nil || IsNil(o.Uri) {
var ret string
return ret
}
return *o.Uri
}
// GetUriOk returns a tuple with the Uri field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainDataset) GetUriOk() (*string, bool) {
if o == nil || IsNil(o.Uri) {
return nil, false
}
return o.Uri, true
}
// HasUri returns a boolean if a field has been set.
func (o *TrainDataset) HasUri() bool {
if o != nil && !IsNil(o.Uri) {
return true
}
return false
}
// SetUri gets a reference to the given string and assigns it to the Uri field.
func (o *TrainDataset) SetUri(v string) {
o.Uri = &v
}
func (o TrainDataset) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainDataset) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Splits) {
toSerialize["splits"] = o.Splits
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainDataset) UnmarshalJSON(data []byte) (err error) {
varTrainDataset := _TrainDataset{}
err = json.Unmarshal(data, &varTrainDataset)
if err != nil {
return err
}
*o = TrainDataset(varTrainDataset)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "splits")
delete(additionalProperties, "uri")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainDataset struct {
value *TrainDataset
isSet bool
}
func (v NullableTrainDataset) Get() *TrainDataset {
return v.value
}
func (v *NullableTrainDataset) Set(val *TrainDataset) {
v.value = val
v.isSet = true
}
func (v NullableTrainDataset) IsSet() bool {
return v.isSet
}
func (v *NullableTrainDataset) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainDataset(val *TrainDataset) *NullableTrainDataset {
return &NullableTrainDataset{value: val, isSet: true}
}
func (v NullableTrainDataset) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainDataset) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}