mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.6 KiB
Go
269 lines
7.6 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 TrainCreateClientIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainCreateClientIn{}
|
|
|
|
// TrainCreateClientIn struct for TrainCreateClientIn
|
|
type TrainCreateClientIn struct {
|
|
// Adaptation is lora, the one mode clients run; its shape is lora_config.
|
|
Adaptation *TrainAdaptation `json:"adaptation,omitempty"`
|
|
// BaseModel is a model the engine loads: a Hugging Face repo id or a local path.
|
|
BaseModel *string `json:"base_model,omitempty"`
|
|
LoraConfig interface{} `json:"lora_config,omitempty"`
|
|
// Protect is refused: clients protect nothing yet.
|
|
Protect *TrainProtect `json:"protect,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainCreateClientIn TrainCreateClientIn
|
|
|
|
// NewTrainCreateClientIn instantiates a new TrainCreateClientIn 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 NewTrainCreateClientIn() *TrainCreateClientIn {
|
|
this := TrainCreateClientIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainCreateClientInWithDefaults instantiates a new TrainCreateClientIn 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 NewTrainCreateClientInWithDefaults() *TrainCreateClientIn {
|
|
this := TrainCreateClientIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetAdaptation returns the Adaptation field value if set, zero value otherwise.
|
|
func (o *TrainCreateClientIn) GetAdaptation() TrainAdaptation {
|
|
if o == nil || IsNil(o.Adaptation) {
|
|
var ret TrainAdaptation
|
|
return ret
|
|
}
|
|
return *o.Adaptation
|
|
}
|
|
|
|
// GetAdaptationOk returns a tuple with the Adaptation field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCreateClientIn) GetAdaptationOk() (*TrainAdaptation, bool) {
|
|
if o == nil || IsNil(o.Adaptation) {
|
|
return nil, false
|
|
}
|
|
return o.Adaptation, true
|
|
}
|
|
|
|
// HasAdaptation returns a boolean if a field has been set.
|
|
func (o *TrainCreateClientIn) HasAdaptation() bool {
|
|
if o != nil && !IsNil(o.Adaptation) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAdaptation gets a reference to the given TrainAdaptation and assigns it to the Adaptation field.
|
|
func (o *TrainCreateClientIn) SetAdaptation(v TrainAdaptation) {
|
|
o.Adaptation = &v
|
|
}
|
|
|
|
// GetBaseModel returns the BaseModel field value if set, zero value otherwise.
|
|
func (o *TrainCreateClientIn) GetBaseModel() string {
|
|
if o == nil || IsNil(o.BaseModel) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.BaseModel
|
|
}
|
|
|
|
// GetBaseModelOk returns a tuple with the BaseModel field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCreateClientIn) GetBaseModelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.BaseModel) {
|
|
return nil, false
|
|
}
|
|
return o.BaseModel, true
|
|
}
|
|
|
|
// HasBaseModel returns a boolean if a field has been set.
|
|
func (o *TrainCreateClientIn) HasBaseModel() bool {
|
|
if o != nil && !IsNil(o.BaseModel) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBaseModel gets a reference to the given string and assigns it to the BaseModel field.
|
|
func (o *TrainCreateClientIn) SetBaseModel(v string) {
|
|
o.BaseModel = &v
|
|
}
|
|
|
|
// GetLoraConfig returns the LoraConfig field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *TrainCreateClientIn) GetLoraConfig() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.LoraConfig
|
|
}
|
|
|
|
// GetLoraConfigOk returns a tuple with the LoraConfig field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *TrainCreateClientIn) GetLoraConfigOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.LoraConfig) {
|
|
return nil, false
|
|
}
|
|
return &o.LoraConfig, true
|
|
}
|
|
|
|
// HasLoraConfig returns a boolean if a field has been set.
|
|
func (o *TrainCreateClientIn) HasLoraConfig() bool {
|
|
if o != nil && !IsNil(o.LoraConfig) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLoraConfig gets a reference to the given interface{} and assigns it to the LoraConfig field.
|
|
func (o *TrainCreateClientIn) SetLoraConfig(v interface{}) {
|
|
o.LoraConfig = v
|
|
}
|
|
|
|
// GetProtect returns the Protect field value if set, zero value otherwise.
|
|
func (o *TrainCreateClientIn) GetProtect() TrainProtect {
|
|
if o == nil || IsNil(o.Protect) {
|
|
var ret TrainProtect
|
|
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 *TrainCreateClientIn) GetProtectOk() (*TrainProtect, 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 *TrainCreateClientIn) HasProtect() bool {
|
|
if o != nil && !IsNil(o.Protect) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProtect gets a reference to the given TrainProtect and assigns it to the Protect field.
|
|
func (o *TrainCreateClientIn) SetProtect(v TrainProtect) {
|
|
o.Protect = &v
|
|
}
|
|
|
|
func (o TrainCreateClientIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainCreateClientIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Adaptation) {
|
|
toSerialize["adaptation"] = o.Adaptation
|
|
}
|
|
if !IsNil(o.BaseModel) {
|
|
toSerialize["base_model"] = o.BaseModel
|
|
}
|
|
if o.LoraConfig != nil {
|
|
toSerialize["lora_config"] = o.LoraConfig
|
|
}
|
|
if !IsNil(o.Protect) {
|
|
toSerialize["protect"] = o.Protect
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainCreateClientIn) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainCreateClientIn := _TrainCreateClientIn{}
|
|
|
|
err = json.Unmarshal(data, &varTrainCreateClientIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainCreateClientIn(varTrainCreateClientIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "adaptation")
|
|
delete(additionalProperties, "base_model")
|
|
delete(additionalProperties, "lora_config")
|
|
delete(additionalProperties, "protect")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainCreateClientIn struct {
|
|
value *TrainCreateClientIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainCreateClientIn) Get() *TrainCreateClientIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainCreateClientIn) Set(val *TrainCreateClientIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainCreateClientIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainCreateClientIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainCreateClientIn(val *TrainCreateClientIn) *NullableTrainCreateClientIn {
|
|
return &NullableTrainCreateClientIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainCreateClientIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainCreateClientIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|