613 lines
17 KiB
Go
613 lines
17 KiB
Go
/*
|
||
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 Metric type satisfies the MappedNullable interface at compile time
|
||
var _ MappedNullable = &Metric{}
|
||
|
||
// Metric A metric representing a numerical measurement from model training or evaluation.
|
||
type Metric 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"`
|
||
// The unique server generated id of the resource.
|
||
Id *string `json:"id,omitempty"`
|
||
// Output only. Create time of the resource in millisecond since epoch.
|
||
CreateTimeSinceEpoch *string `json:"createTimeSinceEpoch,omitempty"`
|
||
// Output only. Last update time of the resource since epoch in millisecond since epoch.
|
||
LastUpdateTimeSinceEpoch *string `json:"lastUpdateTimeSinceEpoch,omitempty"`
|
||
// Optional id of the experiment that produced this artifact.
|
||
ExperimentId *string `json:"experimentId,omitempty"`
|
||
// Optional id of the experiment run that produced this artifact.
|
||
ExperimentRunId *string `json:"experimentRunId,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"`
|
||
}
|
||
|
||
// NewMetric instantiates a new Metric 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 NewMetric() *Metric {
|
||
this := Metric{}
|
||
var artifactType string = "metric"
|
||
this.ArtifactType = &artifactType
|
||
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
|
||
this.State = &state
|
||
return &this
|
||
}
|
||
|
||
// NewMetricWithDefaults instantiates a new Metric 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 NewMetricWithDefaults() *Metric {
|
||
this := Metric{}
|
||
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 *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetCustomProperties(v map[string]MetadataValue) {
|
||
o.CustomProperties = &v
|
||
}
|
||
|
||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetDescription(v string) {
|
||
o.Description = &v
|
||
}
|
||
|
||
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetExternalId(v string) {
|
||
o.ExternalId = &v
|
||
}
|
||
|
||
// GetName returns the Name field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetName(v string) {
|
||
o.Name = &v
|
||
}
|
||
|
||
// GetId returns the Id field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetId(v string) {
|
||
o.Id = &v
|
||
}
|
||
|
||
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
|
||
func (o *Metric) GetCreateTimeSinceEpoch() string {
|
||
if o == nil || IsNil(o.CreateTimeSinceEpoch) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.CreateTimeSinceEpoch
|
||
}
|
||
|
||
// GetCreateTimeSinceEpochOk returns a tuple with the CreateTimeSinceEpoch field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *Metric) GetCreateTimeSinceEpochOk() (*string, bool) {
|
||
if o == nil || IsNil(o.CreateTimeSinceEpoch) {
|
||
return nil, false
|
||
}
|
||
return o.CreateTimeSinceEpoch, true
|
||
}
|
||
|
||
// HasCreateTimeSinceEpoch returns a boolean if a field has been set.
|
||
func (o *Metric) HasCreateTimeSinceEpoch() bool {
|
||
if o != nil && !IsNil(o.CreateTimeSinceEpoch) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetCreateTimeSinceEpoch gets a reference to the given string and assigns it to the CreateTimeSinceEpoch field.
|
||
func (o *Metric) SetCreateTimeSinceEpoch(v string) {
|
||
o.CreateTimeSinceEpoch = &v
|
||
}
|
||
|
||
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
|
||
func (o *Metric) GetLastUpdateTimeSinceEpoch() string {
|
||
if o == nil || IsNil(o.LastUpdateTimeSinceEpoch) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.LastUpdateTimeSinceEpoch
|
||
}
|
||
|
||
// GetLastUpdateTimeSinceEpochOk returns a tuple with the LastUpdateTimeSinceEpoch field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *Metric) GetLastUpdateTimeSinceEpochOk() (*string, bool) {
|
||
if o == nil || IsNil(o.LastUpdateTimeSinceEpoch) {
|
||
return nil, false
|
||
}
|
||
return o.LastUpdateTimeSinceEpoch, true
|
||
}
|
||
|
||
// HasLastUpdateTimeSinceEpoch returns a boolean if a field has been set.
|
||
func (o *Metric) HasLastUpdateTimeSinceEpoch() bool {
|
||
if o != nil && !IsNil(o.LastUpdateTimeSinceEpoch) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetLastUpdateTimeSinceEpoch gets a reference to the given string and assigns it to the LastUpdateTimeSinceEpoch field.
|
||
func (o *Metric) SetLastUpdateTimeSinceEpoch(v string) {
|
||
o.LastUpdateTimeSinceEpoch = &v
|
||
}
|
||
|
||
// GetExperimentId returns the ExperimentId field value if set, zero value otherwise.
|
||
func (o *Metric) GetExperimentId() string {
|
||
if o == nil || IsNil(o.ExperimentId) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.ExperimentId
|
||
}
|
||
|
||
// GetExperimentIdOk returns a tuple with the ExperimentId field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *Metric) GetExperimentIdOk() (*string, bool) {
|
||
if o == nil || IsNil(o.ExperimentId) {
|
||
return nil, false
|
||
}
|
||
return o.ExperimentId, true
|
||
}
|
||
|
||
// HasExperimentId returns a boolean if a field has been set.
|
||
func (o *Metric) HasExperimentId() bool {
|
||
if o != nil && !IsNil(o.ExperimentId) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetExperimentId gets a reference to the given string and assigns it to the ExperimentId field.
|
||
func (o *Metric) SetExperimentId(v string) {
|
||
o.ExperimentId = &v
|
||
}
|
||
|
||
// GetExperimentRunId returns the ExperimentRunId field value if set, zero value otherwise.
|
||
func (o *Metric) GetExperimentRunId() string {
|
||
if o == nil || IsNil(o.ExperimentRunId) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.ExperimentRunId
|
||
}
|
||
|
||
// GetExperimentRunIdOk returns a tuple with the ExperimentRunId field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *Metric) GetExperimentRunIdOk() (*string, bool) {
|
||
if o == nil || IsNil(o.ExperimentRunId) {
|
||
return nil, false
|
||
}
|
||
return o.ExperimentRunId, true
|
||
}
|
||
|
||
// HasExperimentRunId returns a boolean if a field has been set.
|
||
func (o *Metric) HasExperimentRunId() bool {
|
||
if o != nil && !IsNil(o.ExperimentRunId) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetExperimentRunId gets a reference to the given string and assigns it to the ExperimentRunId field.
|
||
func (o *Metric) SetExperimentRunId(v string) {
|
||
o.ExperimentRunId = &v
|
||
}
|
||
|
||
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetArtifactType(v string) {
|
||
o.ArtifactType = &v
|
||
}
|
||
|
||
// GetValue returns the Value field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetValue(v float64) {
|
||
o.Value = &v
|
||
}
|
||
|
||
// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetTimestamp(v string) {
|
||
o.Timestamp = &v
|
||
}
|
||
|
||
// GetStep returns the Step field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetStep(v int64) {
|
||
o.Step = &v
|
||
}
|
||
|
||
// GetState returns the State field value if set, zero value otherwise.
|
||
func (o *Metric) 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 *Metric) 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 *Metric) 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 *Metric) SetState(v ArtifactState) {
|
||
o.State = &v
|
||
}
|
||
|
||
func (o Metric) MarshalJSON() ([]byte, error) {
|
||
toSerialize, err := o.ToMap()
|
||
if err != nil {
|
||
return []byte{}, err
|
||
}
|
||
return json.Marshal(toSerialize)
|
||
}
|
||
|
||
func (o Metric) 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.Id) {
|
||
toSerialize["id"] = o.Id
|
||
}
|
||
if !IsNil(o.CreateTimeSinceEpoch) {
|
||
toSerialize["createTimeSinceEpoch"] = o.CreateTimeSinceEpoch
|
||
}
|
||
if !IsNil(o.LastUpdateTimeSinceEpoch) {
|
||
toSerialize["lastUpdateTimeSinceEpoch"] = o.LastUpdateTimeSinceEpoch
|
||
}
|
||
if !IsNil(o.ExperimentId) {
|
||
toSerialize["experimentId"] = o.ExperimentId
|
||
}
|
||
if !IsNil(o.ExperimentRunId) {
|
||
toSerialize["experimentRunId"] = o.ExperimentRunId
|
||
}
|
||
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 NullableMetric struct {
|
||
value *Metric
|
||
isSet bool
|
||
}
|
||
|
||
func (v NullableMetric) Get() *Metric {
|
||
return v.value
|
||
}
|
||
|
||
func (v *NullableMetric) Set(val *Metric) {
|
||
v.value = val
|
||
v.isSet = true
|
||
}
|
||
|
||
func (v NullableMetric) IsSet() bool {
|
||
return v.isSet
|
||
}
|
||
|
||
func (v *NullableMetric) Unset() {
|
||
v.value = nil
|
||
v.isSet = false
|
||
}
|
||
|
||
func NewNullableMetric(val *Metric) *NullableMetric {
|
||
return &NullableMetric{value: val, isSet: true}
|
||
}
|
||
|
||
func (v NullableMetric) MarshalJSON() ([]byte, error) {
|
||
return json.Marshal(v.value)
|
||
}
|
||
|
||
func (v *NullableMetric) UnmarshalJSON(src []byte) error {
|
||
v.isSet = true
|
||
return json.Unmarshal(src, &v.value)
|
||
}
|