391 lines
10 KiB
Go
391 lines
10 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 MetricUpdate type satisfies the MappedNullable interface at compile time
|
||
var _ MappedNullable = &MetricUpdate{}
|
||
|
||
// MetricUpdate A metric to be updated.
|
||
type MetricUpdate 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"`
|
||
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"`
|
||
}
|
||
|
||
// NewMetricUpdate instantiates a new MetricUpdate 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 NewMetricUpdate() *MetricUpdate {
|
||
this := MetricUpdate{}
|
||
var artifactType string = "metric"
|
||
this.ArtifactType = &artifactType
|
||
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
|
||
this.State = &state
|
||
return &this
|
||
}
|
||
|
||
// NewMetricUpdateWithDefaults instantiates a new MetricUpdate 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 NewMetricUpdateWithDefaults() *MetricUpdate {
|
||
this := MetricUpdate{}
|
||
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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetCustomProperties(v map[string]MetadataValue) {
|
||
o.CustomProperties = &v
|
||
}
|
||
|
||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetDescription(v string) {
|
||
o.Description = &v
|
||
}
|
||
|
||
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetExternalId(v string) {
|
||
o.ExternalId = &v
|
||
}
|
||
|
||
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetArtifactType(v string) {
|
||
o.ArtifactType = &v
|
||
}
|
||
|
||
// GetValue returns the Value field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetValue(v float64) {
|
||
o.Value = &v
|
||
}
|
||
|
||
// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetTimestamp(v string) {
|
||
o.Timestamp = &v
|
||
}
|
||
|
||
// GetStep returns the Step field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetStep(v int64) {
|
||
o.Step = &v
|
||
}
|
||
|
||
// GetState returns the State field value if set, zero value otherwise.
|
||
func (o *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) 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 *MetricUpdate) SetState(v ArtifactState) {
|
||
o.State = &v
|
||
}
|
||
|
||
func (o MetricUpdate) MarshalJSON() ([]byte, error) {
|
||
toSerialize, err := o.ToMap()
|
||
if err != nil {
|
||
return []byte{}, err
|
||
}
|
||
return json.Marshal(toSerialize)
|
||
}
|
||
|
||
func (o MetricUpdate) 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.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 NullableMetricUpdate struct {
|
||
value *MetricUpdate
|
||
isSet bool
|
||
}
|
||
|
||
func (v NullableMetricUpdate) Get() *MetricUpdate {
|
||
return v.value
|
||
}
|
||
|
||
func (v *NullableMetricUpdate) Set(val *MetricUpdate) {
|
||
v.value = val
|
||
v.isSet = true
|
||
}
|
||
|
||
func (v NullableMetricUpdate) IsSet() bool {
|
||
return v.isSet
|
||
}
|
||
|
||
func (v *NullableMetricUpdate) Unset() {
|
||
v.value = nil
|
||
v.isSet = false
|
||
}
|
||
|
||
func NewNullableMetricUpdate(val *MetricUpdate) *NullableMetricUpdate {
|
||
return &NullableMetricUpdate{value: val, isSet: true}
|
||
}
|
||
|
||
func (v NullableMetricUpdate) MarshalJSON() ([]byte, error) {
|
||
return json.Marshal(v.value)
|
||
}
|
||
|
||
func (v *NullableMetricUpdate) UnmarshalJSON(src []byte) error {
|
||
v.isSet = true
|
||
return json.Unmarshal(src, &v.value)
|
||
}
|