Files
sdk/model_eval_item_view.go

421 lines
11 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 EvalItemView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalItemView{}
// EvalItemView struct for EvalItemView
type EvalItemView struct {
// CreatedAt is when the example was first written.
CreatedAt *string `json:"createdAt,omitempty"`
// Dataset is the set this example belongs to.
DatasetName *string `json:"datasetName,omitempty"`
ExpectedOutput interface{} `json:"expectedOutput,omitempty"`
// ID is the example's handle, unique within the caller's org.
Id *string `json:"id,omitempty"`
Input interface{} `json:"input,omitempty"`
// Metadata is the free-form object stored with the example.
Metadata map[string]interface{} `json:"metadata,omitempty"`
// Status is ACTIVE or ARCHIVED. Only ACTIVE examples are fed to a run, which is how one is retired without being deleted.
Status *string `json:"status,omitempty"`
// UpdatedAt is when it last changed.
UpdatedAt *string `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EvalItemView EvalItemView
// NewEvalItemView instantiates a new EvalItemView 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 NewEvalItemView() *EvalItemView {
this := EvalItemView{}
return &this
}
// NewEvalItemViewWithDefaults instantiates a new EvalItemView 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 NewEvalItemViewWithDefaults() *EvalItemView {
this := EvalItemView{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *EvalItemView) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt) {
var ret string
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemView) GetCreatedAtOk() (*string, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *EvalItemView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *EvalItemView) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetDatasetName returns the DatasetName field value if set, zero value otherwise.
func (o *EvalItemView) GetDatasetName() string {
if o == nil || IsNil(o.DatasetName) {
var ret string
return ret
}
return *o.DatasetName
}
// GetDatasetNameOk returns a tuple with the DatasetName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemView) GetDatasetNameOk() (*string, bool) {
if o == nil || IsNil(o.DatasetName) {
return nil, false
}
return o.DatasetName, true
}
// HasDatasetName returns a boolean if a field has been set.
func (o *EvalItemView) HasDatasetName() bool {
if o != nil && !IsNil(o.DatasetName) {
return true
}
return false
}
// SetDatasetName gets a reference to the given string and assigns it to the DatasetName field.
func (o *EvalItemView) SetDatasetName(v string) {
o.DatasetName = &v
}
// GetExpectedOutput returns the ExpectedOutput field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EvalItemView) GetExpectedOutput() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.ExpectedOutput
}
// GetExpectedOutputOk returns a tuple with the ExpectedOutput 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 *EvalItemView) GetExpectedOutputOk() (*interface{}, bool) {
if o == nil || IsNil(o.ExpectedOutput) {
return nil, false
}
return &o.ExpectedOutput, true
}
// HasExpectedOutput returns a boolean if a field has been set.
func (o *EvalItemView) HasExpectedOutput() bool {
if o != nil && !IsNil(o.ExpectedOutput) {
return true
}
return false
}
// SetExpectedOutput gets a reference to the given interface{} and assigns it to the ExpectedOutput field.
func (o *EvalItemView) SetExpectedOutput(v interface{}) {
o.ExpectedOutput = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *EvalItemView) 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 *EvalItemView) 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 *EvalItemView) 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 *EvalItemView) SetId(v string) {
o.Id = &v
}
// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EvalItemView) GetInput() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Input
}
// GetInputOk returns a tuple with the Input 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 *EvalItemView) GetInputOk() (*interface{}, bool) {
if o == nil || IsNil(o.Input) {
return nil, false
}
return &o.Input, true
}
// HasInput returns a boolean if a field has been set.
func (o *EvalItemView) HasInput() bool {
if o != nil && !IsNil(o.Input) {
return true
}
return false
}
// SetInput gets a reference to the given interface{} and assigns it to the Input field.
func (o *EvalItemView) SetInput(v interface{}) {
o.Input = v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *EvalItemView) GetMetadata() map[string]interface{} {
if o == nil || IsNil(o.Metadata) {
var ret map[string]interface{}
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemView) GetMetadataOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Metadata) {
return map[string]interface{}{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *EvalItemView) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *EvalItemView) SetMetadata(v map[string]interface{}) {
o.Metadata = v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *EvalItemView) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemView) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *EvalItemView) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *EvalItemView) SetStatus(v string) {
o.Status = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *EvalItemView) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemView) GetUpdatedAtOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *EvalItemView) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *EvalItemView) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
func (o EvalItemView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalItemView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.DatasetName) {
toSerialize["datasetName"] = o.DatasetName
}
if o.ExpectedOutput != nil {
toSerialize["expectedOutput"] = o.ExpectedOutput
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if o.Input != nil {
toSerialize["input"] = o.Input
}
if !IsNil(o.Metadata) {
toSerialize["metadata"] = o.Metadata
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalItemView) UnmarshalJSON(data []byte) (err error) {
varEvalItemView := _EvalItemView{}
err = json.Unmarshal(data, &varEvalItemView)
if err != nil {
return err
}
*o = EvalItemView(varEvalItemView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdAt")
delete(additionalProperties, "datasetName")
delete(additionalProperties, "expectedOutput")
delete(additionalProperties, "id")
delete(additionalProperties, "input")
delete(additionalProperties, "metadata")
delete(additionalProperties, "status")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalItemView struct {
value *EvalItemView
isSet bool
}
func (v NullableEvalItemView) Get() *EvalItemView {
return v.value
}
func (v *NullableEvalItemView) Set(val *EvalItemView) {
v.value = val
v.isSet = true
}
func (v NullableEvalItemView) IsSet() bool {
return v.isSet
}
func (v *NullableEvalItemView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalItemView(val *EvalItemView) *NullableEvalItemView {
return &NullableEvalItemView{value: val, isSet: true}
}
func (v NullableEvalItemView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalItemView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}