Files
sdk/model_eval_score_config_req.go

320 lines
8.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"
"fmt"
)
// checks if the EvalScoreConfigReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalScoreConfigReq{}
// EvalScoreConfigReq struct for EvalScoreConfigReq
type EvalScoreConfigReq struct {
// Categories is the closed set of labels a CATEGORICAL score may carry. A CATEGORICAL rubric with none is refused.
Categories []string `json:"categories,omitempty"`
// DataType is NUMERIC (the default), CATEGORICAL or BOOLEAN.
DataType *string `json:"dataType,omitempty"`
// MaxValue is the inclusive ceiling a NUMERIC score must stay under, finite.
MaxValue *float64 `json:"maxValue,omitempty"`
// MinValue is the inclusive floor a NUMERIC score must clear. It must be finite and must not exceed MaxValue.
MinValue *float64 `json:"minValue,omitempty"`
// Name is the score name this rubric governs, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$. The name is the key, so re-posting one replaces its rules.
Name string `json:"name"`
AdditionalProperties map[string]interface{}
}
type _EvalScoreConfigReq EvalScoreConfigReq
// NewEvalScoreConfigReq instantiates a new EvalScoreConfigReq 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 NewEvalScoreConfigReq(name string) *EvalScoreConfigReq {
this := EvalScoreConfigReq{}
this.Name = name
return &this
}
// NewEvalScoreConfigReqWithDefaults instantiates a new EvalScoreConfigReq 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 NewEvalScoreConfigReqWithDefaults() *EvalScoreConfigReq {
this := EvalScoreConfigReq{}
return &this
}
// GetCategories returns the Categories field value if set, zero value otherwise.
func (o *EvalScoreConfigReq) GetCategories() []string {
if o == nil || IsNil(o.Categories) {
var ret []string
return ret
}
return o.Categories
}
// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreConfigReq) GetCategoriesOk() ([]string, bool) {
if o == nil || IsNil(o.Categories) {
return nil, false
}
return o.Categories, true
}
// HasCategories returns a boolean if a field has been set.
func (o *EvalScoreConfigReq) HasCategories() bool {
if o != nil && !IsNil(o.Categories) {
return true
}
return false
}
// SetCategories gets a reference to the given []string and assigns it to the Categories field.
func (o *EvalScoreConfigReq) SetCategories(v []string) {
o.Categories = v
}
// GetDataType returns the DataType field value if set, zero value otherwise.
func (o *EvalScoreConfigReq) GetDataType() string {
if o == nil || IsNil(o.DataType) {
var ret string
return ret
}
return *o.DataType
}
// GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreConfigReq) GetDataTypeOk() (*string, bool) {
if o == nil || IsNil(o.DataType) {
return nil, false
}
return o.DataType, true
}
// HasDataType returns a boolean if a field has been set.
func (o *EvalScoreConfigReq) HasDataType() bool {
if o != nil && !IsNil(o.DataType) {
return true
}
return false
}
// SetDataType gets a reference to the given string and assigns it to the DataType field.
func (o *EvalScoreConfigReq) SetDataType(v string) {
o.DataType = &v
}
// GetMaxValue returns the MaxValue field value if set, zero value otherwise.
func (o *EvalScoreConfigReq) GetMaxValue() float64 {
if o == nil || IsNil(o.MaxValue) {
var ret float64
return ret
}
return *o.MaxValue
}
// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreConfigReq) GetMaxValueOk() (*float64, bool) {
if o == nil || IsNil(o.MaxValue) {
return nil, false
}
return o.MaxValue, true
}
// HasMaxValue returns a boolean if a field has been set.
func (o *EvalScoreConfigReq) HasMaxValue() bool {
if o != nil && !IsNil(o.MaxValue) {
return true
}
return false
}
// SetMaxValue gets a reference to the given float64 and assigns it to the MaxValue field.
func (o *EvalScoreConfigReq) SetMaxValue(v float64) {
o.MaxValue = &v
}
// GetMinValue returns the MinValue field value if set, zero value otherwise.
func (o *EvalScoreConfigReq) GetMinValue() float64 {
if o == nil || IsNil(o.MinValue) {
var ret float64
return ret
}
return *o.MinValue
}
// GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreConfigReq) GetMinValueOk() (*float64, bool) {
if o == nil || IsNil(o.MinValue) {
return nil, false
}
return o.MinValue, true
}
// HasMinValue returns a boolean if a field has been set.
func (o *EvalScoreConfigReq) HasMinValue() bool {
if o != nil && !IsNil(o.MinValue) {
return true
}
return false
}
// SetMinValue gets a reference to the given float64 and assigns it to the MinValue field.
func (o *EvalScoreConfigReq) SetMinValue(v float64) {
o.MinValue = &v
}
// GetName returns the Name field value
func (o *EvalScoreConfigReq) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *EvalScoreConfigReq) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *EvalScoreConfigReq) SetName(v string) {
o.Name = v
}
func (o EvalScoreConfigReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalScoreConfigReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Categories) {
toSerialize["categories"] = o.Categories
}
if !IsNil(o.DataType) {
toSerialize["dataType"] = o.DataType
}
if !IsNil(o.MaxValue) {
toSerialize["maxValue"] = o.MaxValue
}
if !IsNil(o.MinValue) {
toSerialize["minValue"] = o.MinValue
}
toSerialize["name"] = o.Name
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalScoreConfigReq) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"name",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEvalScoreConfigReq := _EvalScoreConfigReq{}
err = json.Unmarshal(data, &varEvalScoreConfigReq)
if err != nil {
return err
}
*o = EvalScoreConfigReq(varEvalScoreConfigReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "categories")
delete(additionalProperties, "dataType")
delete(additionalProperties, "maxValue")
delete(additionalProperties, "minValue")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalScoreConfigReq struct {
value *EvalScoreConfigReq
isSet bool
}
func (v NullableEvalScoreConfigReq) Get() *EvalScoreConfigReq {
return v.value
}
func (v *NullableEvalScoreConfigReq) Set(val *EvalScoreConfigReq) {
v.value = val
v.isSet = true
}
func (v NullableEvalScoreConfigReq) IsSet() bool {
return v.isSet
}
func (v *NullableEvalScoreConfigReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalScoreConfigReq(val *EvalScoreConfigReq) *NullableEvalScoreConfigReq {
return &NullableEvalScoreConfigReq{value: val, isSet: true}
}
func (v NullableEvalScoreConfigReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalScoreConfigReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}