Files
sdk/model_eval_score_view.go

459 lines
12 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 EvalScoreView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalScoreView{}
// EvalScoreView struct for EvalScoreView
type EvalScoreView struct {
// Comment is the grader's reasoning, truncated at 2000 characters.
Comment *string `json:"comment,omitempty"`
// DataType is NUMERIC, CATEGORICAL or BOOLEAN.
DataType *string `json:"dataType,omitempty"`
// ID is the score event's handle.
Id *string `json:"id,omitempty"`
// Name is the score name, which a rubric of the same name governs.
Name *string `json:"name,omitempty"`
// RunName is the run this score was recorded under, when it came from one.
RunName *string `json:"runName,omitempty"`
// StringValue is the label of a CATEGORICAL score.
StringValue *string `json:"stringValue,omitempty"`
// Timestamp is when the score was recorded.
Timestamp *string `json:"timestamp,omitempty"`
// TraceID is the model call this score grades, when it grades one.
TraceId *string `json:"traceId,omitempty"`
// Value is the numeric score; for BOOLEAN it is 0 or 1.
Value *float64 `json:"value,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EvalScoreView EvalScoreView
// NewEvalScoreView instantiates a new EvalScoreView 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 NewEvalScoreView() *EvalScoreView {
this := EvalScoreView{}
return &this
}
// NewEvalScoreViewWithDefaults instantiates a new EvalScoreView 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 NewEvalScoreViewWithDefaults() *EvalScoreView {
this := EvalScoreView{}
return &this
}
// GetComment returns the Comment field value if set, zero value otherwise.
func (o *EvalScoreView) GetComment() string {
if o == nil || IsNil(o.Comment) {
var ret string
return ret
}
return *o.Comment
}
// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetCommentOk() (*string, bool) {
if o == nil || IsNil(o.Comment) {
return nil, false
}
return o.Comment, true
}
// HasComment returns a boolean if a field has been set.
func (o *EvalScoreView) HasComment() bool {
if o != nil && !IsNil(o.Comment) {
return true
}
return false
}
// SetComment gets a reference to the given string and assigns it to the Comment field.
func (o *EvalScoreView) SetComment(v string) {
o.Comment = &v
}
// GetDataType returns the DataType field value if set, zero value otherwise.
func (o *EvalScoreView) 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 *EvalScoreView) 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 *EvalScoreView) 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 *EvalScoreView) SetDataType(v string) {
o.DataType = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *EvalScoreView) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *EvalScoreView) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *EvalScoreView) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *EvalScoreView) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *EvalScoreView) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *EvalScoreView) SetName(v string) {
o.Name = &v
}
// GetRunName returns the RunName field value if set, zero value otherwise.
func (o *EvalScoreView) GetRunName() string {
if o == nil || IsNil(o.RunName) {
var ret string
return ret
}
return *o.RunName
}
// GetRunNameOk returns a tuple with the RunName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetRunNameOk() (*string, bool) {
if o == nil || IsNil(o.RunName) {
return nil, false
}
return o.RunName, true
}
// HasRunName returns a boolean if a field has been set.
func (o *EvalScoreView) HasRunName() bool {
if o != nil && !IsNil(o.RunName) {
return true
}
return false
}
// SetRunName gets a reference to the given string and assigns it to the RunName field.
func (o *EvalScoreView) SetRunName(v string) {
o.RunName = &v
}
// GetStringValue returns the StringValue field value if set, zero value otherwise.
func (o *EvalScoreView) GetStringValue() string {
if o == nil || IsNil(o.StringValue) {
var ret string
return ret
}
return *o.StringValue
}
// GetStringValueOk returns a tuple with the StringValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetStringValueOk() (*string, bool) {
if o == nil || IsNil(o.StringValue) {
return nil, false
}
return o.StringValue, true
}
// HasStringValue returns a boolean if a field has been set.
func (o *EvalScoreView) HasStringValue() bool {
if o != nil && !IsNil(o.StringValue) {
return true
}
return false
}
// SetStringValue gets a reference to the given string and assigns it to the StringValue field.
func (o *EvalScoreView) SetStringValue(v string) {
o.StringValue = &v
}
// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
func (o *EvalScoreView) GetTimestamp() string {
if o == nil || IsNil(o.Timestamp) {
var ret string
return ret
}
return *o.Timestamp
}
// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetTimestampOk() (*string, bool) {
if o == nil || IsNil(o.Timestamp) {
return nil, false
}
return o.Timestamp, true
}
// HasTimestamp returns a boolean if a field has been set.
func (o *EvalScoreView) HasTimestamp() bool {
if o != nil && !IsNil(o.Timestamp) {
return true
}
return false
}
// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field.
func (o *EvalScoreView) SetTimestamp(v string) {
o.Timestamp = &v
}
// GetTraceId returns the TraceId field value if set, zero value otherwise.
func (o *EvalScoreView) GetTraceId() string {
if o == nil || IsNil(o.TraceId) {
var ret string
return ret
}
return *o.TraceId
}
// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetTraceIdOk() (*string, bool) {
if o == nil || IsNil(o.TraceId) {
return nil, false
}
return o.TraceId, true
}
// HasTraceId returns a boolean if a field has been set.
func (o *EvalScoreView) HasTraceId() bool {
if o != nil && !IsNil(o.TraceId) {
return true
}
return false
}
// SetTraceId gets a reference to the given string and assigns it to the TraceId field.
func (o *EvalScoreView) SetTraceId(v string) {
o.TraceId = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *EvalScoreView) GetValue() float64 {
if o == nil || IsNil(o.Value) {
var ret float64
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalScoreView) GetValueOk() (*float64, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *EvalScoreView) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given float64 and assigns it to the Value field.
func (o *EvalScoreView) SetValue(v float64) {
o.Value = &v
}
func (o EvalScoreView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalScoreView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Comment) {
toSerialize["comment"] = o.Comment
}
if !IsNil(o.DataType) {
toSerialize["dataType"] = o.DataType
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.RunName) {
toSerialize["runName"] = o.RunName
}
if !IsNil(o.StringValue) {
toSerialize["stringValue"] = o.StringValue
}
if !IsNil(o.Timestamp) {
toSerialize["timestamp"] = o.Timestamp
}
if !IsNil(o.TraceId) {
toSerialize["traceId"] = o.TraceId
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalScoreView) UnmarshalJSON(data []byte) (err error) {
varEvalScoreView := _EvalScoreView{}
err = json.Unmarshal(data, &varEvalScoreView)
if err != nil {
return err
}
*o = EvalScoreView(varEvalScoreView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "comment")
delete(additionalProperties, "dataType")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "runName")
delete(additionalProperties, "stringValue")
delete(additionalProperties, "timestamp")
delete(additionalProperties, "traceId")
delete(additionalProperties, "value")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalScoreView struct {
value *EvalScoreView
isSet bool
}
func (v NullableEvalScoreView) Get() *EvalScoreView {
return v.value
}
func (v *NullableEvalScoreView) Set(val *EvalScoreView) {
v.value = val
v.isSet = true
}
func (v NullableEvalScoreView) IsSet() bool {
return v.isSet
}
func (v *NullableEvalScoreView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalScoreView(val *EvalScoreView) *NullableEvalScoreView {
return &NullableEvalScoreView{value: val, isSet: true}
}
func (v NullableEvalScoreView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalScoreView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}