mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
155 lines
4.0 KiB
Go
155 lines
4.0 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 TrainProjection type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainProjection{}
|
|
|
|
// TrainProjection struct for TrainProjection
|
|
type TrainProjection struct {
|
|
// Strength is λ in [0, 1]; absent is 1, the whole of P g removed.
|
|
Strength *float64 `json:"strength,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainProjection TrainProjection
|
|
|
|
// NewTrainProjection instantiates a new TrainProjection 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 NewTrainProjection() *TrainProjection {
|
|
this := TrainProjection{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainProjectionWithDefaults instantiates a new TrainProjection 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 NewTrainProjectionWithDefaults() *TrainProjection {
|
|
this := TrainProjection{}
|
|
return &this
|
|
}
|
|
|
|
// GetStrength returns the Strength field value if set, zero value otherwise.
|
|
func (o *TrainProjection) GetStrength() float64 {
|
|
if o == nil || IsNil(o.Strength) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.Strength
|
|
}
|
|
|
|
// GetStrengthOk returns a tuple with the Strength field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainProjection) GetStrengthOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.Strength) {
|
|
return nil, false
|
|
}
|
|
return o.Strength, true
|
|
}
|
|
|
|
// HasStrength returns a boolean if a field has been set.
|
|
func (o *TrainProjection) HasStrength() bool {
|
|
if o != nil && !IsNil(o.Strength) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStrength gets a reference to the given float64 and assigns it to the Strength field.
|
|
func (o *TrainProjection) SetStrength(v float64) {
|
|
o.Strength = &v
|
|
}
|
|
|
|
func (o TrainProjection) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainProjection) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Strength) {
|
|
toSerialize["strength"] = o.Strength
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainProjection) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainProjection := _TrainProjection{}
|
|
|
|
err = json.Unmarshal(data, &varTrainProjection)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainProjection(varTrainProjection)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "strength")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainProjection struct {
|
|
value *TrainProjection
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainProjection) Get() *TrainProjection {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainProjection) Set(val *TrainProjection) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainProjection) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainProjection) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainProjection(val *TrainProjection) *NullableTrainProjection {
|
|
return &NullableTrainProjection{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainProjection) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainProjection) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|