model-registry/pkg/openapi/model_model_artifact_update.go

687 lines
21 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 ModelArtifactUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelArtifactUpdate{}
// ModelArtifactUpdate An ML model artifact to be updated.
type ModelArtifactUpdate 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"`
// Name of the model format.
ModelFormatName *string `json:"modelFormatName,omitempty"`
// Storage secret name.
StorageKey *string `json:"storageKey,omitempty"`
// Path for model in storage provided by `storageKey`.
StoragePath *string `json:"storagePath,omitempty"`
// Version of the model format.
ModelFormatVersion *string `json:"modelFormatVersion,omitempty"`
// Name of the service account with storage secret.
ServiceAccountName *string `json:"serviceAccountName,omitempty"`
// A string identifier describing the source kind. It differentiates various sources of model artifacts. This identifier should be agreed upon by producers and consumers of source model metadata. It is not an enumeration to keep the source of model metadata open ended. E.g. Kubeflow pipelines could use `pipelines` to identify models it produces.
ModelSourceKind *string `json:"modelSourceKind,omitempty"`
// A subgroup within the source kind. It is a specific sub-component or instance within the source kind. E.g. `pipelinerun` for a Kubeflow pipeline run.
ModelSourceClass *string `json:"modelSourceClass,omitempty"`
// Unique identifier for a source group for models from source class. It maps to a physical group of source models. E.g. a Kubernetes namespace where the pipeline run was executed.
ModelSourceGroup *string `json:"modelSourceGroup,omitempty"`
// A unique identifier for a source model within kind, class, and group. It should be a url friendly string if source supports using URLs to locate source models. E.g. a pipeline run ID.
ModelSourceId *string `json:"modelSourceId,omitempty"`
// A human-readable name for the source model. E.g. `my-project/1`, `ibm-granite/granite-3.1-8b-base:2.1.2`.
ModelSourceName *string `json:"modelSourceName,omitempty"`
// The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.
Uri *string `json:"uri,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewModelArtifactUpdate instantiates a new ModelArtifactUpdate 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 NewModelArtifactUpdate() *ModelArtifactUpdate {
this := ModelArtifactUpdate{}
var artifactType string = "model-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewModelArtifactUpdateWithDefaults instantiates a new ModelArtifactUpdate 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 NewModelArtifactUpdateWithDefaults() *ModelArtifactUpdate {
this := ModelArtifactUpdate{}
var artifactType string = "model-artifact"
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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetModelFormatName returns the ModelFormatName field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelFormatName() string {
if o == nil || IsNil(o.ModelFormatName) {
var ret string
return ret
}
return *o.ModelFormatName
}
// GetModelFormatNameOk returns a tuple with the ModelFormatName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelFormatNameOk() (*string, bool) {
if o == nil || IsNil(o.ModelFormatName) {
return nil, false
}
return o.ModelFormatName, true
}
// HasModelFormatName returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelFormatName() bool {
if o != nil && !IsNil(o.ModelFormatName) {
return true
}
return false
}
// SetModelFormatName gets a reference to the given string and assigns it to the ModelFormatName field.
func (o *ModelArtifactUpdate) SetModelFormatName(v string) {
o.ModelFormatName = &v
}
// GetStorageKey returns the StorageKey field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetStorageKey() string {
if o == nil || IsNil(o.StorageKey) {
var ret string
return ret
}
return *o.StorageKey
}
// GetStorageKeyOk returns a tuple with the StorageKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetStorageKeyOk() (*string, bool) {
if o == nil || IsNil(o.StorageKey) {
return nil, false
}
return o.StorageKey, true
}
// HasStorageKey returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasStorageKey() bool {
if o != nil && !IsNil(o.StorageKey) {
return true
}
return false
}
// SetStorageKey gets a reference to the given string and assigns it to the StorageKey field.
func (o *ModelArtifactUpdate) SetStorageKey(v string) {
o.StorageKey = &v
}
// GetStoragePath returns the StoragePath field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetStoragePath() string {
if o == nil || IsNil(o.StoragePath) {
var ret string
return ret
}
return *o.StoragePath
}
// GetStoragePathOk returns a tuple with the StoragePath field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetStoragePathOk() (*string, bool) {
if o == nil || IsNil(o.StoragePath) {
return nil, false
}
return o.StoragePath, true
}
// HasStoragePath returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasStoragePath() bool {
if o != nil && !IsNil(o.StoragePath) {
return true
}
return false
}
// SetStoragePath gets a reference to the given string and assigns it to the StoragePath field.
func (o *ModelArtifactUpdate) SetStoragePath(v string) {
o.StoragePath = &v
}
// GetModelFormatVersion returns the ModelFormatVersion field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelFormatVersion() string {
if o == nil || IsNil(o.ModelFormatVersion) {
var ret string
return ret
}
return *o.ModelFormatVersion
}
// GetModelFormatVersionOk returns a tuple with the ModelFormatVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelFormatVersionOk() (*string, bool) {
if o == nil || IsNil(o.ModelFormatVersion) {
return nil, false
}
return o.ModelFormatVersion, true
}
// HasModelFormatVersion returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelFormatVersion() bool {
if o != nil && !IsNil(o.ModelFormatVersion) {
return true
}
return false
}
// SetModelFormatVersion gets a reference to the given string and assigns it to the ModelFormatVersion field.
func (o *ModelArtifactUpdate) SetModelFormatVersion(v string) {
o.ModelFormatVersion = &v
}
// GetServiceAccountName returns the ServiceAccountName field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetServiceAccountName() string {
if o == nil || IsNil(o.ServiceAccountName) {
var ret string
return ret
}
return *o.ServiceAccountName
}
// GetServiceAccountNameOk returns a tuple with the ServiceAccountName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetServiceAccountNameOk() (*string, bool) {
if o == nil || IsNil(o.ServiceAccountName) {
return nil, false
}
return o.ServiceAccountName, true
}
// HasServiceAccountName returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasServiceAccountName() bool {
if o != nil && !IsNil(o.ServiceAccountName) {
return true
}
return false
}
// SetServiceAccountName gets a reference to the given string and assigns it to the ServiceAccountName field.
func (o *ModelArtifactUpdate) SetServiceAccountName(v string) {
o.ServiceAccountName = &v
}
// GetModelSourceKind returns the ModelSourceKind field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelSourceKind() string {
if o == nil || IsNil(o.ModelSourceKind) {
var ret string
return ret
}
return *o.ModelSourceKind
}
// GetModelSourceKindOk returns a tuple with the ModelSourceKind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelSourceKindOk() (*string, bool) {
if o == nil || IsNil(o.ModelSourceKind) {
return nil, false
}
return o.ModelSourceKind, true
}
// HasModelSourceKind returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelSourceKind() bool {
if o != nil && !IsNil(o.ModelSourceKind) {
return true
}
return false
}
// SetModelSourceKind gets a reference to the given string and assigns it to the ModelSourceKind field.
func (o *ModelArtifactUpdate) SetModelSourceKind(v string) {
o.ModelSourceKind = &v
}
// GetModelSourceClass returns the ModelSourceClass field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelSourceClass() string {
if o == nil || IsNil(o.ModelSourceClass) {
var ret string
return ret
}
return *o.ModelSourceClass
}
// GetModelSourceClassOk returns a tuple with the ModelSourceClass field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelSourceClassOk() (*string, bool) {
if o == nil || IsNil(o.ModelSourceClass) {
return nil, false
}
return o.ModelSourceClass, true
}
// HasModelSourceClass returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelSourceClass() bool {
if o != nil && !IsNil(o.ModelSourceClass) {
return true
}
return false
}
// SetModelSourceClass gets a reference to the given string and assigns it to the ModelSourceClass field.
func (o *ModelArtifactUpdate) SetModelSourceClass(v string) {
o.ModelSourceClass = &v
}
// GetModelSourceGroup returns the ModelSourceGroup field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelSourceGroup() string {
if o == nil || IsNil(o.ModelSourceGroup) {
var ret string
return ret
}
return *o.ModelSourceGroup
}
// GetModelSourceGroupOk returns a tuple with the ModelSourceGroup field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelSourceGroupOk() (*string, bool) {
if o == nil || IsNil(o.ModelSourceGroup) {
return nil, false
}
return o.ModelSourceGroup, true
}
// HasModelSourceGroup returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelSourceGroup() bool {
if o != nil && !IsNil(o.ModelSourceGroup) {
return true
}
return false
}
// SetModelSourceGroup gets a reference to the given string and assigns it to the ModelSourceGroup field.
func (o *ModelArtifactUpdate) SetModelSourceGroup(v string) {
o.ModelSourceGroup = &v
}
// GetModelSourceId returns the ModelSourceId field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelSourceId() string {
if o == nil || IsNil(o.ModelSourceId) {
var ret string
return ret
}
return *o.ModelSourceId
}
// GetModelSourceIdOk returns a tuple with the ModelSourceId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelSourceIdOk() (*string, bool) {
if o == nil || IsNil(o.ModelSourceId) {
return nil, false
}
return o.ModelSourceId, true
}
// HasModelSourceId returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelSourceId() bool {
if o != nil && !IsNil(o.ModelSourceId) {
return true
}
return false
}
// SetModelSourceId gets a reference to the given string and assigns it to the ModelSourceId field.
func (o *ModelArtifactUpdate) SetModelSourceId(v string) {
o.ModelSourceId = &v
}
// GetModelSourceName returns the ModelSourceName field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetModelSourceName() string {
if o == nil || IsNil(o.ModelSourceName) {
var ret string
return ret
}
return *o.ModelSourceName
}
// GetModelSourceNameOk returns a tuple with the ModelSourceName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetModelSourceNameOk() (*string, bool) {
if o == nil || IsNil(o.ModelSourceName) {
return nil, false
}
return o.ModelSourceName, true
}
// HasModelSourceName returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasModelSourceName() bool {
if o != nil && !IsNil(o.ModelSourceName) {
return true
}
return false
}
// SetModelSourceName gets a reference to the given string and assigns it to the ModelSourceName field.
func (o *ModelArtifactUpdate) SetModelSourceName(v string) {
o.ModelSourceName = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetUri() string {
if o == nil || IsNil(o.Uri) {
var ret string
return ret
}
return *o.Uri
}
// GetUriOk returns a tuple with the Uri field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetUriOk() (*string, bool) {
if o == nil || IsNil(o.Uri) {
return nil, false
}
return o.Uri, true
}
// HasUri returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasUri() bool {
if o != nil && !IsNil(o.Uri) {
return true
}
return false
}
// SetUri gets a reference to the given string and assigns it to the Uri field.
func (o *ModelArtifactUpdate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) SetState(v ArtifactState) {
o.State = &v
}
func (o ModelArtifactUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelArtifactUpdate) 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.ModelFormatName) {
toSerialize["modelFormatName"] = o.ModelFormatName
}
if !IsNil(o.StorageKey) {
toSerialize["storageKey"] = o.StorageKey
}
if !IsNil(o.StoragePath) {
toSerialize["storagePath"] = o.StoragePath
}
if !IsNil(o.ModelFormatVersion) {
toSerialize["modelFormatVersion"] = o.ModelFormatVersion
}
if !IsNil(o.ServiceAccountName) {
toSerialize["serviceAccountName"] = o.ServiceAccountName
}
if !IsNil(o.ModelSourceKind) {
toSerialize["modelSourceKind"] = o.ModelSourceKind
}
if !IsNil(o.ModelSourceClass) {
toSerialize["modelSourceClass"] = o.ModelSourceClass
}
if !IsNil(o.ModelSourceGroup) {
toSerialize["modelSourceGroup"] = o.ModelSourceGroup
}
if !IsNil(o.ModelSourceId) {
toSerialize["modelSourceId"] = o.ModelSourceId
}
if !IsNil(o.ModelSourceName) {
toSerialize["modelSourceName"] = o.ModelSourceName
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableModelArtifactUpdate struct {
value *ModelArtifactUpdate
isSet bool
}
func (v NullableModelArtifactUpdate) Get() *ModelArtifactUpdate {
return v.value
}
func (v *NullableModelArtifactUpdate) Set(val *ModelArtifactUpdate) {
v.value = val
v.isSet = true
}
func (v NullableModelArtifactUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableModelArtifactUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelArtifactUpdate(val *ModelArtifactUpdate) *NullableModelArtifactUpdate {
return &NullableModelArtifactUpdate{value: val, isSet: true}
}
func (v NullableModelArtifactUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelArtifactUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}