Files
sdk/model_eval_evaluator_req.go

282 lines
7.4 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 EvalEvaluatorReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalEvaluatorReq{}
// EvalEvaluatorReq struct for EvalEvaluatorReq
type EvalEvaluatorReq struct {
// Criteria is the written standard the judge applies; over 64 KiB is refused.
Criteria *string `json:"criteria,omitempty"`
// Model is the model that will do the grading.
Model *string `json:"model,omitempty"`
// Name is the judge's org-unique handle, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$. Re-posting a name edits that judge rather than adding a second one.
Name string `json:"name"`
// ScoreName is the name the resulting scores are filed under. It defaults to the judge's own name and must match the same pattern.
ScoreName *string `json:"scoreName,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EvalEvaluatorReq EvalEvaluatorReq
// NewEvalEvaluatorReq instantiates a new EvalEvaluatorReq 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 NewEvalEvaluatorReq(name string) *EvalEvaluatorReq {
this := EvalEvaluatorReq{}
this.Name = name
return &this
}
// NewEvalEvaluatorReqWithDefaults instantiates a new EvalEvaluatorReq 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 NewEvalEvaluatorReqWithDefaults() *EvalEvaluatorReq {
this := EvalEvaluatorReq{}
return &this
}
// GetCriteria returns the Criteria field value if set, zero value otherwise.
func (o *EvalEvaluatorReq) GetCriteria() string {
if o == nil || IsNil(o.Criteria) {
var ret string
return ret
}
return *o.Criteria
}
// GetCriteriaOk returns a tuple with the Criteria field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalEvaluatorReq) GetCriteriaOk() (*string, bool) {
if o == nil || IsNil(o.Criteria) {
return nil, false
}
return o.Criteria, true
}
// HasCriteria returns a boolean if a field has been set.
func (o *EvalEvaluatorReq) HasCriteria() bool {
if o != nil && !IsNil(o.Criteria) {
return true
}
return false
}
// SetCriteria gets a reference to the given string and assigns it to the Criteria field.
func (o *EvalEvaluatorReq) SetCriteria(v string) {
o.Criteria = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *EvalEvaluatorReq) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalEvaluatorReq) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *EvalEvaluatorReq) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *EvalEvaluatorReq) SetModel(v string) {
o.Model = &v
}
// GetName returns the Name field value
func (o *EvalEvaluatorReq) 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 *EvalEvaluatorReq) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *EvalEvaluatorReq) SetName(v string) {
o.Name = v
}
// GetScoreName returns the ScoreName field value if set, zero value otherwise.
func (o *EvalEvaluatorReq) GetScoreName() string {
if o == nil || IsNil(o.ScoreName) {
var ret string
return ret
}
return *o.ScoreName
}
// GetScoreNameOk returns a tuple with the ScoreName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalEvaluatorReq) GetScoreNameOk() (*string, bool) {
if o == nil || IsNil(o.ScoreName) {
return nil, false
}
return o.ScoreName, true
}
// HasScoreName returns a boolean if a field has been set.
func (o *EvalEvaluatorReq) HasScoreName() bool {
if o != nil && !IsNil(o.ScoreName) {
return true
}
return false
}
// SetScoreName gets a reference to the given string and assigns it to the ScoreName field.
func (o *EvalEvaluatorReq) SetScoreName(v string) {
o.ScoreName = &v
}
func (o EvalEvaluatorReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalEvaluatorReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Criteria) {
toSerialize["criteria"] = o.Criteria
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
toSerialize["name"] = o.Name
if !IsNil(o.ScoreName) {
toSerialize["scoreName"] = o.ScoreName
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalEvaluatorReq) 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)
}
}
varEvalEvaluatorReq := _EvalEvaluatorReq{}
err = json.Unmarshal(data, &varEvalEvaluatorReq)
if err != nil {
return err
}
*o = EvalEvaluatorReq(varEvalEvaluatorReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "criteria")
delete(additionalProperties, "model")
delete(additionalProperties, "name")
delete(additionalProperties, "scoreName")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalEvaluatorReq struct {
value *EvalEvaluatorReq
isSet bool
}
func (v NullableEvalEvaluatorReq) Get() *EvalEvaluatorReq {
return v.value
}
func (v *NullableEvalEvaluatorReq) Set(val *EvalEvaluatorReq) {
v.value = val
v.isSet = true
}
func (v NullableEvalEvaluatorReq) IsSet() bool {
return v.isSet
}
func (v *NullableEvalEvaluatorReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalEvaluatorReq(val *EvalEvaluatorReq) *NullableEvalEvaluatorReq {
return &NullableEvalEvaluatorReq{value: val, isSet: true}
}
func (v NullableEvalEvaluatorReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalEvaluatorReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}