model-registry/pkg/openapi/model_metric_create.go

428 lines
11 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: v1alpha3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetricCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetricCreate{}
// MetricCreate A metric to be created.
type MetricCreate struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,omitempty"`
// An optional description about the resource.
Description *string `json:"description,omitempty"`
// The external id that come from the clients system. This field is optional. If set, it must be unique among all resources within a database instance.
ExternalId *string `json:"externalId,omitempty"`
// The name/key of the metric (e.g., \"accuracy\", \"loss\", \"f1_score\").
Name *string `json:"name,omitempty"`
ArtifactType *string `json:"artifactType,omitempty"`
// The numeric value of the metric.
Value *float64 `json:"value,omitempty"`
// Unix timestamp in milliseconds when the metric was recorded.
Timestamp *string `json:"timestamp,omitempty"`
// The step number for multi-step metrics (e.g., training epochs).
Step *int64 `json:"step,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewMetricCreate instantiates a new MetricCreate 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 NewMetricCreate() *MetricCreate {
this := MetricCreate{}
var artifactType string = "metric"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewMetricCreateWithDefaults instantiates a new MetricCreate 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 NewMetricCreateWithDefaults() *MetricCreate {
this := MetricCreate{}
var artifactType string = "metric"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *MetricCreate) GetCustomProperties() map[string]MetadataValue {
if o == nil || IsNil(o.CustomProperties) {
var ret map[string]MetadataValue
return ret
}
return *o.CustomProperties
}
// GetCustomPropertiesOk returns a tuple with the CustomProperties field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricCreate) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *MetricCreate) HasCustomProperties() bool {
if o != nil && !IsNil(o.CustomProperties) {
return true
}
return false
}
// SetCustomProperties gets a reference to the given map[string]MetadataValue and assigns it to the CustomProperties field.
func (o *MetricCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *MetricCreate) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricCreate) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *MetricCreate) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *MetricCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *MetricCreate) GetExternalId() string {
if o == nil || IsNil(o.ExternalId) {
var ret string
return ret
}
return *o.ExternalId
}
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricCreate) GetExternalIdOk() (*string, bool) {
if o == nil || IsNil(o.ExternalId) {
return nil, false
}
return o.ExternalId, true
}
// HasExternalId returns a boolean if a field has been set.
func (o *MetricCreate) HasExternalId() bool {
if o != nil && !IsNil(o.ExternalId) {
return true
}
return false
}
// SetExternalId gets a reference to the given string and assigns it to the ExternalId field.
func (o *MetricCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *MetricCreate) 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 *MetricCreate) 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 *MetricCreate) 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 *MetricCreate) SetName(v string) {
o.Name = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *MetricCreate) GetArtifactType() string {
if o == nil || IsNil(o.ArtifactType) {
var ret string
return ret
}
return *o.ArtifactType
}
// GetArtifactTypeOk returns a tuple with the ArtifactType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricCreate) GetArtifactTypeOk() (*string, bool) {
if o == nil || IsNil(o.ArtifactType) {
return nil, false
}
return o.ArtifactType, true
}
// HasArtifactType returns a boolean if a field has been set.
func (o *MetricCreate) HasArtifactType() bool {
if o != nil && !IsNil(o.ArtifactType) {
return true
}
return false
}
// SetArtifactType gets a reference to the given string and assigns it to the ArtifactType field.
func (o *MetricCreate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *MetricCreate) 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 *MetricCreate) 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 *MetricCreate) 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 *MetricCreate) SetValue(v float64) {
o.Value = &v
}
// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
func (o *MetricCreate) 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 *MetricCreate) 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 *MetricCreate) 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 *MetricCreate) SetTimestamp(v string) {
o.Timestamp = &v
}
// GetStep returns the Step field value if set, zero value otherwise.
func (o *MetricCreate) GetStep() int64 {
if o == nil || IsNil(o.Step) {
var ret int64
return ret
}
return *o.Step
}
// GetStepOk returns a tuple with the Step field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricCreate) GetStepOk() (*int64, bool) {
if o == nil || IsNil(o.Step) {
return nil, false
}
return o.Step, true
}
// HasStep returns a boolean if a field has been set.
func (o *MetricCreate) HasStep() bool {
if o != nil && !IsNil(o.Step) {
return true
}
return false
}
// SetStep gets a reference to the given int64 and assigns it to the Step field.
func (o *MetricCreate) SetStep(v int64) {
o.Step = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *MetricCreate) GetState() ArtifactState {
if o == nil || IsNil(o.State) {
var ret ArtifactState
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricCreate) GetStateOk() (*ArtifactState, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *MetricCreate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ArtifactState and assigns it to the State field.
func (o *MetricCreate) SetState(v ArtifactState) {
o.State = &v
}
func (o MetricCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetricCreate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.ExternalId) {
toSerialize["externalId"] = o.ExternalId
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.ArtifactType) {
toSerialize["artifactType"] = o.ArtifactType
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.Timestamp) {
toSerialize["timestamp"] = o.Timestamp
}
if !IsNil(o.Step) {
toSerialize["step"] = o.Step
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableMetricCreate struct {
value *MetricCreate
isSet bool
}
func (v NullableMetricCreate) Get() *MetricCreate {
return v.value
}
func (v *NullableMetricCreate) Set(val *MetricCreate) {
v.value = val
v.isSet = true
}
func (v NullableMetricCreate) IsSet() bool {
return v.isSet
}
func (v *NullableMetricCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetricCreate(val *MetricCreate) *NullableMetricCreate {
return &NullableMetricCreate{value: val, isSet: true}
}
func (v NullableMetricCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetricCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}