package dbutil
import (
"fmt"
"strings"
"github.com/golang/glog"
"github.com/kubeflow/model-registry/pkg/api"
)
// isDatabaseTypeConversionError checks if a database error is caused by type conversion issues
// (e.g., trying to convert string "x" to a number) that should return 400 Bad Request instead of 500
func isDatabaseTypeConversionError(err error) bool {
if err == nil {
return false
}
errStr := strings.ToLower(err.Error())
// type conversion error patterns (in lowercase for case-insensitive matching)
errorPatterns := []string{
"invalid input syntax",
"sqlstate",
"incorrect double value",
"incorrect integer value",
"truncated incorrect",
"unable to encode",
"failed to encode",
"cannot find encode plan",
}
for _, pattern := range errorPatterns {
if strings.Contains(errStr, pattern) {
return true
}
}
return false
}
// SanitizeDatabaseError checks if a database error is a type conversion error
// and converts it to a BadRequest error. Otherwise returns the original error.
// This prevents exposing internal database error details to users.
// Should be called after query execution to sanitize errors.
func SanitizeDatabaseError(err error) error {
if err == nil {
return nil
}
if isDatabaseTypeConversionError(err) {
// Log the actual database error internally for debugging
glog.Warningf("Database type conversion error: %v", err)
return fmt.Errorf("invalid filter query, type mismatch or invalid value in comparison: %w", api.ErrBadRequest)
}
return err
}
// EnhanceFilterQueryError provides user-friendly error messages for common filter query parsing mistakes.
// Should be called when filter query parsing fails to give users helpful hints.
func EnhanceFilterQueryError(err error, filterQuery string) error {
errMsg := err.Error()
// Check for common mistakes and provide helpful hints
if strings.Contains(errMsg, "expected Value") {
return fmt.Errorf("invalid filter query syntax: %v. Hint: String values must be quoted (e.g., name=\"value\"). Numbers and booleans don't need quotes (e.g., id>5, active=true)", err)
}
if strings.Contains(errMsg, "unexpected token") {
return fmt.Errorf("invalid filter query syntax: %v. Check that operators and values are correctly formatted", err)
}
// Default: return the original error with a generic message
return fmt.Errorf("invalid filter query syntax: %v", err)
}
package dbutil
import "gorm.io/gorm"
// QuoteTableName quotes a table name based on database dialect to prevent SQL injection
// and handle reserved keywords properly.
//
// MySQL uses backticks: `table_name`
// PostgreSQL uses double quotes: "table_name"
// Other databases use unquoted names
func QuoteTableName(db *gorm.DB, tableName string) string {
if db == nil || tableName == "" {
return tableName
}
switch db.Name() {
case "mysql":
return "`" + tableName + "`"
case "postgres":
return `"` + tableName + `"`
default:
return tableName
}
}
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package filter
import (
"testing"
)
func FuzzFilterParse(f *testing.F) {
f.Fuzz(func(t *testing.T, data string) {
Parse(data)
})
}
package filter
import (
"fmt"
"strings"
"sync"
"github.com/alecthomas/participle/v2"
"github.com/alecthomas/participle/v2/lexer"
)
// Constants for property value types
const (
StringValueType = "string_value"
DoubleValueType = "double_value"
IntValueType = "int_value"
BoolValueType = "bool_value"
ArrayValueType = "array_value"
)
// Define the lexer for SQL WHERE clauses
var sqlLexer = lexer.MustSimple([]lexer.SimpleRule{
{Name: "whitespace", Pattern: `\s+`},
{Name: "Comment", Pattern: `--[^\r\n]*`},
{Name: "Ident", Pattern: `[a-zA-Z_][a-zA-Z0-9_]*`},
{Name: "Float", Pattern: `[-+]?\d*\.\d+([eE][-+]?\d+)?|[-+]?\d+[eE][-+]?\d+`},
{Name: "Int", Pattern: `[-+]?\d+`},
{Name: "String", Pattern: `'([^'\\]|\\.)*'|"([^"\\]|\\.)*"`},
{Name: "EscapedIdent", Pattern: "`([^`\\\\]|\\\\.)*`"},
{Name: "Operators", Pattern: `>=|<=|!=|<>|=|>|<`},
{Name: "Punct", Pattern: `[().,]`},
})
// Global parser instance - built once, reused everywhere (thread-safe)
var (
globalParser *participle.Parser[WhereClause]
parserOnce sync.Once
)
// initParser builds the parser, called in getParser using sync.Once for thread safety
func initParser() {
globalParser = participle.MustBuild[WhereClause](
participle.Lexer(sqlLexer),
participle.Elide("whitespace", "Comment"),
participle.CaseInsensitive("OR", "AND", "LIKE", "ILIKE", "IN", "true", "false", "TRUE", "FALSE"),
participle.CaseInsensitive(StringValueType, DoubleValueType, IntValueType, BoolValueType, ArrayValueType),
)
}
// getParser returns the singleton parser instance (thread-safe)
func getParser() *participle.Parser[WhereClause] {
parserOnce.Do(initParser)
return globalParser
}
// Grammar structures for SQL WHERE clauses
//nolint:govet
type WhereClause struct {
Expression *Expression `@@`
}
//nolint:govet
type Expression struct {
Or *OrExpression `@@`
}
//nolint:govet
type OrExpression struct {
Left *AndExpression `@@`
Right []*AndExpression `("OR" @@)*`
}
//nolint:govet
type AndExpression struct {
Left *Term `@@`
Right []*Term `("AND" @@)*`
}
//nolint:govet
type Term struct {
Group *Expression `"(" @@ ")"`
Comparison *Comparison `| @@`
}
//nolint:govet
type Comparison struct {
Left *PropertyRef `@@`
Operator string `@("=" | "!=" | "<>" | ">=" | "<=" | ">" | "<" | "LIKE" | "ILIKE" | "IN")`
Right *Value `@@`
}
//nolint:govet
type PropertyRef struct {
EscapedName string `@EscapedIdent`
Name string `| @Ident`
Path []string `("." @Ident)*`
Type string `("." @("string_value" | "double_value" | "int_value" | "bool_value"))?`
}
//nolint:govet
type Value struct {
String *string `@String`
Integer *int64 `| @Int`
Float *float64 `| @Float`
Boolean *string `| @("true" | "false" | "TRUE" | "FALSE")`
ValueList *ValueList `| @@`
}
//nolint:govet
type ValueList struct {
Values []*SingleValue `"(" (@@ ("," @@)*)? ")"`
}
//nolint:govet
type SingleValue struct {
String *string `@String`
Integer *int64 `| @Int`
Float *float64 `| @Float`
Boolean *string `| @("true" | "false" | "TRUE" | "FALSE")`
}
// FilterExpression represents a parsed filter expression (keeping for compatibility)
type FilterExpression struct {
Left *FilterExpression
Right *FilterExpression
Operator string
Property string
Value interface{}
IsLeaf bool
}
// PropertyReference represents a property reference with type information
type PropertyReference struct {
Name string
IsCustom bool
ValueType string // StringValueType, DoubleValueType, IntValueType, BoolValueType, ArrayValueType
ExplicitType string // Non-empty if the type was explicitly specified (e.g., "property.double_value")
IsEscaped bool // whether the property name was escaped with backticks
PropertyDef PropertyDefinition // Full property definition for advanced handling
}
// Parse parses a filter query string and returns the root expression
// This function is thread-safe and reuses a singleton parser instance
func Parse(input string) (*FilterExpression, error) {
if strings.TrimSpace(input) == "" {
return nil, nil
}
parser := getParser()
whereClause, err := parser.ParseString("", input)
if err != nil {
return nil, fmt.Errorf("error parsing filter query: %w", err)
}
return convertToFilterExpression(whereClause.Expression), nil
}
// convertToFilterExpression converts the participle AST to our FilterExpression
func convertToFilterExpression(expr *Expression) *FilterExpression {
return convertOrExpression(expr.Or)
}
func convertOrExpression(expr *OrExpression) *FilterExpression {
left := convertAndExpression(expr.Left)
for _, right := range expr.Right {
rightExpr := convertAndExpression(right)
left = &FilterExpression{
Left: left,
Right: rightExpr,
Operator: "OR",
IsLeaf: false,
}
}
return left
}
func convertAndExpression(expr *AndExpression) *FilterExpression {
left := convertTerm(expr.Left)
for _, right := range expr.Right {
rightExpr := convertTerm(right)
left = &FilterExpression{
Left: left,
Right: rightExpr,
Operator: "AND",
IsLeaf: false,
}
}
return left
}
func convertTerm(term *Term) *FilterExpression {
if term.Group != nil {
return convertToFilterExpression(term.Group)
}
return convertComparison(term.Comparison)
}
func convertComparison(comp *Comparison) *FilterExpression {
propRef := convertPropertyRef(comp.Left, comp.Right)
value := convertValue(comp.Right)
// Build the full property path including any nested paths
propertyName := propRef.Name
// Add type suffix if specified (for explicit type queries)
if comp.Left.Type != "" {
propertyName = propRef.Name + "." + comp.Left.Type
}
return &FilterExpression{
Property: propertyName,
Operator: comp.Operator,
Value: value,
IsLeaf: true,
}
}
func convertPropertyRef(prop *PropertyRef, value *Value) *PropertyReference {
var name string
var isEscaped bool
if prop.EscapedName != "" {
// Remove backticks from escaped name
name = strings.Trim(prop.EscapedName, "`")
// Handle escape sequences in the name
name = strings.ReplaceAll(name, `\.`, `.`)
name = strings.ReplaceAll(name, `\\`, `\`)
isEscaped = true
} else {
name = prop.Name
// Build the full path if there are nested properties
if len(prop.Path) > 0 {
name = name + "." + strings.Join(prop.Path, ".")
}
isEscaped = false
}
var valueType string
var isCustom bool
if prop.Type != "" {
// Explicit type specified
valueType = prop.Type
// We still need to determine if it's custom based on the property mapping
// This is a bit tricky since we don't have entity type context here
// For now, assume if explicit type is given, it could be either
isCustom = true // Will be properly determined later in query builder
} else {
// Use the new property mapping system - but we need entity type context
// For now, use a fallback approach and let the query builder handle it properly
isCustom = true // Will be properly determined later in query builder
valueType = inferValueType(value)
}
return &PropertyReference{
Name: name,
IsCustom: isCustom,
ValueType: valueType,
IsEscaped: isEscaped,
}
}
func convertValue(val *Value) interface{} {
if val.String != nil {
return unquoteStringValue(*val.String)
}
if val.Integer != nil {
return *val.Integer
}
if val.Float != nil {
return *val.Float
}
if val.Boolean != nil {
return strings.ToLower(*val.Boolean) == "true"
}
if val.ValueList != nil {
// Convert list of values to slice
var values []any
for _, singleVal := range val.ValueList.Values {
values = append(values, convertSingleValue(singleVal))
}
return values
}
return nil
}
func convertSingleValue(val *SingleValue) interface{} {
if val.String != nil {
return unquoteStringValue(*val.String)
}
if val.Integer != nil {
return *val.Integer
}
if val.Float != nil {
return *val.Float
}
if val.Boolean != nil {
return strings.ToLower(*val.Boolean) == "true"
}
return nil
}
// unquoteStringValue removes quotes and handles escape sequences
func unquoteStringValue(str string) string {
// Remove quotes from string
result := strings.Trim(str, `"'`)
// Handle escape sequences
result = strings.ReplaceAll(result, `\"`, `"`)
result = strings.ReplaceAll(result, `\'`, `'`)
result = strings.ReplaceAll(result, `\\`, `\`)
return result
}
// inferValueType determines the appropriate value type based on the actual value
func inferValueType(val *Value) string {
if val.ValueList != nil && len(val.ValueList.Values) > 0 {
// For lists, infer type from the first value
return inferSingleValueType(val.ValueList.Values[0])
}
// Convert Value to SingleValue for type inference
singleVal := &SingleValue{
String: val.String,
Integer: val.Integer,
Float: val.Float,
Boolean: val.Boolean,
}
return inferSingleValueType(singleVal)
}
// inferSingleValueType determines the appropriate value type for a SingleValue
func inferSingleValueType(val *SingleValue) string {
if val.String != nil {
return StringValueType
}
if val.Integer != nil {
return IntValueType
}
if val.Float != nil {
return DoubleValueType
}
if val.Boolean != nil {
return BoolValueType
}
return StringValueType // default to string
}
package filter
// PropertyLocation indicates where a property is stored
type PropertyLocation int
const (
EntityTable PropertyLocation = iota // Property is a column in the main entity table
PropertyTable // Property is stored in the entity's property table
Custom // Property is a custom property in the property table
RelatedEntity // Property is in a related entity (requires JOIN)
)
// RelatedEntityType indicates the type of related entity
type RelatedEntityType string
const (
RelatedEntityArtifact RelatedEntityType = "artifact"
RelatedEntityContext RelatedEntityType = "context"
RelatedEntityExecution RelatedEntityType = "execution"
)
// PropertyDefinition defines how a property should be handled
type PropertyDefinition struct {
Location PropertyLocation
ValueType string // IntValueType, StringValueType, DoubleValueType, BoolValueType
Column string // Database column name (for entity table) or property name (for property table)
// Fields for related entity properties
RelatedEntityType RelatedEntityType // Type of related entity (artifact, context, execution)
RelatedProperty string // Property name in the related entity
JoinTable string // Table to join through (e.g., "Attribution", "ParentContext")
}
// EntityPropertyMap maps property names to their definitions for each entity type
type EntityPropertyMap map[string]PropertyDefinition
// GetPropertyDefinition returns the property definition for a given entity type and property name
func GetPropertyDefinition(entityType EntityType, propertyName string) PropertyDefinition {
entityMap := getEntityPropertyMap(entityType)
if def, exists := entityMap[propertyName]; exists {
return def
}
// If not found in the map, assume it's a custom property
return PropertyDefinition{
Location: Custom,
ValueType: StringValueType, // Default to string, will be inferred at runtime
Column: propertyName, // Use the property name as-is for custom properties
}
}
// getEntityPropertyMap returns the property mapping for a specific entity type
func getEntityPropertyMap(entityType EntityType) EntityPropertyMap {
switch entityType {
case EntityTypeContext:
return contextPropertyMap
case EntityTypeArtifact:
return artifactPropertyMap
case EntityTypeExecution:
return executionPropertyMap
default:
return contextPropertyMap // Default fallback
}
}
// contextPropertyMap defines properties for Context entities
// Used by: RegisteredModel, ModelVersion, InferenceService, ServingEnvironment, Experiment, ExperimentRun
var contextPropertyMap = EntityPropertyMap{
// Entity table columns (Context table)
"id": {Location: EntityTable, ValueType: IntValueType, Column: "id"},
"name": {Location: EntityTable, ValueType: StringValueType, Column: "name"},
"externalId": {Location: EntityTable, ValueType: StringValueType, Column: "external_id"},
"createTimeSinceEpoch": {Location: EntityTable, ValueType: IntValueType, Column: "create_time_since_epoch"},
"lastUpdateTimeSinceEpoch": {Location: EntityTable, ValueType: IntValueType, Column: "last_update_time_since_epoch"},
// Properties that are stored in ContextProperty table but are "well-known" (not custom)
// These are properties that the application manages, not user-defined custom properties
"registeredModelId": {Location: PropertyTable, ValueType: IntValueType, Column: "registered_model_id"},
"modelVersionId": {Location: PropertyTable, ValueType: IntValueType, Column: "model_version_id"},
"servingEnvironmentId": {Location: PropertyTable, ValueType: IntValueType, Column: "serving_environment_id"},
"experimentId": {Location: PropertyTable, ValueType: IntValueType, Column: "experiment_id"},
"runtime": {Location: PropertyTable, ValueType: StringValueType, Column: "runtime"},
"desiredState": {Location: PropertyTable, ValueType: StringValueType, Column: "desired_state"},
"state": {Location: PropertyTable, ValueType: StringValueType, Column: "state"},
"owner": {Location: PropertyTable, ValueType: StringValueType, Column: "owner"},
"author": {Location: PropertyTable, ValueType: StringValueType, Column: "author"},
"status": {Location: PropertyTable, ValueType: StringValueType, Column: "status"},
"endTimeSinceEpoch": {Location: PropertyTable, ValueType: StringValueType, Column: "end_time_since_epoch"},
"startTimeSinceEpoch": {Location: PropertyTable, ValueType: StringValueType, Column: "start_time_since_epoch"},
}
var artifactPropertyMap = EntityPropertyMap{
// Entity table columns (Artifact table)
"id": {Location: EntityTable, ValueType: IntValueType, Column: "id"},
"name": {Location: EntityTable, ValueType: StringValueType, Column: "name"},
"externalId": {Location: EntityTable, ValueType: StringValueType, Column: "external_id"},
"createTimeSinceEpoch": {Location: EntityTable, ValueType: IntValueType, Column: "create_time_since_epoch"},
"lastUpdateTimeSinceEpoch": {Location: EntityTable, ValueType: IntValueType, Column: "last_update_time_since_epoch"},
"uri": {Location: EntityTable, ValueType: StringValueType, Column: "uri"},
"state": {Location: EntityTable, ValueType: IntValueType, Column: "state"},
// Properties that are stored in ArtifactProperty table but are "well-known"
"modelFormatName": {Location: PropertyTable, ValueType: StringValueType, Column: "model_format_name"},
"modelFormatVersion": {Location: PropertyTable, ValueType: StringValueType, Column: "model_format_version"},
"storageKey": {Location: PropertyTable, ValueType: StringValueType, Column: "storage_key"},
"storagePath": {Location: PropertyTable, ValueType: StringValueType, Column: "storage_path"},
"serviceAccountName": {Location: PropertyTable, ValueType: StringValueType, Column: "service_account_name"},
"modelSourceKind": {Location: PropertyTable, ValueType: StringValueType, Column: "model_source_kind"},
"modelSourceClass": {Location: PropertyTable, ValueType: StringValueType, Column: "model_source_class"},
"modelSourceGroup": {Location: PropertyTable, ValueType: StringValueType, Column: "model_source_group"},
"modelSourceId": {Location: PropertyTable, ValueType: StringValueType, Column: "model_source_id"},
"modelSourceName": {Location: PropertyTable, ValueType: StringValueType, Column: "model_source_name"},
"value": {Location: PropertyTable, ValueType: DoubleValueType, Column: "value"}, // For metrics/parameters
"timestamp": {Location: PropertyTable, ValueType: IntValueType, Column: "timestamp"}, // For metrics
"step": {Location: PropertyTable, ValueType: IntValueType, Column: "step"}, // For metrics
"parameterType": {Location: PropertyTable, ValueType: StringValueType, Column: "parameter_type"}, // For parameters
"digest": {Location: PropertyTable, ValueType: StringValueType, Column: "digest"}, // For datasets
"sourceType": {Location: PropertyTable, ValueType: StringValueType, Column: "source_type"}, // For datasets
"source": {Location: PropertyTable, ValueType: StringValueType, Column: "source"}, // For datasets
"schema": {Location: PropertyTable, ValueType: StringValueType, Column: "schema"}, // For datasets
"profile": {Location: PropertyTable, ValueType: StringValueType, Column: "profile"}, // For datasets
"experimentId": {Location: PropertyTable, ValueType: IntValueType, Column: "experiment_id"}, // For all artifacts
"experimentRunId": {Location: PropertyTable, ValueType: IntValueType, Column: "experiment_run_id"}, // For all artifacts
}
// executionPropertyMap defines properties for Execution entities
// Used by: ServeModel
var executionPropertyMap = EntityPropertyMap{
// Entity table columns (Execution table)
"id": {Location: EntityTable, ValueType: IntValueType, Column: "id"},
"name": {Location: EntityTable, ValueType: StringValueType, Column: "name"},
"externalId": {Location: EntityTable, ValueType: StringValueType, Column: "external_id"},
"createTimeSinceEpoch": {Location: EntityTable, ValueType: IntValueType, Column: "create_time_since_epoch"},
"lastUpdateTimeSinceEpoch": {Location: EntityTable, ValueType: IntValueType, Column: "last_update_time_since_epoch"},
"lastKnownState": {Location: EntityTable, ValueType: IntValueType, Column: "last_known_state"},
// Properties that are stored in ExecutionProperty table but are "well-known"
"modelVersionId": {Location: PropertyTable, ValueType: IntValueType, Column: "model_version_id"},
"inferenceServiceId": {Location: PropertyTable, ValueType: IntValueType, Column: "inference_service_id"},
"registeredModelId": {Location: PropertyTable, ValueType: IntValueType, Column: "registered_model_id"},
"servingEnvironmentId": {Location: PropertyTable, ValueType: IntValueType, Column: "serving_environment_id"},
}
package filter
import (
"fmt"
"strings"
"github.com/kubeflow/model-registry/internal/db/constants"
"github.com/kubeflow/model-registry/internal/db/dbutil"
"gorm.io/gorm"
)
// EntityType represents the type of entity for proper query building
type EntityType string
const (
EntityTypeContext EntityType = "context"
EntityTypeArtifact EntityType = "artifact"
EntityTypeExecution EntityType = "execution"
)
// EntityMappingFunctions defines the interface for entity type mapping functions
// This allows different packages (like catalog) to provide their own entity mappings
type EntityMappingFunctions interface {
// GetMLMDEntityType maps a REST entity type to its underlying MLMD entity type
GetMLMDEntityType(restEntityType RestEntityType) EntityType
// GetPropertyDefinitionForRestEntity returns property definition for a REST entity type
GetPropertyDefinitionForRestEntity(restEntityType RestEntityType, propertyName string) PropertyDefinition
// IsChildEntity returns true if the REST entity type uses prefixed names (parentId:name)
IsChildEntity(entityType RestEntityType) bool
}
// QueryBuilder builds GORM queries from filter expressions
// It handles special cases like prefixed names for child entities (e.g., ModelVersion, ExperimentRun)
// where names are stored as "parentId:actualName" in the database
type QueryBuilder struct {
entityType EntityType
restEntityType RestEntityType
tablePrefix string
joinCounter int
db *gorm.DB // Added to access naming strategy
mappingFuncs EntityMappingFunctions // Entity mapping functions
}
// NewQueryBuilderForRestEntity creates a new query builder for the specified REST entity type
// If mappingFuncs is nil, it falls back to the global functions
func NewQueryBuilderForRestEntity(restEntityType RestEntityType, mappingFuncs EntityMappingFunctions) *QueryBuilder {
// Use default mappings if none provided
if mappingFuncs == nil {
mappingFuncs = &defaultEntityMappings{}
}
// Get the underlying MLMD entity type
entityType := mappingFuncs.GetMLMDEntityType(restEntityType)
var tablePrefix string
switch entityType {
case EntityTypeContext:
tablePrefix = "Context"
case EntityTypeArtifact:
tablePrefix = "Artifact"
case EntityTypeExecution:
tablePrefix = "Execution"
default:
tablePrefix = "Context" // default
}
return &QueryBuilder{
entityType: entityType,
restEntityType: restEntityType,
tablePrefix: tablePrefix,
joinCounter: 0,
mappingFuncs: mappingFuncs,
}
}
// BuildQuery builds a GORM query from a filter expression
func (qb *QueryBuilder) BuildQuery(db *gorm.DB, expr *FilterExpression) *gorm.DB {
if expr == nil {
return db
}
// Store db reference for table name quoting
qb.db = db
qb.applyDatabaseQuoting()
return qb.buildExpression(db, expr)
}
// applyDatabaseQuoting updates tablePrefix with proper quoting based on database dialect
func (qb *QueryBuilder) applyDatabaseQuoting() {
if qb.db == nil {
return
}
// Extract unquoted table name if it was already quoted
unquotedName := strings.Trim(qb.tablePrefix, "`\"")
qb.tablePrefix = dbutil.QuoteTableName(qb.db, unquotedName)
}
// quoteTableName quotes a table name based on database dialect
func (qb *QueryBuilder) quoteTableName(tableName string) string {
return dbutil.QuoteTableName(qb.db, tableName)
}
// buildExpression recursively builds query conditions from filter expressions
func (qb *QueryBuilder) buildExpression(db *gorm.DB, expr *FilterExpression) *gorm.DB {
if expr.IsLeaf {
return qb.buildLeafExpression(db, expr)
}
// Handle logical operators (AND, OR)
switch expr.Operator {
case "AND":
leftQuery := qb.buildExpression(db, expr.Left)
return qb.buildExpression(leftQuery, expr.Right)
case "OR":
// For OR conditions, we need to group them properly
leftCondition := qb.buildConditionString(expr.Left)
rightCondition := qb.buildConditionString(expr.Right)
condition := fmt.Sprintf("(%s OR %s)", leftCondition.condition, rightCondition.condition)
args := append(leftCondition.args, rightCondition.args...)
return db.Where(condition, args...)
default:
return db
}
}
// conditionResult holds a condition string and its arguments
type conditionResult struct {
condition string
args []any
}
// buildConditionString builds a condition string from an expression (for OR grouping)
func (qb *QueryBuilder) buildConditionString(expr *FilterExpression) conditionResult {
if expr.IsLeaf {
return qb.buildLeafConditionString(expr)
}
switch expr.Operator {
case "AND":
left := qb.buildConditionString(expr.Left)
right := qb.buildConditionString(expr.Right)
condition := fmt.Sprintf("(%s AND %s)", left.condition, right.condition)
args := append(left.args, right.args...)
return conditionResult{condition: condition, args: args}
case "OR":
left := qb.buildConditionString(expr.Left)
right := qb.buildConditionString(expr.Right)
condition := fmt.Sprintf("(%s OR %s)", left.condition, right.condition)
args := append(left.args, right.args...)
return conditionResult{condition: condition, args: args}
}
return conditionResult{condition: "1=1", args: []any{}}
}
// buildPropertyReference creates a property reference from a filter expression
func (qb *QueryBuilder) buildPropertyReference(expr *FilterExpression) *PropertyReference {
var propDef PropertyDefinition
propertyName := expr.Property
// Check if the property has an explicit type suffix (e.g., "budget.double_value")
// Valid type suffixes: string_value, double_value, int_value, bool_value
var explicitType string
if parts := strings.Split(propertyName, "."); len(parts) >= 2 {
lastPart := parts[len(parts)-1]
// Only treat as type suffix if it's a valid value type
if lastPart == "string_value" || lastPart == "double_value" || lastPart == "int_value" || lastPart == "bool_value" {
// Reconstruct property name without the type suffix
propertyName = strings.Join(parts[:len(parts)-1], ".")
explicitType = lastPart
}
// Otherwise, keep the full path as property name
}
// Use REST entity type-aware property mapping if available
if qb.restEntityType != "" {
propDef = qb.mappingFuncs.GetPropertyDefinitionForRestEntity(qb.restEntityType, propertyName)
} else {
// Fallback to MLMD entity type only
propDef = GetPropertyDefinition(qb.entityType, propertyName)
}
// For property table properties, use the Column field as the database property name
propName := propertyName
if propDef.Location == PropertyTable && propDef.Column != "" {
propName = propDef.Column
}
propRef := &PropertyReference{
Name: propName,
IsCustom: propDef.Location == Custom,
ValueType: propDef.ValueType,
ExplicitType: explicitType, // Track if type was explicitly specified
PropertyDef: propDef, // Store full property definition for advanced handling
}
// If explicit type was specified, use it
if explicitType != "" {
propRef.ValueType = explicitType
} else if propRef.IsCustom {
// For custom properties without explicit type, infer from value
propRef.ValueType = qb.inferValueTypeFromInterface(expr.Value)
}
return propRef
}
// buildLeafExpression builds a GORM query for a leaf expression (property comparison)
func (qb *QueryBuilder) buildLeafExpression(db *gorm.DB, expr *FilterExpression) *gorm.DB {
propRef := qb.buildPropertyReference(expr)
return qb.buildPropertyCondition(db, propRef, expr.Operator, expr.Value)
}
// buildLeafConditionString builds a condition string for a leaf expression
func (qb *QueryBuilder) buildLeafConditionString(expr *FilterExpression) conditionResult {
propRef := qb.buildPropertyReference(expr)
return qb.buildPropertyConditionString(propRef, expr.Operator, expr.Value)
}
// inferValueTypeFromInterface infers the value type from an any value
func (qb *QueryBuilder) inferValueTypeFromInterface(value any) string {
switch value.(type) {
case string:
return StringValueType
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
return IntValueType
case float32, float64:
return DoubleValueType
case bool:
return BoolValueType
default:
return StringValueType // fallback
}
}
// buildPropertyCondition builds a GORM query condition for a property
func (qb *QueryBuilder) buildPropertyCondition(db *gorm.DB, propRef *PropertyReference, operator string, value any) *gorm.DB {
// Use the property definition from the PropertyReference (already looked up with REST entity mappings)
propDef := propRef.PropertyDef
switch propDef.Location {
case EntityTable:
return qb.buildEntityTablePropertyCondition(db, propRef, operator, value)
case PropertyTable, Custom:
return qb.buildPropertyTableCondition(db, propRef, operator, value)
case RelatedEntity:
return qb.buildRelatedEntityPropertyCondition(db, propDef, propRef.ValueType, operator, value)
default:
return qb.buildEntityTablePropertyCondition(db, propRef, operator, value)
}
}
// buildPropertyConditionString builds a condition string for a property
func (qb *QueryBuilder) buildPropertyConditionString(propRef *PropertyReference, operator string, value any) conditionResult {
// Use the property definition from the PropertyReference (already looked up with REST entity mappings)
propDef := propRef.PropertyDef
switch propDef.Location {
case EntityTable:
return qb.buildEntityTablePropertyConditionString(propRef, operator, value)
case PropertyTable, Custom:
return qb.buildPropertyTableConditionString(propRef, operator, value)
case RelatedEntity:
return qb.buildRelatedEntityPropertyConditionString(propDef, propRef.ValueType, operator, value)
default:
return qb.buildEntityTablePropertyConditionString(propRef, operator, value)
}
}
// ConvertStateValue converts string state values to integers based on entity type
func (qb *QueryBuilder) ConvertStateValue(propertyName string, value any) any {
// Only convert for state properties
if propertyName == "state" {
if strValue, ok := value.(string); ok {
switch qb.entityType {
case EntityTypeArtifact:
if intValue, exists := constants.ArtifactStateMapping[strValue]; exists {
return int32(intValue)
}
// Invalid artifact state - return value that matches no records
return int32(-1) // No artifact has state=-1, so this returns empty results
case EntityTypeExecution:
if intValue, exists := constants.ExecutionStateMapping[strValue]; exists {
return int32(intValue)
}
// Invalid execution state - return value that matches no records
return int32(-1) // No execution has state=-1, so this returns empty results
case EntityTypeContext:
// Context entities (RegisteredModel, ModelVersion, etc.) use string states
// These are stored as string properties, so no conversion needed
return value
}
}
// If conversion fails or value is not a string, return original value
}
return value
}
// buildEntityTablePropertyCondition builds a condition for properties stored in the entity table
func (qb *QueryBuilder) buildEntityTablePropertyCondition(db *gorm.DB, propRef *PropertyReference, operator string, value any) *gorm.DB {
propDef := GetPropertyDefinition(qb.entityType, propRef.Name)
column := fmt.Sprintf("%s.%s", qb.tablePrefix, propDef.Column)
// Convert state string values to integers based on entity type
value = qb.ConvertStateValue(propRef.Name, value)
// Handle prefixed names for child entities
if qb.restEntityType != "" && propRef.Name == "name" && qb.mappingFuncs.IsChildEntity(qb.restEntityType) {
if strValue, ok := value.(string); ok {
// For exact match, convert to LIKE pattern with prefix
if operator == "=" {
operator = "LIKE"
value = "%:" + strValue
} else if operator == "LIKE" && !strings.Contains(strValue, ":") {
// For LIKE patterns without ':', add prefix handling
if !strings.HasPrefix(strValue, "%") {
// Pattern like 'pattern%' -> needs prefix wildcard -> '%:pattern%'
value = "%:" + strValue
}
// Pattern like '%something' or '%-beta' -> keep as is
// because names are stored as 'parentId:actualName' and '%' will match 'parentId:'
}
// If pattern already contains ':', assume it's already properly formatted
}
}
// Use cross-database case-insensitive LIKE for ILIKE operator
if operator == "ILIKE" {
return qb.buildCaseInsensitiveLikeCondition(db, column, value)
}
condition := qb.buildOperatorCondition(column, operator, value)
return db.Where(condition.condition, condition.args...)
}
// buildEntityTablePropertyConditionString builds a condition string for properties stored in the entity table
func (qb *QueryBuilder) buildEntityTablePropertyConditionString(propRef *PropertyReference, operator string, value any) conditionResult {
propDef := GetPropertyDefinition(qb.entityType, propRef.Name)
column := fmt.Sprintf("%s.%s", qb.tablePrefix, propDef.Column)
// Convert state string values to integers based on entity type
value = qb.ConvertStateValue(propRef.Name, value)
// Handle prefixed names for child entities
if qb.restEntityType != "" && propRef.Name == "name" && qb.mappingFuncs.IsChildEntity(qb.restEntityType) {
if strValue, ok := value.(string); ok {
// For exact match, convert to LIKE pattern with prefix
if operator == "=" {
operator = "LIKE"
value = "%:" + strValue
} else if operator == "LIKE" && !strings.Contains(strValue, ":") {
// For LIKE patterns without ':', add prefix handling
if !strings.HasPrefix(strValue, "%") {
// Pattern like 'pattern%' -> needs prefix wildcard -> '%:pattern%'
value = "%:" + strValue
}
// Pattern like '%something' or '%-beta' -> keep as is
// because names are stored as 'parentId:actualName' and '%' will match 'parentId:'
}
// If pattern already contains ':', assume it's already properly formatted
}
}
return qb.buildOperatorCondition(column, operator, value)
}
// buildPropertyTableCondition builds a condition for properties stored in the property table (requires join)
func (qb *QueryBuilder) buildPropertyTableCondition(db *gorm.DB, propRef *PropertyReference, operator string, value any) *gorm.DB {
qb.joinCounter++
alias := fmt.Sprintf("prop_%d", qb.joinCounter)
// Determine the property table based on entity type
var propertyTable string
var joinCondition string
switch qb.entityType {
case EntityTypeContext:
propertyTable = qb.quoteTableName("ContextProperty")
joinCondition = fmt.Sprintf("%s.context_id = %s.id", alias, qb.tablePrefix)
case EntityTypeArtifact:
propertyTable = qb.quoteTableName("ArtifactProperty")
joinCondition = fmt.Sprintf("%s.artifact_id = %s.id", alias, qb.tablePrefix)
case EntityTypeExecution:
propertyTable = qb.quoteTableName("ExecutionProperty")
joinCondition = fmt.Sprintf("%s.execution_id = %s.id", alias, qb.tablePrefix)
}
// Join the property table
joinClause := fmt.Sprintf("JOIN %s %s ON %s", propertyTable, alias, joinCondition)
db = db.Joins(joinClause)
// Add conditions for property name
db = db.Where(fmt.Sprintf("%s.name = ?", alias), propRef.Name)
// Use cross-database case-insensitive LIKE for ILIKE operator
if operator == "ILIKE" {
valueColumn := fmt.Sprintf("%s.%s", alias, propRef.ValueType)
return qb.buildCaseInsensitiveLikeCondition(db, valueColumn, value)
}
// Determine the value type and whether to use dual-column query
valueType, inferredAsInt := qb.determinePropertyValueType(propRef, value)
var condition conditionResult
// Special handling for custom properties with inferred integer type:
// Query BOTH int_value and double_value to handle data stored in either column
if inferredAsInt {
intColumn := fmt.Sprintf("%s.int_value", alias)
doubleColumn := fmt.Sprintf("%s.double_value", alias)
condition = qb.buildDualColumnCondition(intColumn, doubleColumn, operator, value)
} else if valueType == ArrayValueType && db.Name() == "postgres" {
// Special handling for array types in PostgreSQL
valueColumn := fmt.Sprintf("%s.%s", alias, StringValueType)
condition = qb.buildJSONOperatorCondition(valueColumn, operator, value)
} else {
// For explicit types or non-integer types, use the specified column
var valueColumn string
if valueType == ArrayValueType {
valueColumn = fmt.Sprintf("%s.%s", alias, StringValueType)
} else {
valueColumn = fmt.Sprintf("%s.%s", alias, valueType)
}
condition = qb.buildOperatorCondition(valueColumn, operator, value)
}
return db.Where(condition.condition, condition.args...)
}
// buildPropertyTableConditionString builds a condition string for properties stored in the property table
func (qb *QueryBuilder) buildPropertyTableConditionString(propRef *PropertyReference, operator string, value any) conditionResult {
// This is more complex for OR conditions - we need to handle joins differently
// For now, we'll create a subquery-based approach
var propertyTable string
var joinColumn string
switch qb.entityType {
case EntityTypeContext:
propertyTable = qb.quoteTableName("ContextProperty")
joinColumn = "context_id"
case EntityTypeArtifact:
propertyTable = qb.quoteTableName("ArtifactProperty")
joinColumn = "artifact_id"
case EntityTypeExecution:
propertyTable = qb.quoteTableName("ExecutionProperty")
joinColumn = "execution_id"
}
// Determine the value type and whether to use dual-column query
valueType, inferredAsInt := qb.determinePropertyValueType(propRef, value)
var condition conditionResult
// Special handling for custom properties with inferred integer type:
// Query BOTH int_value and double_value to handle data stored in either column
if inferredAsInt {
intColumn := fmt.Sprintf("%s.int_value", propertyTable)
doubleColumn := fmt.Sprintf("%s.double_value", propertyTable)
condition = qb.buildDualColumnCondition(intColumn, doubleColumn, operator, value)
} else {
// For explicit types or non-integer types, use the specified column
var valueColumn string
if valueType == ArrayValueType {
valueColumn = fmt.Sprintf("%s.%s", propertyTable, StringValueType)
} else {
valueColumn = fmt.Sprintf("%s.%s", propertyTable, valueType)
}
condition = qb.buildOperatorCondition(valueColumn, operator, value)
}
subquery := fmt.Sprintf("EXISTS (SELECT 1 FROM %s WHERE %s.%s = %s.id AND %s.name = ? AND %s)",
propertyTable, propertyTable, joinColumn, qb.tablePrefix, propertyTable, condition.condition)
args := []any{propRef.Name}
args = append(args, condition.args...)
return conditionResult{condition: subquery, args: args}
}
// buildRelatedEntityPropertyCondition builds a condition for properties in related entities using EXISTS subquery
// This avoids JOIN multiplication and ensures correct filtering
func (qb *QueryBuilder) buildRelatedEntityPropertyCondition(db *gorm.DB, propDef PropertyDefinition, explicitType string, operator string, value any) *gorm.DB {
conditionResult := qb.buildRelatedEntityPropertyConditionString(propDef, explicitType, operator, value)
return db.Where(conditionResult.condition, conditionResult.args...)
}
// buildRelatedEntityPropertyConditionString builds an EXISTS subquery condition for properties in related entities
func (qb *QueryBuilder) buildRelatedEntityPropertyConditionString(propDef PropertyDefinition, explicitType string, operator string, value any) conditionResult {
// Currently only supporting artifact filtering from Context entities
if qb.entityType != EntityTypeContext || propDef.RelatedEntityType != RelatedEntityArtifact {
// Fallback - return empty condition
return conditionResult{condition: "1=1", args: []any{}}
}
// Increment join counter for unique alias
qb.joinCounter++
// Create unique aliases and table names for this join chain
aliases := qb.createRelatedEntityAliases(qb.joinCounter)
// Build the value condition (handles integer dual-column logic)
valueCondition := qb.buildValueCondition(aliases.propertyAlias, explicitType, operator, value)
// Build the complete EXISTS subquery
subquery := fmt.Sprintf(
"EXISTS (SELECT 1 FROM %s %s "+
"JOIN %s %s ON %s.id = %s.artifact_id "+
"JOIN %s %s ON %s.artifact_id = %s.id "+
"WHERE %s.context_id = %s.id AND %s.name = ? AND %s)",
aliases.attributionTable, aliases.attributionAlias,
aliases.entityTable, aliases.entityAlias, aliases.entityAlias, aliases.attributionAlias,
aliases.propertyTable, aliases.propertyAlias, aliases.propertyAlias, aliases.entityAlias,
aliases.attributionAlias, qb.tablePrefix, aliases.propertyAlias, valueCondition.condition)
args := []any{propDef.RelatedProperty}
args = append(args, valueCondition.args...)
return conditionResult{condition: subquery, args: args}
}
// relatedEntityAliases holds the table aliases for a related entity join chain
type relatedEntityAliases struct {
attributionAlias string
entityAlias string
propertyAlias string
attributionTable string
entityTable string
propertyTable string
}
// createRelatedEntityAliases generates unique aliases and quoted table names for artifact filtering
func (qb *QueryBuilder) createRelatedEntityAliases(counter int) relatedEntityAliases {
return relatedEntityAliases{
attributionAlias: fmt.Sprintf("attr_%d", counter),
entityAlias: fmt.Sprintf("art_%d", counter),
propertyAlias: fmt.Sprintf("artprop_%d", counter),
attributionTable: qb.quoteTableName("Attribution"),
entityTable: qb.quoteTableName("Artifact"),
propertyTable: qb.quoteTableName("ArtifactProperty"),
}
}
// determineValueType determines the value type for a property, handling explicit types and inference
// Returns the value type and a boolean indicating if an integer was inferred (for dual-column queries)
func (qb *QueryBuilder) determineValueType(explicitType string, value any) (valueType string, inferredAsInt bool) {
if explicitType != "" {
// Explicit type provided - use it directly
return explicitType, false
}
// No explicit type - infer from value
inferredType := qb.inferValueTypeFromInterface(value)
if inferredType == IntValueType {
// Integer inferred - flag for dual-column query
return inferredType, true
}
return inferredType, false
}
// determinePropertyValueType determines the value type for a PropertyReference
// It handles both custom and well-known properties with appropriate logic for each
// Returns the value type and a boolean indicating if dual-column query should be used
func (qb *QueryBuilder) determinePropertyValueType(propRef *PropertyReference, value any) (valueType string, inferredAsInt bool) {
if propRef.IsCustom {
// Custom properties: use ExplicitType or infer from value
return qb.determineValueType(propRef.ExplicitType, value)
}
// Well-known properties: use the defined type from property mapping
// ExplicitType overrides if specified (e.g., experimentRunId.string_value)
if propRef.ExplicitType != "" {
return propRef.ExplicitType, false
}
return propRef.ValueType, false // Well-known properties don't use dual-column query
}
// buildDualColumnCondition builds a condition that queries both int_value and double_value columns
// This is used for integer literals on custom properties to handle data stored in either column
func (qb *QueryBuilder) buildDualColumnCondition(intColumn, doubleColumn, operator string, value any) conditionResult {
intCondition := qb.buildOperatorCondition(intColumn, operator, value)
doubleCondition := qb.buildOperatorCondition(doubleColumn, operator, value)
// Combine with OR to find values in either column
return conditionResult{
condition: fmt.Sprintf("(%s OR %s)", intCondition.condition, doubleCondition.condition),
args: append(intCondition.args, doubleCondition.args...),
}
}
// buildValueCondition builds a condition for a property value, handling the dual-column query for integer literals
func (qb *QueryBuilder) buildValueCondition(propertyAlias string, explicitType string, operator string, value any) conditionResult {
valueType, inferredAsInt := qb.determineValueType(explicitType, value)
// Special handling for integer literals without explicit type:
// Query BOTH int_value and double_value to handle data stored in either column.
// This prevents silent query failures when data type doesn't match user's expectation.
if inferredAsInt {
intColumn := fmt.Sprintf("%s.int_value", propertyAlias)
doubleColumn := fmt.Sprintf("%s.double_value", propertyAlias)
return qb.buildDualColumnCondition(intColumn, doubleColumn, operator, value)
}
// For explicit types or non-integer types, use the specified column
valueColumn := fmt.Sprintf("%s.%s", propertyAlias, valueType)
return qb.buildOperatorCondition(valueColumn, operator, value)
}
// buildOperatorCondition builds a condition string for an operator
func (qb *QueryBuilder) buildOperatorCondition(column string, operator string, value any) conditionResult {
switch operator {
case "=":
return conditionResult{condition: fmt.Sprintf("%s = ?", column), args: []any{value}}
case "!=":
return conditionResult{condition: fmt.Sprintf("%s != ?", column), args: []any{value}}
case ">":
return conditionResult{condition: fmt.Sprintf("%s > ?", column), args: []any{value}}
case ">=":
return conditionResult{condition: fmt.Sprintf("%s >= ?", column), args: []any{value}}
case "<":
return conditionResult{condition: fmt.Sprintf("%s < ?", column), args: []any{value}}
case "<=":
return conditionResult{condition: fmt.Sprintf("%s <= ?", column), args: []any{value}}
case "LIKE":
return conditionResult{condition: fmt.Sprintf("%s LIKE ?", column), args: []any{value}}
case "ILIKE":
// Cross-database case-insensitive LIKE using UPPER()
// This works across MySQL, PostgreSQL, SQLite, and most other databases
if strValue, ok := value.(string); ok {
return conditionResult{
condition: fmt.Sprintf("UPPER(%s) LIKE UPPER(?)", column),
args: []any{strValue},
}
}
// Fallback to regular LIKE if value is not a string
return conditionResult{condition: fmt.Sprintf("%s LIKE ?", column), args: []any{value}}
case "IN":
// Handle IN operator with array values
if valueSlice, ok := value.([]interface{}); ok {
if len(valueSlice) == 0 {
// Empty list should return false condition
return conditionResult{condition: "1 = 0", args: []any{}}
}
// Create placeholders for each value
condition := fmt.Sprintf("%s IN (?%s)", column, strings.Repeat(",?", len(valueSlice)-1))
return conditionResult{condition: condition, args: valueSlice}
}
// Fallback to single value (shouldn't normally happen with proper parsing)
return conditionResult{condition: fmt.Sprintf("%s IN (?)", column), args: []any{value}}
default:
// Default to equality
return conditionResult{condition: fmt.Sprintf("%s = ?", column), args: []any{value}}
}
}
// buildCaseInsensitiveLikeCondition builds a cross-database case-insensitive LIKE condition
// This method provides different implementations based on the database type for optimal performance
//
//nolint:staticcheck // Embedded field access is intentional for database dialect checking
func (qb *QueryBuilder) buildCaseInsensitiveLikeCondition(db *gorm.DB, column string, value any) *gorm.DB {
if strValue, ok := value.(string); ok {
// Check database type for optimal implementation
switch db.Name() {
case "postgres":
// PostgreSQL supports ILIKE natively (most efficient)
return db.Where(fmt.Sprintf("%s ILIKE ?", column), strValue)
case "mysql":
// MySQL: use COLLATE for case-insensitive comparison
return db.Where(fmt.Sprintf("%s LIKE ? COLLATE utf8mb4_unicode_ci", column), strValue)
case "sqlite":
// SQLite: LIKE is case-insensitive by default for ASCII characters
return db.Where(fmt.Sprintf("%s LIKE ?", column), strValue)
default:
// Fallback: use UPPER() function (works on most databases)
return db.Where(fmt.Sprintf("UPPER(%s) LIKE UPPER(?)", column), strValue)
}
}
// Fallback to regular LIKE if value is not a string
return db.Where(fmt.Sprintf("%s LIKE ?", column), value)
}
// buildJSONOperatorCondition builds a condition string for an operator on a JSON array
func (qb *QueryBuilder) buildJSONOperatorCondition(column string, operator string, value any) conditionResult {
switch operator {
case "IN":
// Handle IN operator with array values
if valueSlice, ok := value.([]any); ok {
if len(valueSlice) == 0 {
// Empty list should return false condition
return conditionResult{condition: "1 = 0", args: []any{}}
}
// Create placeholders for each value
return conditionResult{
condition: fmt.Sprintf("%s IS JSON ARRAY AND %s::jsonb ? array[?%s]", column, column, strings.Repeat(",?", len(valueSlice)-1)),
args: append([]any{gorm.Expr("?|")}, valueSlice...),
}
}
// Fallback to single value (shouldn't normally happen with proper parsing)
fallthrough
case "=":
return conditionResult{condition: fmt.Sprintf("%s IS JSON ARRAY AND %s::jsonb ? array[?]", column, column), args: []any{gorm.Expr("?|"), value}}
case "!=":
return conditionResult{condition: fmt.Sprintf("%s IS NOT JSON ARRAY OR NOT %s::jsonb ? array[?]", column, column), args: []any{gorm.Expr("?|"), value}}
default:
// Pass through anything else
return qb.buildOperatorCondition(column, operator, value)
}
}
// defaultEntityMappings implements EntityMappingFunctions for the model registry
type defaultEntityMappings struct{}
func (d *defaultEntityMappings) GetMLMDEntityType(restEntityType RestEntityType) EntityType {
return GetMLMDEntityType(restEntityType)
}
func (d *defaultEntityMappings) GetPropertyDefinitionForRestEntity(restEntityType RestEntityType, propertyName string) PropertyDefinition {
return GetPropertyDefinitionForRestEntity(restEntityType, propertyName)
}
func (d *defaultEntityMappings) IsChildEntity(entityType RestEntityType) bool {
return isChildEntity(entityType)
}
package filter
// RestEntityType represents the specific REST API entity type
type RestEntityType string
const (
// Context-based REST entities
RestEntityRegisteredModel RestEntityType = "RegisteredModel"
RestEntityModelVersion RestEntityType = "ModelVersion"
RestEntityInferenceService RestEntityType = "InferenceService"
RestEntityServingEnvironment RestEntityType = "ServingEnvironment"
RestEntityExperiment RestEntityType = "Experiment"
RestEntityExperimentRun RestEntityType = "ExperimentRun"
// Artifact-based REST entities
RestEntityModelArtifact RestEntityType = "ModelArtifact"
RestEntityDocArtifact RestEntityType = "DocArtifact"
RestEntityDataSet RestEntityType = "DataSet"
RestEntityMetric RestEntityType = "Metric"
RestEntityParameter RestEntityType = "Parameter"
// Execution-based REST entities
RestEntityServeModel RestEntityType = "ServeModel"
)
// isChildEntity returns true if the REST entity type uses prefixed names (parentId:name)
func isChildEntity(entityType RestEntityType) bool {
// Only top-level entities don't use prefixed names
switch entityType {
case RestEntityRegisteredModel, RestEntityExperiment, RestEntityServingEnvironment:
return false
default:
// All other entities are child entities that use prefixed names
return true
}
}
// RestEntityPropertyMap maps REST entity types to their allowed properties
var RestEntityPropertyMap = map[RestEntityType]map[string]bool{
// Context-based entities
RestEntityRegisteredModel: {
// Common Context properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
// RegisteredModel-specific properties
"state": true, "owner": true,
// No experiment or serving-specific properties allowed
},
RestEntityModelVersion: {
// Common Context properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
// ModelVersion-specific properties
"registeredModelId": true, "state": true, "author": true,
// No experiment or serving-specific properties allowed
},
RestEntityInferenceService: {
// Common Context properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
// InferenceService-specific properties
"registeredModelId": true, "modelVersionId": true, "servingEnvironmentId": true,
"runtime": true, "desiredState": true,
// No experiment-specific properties allowed
},
RestEntityServingEnvironment: {
// Common Context properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
// ServingEnvironment-specific properties (minimal)
// No inference or experiment-specific properties allowed
},
RestEntityExperiment: {
// Common Context properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
// Experiment-specific properties
"state": true, "owner": true,
// No serving or model-specific properties allowed
},
RestEntityExperimentRun: {
// Common Context properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
// ExperimentRun-specific properties
"experimentId": true, "startTimeSinceEpoch": true, "endTimeSinceEpoch": true,
"status": true, "state": true, "owner": true,
// No serving or model-specific properties allowed
},
// Artifact-based entities
RestEntityModelArtifact: {
// Common Artifact properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
"uri": true, "state": true,
// ModelArtifact-specific properties
"modelFormatName": true, "modelFormatVersion": true,
"storageKey": true, "storagePath": true, "serviceAccountName": true,
"modelSourceKind": true, "modelSourceClass": true, "modelSourceGroup": true,
"modelSourceId": true, "modelSourceName": true,
// Experiment properties (available on all artifacts)
"experimentId": true, "experimentRunId": true,
// No metric/parameter/dataset-specific properties allowed
},
RestEntityDocArtifact: {
// Common Artifact properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
"uri": true, "state": true,
// Experiment properties (available on all artifacts)
"experimentId": true, "experimentRunId": true,
// DocArtifact has minimal additional properties
// No metric/parameter/dataset-specific properties allowed
},
RestEntityDataSet: {
// Common Artifact properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
"uri": true, "state": true,
// DataSet-specific properties
"digest": true, "sourceType": true, "source": true, "schema": true, "profile": true,
// Experiment properties (available on all artifacts)
"experimentId": true, "experimentRunId": true,
// No metric/parameter/model-specific properties allowed
},
RestEntityMetric: {
// Common Artifact properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
"uri": true, "state": true,
// Metric-specific properties
"value": true, "timestamp": true, "step": true,
// Experiment properties (available on all artifacts)
"experimentId": true, "experimentRunId": true,
// No parameter/dataset/model-specific properties allowed
},
RestEntityParameter: {
// Common Artifact properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
"uri": true, "state": true,
// Parameter-specific properties
"value": true, "parameterType": true,
// Experiment properties (available on all artifacts)
"experimentId": true, "experimentRunId": true,
// No metric/dataset/model-specific properties allowed
},
// Execution-based entities
RestEntityServeModel: {
// Common Execution properties
"id": true, "name": true, "externalId": true,
"createTimeSinceEpoch": true, "lastUpdateTimeSinceEpoch": true,
"lastKnownState": true,
// ServeModel-specific properties
"modelVersionId": true, "inferenceServiceId": true,
"registeredModelId": true, "servingEnvironmentId": true,
},
}
// GetMLMDEntityType maps REST entity types to their underlying MLMD entity type
func GetMLMDEntityType(restEntityType RestEntityType) EntityType {
switch restEntityType {
case RestEntityRegisteredModel, RestEntityModelVersion, RestEntityInferenceService,
RestEntityServingEnvironment, RestEntityExperiment, RestEntityExperimentRun:
return EntityTypeContext
case RestEntityModelArtifact, RestEntityDocArtifact, RestEntityDataSet,
RestEntityMetric, RestEntityParameter:
return EntityTypeArtifact
case RestEntityServeModel:
return EntityTypeExecution
default:
return EntityTypeContext // Default fallback
}
}
// GetPropertyDefinitionForRestEntity returns property definition for a REST entity type
// This function determines the correct data type and storage location for properties
func GetPropertyDefinitionForRestEntity(restEntityType RestEntityType, propertyName string) PropertyDefinition {
// Check if this is a well-known property for this specific REST entity type
allowedProperties, exists := RestEntityPropertyMap[restEntityType]
if exists {
if _, isWellKnown := allowedProperties[propertyName]; isWellKnown {
// Use the well-known property definition
mlmdEntityType := GetMLMDEntityType(restEntityType)
return GetPropertyDefinition(mlmdEntityType, propertyName)
}
}
// Not a well-known property for this entity type, treat as custom
return PropertyDefinition{
Location: Custom,
ValueType: StringValueType, // Default, will be inferred at runtime
Column: propertyName, // Use the property name as-is for custom properties
}
}
package api
import (
"errors"
"net/http"
)
var (
ErrBadRequest = errors.New("bad request")
ErrNotFound = errors.New("not found")
ErrConflict = errors.New("conflict")
)
func ErrToStatus(err error) int {
if errors.Is(err, ErrBadRequest) {
return http.StatusBadRequest
}
if errors.Is(err, ErrNotFound) {
return http.StatusNotFound
}
if errors.Is(err, ErrConflict) {
return http.StatusConflict
}
// Default error to return
return http.StatusInternalServerError
}
func IgnoreNotFound(err error) error {
if errors.Is(err, ErrNotFound) {
return nil
}
return err
}
/*
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 (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// ModelRegistryServiceAPIService ModelRegistryServiceAPI service
type ModelRegistryServiceAPIService service
type ApiCreateArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
artifactCreate *ArtifactCreate
}
// A new `Artifact` to be created.
func (r ApiCreateArtifactRequest) ArtifactCreate(artifactCreate ArtifactCreate) ApiCreateArtifactRequest {
r.artifactCreate = &artifactCreate
return r
}
func (r ApiCreateArtifactRequest) Execute() (*Artifact, *http.Response, error) {
return r.ApiService.CreateArtifactExecute(r)
}
/*
CreateArtifact Create an Artifact
Creates a new instance of an `Artifact`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) CreateArtifact(ctx context.Context) ApiCreateArtifactRequest {
return ApiCreateArtifactRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return Artifact
func (a *ModelRegistryServiceAPIService) CreateArtifactExecute(r ApiCreateArtifactRequest) (*Artifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Artifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/artifacts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.artifactCreate == nil {
return localVarReturnValue, nil, reportError("artifactCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.artifactCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateEnvironmentInferenceServiceRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
servingenvironmentId string
inferenceServiceCreate *InferenceServiceCreate
}
// A new `InferenceService` to be created.
func (r ApiCreateEnvironmentInferenceServiceRequest) InferenceServiceCreate(inferenceServiceCreate InferenceServiceCreate) ApiCreateEnvironmentInferenceServiceRequest {
r.inferenceServiceCreate = &inferenceServiceCreate
return r
}
func (r ApiCreateEnvironmentInferenceServiceRequest) Execute() (*InferenceService, *http.Response, error) {
return r.ApiService.CreateEnvironmentInferenceServiceExecute(r)
}
/*
CreateEnvironmentInferenceService Create a InferenceService in ServingEnvironment
Creates a new instance of a `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param servingenvironmentId A unique identifier for a `ServingEnvironment`.
@return ApiCreateEnvironmentInferenceServiceRequest
*/
func (a *ModelRegistryServiceAPIService) CreateEnvironmentInferenceService(ctx context.Context, servingenvironmentId string) ApiCreateEnvironmentInferenceServiceRequest {
return ApiCreateEnvironmentInferenceServiceRequest{
ApiService: a,
ctx: ctx,
servingenvironmentId: servingenvironmentId,
}
}
// Execute executes the request
//
// @return InferenceService
func (a *ModelRegistryServiceAPIService) CreateEnvironmentInferenceServiceExecute(r ApiCreateEnvironmentInferenceServiceRequest) (*InferenceService, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceService
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateEnvironmentInferenceService")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services"
localVarPath = strings.Replace(localVarPath, "{"+"servingenvironmentId"+"}", url.PathEscape(parameterValueToString(r.servingenvironmentId, "servingenvironmentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.inferenceServiceCreate == nil {
return localVarReturnValue, nil, reportError("inferenceServiceCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.inferenceServiceCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateExperimentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentCreate *ExperimentCreate
}
// A new `Experiment` to be created.
func (r ApiCreateExperimentRequest) ExperimentCreate(experimentCreate ExperimentCreate) ApiCreateExperimentRequest {
r.experimentCreate = &experimentCreate
return r
}
func (r ApiCreateExperimentRequest) Execute() (*Experiment, *http.Response, error) {
return r.ApiService.CreateExperimentExecute(r)
}
/*
CreateExperiment Create an Experiment
Creates a new instance of an `Experiment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateExperimentRequest
*/
func (a *ModelRegistryServiceAPIService) CreateExperiment(ctx context.Context) ApiCreateExperimentRequest {
return ApiCreateExperimentRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return Experiment
func (a *ModelRegistryServiceAPIService) CreateExperimentExecute(r ApiCreateExperimentRequest) (*Experiment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Experiment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateExperiment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiments"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.experimentCreate == nil {
return localVarReturnValue, nil, reportError("experimentCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.experimentCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateExperimentExperimentRunRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentId string
experimentRun *ExperimentRun
}
// A new `ExperimentRun` to be created.
func (r ApiCreateExperimentExperimentRunRequest) ExperimentRun(experimentRun ExperimentRun) ApiCreateExperimentExperimentRunRequest {
r.experimentRun = &experimentRun
return r
}
func (r ApiCreateExperimentExperimentRunRequest) Execute() (*ExperimentRun, *http.Response, error) {
return r.ApiService.CreateExperimentExperimentRunExecute(r)
}
/*
CreateExperimentExperimentRun Create an ExperimentRun in Experiment
Creates a new instance of an `ExperimentRun`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentId A unique identifier for an `Experiment`.
@return ApiCreateExperimentExperimentRunRequest
*/
func (a *ModelRegistryServiceAPIService) CreateExperimentExperimentRun(ctx context.Context, experimentId string) ApiCreateExperimentExperimentRunRequest {
return ApiCreateExperimentExperimentRunRequest{
ApiService: a,
ctx: ctx,
experimentId: experimentId,
}
}
// Execute executes the request
//
// @return ExperimentRun
func (a *ModelRegistryServiceAPIService) CreateExperimentExperimentRunExecute(r ApiCreateExperimentExperimentRunRequest) (*ExperimentRun, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRun
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateExperimentExperimentRun")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiments/{experimentId}/experiment_runs"
localVarPath = strings.Replace(localVarPath, "{"+"experimentId"+"}", url.PathEscape(parameterValueToString(r.experimentId, "experimentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.experimentRun == nil {
return localVarReturnValue, nil, reportError("experimentRun is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.experimentRun
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateExperimentRunRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentRunCreate *ExperimentRunCreate
}
// A new `ExperimentRun` to be created.
func (r ApiCreateExperimentRunRequest) ExperimentRunCreate(experimentRunCreate ExperimentRunCreate) ApiCreateExperimentRunRequest {
r.experimentRunCreate = &experimentRunCreate
return r
}
func (r ApiCreateExperimentRunRequest) Execute() (*ExperimentRun, *http.Response, error) {
return r.ApiService.CreateExperimentRunExecute(r)
}
/*
CreateExperimentRun Create an ExperimentRun
Creates a new instance of an `ExperimentRun`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateExperimentRunRequest
*/
func (a *ModelRegistryServiceAPIService) CreateExperimentRun(ctx context.Context) ApiCreateExperimentRunRequest {
return ApiCreateExperimentRunRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ExperimentRun
func (a *ModelRegistryServiceAPIService) CreateExperimentRunExecute(r ApiCreateExperimentRunRequest) (*ExperimentRun, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRun
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateExperimentRun")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.experimentRunCreate == nil {
return localVarReturnValue, nil, reportError("experimentRunCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.experimentRunCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 422 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateInferenceServiceRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceServiceCreate *InferenceServiceCreate
}
// A new `InferenceService` to be created.
func (r ApiCreateInferenceServiceRequest) InferenceServiceCreate(inferenceServiceCreate InferenceServiceCreate) ApiCreateInferenceServiceRequest {
r.inferenceServiceCreate = &inferenceServiceCreate
return r
}
func (r ApiCreateInferenceServiceRequest) Execute() (*InferenceService, *http.Response, error) {
return r.ApiService.CreateInferenceServiceExecute(r)
}
/*
CreateInferenceService Create a InferenceService
Creates a new instance of a `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateInferenceServiceRequest
*/
func (a *ModelRegistryServiceAPIService) CreateInferenceService(ctx context.Context) ApiCreateInferenceServiceRequest {
return ApiCreateInferenceServiceRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return InferenceService
func (a *ModelRegistryServiceAPIService) CreateInferenceServiceExecute(r ApiCreateInferenceServiceRequest) (*InferenceService, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceService
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateInferenceService")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.inferenceServiceCreate == nil {
return localVarReturnValue, nil, reportError("inferenceServiceCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.inferenceServiceCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateInferenceServiceServeRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceserviceId string
serveModelCreate *ServeModelCreate
}
// A new `ServeModel` to be associated with the `InferenceService`.
func (r ApiCreateInferenceServiceServeRequest) ServeModelCreate(serveModelCreate ServeModelCreate) ApiCreateInferenceServiceServeRequest {
r.serveModelCreate = &serveModelCreate
return r
}
func (r ApiCreateInferenceServiceServeRequest) Execute() (*ServeModel, *http.Response, error) {
return r.ApiService.CreateInferenceServiceServeExecute(r)
}
/*
CreateInferenceServiceServe Create a ServeModel action in a InferenceService
Creates a new instance of a `ServeModel` associated with `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param inferenceserviceId A unique identifier for a `InferenceService`.
@return ApiCreateInferenceServiceServeRequest
*/
func (a *ModelRegistryServiceAPIService) CreateInferenceServiceServe(ctx context.Context, inferenceserviceId string) ApiCreateInferenceServiceServeRequest {
return ApiCreateInferenceServiceServeRequest{
ApiService: a,
ctx: ctx,
inferenceserviceId: inferenceserviceId,
}
}
// Execute executes the request
//
// @return ServeModel
func (a *ModelRegistryServiceAPIService) CreateInferenceServiceServeExecute(r ApiCreateInferenceServiceServeRequest) (*ServeModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServeModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateInferenceServiceServe")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves"
localVarPath = strings.Replace(localVarPath, "{"+"inferenceserviceId"+"}", url.PathEscape(parameterValueToString(r.inferenceserviceId, "inferenceserviceId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.serveModelCreate == nil {
return localVarReturnValue, nil, reportError("serveModelCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.serveModelCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateModelArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelArtifactCreate *ModelArtifactCreate
}
// A new `ModelArtifact` to be created.
func (r ApiCreateModelArtifactRequest) ModelArtifactCreate(modelArtifactCreate ModelArtifactCreate) ApiCreateModelArtifactRequest {
r.modelArtifactCreate = &modelArtifactCreate
return r
}
func (r ApiCreateModelArtifactRequest) Execute() (*ModelArtifact, *http.Response, error) {
return r.ApiService.CreateModelArtifactExecute(r)
}
/*
CreateModelArtifact Create a ModelArtifact
Creates a new instance of a `ModelArtifact`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateModelArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) CreateModelArtifact(ctx context.Context) ApiCreateModelArtifactRequest {
return ApiCreateModelArtifactRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ModelArtifact
func (a *ModelRegistryServiceAPIService) CreateModelArtifactExecute(r ApiCreateModelArtifactRequest) (*ModelArtifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelArtifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateModelArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_artifacts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.modelArtifactCreate == nil {
return localVarReturnValue, nil, reportError("modelArtifactCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.modelArtifactCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateModelVersionRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelVersionCreate *ModelVersionCreate
}
// A new `ModelVersion` to be created.
func (r ApiCreateModelVersionRequest) ModelVersionCreate(modelVersionCreate ModelVersionCreate) ApiCreateModelVersionRequest {
r.modelVersionCreate = &modelVersionCreate
return r
}
func (r ApiCreateModelVersionRequest) Execute() (*ModelVersion, *http.Response, error) {
return r.ApiService.CreateModelVersionExecute(r)
}
/*
CreateModelVersion Create a ModelVersion
Creates a new instance of a `ModelVersion`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateModelVersionRequest
*/
func (a *ModelRegistryServiceAPIService) CreateModelVersion(ctx context.Context) ApiCreateModelVersionRequest {
return ApiCreateModelVersionRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ModelVersion
func (a *ModelRegistryServiceAPIService) CreateModelVersionExecute(r ApiCreateModelVersionRequest) (*ModelVersion, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersion
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateModelVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_versions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.modelVersionCreate == nil {
return localVarReturnValue, nil, reportError("modelVersionCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.modelVersionCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 422 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateRegisteredModelRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
registeredModelCreate *RegisteredModelCreate
}
// A new `RegisteredModel` to be created.
func (r ApiCreateRegisteredModelRequest) RegisteredModelCreate(registeredModelCreate RegisteredModelCreate) ApiCreateRegisteredModelRequest {
r.registeredModelCreate = ®isteredModelCreate
return r
}
func (r ApiCreateRegisteredModelRequest) Execute() (*RegisteredModel, *http.Response, error) {
return r.ApiService.CreateRegisteredModelExecute(r)
}
/*
CreateRegisteredModel Create a RegisteredModel
Creates a new instance of a `RegisteredModel`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateRegisteredModelRequest
*/
func (a *ModelRegistryServiceAPIService) CreateRegisteredModel(ctx context.Context) ApiCreateRegisteredModelRequest {
return ApiCreateRegisteredModelRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return RegisteredModel
func (a *ModelRegistryServiceAPIService) CreateRegisteredModelExecute(r ApiCreateRegisteredModelRequest) (*RegisteredModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *RegisteredModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateRegisteredModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_models"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.registeredModelCreate == nil {
return localVarReturnValue, nil, reportError("registeredModelCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.registeredModelCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateRegisteredModelVersionRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
registeredmodelId string
modelVersion *ModelVersion
}
// A new `ModelVersion` to be created.
func (r ApiCreateRegisteredModelVersionRequest) ModelVersion(modelVersion ModelVersion) ApiCreateRegisteredModelVersionRequest {
r.modelVersion = &modelVersion
return r
}
func (r ApiCreateRegisteredModelVersionRequest) Execute() (*ModelVersion, *http.Response, error) {
return r.ApiService.CreateRegisteredModelVersionExecute(r)
}
/*
CreateRegisteredModelVersion Create a ModelVersion in RegisteredModel
Creates a new instance of a `ModelVersion`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param registeredmodelId A unique identifier for a `RegisteredModel`.
@return ApiCreateRegisteredModelVersionRequest
*/
func (a *ModelRegistryServiceAPIService) CreateRegisteredModelVersion(ctx context.Context, registeredmodelId string) ApiCreateRegisteredModelVersionRequest {
return ApiCreateRegisteredModelVersionRequest{
ApiService: a,
ctx: ctx,
registeredmodelId: registeredmodelId,
}
}
// Execute executes the request
//
// @return ModelVersion
func (a *ModelRegistryServiceAPIService) CreateRegisteredModelVersionExecute(r ApiCreateRegisteredModelVersionRequest) (*ModelVersion, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersion
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateRegisteredModelVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions"
localVarPath = strings.Replace(localVarPath, "{"+"registeredmodelId"+"}", url.PathEscape(parameterValueToString(r.registeredmodelId, "registeredmodelId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.modelVersion == nil {
return localVarReturnValue, nil, reportError("modelVersion is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.modelVersion
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiCreateServingEnvironmentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
servingEnvironmentCreate *ServingEnvironmentCreate
}
// A new `ServingEnvironment` to be created.
func (r ApiCreateServingEnvironmentRequest) ServingEnvironmentCreate(servingEnvironmentCreate ServingEnvironmentCreate) ApiCreateServingEnvironmentRequest {
r.servingEnvironmentCreate = &servingEnvironmentCreate
return r
}
func (r ApiCreateServingEnvironmentRequest) Execute() (*ServingEnvironment, *http.Response, error) {
return r.ApiService.CreateServingEnvironmentExecute(r)
}
/*
CreateServingEnvironment Create a ServingEnvironment
Creates a new instance of a `ServingEnvironment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateServingEnvironmentRequest
*/
func (a *ModelRegistryServiceAPIService) CreateServingEnvironment(ctx context.Context) ApiCreateServingEnvironmentRequest {
return ApiCreateServingEnvironmentRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ServingEnvironment
func (a *ModelRegistryServiceAPIService) CreateServingEnvironmentExecute(r ApiCreateServingEnvironmentRequest) (*ServingEnvironment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServingEnvironment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.CreateServingEnvironment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environments"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.servingEnvironmentCreate == nil {
return localVarReturnValue, nil, reportError("servingEnvironmentCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.servingEnvironmentCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
parentResourceId *string
}
// Name of entity to search.
func (r ApiFindArtifactRequest) Name(name string) ApiFindArtifactRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindArtifactRequest) ExternalId(externalId string) ApiFindArtifactRequest {
r.externalId = &externalId
return r
}
// ID of the parent resource to use for search.
func (r ApiFindArtifactRequest) ParentResourceId(parentResourceId string) ApiFindArtifactRequest {
r.parentResourceId = &parentResourceId
return r
}
func (r ApiFindArtifactRequest) Execute() (*Artifact, *http.Response, error) {
return r.ApiService.FindArtifactExecute(r)
}
/*
FindArtifact Get an Artifact that matches search parameters.
Gets the details of a single instance of an `Artifact` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) FindArtifact(ctx context.Context) ApiFindArtifactRequest {
return ApiFindArtifactRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return Artifact
func (a *ModelRegistryServiceAPIService) FindArtifactExecute(r ApiFindArtifactRequest) (*Artifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Artifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/artifact"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.parentResourceId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "parentResourceId", r.parentResourceId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindExperimentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
}
// Name of entity to search.
func (r ApiFindExperimentRequest) Name(name string) ApiFindExperimentRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindExperimentRequest) ExternalId(externalId string) ApiFindExperimentRequest {
r.externalId = &externalId
return r
}
func (r ApiFindExperimentRequest) Execute() (*Experiment, *http.Response, error) {
return r.ApiService.FindExperimentExecute(r)
}
/*
FindExperiment Get an Experiment that matches search parameters.
Gets the details of a single instance of an `Experiment` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindExperimentRequest
*/
func (a *ModelRegistryServiceAPIService) FindExperiment(ctx context.Context) ApiFindExperimentRequest {
return ApiFindExperimentRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return Experiment
func (a *ModelRegistryServiceAPIService) FindExperimentExecute(r ApiFindExperimentRequest) (*Experiment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Experiment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindExperiment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindExperimentRunRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
parentResourceId *string
}
// Name of entity to search.
func (r ApiFindExperimentRunRequest) Name(name string) ApiFindExperimentRunRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindExperimentRunRequest) ExternalId(externalId string) ApiFindExperimentRunRequest {
r.externalId = &externalId
return r
}
// ID of the parent resource to use for search.
func (r ApiFindExperimentRunRequest) ParentResourceId(parentResourceId string) ApiFindExperimentRunRequest {
r.parentResourceId = &parentResourceId
return r
}
func (r ApiFindExperimentRunRequest) Execute() (*ExperimentRun, *http.Response, error) {
return r.ApiService.FindExperimentRunExecute(r)
}
/*
FindExperimentRun Get an ExperimentRun that matches search parameters.
Gets the details of a single instance of an `ExperimentRun` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindExperimentRunRequest
*/
func (a *ModelRegistryServiceAPIService) FindExperimentRun(ctx context.Context) ApiFindExperimentRunRequest {
return ApiFindExperimentRunRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ExperimentRun
func (a *ModelRegistryServiceAPIService) FindExperimentRunExecute(r ApiFindExperimentRunRequest) (*ExperimentRun, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRun
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindExperimentRun")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_run"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.parentResourceId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "parentResourceId", r.parentResourceId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindInferenceServiceRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
parentResourceId *string
}
// Name of entity to search.
func (r ApiFindInferenceServiceRequest) Name(name string) ApiFindInferenceServiceRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindInferenceServiceRequest) ExternalId(externalId string) ApiFindInferenceServiceRequest {
r.externalId = &externalId
return r
}
// ID of the parent resource to use for search.
func (r ApiFindInferenceServiceRequest) ParentResourceId(parentResourceId string) ApiFindInferenceServiceRequest {
r.parentResourceId = &parentResourceId
return r
}
func (r ApiFindInferenceServiceRequest) Execute() (*InferenceService, *http.Response, error) {
return r.ApiService.FindInferenceServiceExecute(r)
}
/*
FindInferenceService Get an InferenceServices that matches search parameters.
Gets the details of a single instance of `InferenceService` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindInferenceServiceRequest
*/
func (a *ModelRegistryServiceAPIService) FindInferenceService(ctx context.Context) ApiFindInferenceServiceRequest {
return ApiFindInferenceServiceRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return InferenceService
func (a *ModelRegistryServiceAPIService) FindInferenceServiceExecute(r ApiFindInferenceServiceRequest) (*InferenceService, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceService
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindInferenceService")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_service"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.parentResourceId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "parentResourceId", r.parentResourceId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindModelArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
parentResourceId *string
}
// Name of entity to search.
func (r ApiFindModelArtifactRequest) Name(name string) ApiFindModelArtifactRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindModelArtifactRequest) ExternalId(externalId string) ApiFindModelArtifactRequest {
r.externalId = &externalId
return r
}
// ID of the parent resource to use for search.
func (r ApiFindModelArtifactRequest) ParentResourceId(parentResourceId string) ApiFindModelArtifactRequest {
r.parentResourceId = &parentResourceId
return r
}
func (r ApiFindModelArtifactRequest) Execute() (*ModelArtifact, *http.Response, error) {
return r.ApiService.FindModelArtifactExecute(r)
}
/*
FindModelArtifact Get a ModelArtifact that matches search parameters.
Gets the details of a single instance of a `ModelArtifact` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindModelArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) FindModelArtifact(ctx context.Context) ApiFindModelArtifactRequest {
return ApiFindModelArtifactRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ModelArtifact
func (a *ModelRegistryServiceAPIService) FindModelArtifactExecute(r ApiFindModelArtifactRequest) (*ModelArtifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelArtifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindModelArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_artifact"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.parentResourceId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "parentResourceId", r.parentResourceId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindModelVersionRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
parentResourceId *string
}
// Name of entity to search.
func (r ApiFindModelVersionRequest) Name(name string) ApiFindModelVersionRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindModelVersionRequest) ExternalId(externalId string) ApiFindModelVersionRequest {
r.externalId = &externalId
return r
}
// ID of the parent resource to use for search.
func (r ApiFindModelVersionRequest) ParentResourceId(parentResourceId string) ApiFindModelVersionRequest {
r.parentResourceId = &parentResourceId
return r
}
func (r ApiFindModelVersionRequest) Execute() (*ModelVersion, *http.Response, error) {
return r.ApiService.FindModelVersionExecute(r)
}
/*
FindModelVersion Get a ModelVersion that matches search parameters.
Gets the details of a single instance of a `ModelVersion` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindModelVersionRequest
*/
func (a *ModelRegistryServiceAPIService) FindModelVersion(ctx context.Context) ApiFindModelVersionRequest {
return ApiFindModelVersionRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ModelVersion
func (a *ModelRegistryServiceAPIService) FindModelVersionExecute(r ApiFindModelVersionRequest) (*ModelVersion, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersion
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindModelVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_version"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.parentResourceId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "parentResourceId", r.parentResourceId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindRegisteredModelRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
}
// Name of entity to search.
func (r ApiFindRegisteredModelRequest) Name(name string) ApiFindRegisteredModelRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindRegisteredModelRequest) ExternalId(externalId string) ApiFindRegisteredModelRequest {
r.externalId = &externalId
return r
}
func (r ApiFindRegisteredModelRequest) Execute() (*RegisteredModel, *http.Response, error) {
return r.ApiService.FindRegisteredModelExecute(r)
}
/*
FindRegisteredModel Get a RegisteredModel that matches search parameters.
Gets the details of a single instance of a `RegisteredModel` that matches search parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindRegisteredModelRequest
*/
func (a *ModelRegistryServiceAPIService) FindRegisteredModel(ctx context.Context) ApiFindRegisteredModelRequest {
return ApiFindRegisteredModelRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return RegisteredModel
func (a *ModelRegistryServiceAPIService) FindRegisteredModelExecute(r ApiFindRegisteredModelRequest) (*RegisteredModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *RegisteredModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindRegisteredModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_model"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiFindServingEnvironmentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
name *string
externalId *string
}
// Name of entity to search.
func (r ApiFindServingEnvironmentRequest) Name(name string) ApiFindServingEnvironmentRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiFindServingEnvironmentRequest) ExternalId(externalId string) ApiFindServingEnvironmentRequest {
r.externalId = &externalId
return r
}
func (r ApiFindServingEnvironmentRequest) Execute() (*ServingEnvironment, *http.Response, error) {
return r.ApiService.FindServingEnvironmentExecute(r)
}
/*
FindServingEnvironment Find ServingEnvironment
Finds a `ServingEnvironment` entity that matches query parameters.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiFindServingEnvironmentRequest
*/
func (a *ModelRegistryServiceAPIService) FindServingEnvironment(ctx context.Context) ApiFindServingEnvironmentRequest {
return ApiFindServingEnvironmentRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ServingEnvironment
func (a *ModelRegistryServiceAPIService) FindServingEnvironmentExecute(r ApiFindServingEnvironmentRequest) (*ServingEnvironment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServingEnvironment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.FindServingEnvironment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environment"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
id string
}
func (r ApiGetArtifactRequest) Execute() (*Artifact, *http.Response, error) {
return r.ApiService.GetArtifactExecute(r)
}
/*
GetArtifact Get an Artifact
Gets the details of a single instance of an `Artifact`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id A unique identifier for an `Artifact`.
@return ApiGetArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) GetArtifact(ctx context.Context, id string) ApiGetArtifactRequest {
return ApiGetArtifactRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return Artifact
func (a *ModelRegistryServiceAPIService) GetArtifactExecute(r ApiGetArtifactRequest) (*Artifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Artifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/artifacts/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetArtifactsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
artifactType *ArtifactTypeQueryParam
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetArtifactsRequest) FilterQuery(filterQuery string) ApiGetArtifactsRequest {
r.filterQuery = &filterQuery
return r
}
// Specifies the artifact type for listing artifacts.
func (r ApiGetArtifactsRequest) ArtifactType(artifactType ArtifactTypeQueryParam) ApiGetArtifactsRequest {
r.artifactType = &artifactType
return r
}
// Number of entities in each page.
func (r ApiGetArtifactsRequest) PageSize(pageSize string) ApiGetArtifactsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetArtifactsRequest) OrderBy(orderBy OrderByField) ApiGetArtifactsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetArtifactsRequest) SortOrder(sortOrder SortOrder) ApiGetArtifactsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetArtifactsRequest) NextPageToken(nextPageToken string) ApiGetArtifactsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetArtifactsRequest) Execute() (*ArtifactList, *http.Response, error) {
return r.ApiService.GetArtifactsExecute(r)
}
/*
GetArtifacts List All Artifacts
Gets a list of all `Artifact` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetArtifactsRequest
*/
func (a *ModelRegistryServiceAPIService) GetArtifacts(ctx context.Context) ApiGetArtifactsRequest {
return ApiGetArtifactsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ArtifactList
func (a *ModelRegistryServiceAPIService) GetArtifactsExecute(r ApiGetArtifactsRequest) (*ArtifactList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ArtifactList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetArtifacts")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/artifacts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.artifactType != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "artifactType", r.artifactType, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetEnvironmentInferenceServicesRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
servingenvironmentId string
filterQuery *string
name *string
externalId *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetEnvironmentInferenceServicesRequest) FilterQuery(filterQuery string) ApiGetEnvironmentInferenceServicesRequest {
r.filterQuery = &filterQuery
return r
}
// Name of entity to search.
func (r ApiGetEnvironmentInferenceServicesRequest) Name(name string) ApiGetEnvironmentInferenceServicesRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiGetEnvironmentInferenceServicesRequest) ExternalId(externalId string) ApiGetEnvironmentInferenceServicesRequest {
r.externalId = &externalId
return r
}
// Number of entities in each page.
func (r ApiGetEnvironmentInferenceServicesRequest) PageSize(pageSize string) ApiGetEnvironmentInferenceServicesRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetEnvironmentInferenceServicesRequest) OrderBy(orderBy OrderByField) ApiGetEnvironmentInferenceServicesRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetEnvironmentInferenceServicesRequest) SortOrder(sortOrder SortOrder) ApiGetEnvironmentInferenceServicesRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetEnvironmentInferenceServicesRequest) NextPageToken(nextPageToken string) ApiGetEnvironmentInferenceServicesRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetEnvironmentInferenceServicesRequest) Execute() (*InferenceServiceList, *http.Response, error) {
return r.ApiService.GetEnvironmentInferenceServicesExecute(r)
}
/*
GetEnvironmentInferenceServices List All ServingEnvironment's InferenceServices
Gets a list of all `InferenceService` entities for the `ServingEnvironment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param servingenvironmentId A unique identifier for a `ServingEnvironment`.
@return ApiGetEnvironmentInferenceServicesRequest
*/
func (a *ModelRegistryServiceAPIService) GetEnvironmentInferenceServices(ctx context.Context, servingenvironmentId string) ApiGetEnvironmentInferenceServicesRequest {
return ApiGetEnvironmentInferenceServicesRequest{
ApiService: a,
ctx: ctx,
servingenvironmentId: servingenvironmentId,
}
}
// Execute executes the request
//
// @return InferenceServiceList
func (a *ModelRegistryServiceAPIService) GetEnvironmentInferenceServicesExecute(r ApiGetEnvironmentInferenceServicesRequest) (*InferenceServiceList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceServiceList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetEnvironmentInferenceServices")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services"
localVarPath = strings.Replace(localVarPath, "{"+"servingenvironmentId"+"}", url.PathEscape(parameterValueToString(r.servingenvironmentId, "servingenvironmentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentId string
}
func (r ApiGetExperimentRequest) Execute() (*Experiment, *http.Response, error) {
return r.ApiService.GetExperimentExecute(r)
}
/*
GetExperiment Get an Experiment
Gets the details of a single instance of an `Experiment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentId A unique identifier for an `Experiment`.
@return ApiGetExperimentRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperiment(ctx context.Context, experimentId string) ApiGetExperimentRequest {
return ApiGetExperimentRequest{
ApiService: a,
ctx: ctx,
experimentId: experimentId,
}
}
// Execute executes the request
//
// @return Experiment
func (a *ModelRegistryServiceAPIService) GetExperimentExecute(r ApiGetExperimentRequest) (*Experiment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Experiment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperiment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiments/{experimentId}"
localVarPath = strings.Replace(localVarPath, "{"+"experimentId"+"}", url.PathEscape(parameterValueToString(r.experimentId, "experimentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentExperimentRunsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentId string
name *string
externalId *string
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// Name of entity to search.
func (r ApiGetExperimentExperimentRunsRequest) Name(name string) ApiGetExperimentExperimentRunsRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiGetExperimentExperimentRunsRequest) ExternalId(externalId string) ApiGetExperimentExperimentRunsRequest {
r.externalId = &externalId
return r
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetExperimentExperimentRunsRequest) FilterQuery(filterQuery string) ApiGetExperimentExperimentRunsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetExperimentExperimentRunsRequest) PageSize(pageSize string) ApiGetExperimentExperimentRunsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetExperimentExperimentRunsRequest) OrderBy(orderBy OrderByField) ApiGetExperimentExperimentRunsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetExperimentExperimentRunsRequest) SortOrder(sortOrder SortOrder) ApiGetExperimentExperimentRunsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetExperimentExperimentRunsRequest) NextPageToken(nextPageToken string) ApiGetExperimentExperimentRunsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetExperimentExperimentRunsRequest) Execute() (*ExperimentRunList, *http.Response, error) {
return r.ApiService.GetExperimentExperimentRunsExecute(r)
}
/*
GetExperimentExperimentRuns List All Experiment's ExperimentRuns
Gets a list of all `ExperimentRun` entities for the `Experiment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentId A unique identifier for an `Experiment`.
@return ApiGetExperimentExperimentRunsRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperimentExperimentRuns(ctx context.Context, experimentId string) ApiGetExperimentExperimentRunsRequest {
return ApiGetExperimentExperimentRunsRequest{
ApiService: a,
ctx: ctx,
experimentId: experimentId,
}
}
// Execute executes the request
//
// @return ExperimentRunList
func (a *ModelRegistryServiceAPIService) GetExperimentExperimentRunsExecute(r ApiGetExperimentExperimentRunsRequest) (*ExperimentRunList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRunList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperimentExperimentRuns")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiments/{experimentId}/experiment_runs"
localVarPath = strings.Replace(localVarPath, "{"+"experimentId"+"}", url.PathEscape(parameterValueToString(r.experimentId, "experimentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentRunRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentrunId string
}
func (r ApiGetExperimentRunRequest) Execute() (*ExperimentRun, *http.Response, error) {
return r.ApiService.GetExperimentRunExecute(r)
}
/*
GetExperimentRun Get an ExperimentRun
Gets the details of a single instance of an `ExperimentRun`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentrunId A unique identifier for an `ExperimentRun`.
@return ApiGetExperimentRunRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperimentRun(ctx context.Context, experimentrunId string) ApiGetExperimentRunRequest {
return ApiGetExperimentRunRequest{
ApiService: a,
ctx: ctx,
experimentrunId: experimentrunId,
}
}
// Execute executes the request
//
// @return ExperimentRun
func (a *ModelRegistryServiceAPIService) GetExperimentRunExecute(r ApiGetExperimentRunRequest) (*ExperimentRun, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRun
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperimentRun")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs/{experimentrunId}"
localVarPath = strings.Replace(localVarPath, "{"+"experimentrunId"+"}", url.PathEscape(parameterValueToString(r.experimentrunId, "experimentrunId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentRunArtifactsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentrunId string
filterQuery *string
name *string
externalId *string
artifactType *ArtifactTypeQueryParam
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetExperimentRunArtifactsRequest) FilterQuery(filterQuery string) ApiGetExperimentRunArtifactsRequest {
r.filterQuery = &filterQuery
return r
}
// Name of entity to search.
func (r ApiGetExperimentRunArtifactsRequest) Name(name string) ApiGetExperimentRunArtifactsRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiGetExperimentRunArtifactsRequest) ExternalId(externalId string) ApiGetExperimentRunArtifactsRequest {
r.externalId = &externalId
return r
}
// Specifies the artifact type for listing artifacts.
func (r ApiGetExperimentRunArtifactsRequest) ArtifactType(artifactType ArtifactTypeQueryParam) ApiGetExperimentRunArtifactsRequest {
r.artifactType = &artifactType
return r
}
// Number of entities in each page.
func (r ApiGetExperimentRunArtifactsRequest) PageSize(pageSize string) ApiGetExperimentRunArtifactsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetExperimentRunArtifactsRequest) OrderBy(orderBy OrderByField) ApiGetExperimentRunArtifactsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetExperimentRunArtifactsRequest) SortOrder(sortOrder SortOrder) ApiGetExperimentRunArtifactsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetExperimentRunArtifactsRequest) NextPageToken(nextPageToken string) ApiGetExperimentRunArtifactsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetExperimentRunArtifactsRequest) Execute() (*ArtifactList, *http.Response, error) {
return r.ApiService.GetExperimentRunArtifactsExecute(r)
}
/*
GetExperimentRunArtifacts List all artifacts associated with the `ExperimentRun`
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentrunId A unique identifier for an `ExperimentRun`.
@return ApiGetExperimentRunArtifactsRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperimentRunArtifacts(ctx context.Context, experimentrunId string) ApiGetExperimentRunArtifactsRequest {
return ApiGetExperimentRunArtifactsRequest{
ApiService: a,
ctx: ctx,
experimentrunId: experimentrunId,
}
}
// Execute executes the request
//
// @return ArtifactList
func (a *ModelRegistryServiceAPIService) GetExperimentRunArtifactsExecute(r ApiGetExperimentRunArtifactsRequest) (*ArtifactList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ArtifactList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperimentRunArtifacts")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs/{experimentrunId}/artifacts"
localVarPath = strings.Replace(localVarPath, "{"+"experimentrunId"+"}", url.PathEscape(parameterValueToString(r.experimentrunId, "experimentrunId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.artifactType != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "artifactType", r.artifactType, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentRunMetricHistoryRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentrunId string
filterQuery *string
name *string
stepIds *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetExperimentRunMetricHistoryRequest) FilterQuery(filterQuery string) ApiGetExperimentRunMetricHistoryRequest {
r.filterQuery = &filterQuery
return r
}
// Name of entity to search.
func (r ApiGetExperimentRunMetricHistoryRequest) Name(name string) ApiGetExperimentRunMetricHistoryRequest {
r.name = &name
return r
}
// Comma-separated list of step IDs to filter metrics by.
func (r ApiGetExperimentRunMetricHistoryRequest) StepIds(stepIds string) ApiGetExperimentRunMetricHistoryRequest {
r.stepIds = &stepIds
return r
}
// Number of entities in each page.
func (r ApiGetExperimentRunMetricHistoryRequest) PageSize(pageSize string) ApiGetExperimentRunMetricHistoryRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetExperimentRunMetricHistoryRequest) OrderBy(orderBy OrderByField) ApiGetExperimentRunMetricHistoryRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetExperimentRunMetricHistoryRequest) SortOrder(sortOrder SortOrder) ApiGetExperimentRunMetricHistoryRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetExperimentRunMetricHistoryRequest) NextPageToken(nextPageToken string) ApiGetExperimentRunMetricHistoryRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetExperimentRunMetricHistoryRequest) Execute() (*MetricList, *http.Response, error) {
return r.ApiService.GetExperimentRunMetricHistoryExecute(r)
}
/*
GetExperimentRunMetricHistory Get metric history for an ExperimentRun
Gets the metric history for an `ExperimentRun` with optional filtering by metric name and step IDs.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentrunId A unique identifier for an `ExperimentRun`.
@return ApiGetExperimentRunMetricHistoryRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperimentRunMetricHistory(ctx context.Context, experimentrunId string) ApiGetExperimentRunMetricHistoryRequest {
return ApiGetExperimentRunMetricHistoryRequest{
ApiService: a,
ctx: ctx,
experimentrunId: experimentrunId,
}
}
// Execute executes the request
//
// @return MetricList
func (a *ModelRegistryServiceAPIService) GetExperimentRunMetricHistoryExecute(r ApiGetExperimentRunMetricHistoryRequest) (*MetricList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *MetricList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperimentRunMetricHistory")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs/{experimentrunId}/metric_history"
localVarPath = strings.Replace(localVarPath, "{"+"experimentrunId"+"}", url.PathEscape(parameterValueToString(r.experimentrunId, "experimentrunId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.stepIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "stepIds", r.stepIds, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentRunsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetExperimentRunsRequest) FilterQuery(filterQuery string) ApiGetExperimentRunsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetExperimentRunsRequest) PageSize(pageSize string) ApiGetExperimentRunsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetExperimentRunsRequest) OrderBy(orderBy OrderByField) ApiGetExperimentRunsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetExperimentRunsRequest) SortOrder(sortOrder SortOrder) ApiGetExperimentRunsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetExperimentRunsRequest) NextPageToken(nextPageToken string) ApiGetExperimentRunsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetExperimentRunsRequest) Execute() (*ExperimentRunList, *http.Response, error) {
return r.ApiService.GetExperimentRunsExecute(r)
}
/*
GetExperimentRuns List All ExperimentRuns
Gets a list of all `ExperimentRun` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetExperimentRunsRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperimentRuns(ctx context.Context) ApiGetExperimentRunsRequest {
return ApiGetExperimentRunsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ExperimentRunList
func (a *ModelRegistryServiceAPIService) GetExperimentRunsExecute(r ApiGetExperimentRunsRequest) (*ExperimentRunList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRunList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperimentRuns")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentRunsMetricHistoryRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
name *string
stepIds *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetExperimentRunsMetricHistoryRequest) FilterQuery(filterQuery string) ApiGetExperimentRunsMetricHistoryRequest {
r.filterQuery = &filterQuery
return r
}
// Name of entity to search.
func (r ApiGetExperimentRunsMetricHistoryRequest) Name(name string) ApiGetExperimentRunsMetricHistoryRequest {
r.name = &name
return r
}
// Comma-separated list of step IDs to filter metrics by.
func (r ApiGetExperimentRunsMetricHistoryRequest) StepIds(stepIds string) ApiGetExperimentRunsMetricHistoryRequest {
r.stepIds = &stepIds
return r
}
// Number of entities in each page.
func (r ApiGetExperimentRunsMetricHistoryRequest) PageSize(pageSize string) ApiGetExperimentRunsMetricHistoryRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetExperimentRunsMetricHistoryRequest) OrderBy(orderBy OrderByField) ApiGetExperimentRunsMetricHistoryRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetExperimentRunsMetricHistoryRequest) SortOrder(sortOrder SortOrder) ApiGetExperimentRunsMetricHistoryRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetExperimentRunsMetricHistoryRequest) NextPageToken(nextPageToken string) ApiGetExperimentRunsMetricHistoryRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetExperimentRunsMetricHistoryRequest) Execute() (*MetricList, *http.Response, error) {
return r.ApiService.GetExperimentRunsMetricHistoryExecute(r)
}
/*
GetExperimentRunsMetricHistory Get metric history for multiple ExperimentRuns
Gets the metric history for multiple `ExperimentRun` entities with optional filtering by metric name, step IDs, and experiment run IDs.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetExperimentRunsMetricHistoryRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperimentRunsMetricHistory(ctx context.Context) ApiGetExperimentRunsMetricHistoryRequest {
return ApiGetExperimentRunsMetricHistoryRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return MetricList
func (a *ModelRegistryServiceAPIService) GetExperimentRunsMetricHistoryExecute(r ApiGetExperimentRunsMetricHistoryRequest) (*MetricList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *MetricList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperimentRunsMetricHistory")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs/metric_history"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.stepIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "stepIds", r.stepIds, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetExperimentsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetExperimentsRequest) FilterQuery(filterQuery string) ApiGetExperimentsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetExperimentsRequest) PageSize(pageSize string) ApiGetExperimentsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetExperimentsRequest) OrderBy(orderBy OrderByField) ApiGetExperimentsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetExperimentsRequest) SortOrder(sortOrder SortOrder) ApiGetExperimentsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetExperimentsRequest) NextPageToken(nextPageToken string) ApiGetExperimentsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetExperimentsRequest) Execute() (*ExperimentList, *http.Response, error) {
return r.ApiService.GetExperimentsExecute(r)
}
/*
GetExperiments List All Experiments
Gets a list of all `Experiment` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetExperimentsRequest
*/
func (a *ModelRegistryServiceAPIService) GetExperiments(ctx context.Context) ApiGetExperimentsRequest {
return ApiGetExperimentsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ExperimentList
func (a *ModelRegistryServiceAPIService) GetExperimentsExecute(r ApiGetExperimentsRequest) (*ExperimentList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetExperiments")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiments"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetInferenceServiceRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceserviceId string
}
func (r ApiGetInferenceServiceRequest) Execute() (*InferenceService, *http.Response, error) {
return r.ApiService.GetInferenceServiceExecute(r)
}
/*
GetInferenceService Get a InferenceService
Gets the details of a single instance of a `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param inferenceserviceId A unique identifier for a `InferenceService`.
@return ApiGetInferenceServiceRequest
*/
func (a *ModelRegistryServiceAPIService) GetInferenceService(ctx context.Context, inferenceserviceId string) ApiGetInferenceServiceRequest {
return ApiGetInferenceServiceRequest{
ApiService: a,
ctx: ctx,
inferenceserviceId: inferenceserviceId,
}
}
// Execute executes the request
//
// @return InferenceService
func (a *ModelRegistryServiceAPIService) GetInferenceServiceExecute(r ApiGetInferenceServiceRequest) (*InferenceService, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceService
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetInferenceService")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}"
localVarPath = strings.Replace(localVarPath, "{"+"inferenceserviceId"+"}", url.PathEscape(parameterValueToString(r.inferenceserviceId, "inferenceserviceId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetInferenceServiceModelRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceserviceId string
}
func (r ApiGetInferenceServiceModelRequest) Execute() (*RegisteredModel, *http.Response, error) {
return r.ApiService.GetInferenceServiceModelExecute(r)
}
/*
GetInferenceServiceModel Get InferenceService's RegisteredModel
Gets the `RegisteredModel` entity for the `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param inferenceserviceId A unique identifier for a `InferenceService`.
@return ApiGetInferenceServiceModelRequest
*/
func (a *ModelRegistryServiceAPIService) GetInferenceServiceModel(ctx context.Context, inferenceserviceId string) ApiGetInferenceServiceModelRequest {
return ApiGetInferenceServiceModelRequest{
ApiService: a,
ctx: ctx,
inferenceserviceId: inferenceserviceId,
}
}
// Execute executes the request
//
// @return RegisteredModel
func (a *ModelRegistryServiceAPIService) GetInferenceServiceModelExecute(r ApiGetInferenceServiceModelRequest) (*RegisteredModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *RegisteredModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetInferenceServiceModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/model"
localVarPath = strings.Replace(localVarPath, "{"+"inferenceserviceId"+"}", url.PathEscape(parameterValueToString(r.inferenceserviceId, "inferenceserviceId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetInferenceServiceServesRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceserviceId string
filterQuery *string
name *string
externalId *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetInferenceServiceServesRequest) FilterQuery(filterQuery string) ApiGetInferenceServiceServesRequest {
r.filterQuery = &filterQuery
return r
}
// Name of entity to search.
func (r ApiGetInferenceServiceServesRequest) Name(name string) ApiGetInferenceServiceServesRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiGetInferenceServiceServesRequest) ExternalId(externalId string) ApiGetInferenceServiceServesRequest {
r.externalId = &externalId
return r
}
// Number of entities in each page.
func (r ApiGetInferenceServiceServesRequest) PageSize(pageSize string) ApiGetInferenceServiceServesRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetInferenceServiceServesRequest) OrderBy(orderBy OrderByField) ApiGetInferenceServiceServesRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetInferenceServiceServesRequest) SortOrder(sortOrder SortOrder) ApiGetInferenceServiceServesRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetInferenceServiceServesRequest) NextPageToken(nextPageToken string) ApiGetInferenceServiceServesRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetInferenceServiceServesRequest) Execute() (*ServeModelList, *http.Response, error) {
return r.ApiService.GetInferenceServiceServesExecute(r)
}
/*
GetInferenceServiceServes List All InferenceService's ServeModel actions
Gets a list of all `ServeModel` entities for the `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param inferenceserviceId A unique identifier for a `InferenceService`.
@return ApiGetInferenceServiceServesRequest
*/
func (a *ModelRegistryServiceAPIService) GetInferenceServiceServes(ctx context.Context, inferenceserviceId string) ApiGetInferenceServiceServesRequest {
return ApiGetInferenceServiceServesRequest{
ApiService: a,
ctx: ctx,
inferenceserviceId: inferenceserviceId,
}
}
// Execute executes the request
//
// @return ServeModelList
func (a *ModelRegistryServiceAPIService) GetInferenceServiceServesExecute(r ApiGetInferenceServiceServesRequest) (*ServeModelList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServeModelList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetInferenceServiceServes")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves"
localVarPath = strings.Replace(localVarPath, "{"+"inferenceserviceId"+"}", url.PathEscape(parameterValueToString(r.inferenceserviceId, "inferenceserviceId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetInferenceServiceVersionRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceserviceId string
}
func (r ApiGetInferenceServiceVersionRequest) Execute() (*ModelVersion, *http.Response, error) {
return r.ApiService.GetInferenceServiceVersionExecute(r)
}
/*
GetInferenceServiceVersion Get InferenceService's ModelVersion
Gets the `ModelVersion` entity for the `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param inferenceserviceId A unique identifier for a `InferenceService`.
@return ApiGetInferenceServiceVersionRequest
*/
func (a *ModelRegistryServiceAPIService) GetInferenceServiceVersion(ctx context.Context, inferenceserviceId string) ApiGetInferenceServiceVersionRequest {
return ApiGetInferenceServiceVersionRequest{
ApiService: a,
ctx: ctx,
inferenceserviceId: inferenceserviceId,
}
}
// Execute executes the request
//
// @return ModelVersion
func (a *ModelRegistryServiceAPIService) GetInferenceServiceVersionExecute(r ApiGetInferenceServiceVersionRequest) (*ModelVersion, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersion
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetInferenceServiceVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/version"
localVarPath = strings.Replace(localVarPath, "{"+"inferenceserviceId"+"}", url.PathEscape(parameterValueToString(r.inferenceserviceId, "inferenceserviceId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetInferenceServicesRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetInferenceServicesRequest) FilterQuery(filterQuery string) ApiGetInferenceServicesRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetInferenceServicesRequest) PageSize(pageSize string) ApiGetInferenceServicesRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetInferenceServicesRequest) OrderBy(orderBy OrderByField) ApiGetInferenceServicesRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetInferenceServicesRequest) SortOrder(sortOrder SortOrder) ApiGetInferenceServicesRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetInferenceServicesRequest) NextPageToken(nextPageToken string) ApiGetInferenceServicesRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetInferenceServicesRequest) Execute() (*InferenceServiceList, *http.Response, error) {
return r.ApiService.GetInferenceServicesExecute(r)
}
/*
GetInferenceServices List All InferenceServices
Gets a list of all `InferenceService` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetInferenceServicesRequest
*/
func (a *ModelRegistryServiceAPIService) GetInferenceServices(ctx context.Context) ApiGetInferenceServicesRequest {
return ApiGetInferenceServicesRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return InferenceServiceList
func (a *ModelRegistryServiceAPIService) GetInferenceServicesExecute(r ApiGetInferenceServicesRequest) (*InferenceServiceList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceServiceList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetInferenceServices")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetModelArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelartifactId string
}
func (r ApiGetModelArtifactRequest) Execute() (*ModelArtifact, *http.Response, error) {
return r.ApiService.GetModelArtifactExecute(r)
}
/*
GetModelArtifact Get a ModelArtifact
Gets the details of a single instance of a `ModelArtifact`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param modelartifactId A unique identifier for a `ModelArtifact`.
@return ApiGetModelArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) GetModelArtifact(ctx context.Context, modelartifactId string) ApiGetModelArtifactRequest {
return ApiGetModelArtifactRequest{
ApiService: a,
ctx: ctx,
modelartifactId: modelartifactId,
}
}
// Execute executes the request
//
// @return ModelArtifact
func (a *ModelRegistryServiceAPIService) GetModelArtifactExecute(r ApiGetModelArtifactRequest) (*ModelArtifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelArtifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetModelArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_artifacts/{modelartifactId}"
localVarPath = strings.Replace(localVarPath, "{"+"modelartifactId"+"}", url.PathEscape(parameterValueToString(r.modelartifactId, "modelartifactId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetModelArtifactsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetModelArtifactsRequest) FilterQuery(filterQuery string) ApiGetModelArtifactsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetModelArtifactsRequest) PageSize(pageSize string) ApiGetModelArtifactsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetModelArtifactsRequest) OrderBy(orderBy OrderByField) ApiGetModelArtifactsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetModelArtifactsRequest) SortOrder(sortOrder SortOrder) ApiGetModelArtifactsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetModelArtifactsRequest) NextPageToken(nextPageToken string) ApiGetModelArtifactsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetModelArtifactsRequest) Execute() (*ModelArtifactList, *http.Response, error) {
return r.ApiService.GetModelArtifactsExecute(r)
}
/*
GetModelArtifacts List All ModelArtifacts
Gets a list of all `ModelArtifact` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetModelArtifactsRequest
*/
func (a *ModelRegistryServiceAPIService) GetModelArtifacts(ctx context.Context) ApiGetModelArtifactsRequest {
return ApiGetModelArtifactsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ModelArtifactList
func (a *ModelRegistryServiceAPIService) GetModelArtifactsExecute(r ApiGetModelArtifactsRequest) (*ModelArtifactList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelArtifactList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetModelArtifacts")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_artifacts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetModelVersionRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelversionId string
}
func (r ApiGetModelVersionRequest) Execute() (*ModelVersion, *http.Response, error) {
return r.ApiService.GetModelVersionExecute(r)
}
/*
GetModelVersion Get a ModelVersion
Gets the details of a single instance of a `ModelVersion`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param modelversionId A unique identifier for a `ModelVersion`.
@return ApiGetModelVersionRequest
*/
func (a *ModelRegistryServiceAPIService) GetModelVersion(ctx context.Context, modelversionId string) ApiGetModelVersionRequest {
return ApiGetModelVersionRequest{
ApiService: a,
ctx: ctx,
modelversionId: modelversionId,
}
}
// Execute executes the request
//
// @return ModelVersion
func (a *ModelRegistryServiceAPIService) GetModelVersionExecute(r ApiGetModelVersionRequest) (*ModelVersion, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersion
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetModelVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_versions/{modelversionId}"
localVarPath = strings.Replace(localVarPath, "{"+"modelversionId"+"}", url.PathEscape(parameterValueToString(r.modelversionId, "modelversionId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetModelVersionArtifactsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelversionId string
filterQuery *string
name *string
externalId *string
artifactType *ArtifactTypeQueryParam
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetModelVersionArtifactsRequest) FilterQuery(filterQuery string) ApiGetModelVersionArtifactsRequest {
r.filterQuery = &filterQuery
return r
}
// Name of entity to search.
func (r ApiGetModelVersionArtifactsRequest) Name(name string) ApiGetModelVersionArtifactsRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiGetModelVersionArtifactsRequest) ExternalId(externalId string) ApiGetModelVersionArtifactsRequest {
r.externalId = &externalId
return r
}
// Specifies the artifact type for listing artifacts.
func (r ApiGetModelVersionArtifactsRequest) ArtifactType(artifactType ArtifactTypeQueryParam) ApiGetModelVersionArtifactsRequest {
r.artifactType = &artifactType
return r
}
// Number of entities in each page.
func (r ApiGetModelVersionArtifactsRequest) PageSize(pageSize string) ApiGetModelVersionArtifactsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetModelVersionArtifactsRequest) OrderBy(orderBy OrderByField) ApiGetModelVersionArtifactsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetModelVersionArtifactsRequest) SortOrder(sortOrder SortOrder) ApiGetModelVersionArtifactsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetModelVersionArtifactsRequest) NextPageToken(nextPageToken string) ApiGetModelVersionArtifactsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetModelVersionArtifactsRequest) Execute() (*ArtifactList, *http.Response, error) {
return r.ApiService.GetModelVersionArtifactsExecute(r)
}
/*
GetModelVersionArtifacts List all artifacts associated with the `ModelVersion`
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param modelversionId A unique identifier for a `ModelVersion`.
@return ApiGetModelVersionArtifactsRequest
*/
func (a *ModelRegistryServiceAPIService) GetModelVersionArtifacts(ctx context.Context, modelversionId string) ApiGetModelVersionArtifactsRequest {
return ApiGetModelVersionArtifactsRequest{
ApiService: a,
ctx: ctx,
modelversionId: modelversionId,
}
}
// Execute executes the request
//
// @return ArtifactList
func (a *ModelRegistryServiceAPIService) GetModelVersionArtifactsExecute(r ApiGetModelVersionArtifactsRequest) (*ArtifactList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ArtifactList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetModelVersionArtifacts")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts"
localVarPath = strings.Replace(localVarPath, "{"+"modelversionId"+"}", url.PathEscape(parameterValueToString(r.modelversionId, "modelversionId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.artifactType != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "artifactType", r.artifactType, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetModelVersionsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetModelVersionsRequest) FilterQuery(filterQuery string) ApiGetModelVersionsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetModelVersionsRequest) PageSize(pageSize string) ApiGetModelVersionsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetModelVersionsRequest) OrderBy(orderBy OrderByField) ApiGetModelVersionsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetModelVersionsRequest) SortOrder(sortOrder SortOrder) ApiGetModelVersionsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetModelVersionsRequest) NextPageToken(nextPageToken string) ApiGetModelVersionsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetModelVersionsRequest) Execute() (*ModelVersionList, *http.Response, error) {
return r.ApiService.GetModelVersionsExecute(r)
}
/*
GetModelVersions List All ModelVersions
Gets a list of all `ModelVersion` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetModelVersionsRequest
*/
func (a *ModelRegistryServiceAPIService) GetModelVersions(ctx context.Context) ApiGetModelVersionsRequest {
return ApiGetModelVersionsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ModelVersionList
func (a *ModelRegistryServiceAPIService) GetModelVersionsExecute(r ApiGetModelVersionsRequest) (*ModelVersionList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersionList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetModelVersions")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_versions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetRegisteredModelRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
registeredmodelId string
}
func (r ApiGetRegisteredModelRequest) Execute() (*RegisteredModel, *http.Response, error) {
return r.ApiService.GetRegisteredModelExecute(r)
}
/*
GetRegisteredModel Get a RegisteredModel
Gets the details of a single instance of a `RegisteredModel`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param registeredmodelId A unique identifier for a `RegisteredModel`.
@return ApiGetRegisteredModelRequest
*/
func (a *ModelRegistryServiceAPIService) GetRegisteredModel(ctx context.Context, registeredmodelId string) ApiGetRegisteredModelRequest {
return ApiGetRegisteredModelRequest{
ApiService: a,
ctx: ctx,
registeredmodelId: registeredmodelId,
}
}
// Execute executes the request
//
// @return RegisteredModel
func (a *ModelRegistryServiceAPIService) GetRegisteredModelExecute(r ApiGetRegisteredModelRequest) (*RegisteredModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *RegisteredModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetRegisteredModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_models/{registeredmodelId}"
localVarPath = strings.Replace(localVarPath, "{"+"registeredmodelId"+"}", url.PathEscape(parameterValueToString(r.registeredmodelId, "registeredmodelId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetRegisteredModelVersionsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
registeredmodelId string
name *string
externalId *string
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// Name of entity to search.
func (r ApiGetRegisteredModelVersionsRequest) Name(name string) ApiGetRegisteredModelVersionsRequest {
r.name = &name
return r
}
// External ID of entity to search.
func (r ApiGetRegisteredModelVersionsRequest) ExternalId(externalId string) ApiGetRegisteredModelVersionsRequest {
r.externalId = &externalId
return r
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetRegisteredModelVersionsRequest) FilterQuery(filterQuery string) ApiGetRegisteredModelVersionsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetRegisteredModelVersionsRequest) PageSize(pageSize string) ApiGetRegisteredModelVersionsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetRegisteredModelVersionsRequest) OrderBy(orderBy OrderByField) ApiGetRegisteredModelVersionsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetRegisteredModelVersionsRequest) SortOrder(sortOrder SortOrder) ApiGetRegisteredModelVersionsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetRegisteredModelVersionsRequest) NextPageToken(nextPageToken string) ApiGetRegisteredModelVersionsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetRegisteredModelVersionsRequest) Execute() (*ModelVersionList, *http.Response, error) {
return r.ApiService.GetRegisteredModelVersionsExecute(r)
}
/*
GetRegisteredModelVersions List All RegisteredModel's ModelVersions
Gets a list of all `ModelVersion` entities for the `RegisteredModel`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param registeredmodelId A unique identifier for a `RegisteredModel`.
@return ApiGetRegisteredModelVersionsRequest
*/
func (a *ModelRegistryServiceAPIService) GetRegisteredModelVersions(ctx context.Context, registeredmodelId string) ApiGetRegisteredModelVersionsRequest {
return ApiGetRegisteredModelVersionsRequest{
ApiService: a,
ctx: ctx,
registeredmodelId: registeredmodelId,
}
}
// Execute executes the request
//
// @return ModelVersionList
func (a *ModelRegistryServiceAPIService) GetRegisteredModelVersionsExecute(r ApiGetRegisteredModelVersionsRequest) (*ModelVersionList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersionList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetRegisteredModelVersions")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions"
localVarPath = strings.Replace(localVarPath, "{"+"registeredmodelId"+"}", url.PathEscape(parameterValueToString(r.registeredmodelId, "registeredmodelId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.name != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "")
}
if r.externalId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "externalId", r.externalId, "form", "")
}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetRegisteredModelsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetRegisteredModelsRequest) FilterQuery(filterQuery string) ApiGetRegisteredModelsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetRegisteredModelsRequest) PageSize(pageSize string) ApiGetRegisteredModelsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetRegisteredModelsRequest) OrderBy(orderBy OrderByField) ApiGetRegisteredModelsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetRegisteredModelsRequest) SortOrder(sortOrder SortOrder) ApiGetRegisteredModelsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetRegisteredModelsRequest) NextPageToken(nextPageToken string) ApiGetRegisteredModelsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetRegisteredModelsRequest) Execute() (*RegisteredModelList, *http.Response, error) {
return r.ApiService.GetRegisteredModelsExecute(r)
}
/*
GetRegisteredModels List All RegisteredModels
Gets a list of all `RegisteredModel` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetRegisteredModelsRequest
*/
func (a *ModelRegistryServiceAPIService) GetRegisteredModels(ctx context.Context) ApiGetRegisteredModelsRequest {
return ApiGetRegisteredModelsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return RegisteredModelList
func (a *ModelRegistryServiceAPIService) GetRegisteredModelsExecute(r ApiGetRegisteredModelsRequest) (*RegisteredModelList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *RegisteredModelList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetRegisteredModels")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_models"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetServingEnvironmentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
servingenvironmentId string
}
func (r ApiGetServingEnvironmentRequest) Execute() (*ServingEnvironment, *http.Response, error) {
return r.ApiService.GetServingEnvironmentExecute(r)
}
/*
GetServingEnvironment Get a ServingEnvironment
Gets the details of a single instance of a `ServingEnvironment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param servingenvironmentId A unique identifier for a `ServingEnvironment`.
@return ApiGetServingEnvironmentRequest
*/
func (a *ModelRegistryServiceAPIService) GetServingEnvironment(ctx context.Context, servingenvironmentId string) ApiGetServingEnvironmentRequest {
return ApiGetServingEnvironmentRequest{
ApiService: a,
ctx: ctx,
servingenvironmentId: servingenvironmentId,
}
}
// Execute executes the request
//
// @return ServingEnvironment
func (a *ModelRegistryServiceAPIService) GetServingEnvironmentExecute(r ApiGetServingEnvironmentRequest) (*ServingEnvironment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServingEnvironment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetServingEnvironment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}"
localVarPath = strings.Replace(localVarPath, "{"+"servingenvironmentId"+"}", url.PathEscape(parameterValueToString(r.servingenvironmentId, "servingenvironmentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetServingEnvironmentsRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
filterQuery *string
pageSize *string
orderBy *OrderByField
sortOrder *SortOrder
nextPageToken *string
}
// A SQL-like query string to filter the list of entities. The query supports rich filtering capabilities with automatic type inference. **Supported Operators:** - Comparison: `=`, `!=`, `<>`, `>`, `<`, `>=`, `<=` - Pattern matching: `LIKE`, `ILIKE` (case-insensitive) - Set membership: `IN` - Logical: `AND`, `OR` - Grouping: `()` for complex expressions **Data Types:** - Strings: `\"value\"` or `'value'` - Numbers: `42`, `3.14`, `1e-5` - Booleans: `true`, `false` (case-insensitive) **Property Access:** - Standard properties: `name`, `id`, `state`, `createTimeSinceEpoch` - Custom properties: Any user-defined property name - Escaped properties: Use backticks for special characters: `` `custom-property` `` - Type-specific access: `property.string_value`, `property.double_value`, `property.int_value`, `property.bool_value` **Examples:** - Basic: `name = \"my-model\"` - Comparison: `accuracy > 0.95` - Pattern: `name LIKE \"%tensorflow%\"` - Complex: `(name = \"model-a\" OR name = \"model-b\") AND state = \"LIVE\"` - Custom property: `framework.string_value = \"pytorch\"` - Escaped property: `` `mlflow.source.type` = \"notebook\" ``
func (r ApiGetServingEnvironmentsRequest) FilterQuery(filterQuery string) ApiGetServingEnvironmentsRequest {
r.filterQuery = &filterQuery
return r
}
// Number of entities in each page.
func (r ApiGetServingEnvironmentsRequest) PageSize(pageSize string) ApiGetServingEnvironmentsRequest {
r.pageSize = &pageSize
return r
}
// Specifies the order by criteria for listing entities.
func (r ApiGetServingEnvironmentsRequest) OrderBy(orderBy OrderByField) ApiGetServingEnvironmentsRequest {
r.orderBy = &orderBy
return r
}
// Specifies the sort order for listing entities, defaults to ASC.
func (r ApiGetServingEnvironmentsRequest) SortOrder(sortOrder SortOrder) ApiGetServingEnvironmentsRequest {
r.sortOrder = &sortOrder
return r
}
// Token to use to retrieve next page of results.
func (r ApiGetServingEnvironmentsRequest) NextPageToken(nextPageToken string) ApiGetServingEnvironmentsRequest {
r.nextPageToken = &nextPageToken
return r
}
func (r ApiGetServingEnvironmentsRequest) Execute() (*ServingEnvironmentList, *http.Response, error) {
return r.ApiService.GetServingEnvironmentsExecute(r)
}
/*
GetServingEnvironments List All ServingEnvironments
Gets a list of all `ServingEnvironment` entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetServingEnvironmentsRequest
*/
func (a *ModelRegistryServiceAPIService) GetServingEnvironments(ctx context.Context) ApiGetServingEnvironmentsRequest {
return ApiGetServingEnvironmentsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return ServingEnvironmentList
func (a *ModelRegistryServiceAPIService) GetServingEnvironmentsExecute(r ApiGetServingEnvironmentsRequest) (*ServingEnvironmentList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServingEnvironmentList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.GetServingEnvironments")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environments"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.filterQuery != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "filterQuery", r.filterQuery, "form", "")
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "form", "")
}
if r.sortOrder != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "")
}
if r.nextPageToken != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "nextPageToken", r.nextPageToken, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
id string
artifactUpdate *ArtifactUpdate
}
// Updated `Artifact` information.
func (r ApiUpdateArtifactRequest) ArtifactUpdate(artifactUpdate ArtifactUpdate) ApiUpdateArtifactRequest {
r.artifactUpdate = &artifactUpdate
return r
}
func (r ApiUpdateArtifactRequest) Execute() (*Artifact, *http.Response, error) {
return r.ApiService.UpdateArtifactExecute(r)
}
/*
UpdateArtifact Update an Artifact
Updates an existing `Artifact`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id A unique identifier for an `Artifact`.
@return ApiUpdateArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateArtifact(ctx context.Context, id string) ApiUpdateArtifactRequest {
return ApiUpdateArtifactRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return Artifact
func (a *ModelRegistryServiceAPIService) UpdateArtifactExecute(r ApiUpdateArtifactRequest) (*Artifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Artifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/artifacts/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.artifactUpdate == nil {
return localVarReturnValue, nil, reportError("artifactUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.artifactUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateExperimentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentId string
experimentUpdate *ExperimentUpdate
}
// Updated `Experiment` information.
func (r ApiUpdateExperimentRequest) ExperimentUpdate(experimentUpdate ExperimentUpdate) ApiUpdateExperimentRequest {
r.experimentUpdate = &experimentUpdate
return r
}
func (r ApiUpdateExperimentRequest) Execute() (*Experiment, *http.Response, error) {
return r.ApiService.UpdateExperimentExecute(r)
}
/*
UpdateExperiment Update an Experiment
Updates an existing `Experiment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentId A unique identifier for an `Experiment`.
@return ApiUpdateExperimentRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateExperiment(ctx context.Context, experimentId string) ApiUpdateExperimentRequest {
return ApiUpdateExperimentRequest{
ApiService: a,
ctx: ctx,
experimentId: experimentId,
}
}
// Execute executes the request
//
// @return Experiment
func (a *ModelRegistryServiceAPIService) UpdateExperimentExecute(r ApiUpdateExperimentRequest) (*Experiment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Experiment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateExperiment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiments/{experimentId}"
localVarPath = strings.Replace(localVarPath, "{"+"experimentId"+"}", url.PathEscape(parameterValueToString(r.experimentId, "experimentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.experimentUpdate == nil {
return localVarReturnValue, nil, reportError("experimentUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.experimentUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateExperimentRunRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentrunId string
experimentRunUpdate *ExperimentRunUpdate
}
// Updated `ExperimentRun` information.
func (r ApiUpdateExperimentRunRequest) ExperimentRunUpdate(experimentRunUpdate ExperimentRunUpdate) ApiUpdateExperimentRunRequest {
r.experimentRunUpdate = &experimentRunUpdate
return r
}
func (r ApiUpdateExperimentRunRequest) Execute() (*ExperimentRun, *http.Response, error) {
return r.ApiService.UpdateExperimentRunExecute(r)
}
/*
UpdateExperimentRun Update an ExperimentRun
Updates an existing `ExperimentRun`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentrunId A unique identifier for an `ExperimentRun`.
@return ApiUpdateExperimentRunRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateExperimentRun(ctx context.Context, experimentrunId string) ApiUpdateExperimentRunRequest {
return ApiUpdateExperimentRunRequest{
ApiService: a,
ctx: ctx,
experimentrunId: experimentrunId,
}
}
// Execute executes the request
//
// @return ExperimentRun
func (a *ModelRegistryServiceAPIService) UpdateExperimentRunExecute(r ApiUpdateExperimentRunRequest) (*ExperimentRun, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ExperimentRun
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateExperimentRun")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs/{experimentrunId}"
localVarPath = strings.Replace(localVarPath, "{"+"experimentrunId"+"}", url.PathEscape(parameterValueToString(r.experimentrunId, "experimentrunId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.experimentRunUpdate == nil {
return localVarReturnValue, nil, reportError("experimentRunUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.experimentRunUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateInferenceServiceRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
inferenceserviceId string
inferenceServiceUpdate *InferenceServiceUpdate
}
// Updated `InferenceService` information.
func (r ApiUpdateInferenceServiceRequest) InferenceServiceUpdate(inferenceServiceUpdate InferenceServiceUpdate) ApiUpdateInferenceServiceRequest {
r.inferenceServiceUpdate = &inferenceServiceUpdate
return r
}
func (r ApiUpdateInferenceServiceRequest) Execute() (*InferenceService, *http.Response, error) {
return r.ApiService.UpdateInferenceServiceExecute(r)
}
/*
UpdateInferenceService Update a InferenceService
Updates an existing `InferenceService`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param inferenceserviceId A unique identifier for a `InferenceService`.
@return ApiUpdateInferenceServiceRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateInferenceService(ctx context.Context, inferenceserviceId string) ApiUpdateInferenceServiceRequest {
return ApiUpdateInferenceServiceRequest{
ApiService: a,
ctx: ctx,
inferenceserviceId: inferenceserviceId,
}
}
// Execute executes the request
//
// @return InferenceService
func (a *ModelRegistryServiceAPIService) UpdateInferenceServiceExecute(r ApiUpdateInferenceServiceRequest) (*InferenceService, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *InferenceService
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateInferenceService")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}"
localVarPath = strings.Replace(localVarPath, "{"+"inferenceserviceId"+"}", url.PathEscape(parameterValueToString(r.inferenceserviceId, "inferenceserviceId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.inferenceServiceUpdate == nil {
return localVarReturnValue, nil, reportError("inferenceServiceUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.inferenceServiceUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateModelArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelartifactId string
modelArtifactUpdate *ModelArtifactUpdate
}
// Updated `ModelArtifact` information.
func (r ApiUpdateModelArtifactRequest) ModelArtifactUpdate(modelArtifactUpdate ModelArtifactUpdate) ApiUpdateModelArtifactRequest {
r.modelArtifactUpdate = &modelArtifactUpdate
return r
}
func (r ApiUpdateModelArtifactRequest) Execute() (*ModelArtifact, *http.Response, error) {
return r.ApiService.UpdateModelArtifactExecute(r)
}
/*
UpdateModelArtifact Update a ModelArtifact
Updates an existing `ModelArtifact`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param modelartifactId A unique identifier for a `ModelArtifact`.
@return ApiUpdateModelArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateModelArtifact(ctx context.Context, modelartifactId string) ApiUpdateModelArtifactRequest {
return ApiUpdateModelArtifactRequest{
ApiService: a,
ctx: ctx,
modelartifactId: modelartifactId,
}
}
// Execute executes the request
//
// @return ModelArtifact
func (a *ModelRegistryServiceAPIService) UpdateModelArtifactExecute(r ApiUpdateModelArtifactRequest) (*ModelArtifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelArtifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateModelArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_artifacts/{modelartifactId}"
localVarPath = strings.Replace(localVarPath, "{"+"modelartifactId"+"}", url.PathEscape(parameterValueToString(r.modelartifactId, "modelartifactId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.modelArtifactUpdate == nil {
return localVarReturnValue, nil, reportError("modelArtifactUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.modelArtifactUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateModelVersionRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelversionId string
modelVersionUpdate *ModelVersionUpdate
}
// Updated `ModelVersion` information.
func (r ApiUpdateModelVersionRequest) ModelVersionUpdate(modelVersionUpdate ModelVersionUpdate) ApiUpdateModelVersionRequest {
r.modelVersionUpdate = &modelVersionUpdate
return r
}
func (r ApiUpdateModelVersionRequest) Execute() (*ModelVersion, *http.Response, error) {
return r.ApiService.UpdateModelVersionExecute(r)
}
/*
UpdateModelVersion Update a ModelVersion
Updates an existing `ModelVersion`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param modelversionId A unique identifier for a `ModelVersion`.
@return ApiUpdateModelVersionRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateModelVersion(ctx context.Context, modelversionId string) ApiUpdateModelVersionRequest {
return ApiUpdateModelVersionRequest{
ApiService: a,
ctx: ctx,
modelversionId: modelversionId,
}
}
// Execute executes the request
//
// @return ModelVersion
func (a *ModelRegistryServiceAPIService) UpdateModelVersionExecute(r ApiUpdateModelVersionRequest) (*ModelVersion, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ModelVersion
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateModelVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_versions/{modelversionId}"
localVarPath = strings.Replace(localVarPath, "{"+"modelversionId"+"}", url.PathEscape(parameterValueToString(r.modelversionId, "modelversionId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.modelVersionUpdate == nil {
return localVarReturnValue, nil, reportError("modelVersionUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.modelVersionUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateRegisteredModelRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
registeredmodelId string
registeredModelUpdate *RegisteredModelUpdate
}
// Updated `RegisteredModel` information.
func (r ApiUpdateRegisteredModelRequest) RegisteredModelUpdate(registeredModelUpdate RegisteredModelUpdate) ApiUpdateRegisteredModelRequest {
r.registeredModelUpdate = ®isteredModelUpdate
return r
}
func (r ApiUpdateRegisteredModelRequest) Execute() (*RegisteredModel, *http.Response, error) {
return r.ApiService.UpdateRegisteredModelExecute(r)
}
/*
UpdateRegisteredModel Update a RegisteredModel
Updates an existing `RegisteredModel`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param registeredmodelId A unique identifier for a `RegisteredModel`.
@return ApiUpdateRegisteredModelRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateRegisteredModel(ctx context.Context, registeredmodelId string) ApiUpdateRegisteredModelRequest {
return ApiUpdateRegisteredModelRequest{
ApiService: a,
ctx: ctx,
registeredmodelId: registeredmodelId,
}
}
// Execute executes the request
//
// @return RegisteredModel
func (a *ModelRegistryServiceAPIService) UpdateRegisteredModelExecute(r ApiUpdateRegisteredModelRequest) (*RegisteredModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *RegisteredModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateRegisteredModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/registered_models/{registeredmodelId}"
localVarPath = strings.Replace(localVarPath, "{"+"registeredmodelId"+"}", url.PathEscape(parameterValueToString(r.registeredmodelId, "registeredmodelId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.registeredModelUpdate == nil {
return localVarReturnValue, nil, reportError("registeredModelUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.registeredModelUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateServingEnvironmentRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
servingenvironmentId string
servingEnvironmentUpdate *ServingEnvironmentUpdate
}
// Updated `ServingEnvironment` information.
func (r ApiUpdateServingEnvironmentRequest) ServingEnvironmentUpdate(servingEnvironmentUpdate ServingEnvironmentUpdate) ApiUpdateServingEnvironmentRequest {
r.servingEnvironmentUpdate = &servingEnvironmentUpdate
return r
}
func (r ApiUpdateServingEnvironmentRequest) Execute() (*ServingEnvironment, *http.Response, error) {
return r.ApiService.UpdateServingEnvironmentExecute(r)
}
/*
UpdateServingEnvironment Update a ServingEnvironment
Updates an existing `ServingEnvironment`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param servingenvironmentId A unique identifier for a `ServingEnvironment`.
@return ApiUpdateServingEnvironmentRequest
*/
func (a *ModelRegistryServiceAPIService) UpdateServingEnvironment(ctx context.Context, servingenvironmentId string) ApiUpdateServingEnvironmentRequest {
return ApiUpdateServingEnvironmentRequest{
ApiService: a,
ctx: ctx,
servingenvironmentId: servingenvironmentId,
}
}
// Execute executes the request
//
// @return ServingEnvironment
func (a *ModelRegistryServiceAPIService) UpdateServingEnvironmentExecute(r ApiUpdateServingEnvironmentRequest) (*ServingEnvironment, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ServingEnvironment
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpdateServingEnvironment")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}"
localVarPath = strings.Replace(localVarPath, "{"+"servingenvironmentId"+"}", url.PathEscape(parameterValueToString(r.servingenvironmentId, "servingenvironmentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.servingEnvironmentUpdate == nil {
return localVarReturnValue, nil, reportError("servingEnvironmentUpdate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.servingEnvironmentUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpsertExperimentRunArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
experimentrunId string
artifact *Artifact
}
// A new or existing `Artifact` to be associated with the `ExperimentRun`.
func (r ApiUpsertExperimentRunArtifactRequest) Artifact(artifact Artifact) ApiUpsertExperimentRunArtifactRequest {
r.artifact = &artifact
return r
}
func (r ApiUpsertExperimentRunArtifactRequest) Execute() (*Artifact, *http.Response, error) {
return r.ApiService.UpsertExperimentRunArtifactExecute(r)
}
/*
UpsertExperimentRunArtifact Upsert an Artifact in an ExperimentRun
Creates a new instance of an Artifact if needed and associates it with `ExperimentRun`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param experimentrunId A unique identifier for an `ExperimentRun`.
@return ApiUpsertExperimentRunArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) UpsertExperimentRunArtifact(ctx context.Context, experimentrunId string) ApiUpsertExperimentRunArtifactRequest {
return ApiUpsertExperimentRunArtifactRequest{
ApiService: a,
ctx: ctx,
experimentrunId: experimentrunId,
}
}
// Execute executes the request
//
// @return Artifact
func (a *ModelRegistryServiceAPIService) UpsertExperimentRunArtifactExecute(r ApiUpsertExperimentRunArtifactRequest) (*Artifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Artifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpsertExperimentRunArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/experiment_runs/{experimentrunId}/artifacts"
localVarPath = strings.Replace(localVarPath, "{"+"experimentrunId"+"}", url.PathEscape(parameterValueToString(r.experimentrunId, "experimentrunId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.artifact == nil {
return localVarReturnValue, nil, reportError("artifact is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.artifact
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpsertModelVersionArtifactRequest struct {
ctx context.Context
ApiService *ModelRegistryServiceAPIService
modelversionId string
artifact *Artifact
}
// A new or existing `Artifact` to be associated with the `ModelVersion`.
func (r ApiUpsertModelVersionArtifactRequest) Artifact(artifact Artifact) ApiUpsertModelVersionArtifactRequest {
r.artifact = &artifact
return r
}
func (r ApiUpsertModelVersionArtifactRequest) Execute() (*Artifact, *http.Response, error) {
return r.ApiService.UpsertModelVersionArtifactExecute(r)
}
/*
UpsertModelVersionArtifact Upsert an Artifact in a ModelVersion
Creates a new instance of an Artifact if needed and associates it with `ModelVersion`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param modelversionId A unique identifier for a `ModelVersion`.
@return ApiUpsertModelVersionArtifactRequest
*/
func (a *ModelRegistryServiceAPIService) UpsertModelVersionArtifact(ctx context.Context, modelversionId string) ApiUpsertModelVersionArtifactRequest {
return ApiUpsertModelVersionArtifactRequest{
ApiService: a,
ctx: ctx,
modelversionId: modelversionId,
}
}
// Execute executes the request
//
// @return Artifact
func (a *ModelRegistryServiceAPIService) UpsertModelVersionArtifactExecute(r ApiUpsertModelVersionArtifactRequest) (*Artifact, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Artifact
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ModelRegistryServiceAPIService.UpsertModelVersionArtifact")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts"
localVarPath = strings.Replace(localVarPath, "{"+"modelversionId"+"}", url.PathEscape(parameterValueToString(r.modelversionId, "modelversionId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.artifact == nil {
return localVarReturnValue, nil, reportError("artifact is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.artifact
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 409 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 503 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
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 (
"bytes"
"context"
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unicode/utf8"
)
var (
JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]")
)
// APIClient manages communication with the Model Registry REST API API vv1alpha3
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
ModelRegistryServiceAPI *ModelRegistryServiceAPIService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.ModelRegistryServiceAPI = (*ModelRegistryServiceAPIService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insensitive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.EqualFold(a, needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
func parameterValueToString(obj interface{}, key string) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok {
return fmt.Sprintf("%v", actualObj.GetActualInstanceValue())
}
return fmt.Sprintf("%v", obj)
}
var param, ok = obj.(MappedNullable)
if !ok {
return ""
}
dataMap, err := param.ToMap()
if err != nil {
return ""
}
return fmt.Sprintf("%v", dataMap[key])
}
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
// supporting deep object syntax
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) {
var v = reflect.ValueOf(obj)
var value = ""
if v == reflect.ValueOf(nil) {
value = "null"
} else {
switch v.Kind() {
case reflect.Invalid:
value = "invalid"
case reflect.Struct:
if t, ok := obj.(MappedNullable); ok {
dataMap, err := t.ToMap()
if err != nil {
return
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType)
return
}
if t, ok := obj.(time.Time); ok {
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType)
return
}
value = v.Type().String() + " value"
case reflect.Slice:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
var lenIndValue = indValue.Len()
for i := 0; i < lenIndValue; i++ {
var arrayValue = indValue.Index(i)
var keyPrefixForCollectionType = keyPrefix
if style == "deepObject" {
keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]"
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType)
}
return
case reflect.Map:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
iter := indValue.MapRange()
for iter.Next() {
k, v := iter.Key(), iter.Value()
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType)
}
return
case reflect.Interface:
fallthrough
case reflect.Ptr:
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType)
return
case reflect.Int, reflect.Int8, reflect.Int16,
reflect.Int32, reflect.Int64:
value = strconv.FormatInt(v.Int(), 10)
case reflect.Uint, reflect.Uint8, reflect.Uint16,
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
value = strconv.FormatUint(v.Uint(), 10)
case reflect.Float32, reflect.Float64:
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
case reflect.Bool:
value = strconv.FormatBool(v.Bool())
case reflect.String:
value = v.String()
default:
value = v.Type().String() + " value"
}
}
switch valuesMap := headerOrQueryParams.(type) {
case url.Values:
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
} else {
valuesMap.Add(keyPrefix, value)
}
break
case map[string]string:
valuesMap[keyPrefix] = value
break
}
}
// helper for converting interface{} parameters to json strings
func parameterToJson(obj interface{}) (string, error) {
jsonBuf, err := json.Marshal(obj)
if err != nil {
return "", err
}
return string(jsonBuf), err
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
if c.cfg.Debug {
dump, err := httputil.DumpRequestOut(request, true)
if err != nil {
return nil, err
}
log.Printf("\n%s\n", string(dump))
}
resp, err := c.cfg.HTTPClient.Do(request)
if err != nil {
return resp, err
}
if c.cfg.Debug {
dump, err := httputil.DumpResponse(resp, true)
if err != nil {
return resp, err
}
log.Printf("\n%s\n", string(dump))
}
return resp, err
}
// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}
type formFile struct {
fileBytes []byte
fileName string
formFileName string
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
formFiles []formFile) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
for _, formFile := range formFiles {
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
w.Boundary()
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
if err != nil {
return nil, err
}
_, err = part.Write(formFile.fileBytes)
if err != nil {
return nil, err
}
}
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
if body != nil {
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
}
body = &bytes.Buffer{}
body.WriteString(formParams.Encode())
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Override request host, if applicable
if c.cfg.Host != "" {
url.Host = c.cfg.Host
}
// Override request scheme, if applicable
if c.cfg.Scheme != "" {
url.Scheme = c.cfg.Scheme
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
pieces := strings.Split(s, "=")
pieces[0] = queryDescape.Replace(pieces[0])
return strings.Join(pieces, "=")
})
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers[h] = []string{v}
}
localVarRequest.Header = headers
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
}
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
*s = string(b)
return nil
}
if f, ok := v.(*os.File); ok {
f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = f.Write(b)
if err != nil {
return
}
_, err = f.Seek(0, io.SeekStart)
return
}
if f, ok := v.(**os.File); ok {
*f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = (*f).Write(b)
if err != nil {
return
}
_, err = (*f).Seek(0, io.SeekStart)
return
}
if XmlCheck.MatchString(contentType) {
if err = xml.Unmarshal(b, v); err != nil {
return err
}
return nil
}
if JsonCheck.MatchString(contentType) {
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
return err
}
} else {
return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
}
} else if err = json.Unmarshal(b, v); err != nil { // simple model
return err
}
return nil
}
return errors.New("undefined response type")
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(filepath.Clean(path))
if err != nil {
return err
}
err = file.Close()
if err != nil {
return err
}
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(*os.File); ok {
_, err = bodyBuf.ReadFrom(fp)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if JsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if XmlCheck.MatchString(contentType) {
var bs []byte
bs, err = xml.Marshal(body)
if err == nil {
bodyBuf.Write(bs)
}
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) time.Time {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
} else {
expires = now.Add(lifetime)
}
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) int {
return utf8.RuneCountInString(s)
}
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
type GenericOpenAPIError struct {
body []byte
error string
model interface{}
}
// Error returns non-empty string if there was an error.
func (e GenericOpenAPIError) Error() string {
return e.error
}
// Body returns the raw bytes of the response
func (e GenericOpenAPIError) Body() []byte {
return e.body
}
// Model returns the unpacked model of the error
func (e GenericOpenAPIError) Model() interface{} {
return e.model
}
// format error message using title and detail when model implements rfc7807
func formatErrorMessage(status string, v interface{}) string {
str := ""
metaValue := reflect.ValueOf(v).Elem()
if metaValue.Kind() == reflect.Struct {
field := metaValue.FieldByName("Title")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s", field.Interface())
}
field = metaValue.FieldByName("Detail")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s (%s)", str, field.Interface())
}
}
return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
}
/*
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 (
"context"
"fmt"
"net/http"
"strings"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextServerIndex uses a server configuration from the index.
ContextServerIndex = contextKey("serverIndex")
// ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerIndices = contextKey("serverOperationIndices")
// ContextServerVariables overrides a server configuration variables.
ContextServerVariables = contextKey("serverVariables")
// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextOperationServerVariables = contextKey("serverOperationVariables")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
// ServerVariable stores the information about a server variable
type ServerVariable struct {
Description string
DefaultValue string
EnumValues []string
}
// ServerConfiguration stores the information about a server
type ServerConfiguration struct {
URL string
Description string
Variables map[string]ServerVariable
}
// ServerConfigurations stores multiple ServerConfiguration items
type ServerConfigurations []ServerConfiguration
// Configuration stores the configuration of the API client
type Configuration struct {
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Debug bool `json:"debug,omitempty"`
Servers ServerConfigurations
OperationServers map[string]ServerConfigurations
HTTPClient *http.Client
}
// NewConfiguration returns a new Configuration object
func NewConfiguration() *Configuration {
cfg := &Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Servers: ServerConfigurations{
{
URL: "https://localhost:8080",
Description: "No description provided",
},
{
URL: "http://localhost:8080",
Description: "No description provided",
},
},
OperationServers: map[string]ServerConfigurations{},
}
return cfg
}
// AddDefaultHeader adds a new HTTP header to the default header in the request
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}
// URL formats template on a index using given variables
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
if index < 0 || len(sc) <= index {
return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1)
}
server := sc[index]
url := server.URL
// go through variables and replace placeholders
for name, variable := range server.Variables {
if value, ok := variables[name]; ok {
found := bool(len(variable.EnumValues) == 0)
for _, enumValue := range variable.EnumValues {
if value == enumValue {
found = true
}
}
if !found {
return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
}
url = strings.Replace(url, "{"+name+"}", value, -1)
} else {
url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1)
}
}
return url, nil
}
// ServerURL returns URL based on server settings
func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
return c.Servers.URL(index, variables)
}
func getServerIndex(ctx context.Context) (int, error) {
si := ctx.Value(ContextServerIndex)
if si != nil {
if index, ok := si.(int); ok {
return index, nil
}
return 0, reportError("Invalid type %T should be int", si)
}
return 0, nil
}
func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) {
osi := ctx.Value(ContextOperationServerIndices)
if osi != nil {
if operationIndices, ok := osi.(map[string]int); !ok {
return 0, reportError("Invalid type %T should be map[string]int", osi)
} else {
index, ok := operationIndices[endpoint]
if ok {
return index, nil
}
}
}
return getServerIndex(ctx)
}
func getServerVariables(ctx context.Context) (map[string]string, error) {
sv := ctx.Value(ContextServerVariables)
if sv != nil {
if variables, ok := sv.(map[string]string); ok {
return variables, nil
}
return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv)
}
return nil, nil
}
func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) {
osv := ctx.Value(ContextOperationServerVariables)
if osv != nil {
if operationVariables, ok := osv.(map[string]map[string]string); !ok {
return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv)
} else {
variables, ok := operationVariables[endpoint]
if ok {
return variables, nil
}
}
}
return getServerVariables(ctx)
}
// ServerURLWithContext returns a new server URL given an endpoint
func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) {
sc, ok := c.OperationServers[endpoint]
if !ok {
sc = c.Servers
}
if ctx == nil {
return sc.URL(0, nil)
}
index, err := getServerOperationIndex(ctx, endpoint)
if err != nil {
return "", err
}
variables, err := getServerOperationVariables(ctx, endpoint)
if err != nil {
return "", err
}
return sc.URL(index, variables)
}
package openapi
func NewArtifactCreateWithDefaults() *ArtifactCreate {
return &ArtifactCreate{}
}
func NewArtifactUpdateWithDefaults() *ArtifactUpdate {
return &ArtifactUpdate{}
}
func NewArtifactWithDefaults() *Artifact {
return &Artifact{}
}
/*
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"
"fmt"
)
// Artifact - A metadata Artifact Entity.
type Artifact struct {
DataSet *DataSet
DocArtifact *DocArtifact
Metric *Metric
ModelArtifact *ModelArtifact
Parameter *Parameter
}
// DataSetAsArtifact is a convenience function that returns DataSet wrapped in Artifact
func DataSetAsArtifact(v *DataSet) Artifact {
return Artifact{
DataSet: v,
}
}
// DocArtifactAsArtifact is a convenience function that returns DocArtifact wrapped in Artifact
func DocArtifactAsArtifact(v *DocArtifact) Artifact {
return Artifact{
DocArtifact: v,
}
}
// MetricAsArtifact is a convenience function that returns Metric wrapped in Artifact
func MetricAsArtifact(v *Metric) Artifact {
return Artifact{
Metric: v,
}
}
// ModelArtifactAsArtifact is a convenience function that returns ModelArtifact wrapped in Artifact
func ModelArtifactAsArtifact(v *ModelArtifact) Artifact {
return Artifact{
ModelArtifact: v,
}
}
// ParameterAsArtifact is a convenience function that returns Parameter wrapped in Artifact
func ParameterAsArtifact(v *Parameter) Artifact {
return Artifact{
Parameter: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *Artifact) UnmarshalJSON(data []byte) error {
var err error
// use discriminator value to speed up the lookup
var jsonDict map[string]interface{}
err = newStrictDecoder(data).Decode(&jsonDict)
if err != nil {
return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup")
}
// check if the discriminator value is 'dataset-artifact'
if jsonDict["artifactType"] == "dataset-artifact" {
// try to unmarshal JSON data into DataSet
err = json.Unmarshal(data, &dst.DataSet)
if err == nil {
return nil // data stored in dst.DataSet, return on the first match
} else {
dst.DataSet = nil
return fmt.Errorf("failed to unmarshal Artifact as DataSet: %s", err.Error())
}
}
// check if the discriminator value is 'doc-artifact'
if jsonDict["artifactType"] == "doc-artifact" {
// try to unmarshal JSON data into DocArtifact
err = json.Unmarshal(data, &dst.DocArtifact)
if err == nil {
return nil // data stored in dst.DocArtifact, return on the first match
} else {
dst.DocArtifact = nil
return fmt.Errorf("failed to unmarshal Artifact as DocArtifact: %s", err.Error())
}
}
// check if the discriminator value is 'metric'
if jsonDict["artifactType"] == "metric" {
// try to unmarshal JSON data into Metric
err = json.Unmarshal(data, &dst.Metric)
if err == nil {
return nil // data stored in dst.Metric, return on the first match
} else {
dst.Metric = nil
return fmt.Errorf("failed to unmarshal Artifact as Metric: %s", err.Error())
}
}
// check if the discriminator value is 'model-artifact'
if jsonDict["artifactType"] == "model-artifact" {
// try to unmarshal JSON data into ModelArtifact
err = json.Unmarshal(data, &dst.ModelArtifact)
if err == nil {
return nil // data stored in dst.ModelArtifact, return on the first match
} else {
dst.ModelArtifact = nil
return fmt.Errorf("failed to unmarshal Artifact as ModelArtifact: %s", err.Error())
}
}
// check if the discriminator value is 'parameter'
if jsonDict["artifactType"] == "parameter" {
// try to unmarshal JSON data into Parameter
err = json.Unmarshal(data, &dst.Parameter)
if err == nil {
return nil // data stored in dst.Parameter, return on the first match
} else {
dst.Parameter = nil
return fmt.Errorf("failed to unmarshal Artifact as Parameter: %s", err.Error())
}
}
return nil
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src Artifact) MarshalJSON() ([]byte, error) {
if src.DataSet != nil {
return json.Marshal(&src.DataSet)
}
if src.DocArtifact != nil {
return json.Marshal(&src.DocArtifact)
}
if src.Metric != nil {
return json.Marshal(&src.Metric)
}
if src.ModelArtifact != nil {
return json.Marshal(&src.ModelArtifact)
}
if src.Parameter != nil {
return json.Marshal(&src.Parameter)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *Artifact) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.DataSet != nil {
return obj.DataSet
}
if obj.DocArtifact != nil {
return obj.DocArtifact
}
if obj.Metric != nil {
return obj.Metric
}
if obj.ModelArtifact != nil {
return obj.ModelArtifact
}
if obj.Parameter != nil {
return obj.Parameter
}
// all schemas are nil
return nil
}
// Get the actual instance value
func (obj Artifact) GetActualInstanceValue() interface{} {
if obj.DataSet != nil {
return *obj.DataSet
}
if obj.DocArtifact != nil {
return *obj.DocArtifact
}
if obj.Metric != nil {
return *obj.Metric
}
if obj.ModelArtifact != nil {
return *obj.ModelArtifact
}
if obj.Parameter != nil {
return *obj.Parameter
}
// all schemas are nil
return nil
}
type NullableArtifact struct {
value *Artifact
isSet bool
}
func (v NullableArtifact) Get() *Artifact {
return v.value
}
func (v *NullableArtifact) Set(val *Artifact) {
v.value = val
v.isSet = true
}
func (v NullableArtifact) IsSet() bool {
return v.isSet
}
func (v *NullableArtifact) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArtifact(val *Artifact) *NullableArtifact {
return &NullableArtifact{value: val, isSet: true}
}
func (v NullableArtifact) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArtifact) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ArtifactCreate - An Artifact to be created.
type ArtifactCreate struct {
DataSetCreate *DataSetCreate
DocArtifactCreate *DocArtifactCreate
MetricCreate *MetricCreate
ModelArtifactCreate *ModelArtifactCreate
ParameterCreate *ParameterCreate
}
// DataSetCreateAsArtifactCreate is a convenience function that returns DataSetCreate wrapped in ArtifactCreate
func DataSetCreateAsArtifactCreate(v *DataSetCreate) ArtifactCreate {
return ArtifactCreate{
DataSetCreate: v,
}
}
// DocArtifactCreateAsArtifactCreate is a convenience function that returns DocArtifactCreate wrapped in ArtifactCreate
func DocArtifactCreateAsArtifactCreate(v *DocArtifactCreate) ArtifactCreate {
return ArtifactCreate{
DocArtifactCreate: v,
}
}
// MetricCreateAsArtifactCreate is a convenience function that returns MetricCreate wrapped in ArtifactCreate
func MetricCreateAsArtifactCreate(v *MetricCreate) ArtifactCreate {
return ArtifactCreate{
MetricCreate: v,
}
}
// ModelArtifactCreateAsArtifactCreate is a convenience function that returns ModelArtifactCreate wrapped in ArtifactCreate
func ModelArtifactCreateAsArtifactCreate(v *ModelArtifactCreate) ArtifactCreate {
return ArtifactCreate{
ModelArtifactCreate: v,
}
}
// ParameterCreateAsArtifactCreate is a convenience function that returns ParameterCreate wrapped in ArtifactCreate
func ParameterCreateAsArtifactCreate(v *ParameterCreate) ArtifactCreate {
return ArtifactCreate{
ParameterCreate: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *ArtifactCreate) UnmarshalJSON(data []byte) error {
var err error
// use discriminator value to speed up the lookup
var jsonDict map[string]interface{}
err = newStrictDecoder(data).Decode(&jsonDict)
if err != nil {
return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup")
}
// check if the discriminator value is 'dataset-artifact'
if jsonDict["artifactType"] == "dataset-artifact" {
// try to unmarshal JSON data into DataSetCreate
err = json.Unmarshal(data, &dst.DataSetCreate)
if err == nil {
return nil // data stored in dst.DataSetCreate, return on the first match
} else {
dst.DataSetCreate = nil
return fmt.Errorf("failed to unmarshal ArtifactCreate as DataSetCreate: %s", err.Error())
}
}
// check if the discriminator value is 'doc-artifact'
if jsonDict["artifactType"] == "doc-artifact" {
// try to unmarshal JSON data into DocArtifactCreate
err = json.Unmarshal(data, &dst.DocArtifactCreate)
if err == nil {
return nil // data stored in dst.DocArtifactCreate, return on the first match
} else {
dst.DocArtifactCreate = nil
return fmt.Errorf("failed to unmarshal ArtifactCreate as DocArtifactCreate: %s", err.Error())
}
}
// check if the discriminator value is 'metric'
if jsonDict["artifactType"] == "metric" {
// try to unmarshal JSON data into MetricCreate
err = json.Unmarshal(data, &dst.MetricCreate)
if err == nil {
return nil // data stored in dst.MetricCreate, return on the first match
} else {
dst.MetricCreate = nil
return fmt.Errorf("failed to unmarshal ArtifactCreate as MetricCreate: %s", err.Error())
}
}
// check if the discriminator value is 'model-artifact'
if jsonDict["artifactType"] == "model-artifact" {
// try to unmarshal JSON data into ModelArtifactCreate
err = json.Unmarshal(data, &dst.ModelArtifactCreate)
if err == nil {
return nil // data stored in dst.ModelArtifactCreate, return on the first match
} else {
dst.ModelArtifactCreate = nil
return fmt.Errorf("failed to unmarshal ArtifactCreate as ModelArtifactCreate: %s", err.Error())
}
}
// check if the discriminator value is 'parameter'
if jsonDict["artifactType"] == "parameter" {
// try to unmarshal JSON data into ParameterCreate
err = json.Unmarshal(data, &dst.ParameterCreate)
if err == nil {
return nil // data stored in dst.ParameterCreate, return on the first match
} else {
dst.ParameterCreate = nil
return fmt.Errorf("failed to unmarshal ArtifactCreate as ParameterCreate: %s", err.Error())
}
}
return nil
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src ArtifactCreate) MarshalJSON() ([]byte, error) {
if src.DataSetCreate != nil {
return json.Marshal(&src.DataSetCreate)
}
if src.DocArtifactCreate != nil {
return json.Marshal(&src.DocArtifactCreate)
}
if src.MetricCreate != nil {
return json.Marshal(&src.MetricCreate)
}
if src.ModelArtifactCreate != nil {
return json.Marshal(&src.ModelArtifactCreate)
}
if src.ParameterCreate != nil {
return json.Marshal(&src.ParameterCreate)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *ArtifactCreate) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.DataSetCreate != nil {
return obj.DataSetCreate
}
if obj.DocArtifactCreate != nil {
return obj.DocArtifactCreate
}
if obj.MetricCreate != nil {
return obj.MetricCreate
}
if obj.ModelArtifactCreate != nil {
return obj.ModelArtifactCreate
}
if obj.ParameterCreate != nil {
return obj.ParameterCreate
}
// all schemas are nil
return nil
}
// Get the actual instance value
func (obj ArtifactCreate) GetActualInstanceValue() interface{} {
if obj.DataSetCreate != nil {
return *obj.DataSetCreate
}
if obj.DocArtifactCreate != nil {
return *obj.DocArtifactCreate
}
if obj.MetricCreate != nil {
return *obj.MetricCreate
}
if obj.ModelArtifactCreate != nil {
return *obj.ModelArtifactCreate
}
if obj.ParameterCreate != nil {
return *obj.ParameterCreate
}
// all schemas are nil
return nil
}
type NullableArtifactCreate struct {
value *ArtifactCreate
isSet bool
}
func (v NullableArtifactCreate) Get() *ArtifactCreate {
return v.value
}
func (v *NullableArtifactCreate) Set(val *ArtifactCreate) {
v.value = val
v.isSet = true
}
func (v NullableArtifactCreate) IsSet() bool {
return v.isSet
}
func (v *NullableArtifactCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArtifactCreate(val *ArtifactCreate) *NullableArtifactCreate {
return &NullableArtifactCreate{value: val, isSet: true}
}
func (v NullableArtifactCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArtifactCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ArtifactList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ArtifactList{}
// ArtifactList A list of Artifact entities.
type ArtifactList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
// Array of `Artifact` entities.
Items []Artifact `json:"items"`
}
type _ArtifactList ArtifactList
// NewArtifactList instantiates a new ArtifactList 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 NewArtifactList(nextPageToken string, pageSize int32, size int32, items []Artifact) *ArtifactList {
this := ArtifactList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewArtifactListWithDefaults instantiates a new ArtifactList 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 NewArtifactListWithDefaults() *ArtifactList {
this := ArtifactList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ArtifactList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ArtifactList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ArtifactList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ArtifactList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ArtifactList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ArtifactList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ArtifactList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ArtifactList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ArtifactList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ArtifactList) GetItems() []Artifact {
if o == nil {
var ret []Artifact
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ArtifactList) GetItemsOk() ([]Artifact, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ArtifactList) SetItems(v []Artifact) {
o.Items = v
}
func (o ArtifactList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ArtifactList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableArtifactList struct {
value *ArtifactList
isSet bool
}
func (v NullableArtifactList) Get() *ArtifactList {
return v.value
}
func (v *NullableArtifactList) Set(val *ArtifactList) {
v.value = val
v.isSet = true
}
func (v NullableArtifactList) IsSet() bool {
return v.isSet
}
func (v *NullableArtifactList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArtifactList(val *ArtifactList) *NullableArtifactList {
return &NullableArtifactList{value: val, isSet: true}
}
func (v NullableArtifactList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArtifactList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ArtifactState - PENDING: A state indicating that the artifact may exist. - LIVE: A state indicating that the artifact should exist, unless something external to the system deletes it. - MARKED_FOR_DELETION: A state indicating that the artifact should be deleted. - DELETED: A state indicating that the artifact has been deleted. - ABANDONED: A state indicating that the artifact has been abandoned, which may be due to a failed or cancelled execution. - REFERENCE: A state indicating that the artifact is a reference artifact. At execution start time, the orchestrator produces an output artifact for each output key with state PENDING. However, for an intermediate artifact, this first artifact's state will be REFERENCE. Intermediate artifacts emitted during a component's execution will copy the REFERENCE artifact's attributes. At the end of an execution, the artifact state should remain REFERENCE instead of being changed to LIVE. See also: ml-metadata Artifact.State
type ArtifactState string
// List of ArtifactState
const (
ARTIFACTSTATE_UNKNOWN ArtifactState = "UNKNOWN"
ARTIFACTSTATE_PENDING ArtifactState = "PENDING"
ARTIFACTSTATE_LIVE ArtifactState = "LIVE"
ARTIFACTSTATE_MARKED_FOR_DELETION ArtifactState = "MARKED_FOR_DELETION"
ARTIFACTSTATE_DELETED ArtifactState = "DELETED"
ARTIFACTSTATE_ABANDONED ArtifactState = "ABANDONED"
ARTIFACTSTATE_REFERENCE ArtifactState = "REFERENCE"
)
// All allowed values of ArtifactState enum
var AllowedArtifactStateEnumValues = []ArtifactState{
"UNKNOWN",
"PENDING",
"LIVE",
"MARKED_FOR_DELETION",
"DELETED",
"ABANDONED",
"REFERENCE",
}
func (v *ArtifactState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ArtifactState(value)
for _, existing := range AllowedArtifactStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ArtifactState", value)
}
// NewArtifactStateFromValue returns a pointer to a valid ArtifactState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewArtifactStateFromValue(v string) (*ArtifactState, error) {
ev := ArtifactState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ArtifactState: valid values are %v", v, AllowedArtifactStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ArtifactState) IsValid() bool {
for _, existing := range AllowedArtifactStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ArtifactState value
func (v ArtifactState) Ptr() *ArtifactState {
return &v
}
type NullableArtifactState struct {
value *ArtifactState
isSet bool
}
func (v NullableArtifactState) Get() *ArtifactState {
return v.value
}
func (v *NullableArtifactState) Set(val *ArtifactState) {
v.value = val
v.isSet = true
}
func (v NullableArtifactState) IsSet() bool {
return v.isSet
}
func (v *NullableArtifactState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArtifactState(val *ArtifactState) *NullableArtifactState {
return &NullableArtifactState{value: val, isSet: true}
}
func (v NullableArtifactState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArtifactState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ArtifactTypeQueryParam Supported artifact types for querying.
type ArtifactTypeQueryParam string
// List of ArtifactTypeQueryParam
const (
ARTIFACTTYPEQUERYPARAM_MODEL_ARTIFACT ArtifactTypeQueryParam = "model-artifact"
ARTIFACTTYPEQUERYPARAM_DOC_ARTIFACT ArtifactTypeQueryParam = "doc-artifact"
ARTIFACTTYPEQUERYPARAM_DATASET_ARTIFACT ArtifactTypeQueryParam = "dataset-artifact"
ARTIFACTTYPEQUERYPARAM_METRIC ArtifactTypeQueryParam = "metric"
ARTIFACTTYPEQUERYPARAM_PARAMETER ArtifactTypeQueryParam = "parameter"
)
// All allowed values of ArtifactTypeQueryParam enum
var AllowedArtifactTypeQueryParamEnumValues = []ArtifactTypeQueryParam{
"model-artifact",
"doc-artifact",
"dataset-artifact",
"metric",
"parameter",
}
func (v *ArtifactTypeQueryParam) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ArtifactTypeQueryParam(value)
for _, existing := range AllowedArtifactTypeQueryParamEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ArtifactTypeQueryParam", value)
}
// NewArtifactTypeQueryParamFromValue returns a pointer to a valid ArtifactTypeQueryParam
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewArtifactTypeQueryParamFromValue(v string) (*ArtifactTypeQueryParam, error) {
ev := ArtifactTypeQueryParam(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ArtifactTypeQueryParam: valid values are %v", v, AllowedArtifactTypeQueryParamEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ArtifactTypeQueryParam) IsValid() bool {
for _, existing := range AllowedArtifactTypeQueryParamEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ArtifactTypeQueryParam value
func (v ArtifactTypeQueryParam) Ptr() *ArtifactTypeQueryParam {
return &v
}
type NullableArtifactTypeQueryParam struct {
value *ArtifactTypeQueryParam
isSet bool
}
func (v NullableArtifactTypeQueryParam) Get() *ArtifactTypeQueryParam {
return v.value
}
func (v *NullableArtifactTypeQueryParam) Set(val *ArtifactTypeQueryParam) {
v.value = val
v.isSet = true
}
func (v NullableArtifactTypeQueryParam) IsSet() bool {
return v.isSet
}
func (v *NullableArtifactTypeQueryParam) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArtifactTypeQueryParam(val *ArtifactTypeQueryParam) *NullableArtifactTypeQueryParam {
return &NullableArtifactTypeQueryParam{value: val, isSet: true}
}
func (v NullableArtifactTypeQueryParam) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArtifactTypeQueryParam) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ArtifactUpdate - An Artifact to be updated.
type ArtifactUpdate struct {
DataSetUpdate *DataSetUpdate
DocArtifactUpdate *DocArtifactUpdate
MetricUpdate *MetricUpdate
ModelArtifactUpdate *ModelArtifactUpdate
ParameterUpdate *ParameterUpdate
}
// DataSetUpdateAsArtifactUpdate is a convenience function that returns DataSetUpdate wrapped in ArtifactUpdate
func DataSetUpdateAsArtifactUpdate(v *DataSetUpdate) ArtifactUpdate {
return ArtifactUpdate{
DataSetUpdate: v,
}
}
// DocArtifactUpdateAsArtifactUpdate is a convenience function that returns DocArtifactUpdate wrapped in ArtifactUpdate
func DocArtifactUpdateAsArtifactUpdate(v *DocArtifactUpdate) ArtifactUpdate {
return ArtifactUpdate{
DocArtifactUpdate: v,
}
}
// MetricUpdateAsArtifactUpdate is a convenience function that returns MetricUpdate wrapped in ArtifactUpdate
func MetricUpdateAsArtifactUpdate(v *MetricUpdate) ArtifactUpdate {
return ArtifactUpdate{
MetricUpdate: v,
}
}
// ModelArtifactUpdateAsArtifactUpdate is a convenience function that returns ModelArtifactUpdate wrapped in ArtifactUpdate
func ModelArtifactUpdateAsArtifactUpdate(v *ModelArtifactUpdate) ArtifactUpdate {
return ArtifactUpdate{
ModelArtifactUpdate: v,
}
}
// ParameterUpdateAsArtifactUpdate is a convenience function that returns ParameterUpdate wrapped in ArtifactUpdate
func ParameterUpdateAsArtifactUpdate(v *ParameterUpdate) ArtifactUpdate {
return ArtifactUpdate{
ParameterUpdate: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *ArtifactUpdate) UnmarshalJSON(data []byte) error {
var err error
// use discriminator value to speed up the lookup
var jsonDict map[string]interface{}
err = newStrictDecoder(data).Decode(&jsonDict)
if err != nil {
return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup")
}
// check if the discriminator value is 'dataset-artifact'
if jsonDict["artifactType"] == "dataset-artifact" {
// try to unmarshal JSON data into DataSetUpdate
err = json.Unmarshal(data, &dst.DataSetUpdate)
if err == nil {
return nil // data stored in dst.DataSetUpdate, return on the first match
} else {
dst.DataSetUpdate = nil
return fmt.Errorf("failed to unmarshal ArtifactUpdate as DataSetUpdate: %s", err.Error())
}
}
// check if the discriminator value is 'doc-artifact'
if jsonDict["artifactType"] == "doc-artifact" {
// try to unmarshal JSON data into DocArtifactUpdate
err = json.Unmarshal(data, &dst.DocArtifactUpdate)
if err == nil {
return nil // data stored in dst.DocArtifactUpdate, return on the first match
} else {
dst.DocArtifactUpdate = nil
return fmt.Errorf("failed to unmarshal ArtifactUpdate as DocArtifactUpdate: %s", err.Error())
}
}
// check if the discriminator value is 'metric'
if jsonDict["artifactType"] == "metric" {
// try to unmarshal JSON data into MetricUpdate
err = json.Unmarshal(data, &dst.MetricUpdate)
if err == nil {
return nil // data stored in dst.MetricUpdate, return on the first match
} else {
dst.MetricUpdate = nil
return fmt.Errorf("failed to unmarshal ArtifactUpdate as MetricUpdate: %s", err.Error())
}
}
// check if the discriminator value is 'model-artifact'
if jsonDict["artifactType"] == "model-artifact" {
// try to unmarshal JSON data into ModelArtifactUpdate
err = json.Unmarshal(data, &dst.ModelArtifactUpdate)
if err == nil {
return nil // data stored in dst.ModelArtifactUpdate, return on the first match
} else {
dst.ModelArtifactUpdate = nil
return fmt.Errorf("failed to unmarshal ArtifactUpdate as ModelArtifactUpdate: %s", err.Error())
}
}
// check if the discriminator value is 'parameter'
if jsonDict["artifactType"] == "parameter" {
// try to unmarshal JSON data into ParameterUpdate
err = json.Unmarshal(data, &dst.ParameterUpdate)
if err == nil {
return nil // data stored in dst.ParameterUpdate, return on the first match
} else {
dst.ParameterUpdate = nil
return fmt.Errorf("failed to unmarshal ArtifactUpdate as ParameterUpdate: %s", err.Error())
}
}
return nil
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src ArtifactUpdate) MarshalJSON() ([]byte, error) {
if src.DataSetUpdate != nil {
return json.Marshal(&src.DataSetUpdate)
}
if src.DocArtifactUpdate != nil {
return json.Marshal(&src.DocArtifactUpdate)
}
if src.MetricUpdate != nil {
return json.Marshal(&src.MetricUpdate)
}
if src.ModelArtifactUpdate != nil {
return json.Marshal(&src.ModelArtifactUpdate)
}
if src.ParameterUpdate != nil {
return json.Marshal(&src.ParameterUpdate)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *ArtifactUpdate) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.DataSetUpdate != nil {
return obj.DataSetUpdate
}
if obj.DocArtifactUpdate != nil {
return obj.DocArtifactUpdate
}
if obj.MetricUpdate != nil {
return obj.MetricUpdate
}
if obj.ModelArtifactUpdate != nil {
return obj.ModelArtifactUpdate
}
if obj.ParameterUpdate != nil {
return obj.ParameterUpdate
}
// all schemas are nil
return nil
}
// Get the actual instance value
func (obj ArtifactUpdate) GetActualInstanceValue() interface{} {
if obj.DataSetUpdate != nil {
return *obj.DataSetUpdate
}
if obj.DocArtifactUpdate != nil {
return *obj.DocArtifactUpdate
}
if obj.MetricUpdate != nil {
return *obj.MetricUpdate
}
if obj.ModelArtifactUpdate != nil {
return *obj.ModelArtifactUpdate
}
if obj.ParameterUpdate != nil {
return *obj.ParameterUpdate
}
// all schemas are nil
return nil
}
type NullableArtifactUpdate struct {
value *ArtifactUpdate
isSet bool
}
func (v NullableArtifactUpdate) Get() *ArtifactUpdate {
return v.value
}
func (v *NullableArtifactUpdate) Set(val *ArtifactUpdate) {
v.value = val
v.isSet = true
}
func (v NullableArtifactUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableArtifactUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArtifactUpdate(val *ArtifactUpdate) *NullableArtifactUpdate {
return &NullableArtifactUpdate{value: val, isSet: true}
}
func (v NullableArtifactUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArtifactUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseArtifact type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseArtifact{}
// BaseArtifact Base schema for all artifact types with common server generated properties.
type BaseArtifact 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
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"`
}
// NewBaseArtifact instantiates a new BaseArtifact 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 NewBaseArtifact() *BaseArtifact {
this := BaseArtifact{}
return &this
}
// NewBaseArtifactWithDefaults instantiates a new BaseArtifact 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 NewBaseArtifactWithDefaults() *BaseArtifact {
this := BaseArtifact{}
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseArtifact) 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 *BaseArtifact) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetExperimentId returns the ExperimentId field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetExperimentId(v string) {
o.ExperimentId = &v
}
// GetExperimentRunId returns the ExperimentRunId field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetExperimentRunId(v string) {
o.ExperimentRunId = &v
}
func (o BaseArtifact) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseArtifact) 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
}
return toSerialize, nil
}
type NullableBaseArtifact struct {
value *BaseArtifact
isSet bool
}
func (v NullableBaseArtifact) Get() *BaseArtifact {
return v.value
}
func (v *NullableBaseArtifact) Set(val *BaseArtifact) {
v.value = val
v.isSet = true
}
func (v NullableBaseArtifact) IsSet() bool {
return v.isSet
}
func (v *NullableBaseArtifact) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseArtifact(val *BaseArtifact) *NullableBaseArtifact {
return &NullableBaseArtifact{value: val, isSet: true}
}
func (v NullableBaseArtifact) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseArtifact) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseModel{}
// BaseModel struct for BaseModel
type BaseModel struct {
// Human-readable description of the model.
Description *string `json:"description,omitempty"`
// Model documentation in Markdown.
Readme *string `json:"readme,omitempty"`
// Maturity level of the model.
Maturity *string `json:"maturity,omitempty"`
// List of supported languages (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
Language []string `json:"language,omitempty"`
// List of tasks the model is designed for.
Tasks []string `json:"tasks,omitempty"`
// Name of the organization or entity that provides the model.
Provider *string `json:"provider,omitempty"`
// URL to the model's logo. A [data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data) is recommended.
Logo *string `json:"logo,omitempty"`
// Short name of the model's license.
License *string `json:"license,omitempty"`
// URL to the license text.
LicenseLink *string `json:"licenseLink,omitempty"`
LibraryName *string `json:"libraryName,omitempty"`
// User provided custom properties which are not defined by its type.
CustomProperties map[string]MetadataValue `json:"customProperties,omitempty"`
}
// NewBaseModel instantiates a new BaseModel 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 NewBaseModel() *BaseModel {
this := BaseModel{}
return &this
}
// NewBaseModelWithDefaults instantiates a new BaseModel 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 NewBaseModelWithDefaults() *BaseModel {
this := BaseModel{}
return &this
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseModel) 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 *BaseModel) 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 *BaseModel) 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 *BaseModel) SetDescription(v string) {
o.Description = &v
}
// GetReadme returns the Readme field value if set, zero value otherwise.
func (o *BaseModel) GetReadme() string {
if o == nil || IsNil(o.Readme) {
var ret string
return ret
}
return *o.Readme
}
// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetReadmeOk() (*string, bool) {
if o == nil || IsNil(o.Readme) {
return nil, false
}
return o.Readme, true
}
// HasReadme returns a boolean if a field has been set.
func (o *BaseModel) HasReadme() bool {
if o != nil && !IsNil(o.Readme) {
return true
}
return false
}
// SetReadme gets a reference to the given string and assigns it to the Readme field.
func (o *BaseModel) SetReadme(v string) {
o.Readme = &v
}
// GetMaturity returns the Maturity field value if set, zero value otherwise.
func (o *BaseModel) GetMaturity() string {
if o == nil || IsNil(o.Maturity) {
var ret string
return ret
}
return *o.Maturity
}
// GetMaturityOk returns a tuple with the Maturity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetMaturityOk() (*string, bool) {
if o == nil || IsNil(o.Maturity) {
return nil, false
}
return o.Maturity, true
}
// HasMaturity returns a boolean if a field has been set.
func (o *BaseModel) HasMaturity() bool {
if o != nil && !IsNil(o.Maturity) {
return true
}
return false
}
// SetMaturity gets a reference to the given string and assigns it to the Maturity field.
func (o *BaseModel) SetMaturity(v string) {
o.Maturity = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *BaseModel) GetLanguage() []string {
if o == nil || IsNil(o.Language) {
var ret []string
return ret
}
return o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetLanguageOk() ([]string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *BaseModel) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given []string and assigns it to the Language field.
func (o *BaseModel) SetLanguage(v []string) {
o.Language = v
}
// GetTasks returns the Tasks field value if set, zero value otherwise.
func (o *BaseModel) GetTasks() []string {
if o == nil || IsNil(o.Tasks) {
var ret []string
return ret
}
return o.Tasks
}
// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetTasksOk() ([]string, bool) {
if o == nil || IsNil(o.Tasks) {
return nil, false
}
return o.Tasks, true
}
// HasTasks returns a boolean if a field has been set.
func (o *BaseModel) HasTasks() bool {
if o != nil && !IsNil(o.Tasks) {
return true
}
return false
}
// SetTasks gets a reference to the given []string and assigns it to the Tasks field.
func (o *BaseModel) SetTasks(v []string) {
o.Tasks = v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *BaseModel) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *BaseModel) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *BaseModel) SetProvider(v string) {
o.Provider = &v
}
// GetLogo returns the Logo field value if set, zero value otherwise.
func (o *BaseModel) GetLogo() string {
if o == nil || IsNil(o.Logo) {
var ret string
return ret
}
return *o.Logo
}
// GetLogoOk returns a tuple with the Logo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetLogoOk() (*string, bool) {
if o == nil || IsNil(o.Logo) {
return nil, false
}
return o.Logo, true
}
// HasLogo returns a boolean if a field has been set.
func (o *BaseModel) HasLogo() bool {
if o != nil && !IsNil(o.Logo) {
return true
}
return false
}
// SetLogo gets a reference to the given string and assigns it to the Logo field.
func (o *BaseModel) SetLogo(v string) {
o.Logo = &v
}
// GetLicense returns the License field value if set, zero value otherwise.
func (o *BaseModel) GetLicense() string {
if o == nil || IsNil(o.License) {
var ret string
return ret
}
return *o.License
}
// GetLicenseOk returns a tuple with the License field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetLicenseOk() (*string, bool) {
if o == nil || IsNil(o.License) {
return nil, false
}
return o.License, true
}
// HasLicense returns a boolean if a field has been set.
func (o *BaseModel) HasLicense() bool {
if o != nil && !IsNil(o.License) {
return true
}
return false
}
// SetLicense gets a reference to the given string and assigns it to the License field.
func (o *BaseModel) SetLicense(v string) {
o.License = &v
}
// GetLicenseLink returns the LicenseLink field value if set, zero value otherwise.
func (o *BaseModel) GetLicenseLink() string {
if o == nil || IsNil(o.LicenseLink) {
var ret string
return ret
}
return *o.LicenseLink
}
// GetLicenseLinkOk returns a tuple with the LicenseLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetLicenseLinkOk() (*string, bool) {
if o == nil || IsNil(o.LicenseLink) {
return nil, false
}
return o.LicenseLink, true
}
// HasLicenseLink returns a boolean if a field has been set.
func (o *BaseModel) HasLicenseLink() bool {
if o != nil && !IsNil(o.LicenseLink) {
return true
}
return false
}
// SetLicenseLink gets a reference to the given string and assigns it to the LicenseLink field.
func (o *BaseModel) SetLicenseLink(v string) {
o.LicenseLink = &v
}
// GetLibraryName returns the LibraryName field value if set, zero value otherwise.
func (o *BaseModel) GetLibraryName() string {
if o == nil || IsNil(o.LibraryName) {
var ret string
return ret
}
return *o.LibraryName
}
// GetLibraryNameOk returns a tuple with the LibraryName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseModel) GetLibraryNameOk() (*string, bool) {
if o == nil || IsNil(o.LibraryName) {
return nil, false
}
return o.LibraryName, true
}
// HasLibraryName returns a boolean if a field has been set.
func (o *BaseModel) HasLibraryName() bool {
if o != nil && !IsNil(o.LibraryName) {
return true
}
return false
}
// SetLibraryName gets a reference to the given string and assigns it to the LibraryName field.
func (o *BaseModel) SetLibraryName(v string) {
o.LibraryName = &v
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseModel) 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 *BaseModel) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseModel) 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 *BaseModel) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
func (o BaseModel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseModel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Readme) {
toSerialize["readme"] = o.Readme
}
if !IsNil(o.Maturity) {
toSerialize["maturity"] = o.Maturity
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Tasks) {
toSerialize["tasks"] = o.Tasks
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Logo) {
toSerialize["logo"] = o.Logo
}
if !IsNil(o.License) {
toSerialize["license"] = o.License
}
if !IsNil(o.LicenseLink) {
toSerialize["licenseLink"] = o.LicenseLink
}
if !IsNil(o.LibraryName) {
toSerialize["libraryName"] = o.LibraryName
}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
return toSerialize, nil
}
type NullableBaseModel struct {
value *BaseModel
isSet bool
}
func (v NullableBaseModel) Get() *BaseModel {
return v.value
}
func (v *NullableBaseModel) Set(val *BaseModel) {
v.value = val
v.isSet = true
}
func (v NullableBaseModel) IsSet() bool {
return v.isSet
}
func (v *NullableBaseModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseModel(val *BaseModel) *NullableBaseModel {
return &NullableBaseModel{value: val, isSet: true}
}
func (v NullableBaseModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseResource type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseResource{}
// BaseResource struct for BaseResource
type BaseResource struct {
// 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"`
// 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
// The unique server generated id of the resource.
Id *string `json:"id,omitempty"`
}
// NewBaseResource instantiates a new BaseResource 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 NewBaseResource() *BaseResource {
this := BaseResource{}
return &this
}
// NewBaseResourceWithDefaults instantiates a new BaseResource 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 NewBaseResourceWithDefaults() *BaseResource {
this := BaseResource{}
return &this
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) 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 *BaseResource) 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 *BaseResource) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) 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 *BaseResource) 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 *BaseResource) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseResource) 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 *BaseResource) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) 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 *BaseResource) 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 *BaseResource) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) 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 *BaseResource) 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 *BaseResource) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) 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 *BaseResource) 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 *BaseResource) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BaseResource) 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 *BaseResource) 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 *BaseResource) 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 *BaseResource) SetId(v string) {
o.Id = &v
}
func (o BaseResource) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseResource) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreateTimeSinceEpoch) {
toSerialize["createTimeSinceEpoch"] = o.CreateTimeSinceEpoch
}
if !IsNil(o.LastUpdateTimeSinceEpoch) {
toSerialize["lastUpdateTimeSinceEpoch"] = o.LastUpdateTimeSinceEpoch
}
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
}
return toSerialize, nil
}
type NullableBaseResource struct {
value *BaseResource
isSet bool
}
func (v NullableBaseResource) Get() *BaseResource {
return v.value
}
func (v *NullableBaseResource) Set(val *BaseResource) {
v.value = val
v.isSet = true
}
func (v NullableBaseResource) IsSet() bool {
return v.isSet
}
func (v *NullableBaseResource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseResource(val *BaseResource) *NullableBaseResource {
return &NullableBaseResource{value: val, isSet: true}
}
func (v NullableBaseResource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseResource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseResourceCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseResourceCreate{}
// BaseResourceCreate struct for BaseResourceCreate
type BaseResourceCreate 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
}
// NewBaseResourceCreate instantiates a new BaseResourceCreate 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 NewBaseResourceCreate() *BaseResourceCreate {
this := BaseResourceCreate{}
return &this
}
// NewBaseResourceCreateWithDefaults instantiates a new BaseResourceCreate 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 NewBaseResourceCreateWithDefaults() *BaseResourceCreate {
this := BaseResourceCreate{}
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseResourceCreate) 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 *BaseResourceCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseResourceCreate) 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 *BaseResourceCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseResourceCreate) 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 *BaseResourceCreate) 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 *BaseResourceCreate) 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 *BaseResourceCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *BaseResourceCreate) 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 *BaseResourceCreate) 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 *BaseResourceCreate) 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 *BaseResourceCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BaseResourceCreate) 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 *BaseResourceCreate) 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 *BaseResourceCreate) 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 *BaseResourceCreate) SetName(v string) {
o.Name = &v
}
func (o BaseResourceCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseResourceCreate) 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
}
return toSerialize, nil
}
type NullableBaseResourceCreate struct {
value *BaseResourceCreate
isSet bool
}
func (v NullableBaseResourceCreate) Get() *BaseResourceCreate {
return v.value
}
func (v *NullableBaseResourceCreate) Set(val *BaseResourceCreate) {
v.value = val
v.isSet = true
}
func (v NullableBaseResourceCreate) IsSet() bool {
return v.isSet
}
func (v *NullableBaseResourceCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseResourceCreate(val *BaseResourceCreate) *NullableBaseResourceCreate {
return &NullableBaseResourceCreate{value: val, isSet: true}
}
func (v NullableBaseResourceCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseResourceCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseResourceDates type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseResourceDates{}
// BaseResourceDates Common timestamp fields for resources
type BaseResourceDates struct {
// 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"`
}
// NewBaseResourceDates instantiates a new BaseResourceDates 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 NewBaseResourceDates() *BaseResourceDates {
this := BaseResourceDates{}
return &this
}
// NewBaseResourceDatesWithDefaults instantiates a new BaseResourceDates 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 NewBaseResourceDatesWithDefaults() *BaseResourceDates {
this := BaseResourceDates{}
return &this
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseResourceDates) 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 *BaseResourceDates) 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 *BaseResourceDates) 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 *BaseResourceDates) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseResourceDates) 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 *BaseResourceDates) 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 *BaseResourceDates) 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 *BaseResourceDates) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
func (o BaseResourceDates) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseResourceDates) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreateTimeSinceEpoch) {
toSerialize["createTimeSinceEpoch"] = o.CreateTimeSinceEpoch
}
if !IsNil(o.LastUpdateTimeSinceEpoch) {
toSerialize["lastUpdateTimeSinceEpoch"] = o.LastUpdateTimeSinceEpoch
}
return toSerialize, nil
}
type NullableBaseResourceDates struct {
value *BaseResourceDates
isSet bool
}
func (v NullableBaseResourceDates) Get() *BaseResourceDates {
return v.value
}
func (v *NullableBaseResourceDates) Set(val *BaseResourceDates) {
v.value = val
v.isSet = true
}
func (v NullableBaseResourceDates) IsSet() bool {
return v.isSet
}
func (v *NullableBaseResourceDates) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseResourceDates(val *BaseResourceDates) *NullableBaseResourceDates {
return &NullableBaseResourceDates{value: val, isSet: true}
}
func (v NullableBaseResourceDates) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseResourceDates) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseResourceList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseResourceList{}
// BaseResourceList struct for BaseResourceList
type BaseResourceList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
}
type _BaseResourceList BaseResourceList
// NewBaseResourceList instantiates a new BaseResourceList 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 NewBaseResourceList(nextPageToken string, pageSize int32, size int32) *BaseResourceList {
this := BaseResourceList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
return &this
}
// NewBaseResourceListWithDefaults instantiates a new BaseResourceList 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 NewBaseResourceListWithDefaults() *BaseResourceList {
this := BaseResourceList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *BaseResourceList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *BaseResourceList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *BaseResourceList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *BaseResourceList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *BaseResourceList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *BaseResourceList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *BaseResourceList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *BaseResourceList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *BaseResourceList) SetSize(v int32) {
o.Size = v
}
func (o BaseResourceList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseResourceList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
return toSerialize, nil
}
type NullableBaseResourceList struct {
value *BaseResourceList
isSet bool
}
func (v NullableBaseResourceList) Get() *BaseResourceList {
return v.value
}
func (v *NullableBaseResourceList) Set(val *BaseResourceList) {
v.value = val
v.isSet = true
}
func (v NullableBaseResourceList) IsSet() bool {
return v.isSet
}
func (v *NullableBaseResourceList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseResourceList(val *BaseResourceList) *NullableBaseResourceList {
return &NullableBaseResourceList{value: val, isSet: true}
}
func (v NullableBaseResourceList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseResourceList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 BaseResourceUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseResourceUpdate{}
// BaseResourceUpdate struct for BaseResourceUpdate
type BaseResourceUpdate 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"`
}
// NewBaseResourceUpdate instantiates a new BaseResourceUpdate 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 NewBaseResourceUpdate() *BaseResourceUpdate {
this := BaseResourceUpdate{}
return &this
}
// NewBaseResourceUpdateWithDefaults instantiates a new BaseResourceUpdate 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 NewBaseResourceUpdateWithDefaults() *BaseResourceUpdate {
this := BaseResourceUpdate{}
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseResourceUpdate) 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 *BaseResourceUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseResourceUpdate) 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 *BaseResourceUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseResourceUpdate) 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 *BaseResourceUpdate) 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 *BaseResourceUpdate) 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 *BaseResourceUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *BaseResourceUpdate) 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 *BaseResourceUpdate) 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 *BaseResourceUpdate) 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 *BaseResourceUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
func (o BaseResourceUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseResourceUpdate) 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
}
return toSerialize, nil
}
type NullableBaseResourceUpdate struct {
value *BaseResourceUpdate
isSet bool
}
func (v NullableBaseResourceUpdate) Get() *BaseResourceUpdate {
return v.value
}
func (v *NullableBaseResourceUpdate) Set(val *BaseResourceUpdate) {
v.value = val
v.isSet = true
}
func (v NullableBaseResourceUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableBaseResourceUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseResourceUpdate(val *BaseResourceUpdate) *NullableBaseResourceUpdate {
return &NullableBaseResourceUpdate{value: val, isSet: true}
}
func (v NullableBaseResourceUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseResourceUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DataSet type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DataSet{}
// DataSet A dataset artifact representing training or test data.
type DataSet 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
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"`
// A unique hash or identifier for the dataset content.
Digest *string `json:"digest,omitempty"`
// The type of data source (e.g., \"s3\", \"hdfs\", \"local\", \"database\").
SourceType *string `json:"sourceType,omitempty"`
// The location or connection string for the dataset source.
Source *string `json:"source,omitempty"`
// JSON schema or description of the dataset structure.
Schema *string `json:"schema,omitempty"`
// Statistical profile or summary of the dataset.
Profile *string `json:"profile,omitempty"`
// The uniform resource identifier of the physical dataset. May be empty if there is no physical dataset.
Uri *string `json:"uri,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewDataSet instantiates a new DataSet 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 NewDataSet() *DataSet {
this := DataSet{}
var artifactType string = "dataset-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewDataSetWithDefaults instantiates a new DataSet 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 NewDataSetWithDefaults() *DataSet {
this := DataSet{}
var artifactType string = "dataset-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 *DataSet) 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 *DataSet) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *DataSet) 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 *DataSet) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetExperimentId returns the ExperimentId field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetExperimentId(v string) {
o.ExperimentId = &v
}
// GetExperimentRunId returns the ExperimentRunId field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetExperimentRunId(v string) {
o.ExperimentRunId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *DataSet) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSet) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *DataSet) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *DataSet) SetDigest(v string) {
o.Digest = &v
}
// GetSourceType returns the SourceType field value if set, zero value otherwise.
func (o *DataSet) GetSourceType() string {
if o == nil || IsNil(o.SourceType) {
var ret string
return ret
}
return *o.SourceType
}
// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSet) GetSourceTypeOk() (*string, bool) {
if o == nil || IsNil(o.SourceType) {
return nil, false
}
return o.SourceType, true
}
// HasSourceType returns a boolean if a field has been set.
func (o *DataSet) HasSourceType() bool {
if o != nil && !IsNil(o.SourceType) {
return true
}
return false
}
// SetSourceType gets a reference to the given string and assigns it to the SourceType field.
func (o *DataSet) SetSourceType(v string) {
o.SourceType = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *DataSet) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSet) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *DataSet) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *DataSet) SetSource(v string) {
o.Source = &v
}
// GetSchema returns the Schema field value if set, zero value otherwise.
func (o *DataSet) GetSchema() string {
if o == nil || IsNil(o.Schema) {
var ret string
return ret
}
return *o.Schema
}
// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSet) GetSchemaOk() (*string, bool) {
if o == nil || IsNil(o.Schema) {
return nil, false
}
return o.Schema, true
}
// HasSchema returns a boolean if a field has been set.
func (o *DataSet) HasSchema() bool {
if o != nil && !IsNil(o.Schema) {
return true
}
return false
}
// SetSchema gets a reference to the given string and assigns it to the Schema field.
func (o *DataSet) SetSchema(v string) {
o.Schema = &v
}
// GetProfile returns the Profile field value if set, zero value otherwise.
func (o *DataSet) GetProfile() string {
if o == nil || IsNil(o.Profile) {
var ret string
return ret
}
return *o.Profile
}
// GetProfileOk returns a tuple with the Profile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSet) GetProfileOk() (*string, bool) {
if o == nil || IsNil(o.Profile) {
return nil, false
}
return o.Profile, true
}
// HasProfile returns a boolean if a field has been set.
func (o *DataSet) HasProfile() bool {
if o != nil && !IsNil(o.Profile) {
return true
}
return false
}
// SetProfile gets a reference to the given string and assigns it to the Profile field.
func (o *DataSet) SetProfile(v string) {
o.Profile = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *DataSet) 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 *DataSet) 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 *DataSet) 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 *DataSet) SetState(v ArtifactState) {
o.State = &v
}
func (o DataSet) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DataSet) 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.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.SourceType) {
toSerialize["sourceType"] = o.SourceType
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Schema) {
toSerialize["schema"] = o.Schema
}
if !IsNil(o.Profile) {
toSerialize["profile"] = o.Profile
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDataSet struct {
value *DataSet
isSet bool
}
func (v NullableDataSet) Get() *DataSet {
return v.value
}
func (v *NullableDataSet) Set(val *DataSet) {
v.value = val
v.isSet = true
}
func (v NullableDataSet) IsSet() bool {
return v.isSet
}
func (v *NullableDataSet) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDataSet(val *DataSet) *NullableDataSet {
return &NullableDataSet{value: val, isSet: true}
}
func (v NullableDataSet) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDataSet) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DataSetCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DataSetCreate{}
// DataSetCreate A dataset artifact to be created.
type DataSetCreate 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
ArtifactType *string `json:"artifactType,omitempty"`
// A unique hash or identifier for the dataset content.
Digest *string `json:"digest,omitempty"`
// The type of data source (e.g., \"s3\", \"hdfs\", \"local\", \"database\").
SourceType *string `json:"sourceType,omitempty"`
// The location or connection string for the dataset source.
Source *string `json:"source,omitempty"`
// JSON schema or description of the dataset structure.
Schema *string `json:"schema,omitempty"`
// Statistical profile or summary of the dataset.
Profile *string `json:"profile,omitempty"`
// The uniform resource identifier of the physical dataset. May be empty if there is no physical dataset.
Uri *string `json:"uri,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewDataSetCreate instantiates a new DataSetCreate 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 NewDataSetCreate() *DataSetCreate {
this := DataSetCreate{}
var artifactType string = "dataset-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewDataSetCreateWithDefaults instantiates a new DataSetCreate 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 NewDataSetCreateWithDefaults() *DataSetCreate {
this := DataSetCreate{}
var artifactType string = "dataset-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 *DataSetCreate) 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 *DataSetCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *DataSetCreate) 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 *DataSetCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) SetName(v string) {
o.Name = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *DataSetCreate) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetCreate) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *DataSetCreate) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *DataSetCreate) SetDigest(v string) {
o.Digest = &v
}
// GetSourceType returns the SourceType field value if set, zero value otherwise.
func (o *DataSetCreate) GetSourceType() string {
if o == nil || IsNil(o.SourceType) {
var ret string
return ret
}
return *o.SourceType
}
// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetCreate) GetSourceTypeOk() (*string, bool) {
if o == nil || IsNil(o.SourceType) {
return nil, false
}
return o.SourceType, true
}
// HasSourceType returns a boolean if a field has been set.
func (o *DataSetCreate) HasSourceType() bool {
if o != nil && !IsNil(o.SourceType) {
return true
}
return false
}
// SetSourceType gets a reference to the given string and assigns it to the SourceType field.
func (o *DataSetCreate) SetSourceType(v string) {
o.SourceType = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *DataSetCreate) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetCreate) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *DataSetCreate) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *DataSetCreate) SetSource(v string) {
o.Source = &v
}
// GetSchema returns the Schema field value if set, zero value otherwise.
func (o *DataSetCreate) GetSchema() string {
if o == nil || IsNil(o.Schema) {
var ret string
return ret
}
return *o.Schema
}
// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetCreate) GetSchemaOk() (*string, bool) {
if o == nil || IsNil(o.Schema) {
return nil, false
}
return o.Schema, true
}
// HasSchema returns a boolean if a field has been set.
func (o *DataSetCreate) HasSchema() bool {
if o != nil && !IsNil(o.Schema) {
return true
}
return false
}
// SetSchema gets a reference to the given string and assigns it to the Schema field.
func (o *DataSetCreate) SetSchema(v string) {
o.Schema = &v
}
// GetProfile returns the Profile field value if set, zero value otherwise.
func (o *DataSetCreate) GetProfile() string {
if o == nil || IsNil(o.Profile) {
var ret string
return ret
}
return *o.Profile
}
// GetProfileOk returns a tuple with the Profile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetCreate) GetProfileOk() (*string, bool) {
if o == nil || IsNil(o.Profile) {
return nil, false
}
return o.Profile, true
}
// HasProfile returns a boolean if a field has been set.
func (o *DataSetCreate) HasProfile() bool {
if o != nil && !IsNil(o.Profile) {
return true
}
return false
}
// SetProfile gets a reference to the given string and assigns it to the Profile field.
func (o *DataSetCreate) SetProfile(v string) {
o.Profile = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) 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 *DataSetCreate) SetState(v ArtifactState) {
o.State = &v
}
func (o DataSetCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DataSetCreate) 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.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.SourceType) {
toSerialize["sourceType"] = o.SourceType
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Schema) {
toSerialize["schema"] = o.Schema
}
if !IsNil(o.Profile) {
toSerialize["profile"] = o.Profile
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDataSetCreate struct {
value *DataSetCreate
isSet bool
}
func (v NullableDataSetCreate) Get() *DataSetCreate {
return v.value
}
func (v *NullableDataSetCreate) Set(val *DataSetCreate) {
v.value = val
v.isSet = true
}
func (v NullableDataSetCreate) IsSet() bool {
return v.isSet
}
func (v *NullableDataSetCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDataSetCreate(val *DataSetCreate) *NullableDataSetCreate {
return &NullableDataSetCreate{value: val, isSet: true}
}
func (v NullableDataSetCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDataSetCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DataSetList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DataSetList{}
// DataSetList List of DataSets.
type DataSetList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
//
Items []DataSet `json:"items"`
}
// NewDataSetList instantiates a new DataSetList 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 NewDataSetList(nextPageToken string, pageSize int32, size int32, items []DataSet) *DataSetList {
this := DataSetList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewDataSetListWithDefaults instantiates a new DataSetList 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 NewDataSetListWithDefaults() *DataSetList {
this := DataSetList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *DataSetList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *DataSetList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *DataSetList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *DataSetList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *DataSetList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *DataSetList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *DataSetList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *DataSetList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *DataSetList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *DataSetList) GetItems() []DataSet {
if o == nil {
var ret []DataSet
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *DataSetList) GetItemsOk() ([]DataSet, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *DataSetList) SetItems(v []DataSet) {
o.Items = v
}
func (o DataSetList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DataSetList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableDataSetList struct {
value *DataSetList
isSet bool
}
func (v NullableDataSetList) Get() *DataSetList {
return v.value
}
func (v *NullableDataSetList) Set(val *DataSetList) {
v.value = val
v.isSet = true
}
func (v NullableDataSetList) IsSet() bool {
return v.isSet
}
func (v *NullableDataSetList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDataSetList(val *DataSetList) *NullableDataSetList {
return &NullableDataSetList{value: val, isSet: true}
}
func (v NullableDataSetList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDataSetList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DataSetUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DataSetUpdate{}
// DataSetUpdate A dataset artifact to be updated.
type DataSetUpdate 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"`
// A unique hash or identifier for the dataset content.
Digest *string `json:"digest,omitempty"`
// The type of data source (e.g., \"s3\", \"hdfs\", \"local\", \"database\").
SourceType *string `json:"sourceType,omitempty"`
// The location or connection string for the dataset source.
Source *string `json:"source,omitempty"`
// JSON schema or description of the dataset structure.
Schema *string `json:"schema,omitempty"`
// Statistical profile or summary of the dataset.
Profile *string `json:"profile,omitempty"`
// The uniform resource identifier of the physical dataset. May be empty if there is no physical dataset.
Uri *string `json:"uri,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewDataSetUpdate instantiates a new DataSetUpdate 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 NewDataSetUpdate() *DataSetUpdate {
this := DataSetUpdate{}
var artifactType string = "dataset-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewDataSetUpdateWithDefaults instantiates a new DataSetUpdate 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 NewDataSetUpdateWithDefaults() *DataSetUpdate {
this := DataSetUpdate{}
var artifactType string = "dataset-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 *DataSetUpdate) 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 *DataSetUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *DataSetUpdate) 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 *DataSetUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *DataSetUpdate) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetUpdate) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *DataSetUpdate) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *DataSetUpdate) SetDigest(v string) {
o.Digest = &v
}
// GetSourceType returns the SourceType field value if set, zero value otherwise.
func (o *DataSetUpdate) GetSourceType() string {
if o == nil || IsNil(o.SourceType) {
var ret string
return ret
}
return *o.SourceType
}
// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetUpdate) GetSourceTypeOk() (*string, bool) {
if o == nil || IsNil(o.SourceType) {
return nil, false
}
return o.SourceType, true
}
// HasSourceType returns a boolean if a field has been set.
func (o *DataSetUpdate) HasSourceType() bool {
if o != nil && !IsNil(o.SourceType) {
return true
}
return false
}
// SetSourceType gets a reference to the given string and assigns it to the SourceType field.
func (o *DataSetUpdate) SetSourceType(v string) {
o.SourceType = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *DataSetUpdate) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetUpdate) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *DataSetUpdate) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *DataSetUpdate) SetSource(v string) {
o.Source = &v
}
// GetSchema returns the Schema field value if set, zero value otherwise.
func (o *DataSetUpdate) GetSchema() string {
if o == nil || IsNil(o.Schema) {
var ret string
return ret
}
return *o.Schema
}
// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetUpdate) GetSchemaOk() (*string, bool) {
if o == nil || IsNil(o.Schema) {
return nil, false
}
return o.Schema, true
}
// HasSchema returns a boolean if a field has been set.
func (o *DataSetUpdate) HasSchema() bool {
if o != nil && !IsNil(o.Schema) {
return true
}
return false
}
// SetSchema gets a reference to the given string and assigns it to the Schema field.
func (o *DataSetUpdate) SetSchema(v string) {
o.Schema = &v
}
// GetProfile returns the Profile field value if set, zero value otherwise.
func (o *DataSetUpdate) GetProfile() string {
if o == nil || IsNil(o.Profile) {
var ret string
return ret
}
return *o.Profile
}
// GetProfileOk returns a tuple with the Profile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataSetUpdate) GetProfileOk() (*string, bool) {
if o == nil || IsNil(o.Profile) {
return nil, false
}
return o.Profile, true
}
// HasProfile returns a boolean if a field has been set.
func (o *DataSetUpdate) HasProfile() bool {
if o != nil && !IsNil(o.Profile) {
return true
}
return false
}
// SetProfile gets a reference to the given string and assigns it to the Profile field.
func (o *DataSetUpdate) SetProfile(v string) {
o.Profile = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) 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 *DataSetUpdate) SetState(v ArtifactState) {
o.State = &v
}
func (o DataSetUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DataSetUpdate) 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.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.SourceType) {
toSerialize["sourceType"] = o.SourceType
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Schema) {
toSerialize["schema"] = o.Schema
}
if !IsNil(o.Profile) {
toSerialize["profile"] = o.Profile
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDataSetUpdate struct {
value *DataSetUpdate
isSet bool
}
func (v NullableDataSetUpdate) Get() *DataSetUpdate {
return v.value
}
func (v *NullableDataSetUpdate) Set(val *DataSetUpdate) {
v.value = val
v.isSet = true
}
func (v NullableDataSetUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableDataSetUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDataSetUpdate(val *DataSetUpdate) *NullableDataSetUpdate {
return &NullableDataSetUpdate{value: val, isSet: true}
}
func (v NullableDataSetUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDataSetUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DocArtifact type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DocArtifact{}
// DocArtifact A document.
type DocArtifact 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
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 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"`
}
// NewDocArtifact instantiates a new DocArtifact 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 NewDocArtifact() *DocArtifact {
this := DocArtifact{}
var artifactType string = "doc-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewDocArtifactWithDefaults instantiates a new DocArtifact 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 NewDocArtifactWithDefaults() *DocArtifact {
this := DocArtifact{}
var artifactType string = "doc-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 *DocArtifact) 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 *DocArtifact) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *DocArtifact) 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 *DocArtifact) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetExperimentId returns the ExperimentId field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetExperimentId(v string) {
o.ExperimentId = &v
}
// GetExperimentRunId returns the ExperimentRunId field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetExperimentRunId(v string) {
o.ExperimentRunId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) 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 *DocArtifact) SetState(v ArtifactState) {
o.State = &v
}
func (o DocArtifact) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DocArtifact) 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.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDocArtifact struct {
value *DocArtifact
isSet bool
}
func (v NullableDocArtifact) Get() *DocArtifact {
return v.value
}
func (v *NullableDocArtifact) Set(val *DocArtifact) {
v.value = val
v.isSet = true
}
func (v NullableDocArtifact) IsSet() bool {
return v.isSet
}
func (v *NullableDocArtifact) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDocArtifact(val *DocArtifact) *NullableDocArtifact {
return &NullableDocArtifact{value: val, isSet: true}
}
func (v NullableDocArtifact) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDocArtifact) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DocArtifactCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DocArtifactCreate{}
// DocArtifactCreate A document artifact to be created.
type DocArtifactCreate 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
ArtifactType *string `json:"artifactType,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"`
}
// NewDocArtifactCreate instantiates a new DocArtifactCreate 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 NewDocArtifactCreate() *DocArtifactCreate {
this := DocArtifactCreate{}
var artifactType string = "doc-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewDocArtifactCreateWithDefaults instantiates a new DocArtifactCreate 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 NewDocArtifactCreateWithDefaults() *DocArtifactCreate {
this := DocArtifactCreate{}
var artifactType string = "doc-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 *DocArtifactCreate) 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 *DocArtifactCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) SetName(v string) {
o.Name = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) 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 *DocArtifactCreate) SetState(v ArtifactState) {
o.State = &v
}
func (o DocArtifactCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DocArtifactCreate) 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.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDocArtifactCreate struct {
value *DocArtifactCreate
isSet bool
}
func (v NullableDocArtifactCreate) Get() *DocArtifactCreate {
return v.value
}
func (v *NullableDocArtifactCreate) Set(val *DocArtifactCreate) {
v.value = val
v.isSet = true
}
func (v NullableDocArtifactCreate) IsSet() bool {
return v.isSet
}
func (v *NullableDocArtifactCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDocArtifactCreate(val *DocArtifactCreate) *NullableDocArtifactCreate {
return &NullableDocArtifactCreate{value: val, isSet: true}
}
func (v NullableDocArtifactCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDocArtifactCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 DocArtifactUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DocArtifactUpdate{}
// DocArtifactUpdate A document artifact to be updated.
type DocArtifactUpdate 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 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"`
}
// NewDocArtifactUpdate instantiates a new DocArtifactUpdate 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 NewDocArtifactUpdate() *DocArtifactUpdate {
this := DocArtifactUpdate{}
var artifactType string = "doc-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewDocArtifactUpdateWithDefaults instantiates a new DocArtifactUpdate 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 NewDocArtifactUpdateWithDefaults() *DocArtifactUpdate {
this := DocArtifactUpdate{}
var artifactType string = "doc-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 *DocArtifactUpdate) 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 *DocArtifactUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *DocArtifactUpdate) 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 *DocArtifactUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) 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 *DocArtifactUpdate) SetState(v ArtifactState) {
o.State = &v
}
func (o DocArtifactUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DocArtifactUpdate) 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.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDocArtifactUpdate struct {
value *DocArtifactUpdate
isSet bool
}
func (v NullableDocArtifactUpdate) Get() *DocArtifactUpdate {
return v.value
}
func (v *NullableDocArtifactUpdate) Set(val *DocArtifactUpdate) {
v.value = val
v.isSet = true
}
func (v NullableDocArtifactUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableDocArtifactUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDocArtifactUpdate(val *DocArtifactUpdate) *NullableDocArtifactUpdate {
return &NullableDocArtifactUpdate{value: val, isSet: true}
}
func (v NullableDocArtifactUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDocArtifactUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 Error type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Error{}
// Error Error code and message.
type Error struct {
// Error code
Code string `json:"code"`
// Error message
Message string `json:"message"`
}
type _Error Error
// NewError instantiates a new Error 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 NewError(code string, message string) *Error {
this := Error{}
this.Code = code
this.Message = message
return &this
}
// NewErrorWithDefaults instantiates a new Error 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 NewErrorWithDefaults() *Error {
this := Error{}
return &this
}
// GetCode returns the Code field value
func (o *Error) GetCode() string {
if o == nil {
var ret string
return ret
}
return o.Code
}
// GetCodeOk returns a tuple with the Code field value
// and a boolean to check if the value has been set.
func (o *Error) GetCodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Code, true
}
// SetCode sets field value
func (o *Error) SetCode(v string) {
o.Code = v
}
// GetMessage returns the Message field value
func (o *Error) GetMessage() string {
if o == nil {
var ret string
return ret
}
return o.Message
}
// GetMessageOk returns a tuple with the Message field value
// and a boolean to check if the value has been set.
func (o *Error) GetMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Message, true
}
// SetMessage sets field value
func (o *Error) SetMessage(v string) {
o.Message = v
}
func (o Error) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Error) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["code"] = o.Code
toSerialize["message"] = o.Message
return toSerialize, nil
}
type NullableError struct {
value *Error
isSet bool
}
func (v NullableError) Get() *Error {
return v.value
}
func (v *NullableError) Set(val *Error) {
v.value = val
v.isSet = true
}
func (v NullableError) IsSet() bool {
return v.isSet
}
func (v *NullableError) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableError(val *Error) *NullableError {
return &NullableError{value: val, isSet: true}
}
func (v NullableError) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableError) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ExecutionState The state of the Execution. The state transitions are NEW -> RUNNING -> COMPLETE | CACHED | FAILED | CANCELED CACHED means the execution is skipped due to cached results. CANCELED means the execution is skipped due to precondition not met. It is different from CACHED in that a CANCELED execution will not have any event associated with it. It is different from FAILED in that there is no unexpected error happened and it is regarded as a normal state. See also: ml-metadata Execution.State
type ExecutionState string
// List of ExecutionState
const (
EXECUTIONSTATE_UNKNOWN ExecutionState = "UNKNOWN"
EXECUTIONSTATE_NEW ExecutionState = "NEW"
EXECUTIONSTATE_RUNNING ExecutionState = "RUNNING"
EXECUTIONSTATE_COMPLETE ExecutionState = "COMPLETE"
EXECUTIONSTATE_FAILED ExecutionState = "FAILED"
EXECUTIONSTATE_CACHED ExecutionState = "CACHED"
EXECUTIONSTATE_CANCELED ExecutionState = "CANCELED"
)
// All allowed values of ExecutionState enum
var AllowedExecutionStateEnumValues = []ExecutionState{
"UNKNOWN",
"NEW",
"RUNNING",
"COMPLETE",
"FAILED",
"CACHED",
"CANCELED",
}
func (v *ExecutionState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ExecutionState(value)
for _, existing := range AllowedExecutionStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ExecutionState", value)
}
// NewExecutionStateFromValue returns a pointer to a valid ExecutionState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewExecutionStateFromValue(v string) (*ExecutionState, error) {
ev := ExecutionState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ExecutionState: valid values are %v", v, AllowedExecutionStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ExecutionState) IsValid() bool {
for _, existing := range AllowedExecutionStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ExecutionState value
func (v ExecutionState) Ptr() *ExecutionState {
return &v
}
type NullableExecutionState struct {
value *ExecutionState
isSet bool
}
func (v NullableExecutionState) Get() *ExecutionState {
return v.value
}
func (v *NullableExecutionState) Set(val *ExecutionState) {
v.value = val
v.isSet = true
}
func (v NullableExecutionState) IsSet() bool {
return v.isSet
}
func (v *NullableExecutionState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExecutionState(val *ExecutionState) *NullableExecutionState {
return &NullableExecutionState{value: val, isSet: true}
}
func (v NullableExecutionState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExecutionState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 Experiment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Experiment{}
// Experiment An experiment in model registry. An experiment has ExperimentRun children.
type Experiment 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 client provided name of the experiment. It must be unique among all the Experiments of the same type within a Model Registry instance and cannot be changed once set.
Name string `json:"name"`
// 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"`
Owner *string `json:"owner,omitempty"`
State *ExperimentState `json:"state,omitempty"`
}
type _Experiment Experiment
// NewExperiment instantiates a new Experiment 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 NewExperiment(name string) *Experiment {
this := Experiment{}
this.Name = name
var state ExperimentState = EXPERIMENTSTATE_LIVE
this.State = &state
return &this
}
// NewExperimentWithDefaults instantiates a new Experiment 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 NewExperimentWithDefaults() *Experiment {
this := Experiment{}
var state ExperimentState = EXPERIMENTSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *Experiment) 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 *Experiment) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *Experiment) 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 *Experiment) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Experiment) 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 *Experiment) 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 *Experiment) 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 *Experiment) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *Experiment) 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 *Experiment) 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 *Experiment) 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 *Experiment) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *Experiment) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Experiment) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Experiment) SetName(v string) {
o.Name = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Experiment) 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 *Experiment) 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 *Experiment) 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 *Experiment) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *Experiment) 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 *Experiment) 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 *Experiment) 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 *Experiment) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *Experiment) 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 *Experiment) 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 *Experiment) 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 *Experiment) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Experiment) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Experiment) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *Experiment) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *Experiment) SetOwner(v string) {
o.Owner = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Experiment) GetState() ExperimentState {
if o == nil || IsNil(o.State) {
var ret ExperimentState
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 *Experiment) GetStateOk() (*ExperimentState, 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 *Experiment) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ExperimentState and assigns it to the State field.
func (o *Experiment) SetState(v ExperimentState) {
o.State = &v
}
func (o Experiment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Experiment) 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
}
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.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableExperiment struct {
value *Experiment
isSet bool
}
func (v NullableExperiment) Get() *Experiment {
return v.value
}
func (v *NullableExperiment) Set(val *Experiment) {
v.value = val
v.isSet = true
}
func (v NullableExperiment) IsSet() bool {
return v.isSet
}
func (v *NullableExperiment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperiment(val *Experiment) *NullableExperiment {
return &NullableExperiment{value: val, isSet: true}
}
func (v NullableExperiment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperiment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentCreate{}
// ExperimentCreate An experiment in model registry. An experiment has ExperimentRun children.
type ExperimentCreate 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 client provided name of the experiment. It must be unique among all the Experiments of the same type within a Model Registry instance and cannot be changed once set.
Name string `json:"name"`
Owner *string `json:"owner,omitempty"`
State *ExperimentState `json:"state,omitempty"`
}
type _ExperimentCreate ExperimentCreate
// NewExperimentCreate instantiates a new ExperimentCreate 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 NewExperimentCreate(name string) *ExperimentCreate {
this := ExperimentCreate{}
this.Name = name
var state ExperimentState = EXPERIMENTSTATE_LIVE
this.State = &state
return &this
}
// NewExperimentCreateWithDefaults instantiates a new ExperimentCreate 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 NewExperimentCreateWithDefaults() *ExperimentCreate {
this := ExperimentCreate{}
var state ExperimentState = EXPERIMENTSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ExperimentCreate) 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 *ExperimentCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ExperimentCreate) 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 *ExperimentCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ExperimentCreate) 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 *ExperimentCreate) 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 *ExperimentCreate) 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 *ExperimentCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ExperimentCreate) 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 *ExperimentCreate) 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 *ExperimentCreate) 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 *ExperimentCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *ExperimentCreate) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ExperimentCreate) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ExperimentCreate) SetName(v string) {
o.Name = v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *ExperimentCreate) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentCreate) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *ExperimentCreate) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *ExperimentCreate) SetOwner(v string) {
o.Owner = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ExperimentCreate) GetState() ExperimentState {
if o == nil || IsNil(o.State) {
var ret ExperimentState
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 *ExperimentCreate) GetStateOk() (*ExperimentState, 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 *ExperimentCreate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ExperimentState and assigns it to the State field.
func (o *ExperimentCreate) SetState(v ExperimentState) {
o.State = &v
}
func (o ExperimentCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentCreate) 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
}
toSerialize["name"] = o.Name
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableExperimentCreate struct {
value *ExperimentCreate
isSet bool
}
func (v NullableExperimentCreate) Get() *ExperimentCreate {
return v.value
}
func (v *NullableExperimentCreate) Set(val *ExperimentCreate) {
v.value = val
v.isSet = true
}
func (v NullableExperimentCreate) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentCreate(val *ExperimentCreate) *NullableExperimentCreate {
return &NullableExperimentCreate{value: val, isSet: true}
}
func (v NullableExperimentCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentList{}
// ExperimentList List of Experiments.
type ExperimentList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
//
Items []Experiment `json:"items"`
}
type _ExperimentList ExperimentList
// NewExperimentList instantiates a new ExperimentList 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 NewExperimentList(nextPageToken string, pageSize int32, size int32, items []Experiment) *ExperimentList {
this := ExperimentList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewExperimentListWithDefaults instantiates a new ExperimentList 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 NewExperimentListWithDefaults() *ExperimentList {
this := ExperimentList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ExperimentList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ExperimentList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ExperimentList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ExperimentList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ExperimentList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ExperimentList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ExperimentList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ExperimentList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ExperimentList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ExperimentList) GetItems() []Experiment {
if o == nil {
var ret []Experiment
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ExperimentList) GetItemsOk() ([]Experiment, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ExperimentList) SetItems(v []Experiment) {
o.Items = v
}
func (o ExperimentList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableExperimentList struct {
value *ExperimentList
isSet bool
}
func (v NullableExperimentList) Get() *ExperimentList {
return v.value
}
func (v *NullableExperimentList) Set(val *ExperimentList) {
v.value = val
v.isSet = true
}
func (v NullableExperimentList) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentList(val *ExperimentList) *NullableExperimentList {
return &NullableExperimentList{value: val, isSet: true}
}
func (v NullableExperimentList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentRun type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentRun{}
// ExperimentRun Represents an ExperimentRun belonging to an Experiment.
type ExperimentRun 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
// End time of the actual experiment run in milliseconds since epoch. Different from lastUpdateTimeSinceEpoch, which is registry resource update time.
EndTimeSinceEpoch *string `json:"endTimeSinceEpoch,omitempty"`
Status *ExperimentRunStatus `json:"status,omitempty"`
State *ExperimentRunState `json:"state,omitempty"`
// Experiment run owner id or name.
Owner *string `json:"owner,omitempty"`
// ID of the `Experiment` to which this experiment run belongs.
ExperimentId string `json:"experimentId"`
// Start time of the experiment run in milliseconds since epoch. Different from createTimeSinceEpoch, which is registry resource creation time.
StartTimeSinceEpoch *string `json:"startTimeSinceEpoch,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"`
}
type _ExperimentRun ExperimentRun
// NewExperimentRun instantiates a new ExperimentRun 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 NewExperimentRun(experimentId string) *ExperimentRun {
this := ExperimentRun{}
var status ExperimentRunStatus = EXPERIMENTRUNSTATUS_RUNNING
this.Status = &status
var state ExperimentRunState = EXPERIMENTRUNSTATE_LIVE
this.State = &state
this.ExperimentId = experimentId
return &this
}
// NewExperimentRunWithDefaults instantiates a new ExperimentRun 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 NewExperimentRunWithDefaults() *ExperimentRun {
this := ExperimentRun{}
var status ExperimentRunStatus = EXPERIMENTRUNSTATUS_RUNNING
this.Status = &status
var state ExperimentRunState = EXPERIMENTRUNSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ExperimentRun) 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 *ExperimentRun) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) SetName(v string) {
o.Name = &v
}
// GetEndTimeSinceEpoch returns the EndTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRun) GetEndTimeSinceEpoch() string {
if o == nil || IsNil(o.EndTimeSinceEpoch) {
var ret string
return ret
}
return *o.EndTimeSinceEpoch
}
// GetEndTimeSinceEpochOk returns a tuple with the EndTimeSinceEpoch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRun) GetEndTimeSinceEpochOk() (*string, bool) {
if o == nil || IsNil(o.EndTimeSinceEpoch) {
return nil, false
}
return o.EndTimeSinceEpoch, true
}
// HasEndTimeSinceEpoch returns a boolean if a field has been set.
func (o *ExperimentRun) HasEndTimeSinceEpoch() bool {
if o != nil && !IsNil(o.EndTimeSinceEpoch) {
return true
}
return false
}
// SetEndTimeSinceEpoch gets a reference to the given string and assigns it to the EndTimeSinceEpoch field.
func (o *ExperimentRun) SetEndTimeSinceEpoch(v string) {
o.EndTimeSinceEpoch = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ExperimentRun) GetStatus() ExperimentRunStatus {
if o == nil || IsNil(o.Status) {
var ret ExperimentRunStatus
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 *ExperimentRun) GetStatusOk() (*ExperimentRunStatus, 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 *ExperimentRun) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given ExperimentRunStatus and assigns it to the Status field.
func (o *ExperimentRun) SetStatus(v ExperimentRunStatus) {
o.Status = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ExperimentRun) GetState() ExperimentRunState {
if o == nil || IsNil(o.State) {
var ret ExperimentRunState
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 *ExperimentRun) GetStateOk() (*ExperimentRunState, 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 *ExperimentRun) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ExperimentRunState and assigns it to the State field.
func (o *ExperimentRun) SetState(v ExperimentRunState) {
o.State = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *ExperimentRun) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRun) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *ExperimentRun) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *ExperimentRun) SetOwner(v string) {
o.Owner = &v
}
// GetExperimentId returns the ExperimentId field value
func (o *ExperimentRun) GetExperimentId() string {
if o == nil {
var ret string
return ret
}
return o.ExperimentId
}
// GetExperimentIdOk returns a tuple with the ExperimentId field value
// and a boolean to check if the value has been set.
func (o *ExperimentRun) GetExperimentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ExperimentId, true
}
// SetExperimentId sets field value
func (o *ExperimentRun) SetExperimentId(v string) {
o.ExperimentId = v
}
// GetStartTimeSinceEpoch returns the StartTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRun) GetStartTimeSinceEpoch() string {
if o == nil || IsNil(o.StartTimeSinceEpoch) {
var ret string
return ret
}
return *o.StartTimeSinceEpoch
}
// GetStartTimeSinceEpochOk returns a tuple with the StartTimeSinceEpoch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRun) GetStartTimeSinceEpochOk() (*string, bool) {
if o == nil || IsNil(o.StartTimeSinceEpoch) {
return nil, false
}
return o.StartTimeSinceEpoch, true
}
// HasStartTimeSinceEpoch returns a boolean if a field has been set.
func (o *ExperimentRun) HasStartTimeSinceEpoch() bool {
if o != nil && !IsNil(o.StartTimeSinceEpoch) {
return true
}
return false
}
// SetStartTimeSinceEpoch gets a reference to the given string and assigns it to the StartTimeSinceEpoch field.
func (o *ExperimentRun) SetStartTimeSinceEpoch(v string) {
o.StartTimeSinceEpoch = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) 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 *ExperimentRun) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
func (o ExperimentRun) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentRun) 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.EndTimeSinceEpoch) {
toSerialize["endTimeSinceEpoch"] = o.EndTimeSinceEpoch
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
toSerialize["experimentId"] = o.ExperimentId
if !IsNil(o.StartTimeSinceEpoch) {
toSerialize["startTimeSinceEpoch"] = o.StartTimeSinceEpoch
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.CreateTimeSinceEpoch) {
toSerialize["createTimeSinceEpoch"] = o.CreateTimeSinceEpoch
}
if !IsNil(o.LastUpdateTimeSinceEpoch) {
toSerialize["lastUpdateTimeSinceEpoch"] = o.LastUpdateTimeSinceEpoch
}
return toSerialize, nil
}
type NullableExperimentRun struct {
value *ExperimentRun
isSet bool
}
func (v NullableExperimentRun) Get() *ExperimentRun {
return v.value
}
func (v *NullableExperimentRun) Set(val *ExperimentRun) {
v.value = val
v.isSet = true
}
func (v NullableExperimentRun) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentRun) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentRun(val *ExperimentRun) *NullableExperimentRun {
return &NullableExperimentRun{value: val, isSet: true}
}
func (v NullableExperimentRun) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentRun) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentRunCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentRunCreate{}
// ExperimentRunCreate Represents an ExperimentRun belonging to an Experiment.
type ExperimentRunCreate 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 client provided name of the experiment run. It must be unique among all the ExperimentRuns of the same type within a Model Registry instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
// End time of the actual experiment run in milliseconds since epoch. Different from lastUpdateTimeSinceEpoch, which is registry resource update time.
EndTimeSinceEpoch *string `json:"endTimeSinceEpoch,omitempty"`
Status *ExperimentRunStatus `json:"status,omitempty"`
State *ExperimentRunState `json:"state,omitempty"`
// Experiment run owner id or name.
Owner *string `json:"owner,omitempty"`
// ID of the `Experiment` to which this experiment run belongs.
ExperimentId string `json:"experimentId"`
// Start time of the experiment run in milliseconds since epoch. Different from createTimeSinceEpoch, which is registry resource creation time.
StartTimeSinceEpoch *string `json:"startTimeSinceEpoch,omitempty"`
}
type _ExperimentRunCreate ExperimentRunCreate
// NewExperimentRunCreate instantiates a new ExperimentRunCreate 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 NewExperimentRunCreate(experimentId string) *ExperimentRunCreate {
this := ExperimentRunCreate{}
var status ExperimentRunStatus = EXPERIMENTRUNSTATUS_RUNNING
this.Status = &status
var state ExperimentRunState = EXPERIMENTRUNSTATE_LIVE
this.State = &state
this.ExperimentId = experimentId
return &this
}
// NewExperimentRunCreateWithDefaults instantiates a new ExperimentRunCreate 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 NewExperimentRunCreateWithDefaults() *ExperimentRunCreate {
this := ExperimentRunCreate{}
var status ExperimentRunStatus = EXPERIMENTRUNSTATUS_RUNNING
this.Status = &status
var state ExperimentRunState = EXPERIMENTRUNSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ExperimentRunCreate) 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 *ExperimentRunCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ExperimentRunCreate) 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 *ExperimentRunCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ExperimentRunCreate) 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 *ExperimentRunCreate) 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 *ExperimentRunCreate) 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 *ExperimentRunCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ExperimentRunCreate) 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 *ExperimentRunCreate) 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 *ExperimentRunCreate) 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 *ExperimentRunCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ExperimentRunCreate) 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 *ExperimentRunCreate) 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 *ExperimentRunCreate) 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 *ExperimentRunCreate) SetName(v string) {
o.Name = &v
}
// GetEndTimeSinceEpoch returns the EndTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRunCreate) GetEndTimeSinceEpoch() string {
if o == nil || IsNil(o.EndTimeSinceEpoch) {
var ret string
return ret
}
return *o.EndTimeSinceEpoch
}
// GetEndTimeSinceEpochOk returns a tuple with the EndTimeSinceEpoch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRunCreate) GetEndTimeSinceEpochOk() (*string, bool) {
if o == nil || IsNil(o.EndTimeSinceEpoch) {
return nil, false
}
return o.EndTimeSinceEpoch, true
}
// HasEndTimeSinceEpoch returns a boolean if a field has been set.
func (o *ExperimentRunCreate) HasEndTimeSinceEpoch() bool {
if o != nil && !IsNil(o.EndTimeSinceEpoch) {
return true
}
return false
}
// SetEndTimeSinceEpoch gets a reference to the given string and assigns it to the EndTimeSinceEpoch field.
func (o *ExperimentRunCreate) SetEndTimeSinceEpoch(v string) {
o.EndTimeSinceEpoch = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ExperimentRunCreate) GetStatus() ExperimentRunStatus {
if o == nil || IsNil(o.Status) {
var ret ExperimentRunStatus
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 *ExperimentRunCreate) GetStatusOk() (*ExperimentRunStatus, 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 *ExperimentRunCreate) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given ExperimentRunStatus and assigns it to the Status field.
func (o *ExperimentRunCreate) SetStatus(v ExperimentRunStatus) {
o.Status = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ExperimentRunCreate) GetState() ExperimentRunState {
if o == nil || IsNil(o.State) {
var ret ExperimentRunState
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 *ExperimentRunCreate) GetStateOk() (*ExperimentRunState, 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 *ExperimentRunCreate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ExperimentRunState and assigns it to the State field.
func (o *ExperimentRunCreate) SetState(v ExperimentRunState) {
o.State = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *ExperimentRunCreate) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRunCreate) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *ExperimentRunCreate) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *ExperimentRunCreate) SetOwner(v string) {
o.Owner = &v
}
// GetExperimentId returns the ExperimentId field value
func (o *ExperimentRunCreate) GetExperimentId() string {
if o == nil {
var ret string
return ret
}
return o.ExperimentId
}
// GetExperimentIdOk returns a tuple with the ExperimentId field value
// and a boolean to check if the value has been set.
func (o *ExperimentRunCreate) GetExperimentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ExperimentId, true
}
// SetExperimentId sets field value
func (o *ExperimentRunCreate) SetExperimentId(v string) {
o.ExperimentId = v
}
// GetStartTimeSinceEpoch returns the StartTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRunCreate) GetStartTimeSinceEpoch() string {
if o == nil || IsNil(o.StartTimeSinceEpoch) {
var ret string
return ret
}
return *o.StartTimeSinceEpoch
}
// GetStartTimeSinceEpochOk returns a tuple with the StartTimeSinceEpoch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRunCreate) GetStartTimeSinceEpochOk() (*string, bool) {
if o == nil || IsNil(o.StartTimeSinceEpoch) {
return nil, false
}
return o.StartTimeSinceEpoch, true
}
// HasStartTimeSinceEpoch returns a boolean if a field has been set.
func (o *ExperimentRunCreate) HasStartTimeSinceEpoch() bool {
if o != nil && !IsNil(o.StartTimeSinceEpoch) {
return true
}
return false
}
// SetStartTimeSinceEpoch gets a reference to the given string and assigns it to the StartTimeSinceEpoch field.
func (o *ExperimentRunCreate) SetStartTimeSinceEpoch(v string) {
o.StartTimeSinceEpoch = &v
}
func (o ExperimentRunCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentRunCreate) 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.EndTimeSinceEpoch) {
toSerialize["endTimeSinceEpoch"] = o.EndTimeSinceEpoch
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
toSerialize["experimentId"] = o.ExperimentId
if !IsNil(o.StartTimeSinceEpoch) {
toSerialize["startTimeSinceEpoch"] = o.StartTimeSinceEpoch
}
return toSerialize, nil
}
type NullableExperimentRunCreate struct {
value *ExperimentRunCreate
isSet bool
}
func (v NullableExperimentRunCreate) Get() *ExperimentRunCreate {
return v.value
}
func (v *NullableExperimentRunCreate) Set(val *ExperimentRunCreate) {
v.value = val
v.isSet = true
}
func (v NullableExperimentRunCreate) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentRunCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentRunCreate(val *ExperimentRunCreate) *NullableExperimentRunCreate {
return &NullableExperimentRunCreate{value: val, isSet: true}
}
func (v NullableExperimentRunCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentRunCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentRunList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentRunList{}
// ExperimentRunList List of ExperimentRun entities.
type ExperimentRunList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
// Array of `ExperimentRun` entities.
Items []ExperimentRun `json:"items"`
}
type _ExperimentRunList ExperimentRunList
// NewExperimentRunList instantiates a new ExperimentRunList 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 NewExperimentRunList(nextPageToken string, pageSize int32, size int32, items []ExperimentRun) *ExperimentRunList {
this := ExperimentRunList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewExperimentRunListWithDefaults instantiates a new ExperimentRunList 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 NewExperimentRunListWithDefaults() *ExperimentRunList {
this := ExperimentRunList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ExperimentRunList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ExperimentRunList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ExperimentRunList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ExperimentRunList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ExperimentRunList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ExperimentRunList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ExperimentRunList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ExperimentRunList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ExperimentRunList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ExperimentRunList) GetItems() []ExperimentRun {
if o == nil {
var ret []ExperimentRun
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ExperimentRunList) GetItemsOk() ([]ExperimentRun, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ExperimentRunList) SetItems(v []ExperimentRun) {
o.Items = v
}
func (o ExperimentRunList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentRunList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableExperimentRunList struct {
value *ExperimentRunList
isSet bool
}
func (v NullableExperimentRunList) Get() *ExperimentRunList {
return v.value
}
func (v *NullableExperimentRunList) Set(val *ExperimentRunList) {
v.value = val
v.isSet = true
}
func (v NullableExperimentRunList) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentRunList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentRunList(val *ExperimentRunList) *NullableExperimentRunList {
return &NullableExperimentRunList{value: val, isSet: true}
}
func (v NullableExperimentRunList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentRunList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ExperimentRunState - LIVE: A state indicating that the `ExperimentRun` exists - ARCHIVED: A state indicating that the `ExperimentRun` has been archived.
type ExperimentRunState string
// List of ExperimentRunState
const (
EXPERIMENTRUNSTATE_LIVE ExperimentRunState = "LIVE"
EXPERIMENTRUNSTATE_ARCHIVED ExperimentRunState = "ARCHIVED"
)
// All allowed values of ExperimentRunState enum
var AllowedExperimentRunStateEnumValues = []ExperimentRunState{
"LIVE",
"ARCHIVED",
}
func (v *ExperimentRunState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ExperimentRunState(value)
for _, existing := range AllowedExperimentRunStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ExperimentRunState", value)
}
// NewExperimentRunStateFromValue returns a pointer to a valid ExperimentRunState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewExperimentRunStateFromValue(v string) (*ExperimentRunState, error) {
ev := ExperimentRunState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ExperimentRunState: valid values are %v", v, AllowedExperimentRunStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ExperimentRunState) IsValid() bool {
for _, existing := range AllowedExperimentRunStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ExperimentRunState value
func (v ExperimentRunState) Ptr() *ExperimentRunState {
return &v
}
type NullableExperimentRunState struct {
value *ExperimentRunState
isSet bool
}
func (v NullableExperimentRunState) Get() *ExperimentRunState {
return v.value
}
func (v *NullableExperimentRunState) Set(val *ExperimentRunState) {
v.value = val
v.isSet = true
}
func (v NullableExperimentRunState) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentRunState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentRunState(val *ExperimentRunState) *NullableExperimentRunState {
return &NullableExperimentRunState{value: val, isSet: true}
}
func (v NullableExperimentRunState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentRunState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ExperimentRunStatus The state of the Experiment Run. The state transitions are [SCHEDULED ->] RUNNING -> FINISHED | FAILED | KILLED RUNNING: Run has been initiated. SCHEDULED: Run is scheduled to run at a later time. FINISHED: Run has completed. FAILED: Run execution failed. KILLED: Run killed by user.
type ExperimentRunStatus string
// List of ExperimentRunStatus
const (
EXPERIMENTRUNSTATUS_RUNNING ExperimentRunStatus = "RUNNING"
EXPERIMENTRUNSTATUS_SCHEDULED ExperimentRunStatus = "SCHEDULED"
EXPERIMENTRUNSTATUS_FINISHED ExperimentRunStatus = "FINISHED"
EXPERIMENTRUNSTATUS_FAILED ExperimentRunStatus = "FAILED"
EXPERIMENTRUNSTATUS_KILLED ExperimentRunStatus = "KILLED"
)
// All allowed values of ExperimentRunStatus enum
var AllowedExperimentRunStatusEnumValues = []ExperimentRunStatus{
"RUNNING",
"SCHEDULED",
"FINISHED",
"FAILED",
"KILLED",
}
func (v *ExperimentRunStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ExperimentRunStatus(value)
for _, existing := range AllowedExperimentRunStatusEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ExperimentRunStatus", value)
}
// NewExperimentRunStatusFromValue returns a pointer to a valid ExperimentRunStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewExperimentRunStatusFromValue(v string) (*ExperimentRunStatus, error) {
ev := ExperimentRunStatus(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ExperimentRunStatus: valid values are %v", v, AllowedExperimentRunStatusEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ExperimentRunStatus) IsValid() bool {
for _, existing := range AllowedExperimentRunStatusEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ExperimentRunStatus value
func (v ExperimentRunStatus) Ptr() *ExperimentRunStatus {
return &v
}
type NullableExperimentRunStatus struct {
value *ExperimentRunStatus
isSet bool
}
func (v NullableExperimentRunStatus) Get() *ExperimentRunStatus {
return v.value
}
func (v *NullableExperimentRunStatus) Set(val *ExperimentRunStatus) {
v.value = val
v.isSet = true
}
func (v NullableExperimentRunStatus) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentRunStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentRunStatus(val *ExperimentRunStatus) *NullableExperimentRunStatus {
return &NullableExperimentRunStatus{value: val, isSet: true}
}
func (v NullableExperimentRunStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentRunStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentRunUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentRunUpdate{}
// ExperimentRunUpdate Represents an ExperimentRun belonging to an Experiment.
type ExperimentRunUpdate 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"`
// End time of the actual experiment run in milliseconds since epoch. Different from lastUpdateTimeSinceEpoch, which is registry resource update time.
EndTimeSinceEpoch *string `json:"endTimeSinceEpoch,omitempty"`
Status *ExperimentRunStatus `json:"status,omitempty"`
State *ExperimentRunState `json:"state,omitempty"`
// Experiment run owner id or name.
Owner *string `json:"owner,omitempty"`
}
// NewExperimentRunUpdate instantiates a new ExperimentRunUpdate 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 NewExperimentRunUpdate() *ExperimentRunUpdate {
this := ExperimentRunUpdate{}
var status ExperimentRunStatus = EXPERIMENTRUNSTATUS_RUNNING
this.Status = &status
var state ExperimentRunState = EXPERIMENTRUNSTATE_LIVE
this.State = &state
return &this
}
// NewExperimentRunUpdateWithDefaults instantiates a new ExperimentRunUpdate 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 NewExperimentRunUpdateWithDefaults() *ExperimentRunUpdate {
this := ExperimentRunUpdate{}
var status ExperimentRunStatus = EXPERIMENTRUNSTATUS_RUNNING
this.Status = &status
var state ExperimentRunState = EXPERIMENTRUNSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) 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 *ExperimentRunUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ExperimentRunUpdate) 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 *ExperimentRunUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) 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 *ExperimentRunUpdate) 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 *ExperimentRunUpdate) 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 *ExperimentRunUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) 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 *ExperimentRunUpdate) 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 *ExperimentRunUpdate) 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 *ExperimentRunUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetEndTimeSinceEpoch returns the EndTimeSinceEpoch field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) GetEndTimeSinceEpoch() string {
if o == nil || IsNil(o.EndTimeSinceEpoch) {
var ret string
return ret
}
return *o.EndTimeSinceEpoch
}
// GetEndTimeSinceEpochOk returns a tuple with the EndTimeSinceEpoch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRunUpdate) GetEndTimeSinceEpochOk() (*string, bool) {
if o == nil || IsNil(o.EndTimeSinceEpoch) {
return nil, false
}
return o.EndTimeSinceEpoch, true
}
// HasEndTimeSinceEpoch returns a boolean if a field has been set.
func (o *ExperimentRunUpdate) HasEndTimeSinceEpoch() bool {
if o != nil && !IsNil(o.EndTimeSinceEpoch) {
return true
}
return false
}
// SetEndTimeSinceEpoch gets a reference to the given string and assigns it to the EndTimeSinceEpoch field.
func (o *ExperimentRunUpdate) SetEndTimeSinceEpoch(v string) {
o.EndTimeSinceEpoch = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) GetStatus() ExperimentRunStatus {
if o == nil || IsNil(o.Status) {
var ret ExperimentRunStatus
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 *ExperimentRunUpdate) GetStatusOk() (*ExperimentRunStatus, 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 *ExperimentRunUpdate) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given ExperimentRunStatus and assigns it to the Status field.
func (o *ExperimentRunUpdate) SetStatus(v ExperimentRunStatus) {
o.Status = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) GetState() ExperimentRunState {
if o == nil || IsNil(o.State) {
var ret ExperimentRunState
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 *ExperimentRunUpdate) GetStateOk() (*ExperimentRunState, 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 *ExperimentRunUpdate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ExperimentRunState and assigns it to the State field.
func (o *ExperimentRunUpdate) SetState(v ExperimentRunState) {
o.State = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *ExperimentRunUpdate) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentRunUpdate) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *ExperimentRunUpdate) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *ExperimentRunUpdate) SetOwner(v string) {
o.Owner = &v
}
func (o ExperimentRunUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentRunUpdate) 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.EndTimeSinceEpoch) {
toSerialize["endTimeSinceEpoch"] = o.EndTimeSinceEpoch
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
return toSerialize, nil
}
type NullableExperimentRunUpdate struct {
value *ExperimentRunUpdate
isSet bool
}
func (v NullableExperimentRunUpdate) Get() *ExperimentRunUpdate {
return v.value
}
func (v *NullableExperimentRunUpdate) Set(val *ExperimentRunUpdate) {
v.value = val
v.isSet = true
}
func (v NullableExperimentRunUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentRunUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentRunUpdate(val *ExperimentRunUpdate) *NullableExperimentRunUpdate {
return &NullableExperimentRunUpdate{value: val, isSet: true}
}
func (v NullableExperimentRunUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentRunUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ExperimentState - LIVE: A state indicating that the `Experiment` exists - ARCHIVED: A state indicating that the `Experiment` has been archived.
type ExperimentState string
// List of ExperimentState
const (
EXPERIMENTSTATE_LIVE ExperimentState = "LIVE"
EXPERIMENTSTATE_ARCHIVED ExperimentState = "ARCHIVED"
)
// All allowed values of ExperimentState enum
var AllowedExperimentStateEnumValues = []ExperimentState{
"LIVE",
"ARCHIVED",
}
func (v *ExperimentState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ExperimentState(value)
for _, existing := range AllowedExperimentStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ExperimentState", value)
}
// NewExperimentStateFromValue returns a pointer to a valid ExperimentState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewExperimentStateFromValue(v string) (*ExperimentState, error) {
ev := ExperimentState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ExperimentState: valid values are %v", v, AllowedExperimentStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ExperimentState) IsValid() bool {
for _, existing := range AllowedExperimentStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ExperimentState value
func (v ExperimentState) Ptr() *ExperimentState {
return &v
}
type NullableExperimentState struct {
value *ExperimentState
isSet bool
}
func (v NullableExperimentState) Get() *ExperimentState {
return v.value
}
func (v *NullableExperimentState) Set(val *ExperimentState) {
v.value = val
v.isSet = true
}
func (v NullableExperimentState) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentState(val *ExperimentState) *NullableExperimentState {
return &NullableExperimentState{value: val, isSet: true}
}
func (v NullableExperimentState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ExperimentUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExperimentUpdate{}
// ExperimentUpdate An experiment in model registry. An experiment has ExperimentRun children.
type ExperimentUpdate 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"`
Owner *string `json:"owner,omitempty"`
State *ExperimentState `json:"state,omitempty"`
}
// NewExperimentUpdate instantiates a new ExperimentUpdate 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 NewExperimentUpdate() *ExperimentUpdate {
this := ExperimentUpdate{}
var state ExperimentState = EXPERIMENTSTATE_LIVE
this.State = &state
return &this
}
// NewExperimentUpdateWithDefaults instantiates a new ExperimentUpdate 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 NewExperimentUpdateWithDefaults() *ExperimentUpdate {
this := ExperimentUpdate{}
var state ExperimentState = EXPERIMENTSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ExperimentUpdate) 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 *ExperimentUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ExperimentUpdate) 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 *ExperimentUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ExperimentUpdate) 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 *ExperimentUpdate) 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 *ExperimentUpdate) 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 *ExperimentUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ExperimentUpdate) 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 *ExperimentUpdate) 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 *ExperimentUpdate) 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 *ExperimentUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *ExperimentUpdate) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExperimentUpdate) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *ExperimentUpdate) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *ExperimentUpdate) SetOwner(v string) {
o.Owner = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ExperimentUpdate) GetState() ExperimentState {
if o == nil || IsNil(o.State) {
var ret ExperimentState
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 *ExperimentUpdate) GetStateOk() (*ExperimentState, 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 *ExperimentUpdate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ExperimentState and assigns it to the State field.
func (o *ExperimentUpdate) SetState(v ExperimentState) {
o.State = &v
}
func (o ExperimentUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExperimentUpdate) 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.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableExperimentUpdate struct {
value *ExperimentUpdate
isSet bool
}
func (v NullableExperimentUpdate) Get() *ExperimentUpdate {
return v.value
}
func (v *NullableExperimentUpdate) Set(val *ExperimentUpdate) {
v.value = val
v.isSet = true
}
func (v NullableExperimentUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableExperimentUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExperimentUpdate(val *ExperimentUpdate) *NullableExperimentUpdate {
return &NullableExperimentUpdate{value: val, isSet: true}
}
func (v NullableExperimentUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExperimentUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 InferenceService type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &InferenceService{}
// InferenceService An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving.
type InferenceService 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
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"`
// ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served.
ModelVersionId *string `json:"modelVersionId,omitempty"`
// Model runtime.
Runtime *string `json:"runtime,omitempty"`
DesiredState *InferenceServiceState `json:"desiredState,omitempty"`
// ID of the `RegisteredModel` to serve.
RegisteredModelId string `json:"registeredModelId"`
// ID of the parent `ServingEnvironment` for this `InferenceService` entity.
ServingEnvironmentId string `json:"servingEnvironmentId"`
}
type _InferenceService InferenceService
// NewInferenceService instantiates a new InferenceService 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 NewInferenceService(registeredModelId string, servingEnvironmentId string) *InferenceService {
this := InferenceService{}
var desiredState InferenceServiceState = INFERENCESERVICESTATE_DEPLOYED
this.DesiredState = &desiredState
this.RegisteredModelId = registeredModelId
this.ServingEnvironmentId = servingEnvironmentId
return &this
}
// NewInferenceServiceWithDefaults instantiates a new InferenceService 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 NewInferenceServiceWithDefaults() *InferenceService {
this := InferenceService{}
var desiredState InferenceServiceState = INFERENCESERVICESTATE_DEPLOYED
this.DesiredState = &desiredState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *InferenceService) 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 *InferenceService) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) 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 *InferenceService) 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 *InferenceService) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) 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 *InferenceService) 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 *InferenceService) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) 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 *InferenceService) 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 *InferenceService) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) 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 *InferenceService) 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 *InferenceService) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) 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 *InferenceService) 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 *InferenceService) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *InferenceService) 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 *InferenceService) 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 *InferenceService) 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 *InferenceService) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetModelVersionId returns the ModelVersionId field value if set, zero value otherwise.
func (o *InferenceService) GetModelVersionId() string {
if o == nil || IsNil(o.ModelVersionId) {
var ret string
return ret
}
return *o.ModelVersionId
}
// GetModelVersionIdOk returns a tuple with the ModelVersionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceService) GetModelVersionIdOk() (*string, bool) {
if o == nil || IsNil(o.ModelVersionId) {
return nil, false
}
return o.ModelVersionId, true
}
// HasModelVersionId returns a boolean if a field has been set.
func (o *InferenceService) HasModelVersionId() bool {
if o != nil && !IsNil(o.ModelVersionId) {
return true
}
return false
}
// SetModelVersionId gets a reference to the given string and assigns it to the ModelVersionId field.
func (o *InferenceService) SetModelVersionId(v string) {
o.ModelVersionId = &v
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *InferenceService) GetRuntime() string {
if o == nil || IsNil(o.Runtime) {
var ret string
return ret
}
return *o.Runtime
}
// GetRuntimeOk returns a tuple with the Runtime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceService) GetRuntimeOk() (*string, bool) {
if o == nil || IsNil(o.Runtime) {
return nil, false
}
return o.Runtime, true
}
// HasRuntime returns a boolean if a field has been set.
func (o *InferenceService) HasRuntime() bool {
if o != nil && !IsNil(o.Runtime) {
return true
}
return false
}
// SetRuntime gets a reference to the given string and assigns it to the Runtime field.
func (o *InferenceService) SetRuntime(v string) {
o.Runtime = &v
}
// GetDesiredState returns the DesiredState field value if set, zero value otherwise.
func (o *InferenceService) GetDesiredState() InferenceServiceState {
if o == nil || IsNil(o.DesiredState) {
var ret InferenceServiceState
return ret
}
return *o.DesiredState
}
// GetDesiredStateOk returns a tuple with the DesiredState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceService) GetDesiredStateOk() (*InferenceServiceState, bool) {
if o == nil || IsNil(o.DesiredState) {
return nil, false
}
return o.DesiredState, true
}
// HasDesiredState returns a boolean if a field has been set.
func (o *InferenceService) HasDesiredState() bool {
if o != nil && !IsNil(o.DesiredState) {
return true
}
return false
}
// SetDesiredState gets a reference to the given InferenceServiceState and assigns it to the DesiredState field.
func (o *InferenceService) SetDesiredState(v InferenceServiceState) {
o.DesiredState = &v
}
// GetRegisteredModelId returns the RegisteredModelId field value
func (o *InferenceService) GetRegisteredModelId() string {
if o == nil {
var ret string
return ret
}
return o.RegisteredModelId
}
// GetRegisteredModelIdOk returns a tuple with the RegisteredModelId field value
// and a boolean to check if the value has been set.
func (o *InferenceService) GetRegisteredModelIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RegisteredModelId, true
}
// SetRegisteredModelId sets field value
func (o *InferenceService) SetRegisteredModelId(v string) {
o.RegisteredModelId = v
}
// GetServingEnvironmentId returns the ServingEnvironmentId field value
func (o *InferenceService) GetServingEnvironmentId() string {
if o == nil {
var ret string
return ret
}
return o.ServingEnvironmentId
}
// GetServingEnvironmentIdOk returns a tuple with the ServingEnvironmentId field value
// and a boolean to check if the value has been set.
func (o *InferenceService) GetServingEnvironmentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ServingEnvironmentId, true
}
// SetServingEnvironmentId sets field value
func (o *InferenceService) SetServingEnvironmentId(v string) {
o.ServingEnvironmentId = v
}
func (o InferenceService) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o InferenceService) 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.ModelVersionId) {
toSerialize["modelVersionId"] = o.ModelVersionId
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
if !IsNil(o.DesiredState) {
toSerialize["desiredState"] = o.DesiredState
}
toSerialize["registeredModelId"] = o.RegisteredModelId
toSerialize["servingEnvironmentId"] = o.ServingEnvironmentId
return toSerialize, nil
}
type NullableInferenceService struct {
value *InferenceService
isSet bool
}
func (v NullableInferenceService) Get() *InferenceService {
return v.value
}
func (v *NullableInferenceService) Set(val *InferenceService) {
v.value = val
v.isSet = true
}
func (v NullableInferenceService) IsSet() bool {
return v.isSet
}
func (v *NullableInferenceService) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInferenceService(val *InferenceService) *NullableInferenceService {
return &NullableInferenceService{value: val, isSet: true}
}
func (v NullableInferenceService) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInferenceService) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 InferenceServiceCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &InferenceServiceCreate{}
// InferenceServiceCreate An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving.
type InferenceServiceCreate 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
// ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served.
ModelVersionId *string `json:"modelVersionId,omitempty"`
// Model runtime.
Runtime *string `json:"runtime,omitempty"`
DesiredState *InferenceServiceState `json:"desiredState,omitempty"`
// ID of the `RegisteredModel` to serve.
RegisteredModelId string `json:"registeredModelId"`
// ID of the parent `ServingEnvironment` for this `InferenceService` entity.
ServingEnvironmentId string `json:"servingEnvironmentId"`
}
type _InferenceServiceCreate InferenceServiceCreate
// NewInferenceServiceCreate instantiates a new InferenceServiceCreate 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 NewInferenceServiceCreate(registeredModelId string, servingEnvironmentId string) *InferenceServiceCreate {
this := InferenceServiceCreate{}
var desiredState InferenceServiceState = INFERENCESERVICESTATE_DEPLOYED
this.DesiredState = &desiredState
this.RegisteredModelId = registeredModelId
this.ServingEnvironmentId = servingEnvironmentId
return &this
}
// NewInferenceServiceCreateWithDefaults instantiates a new InferenceServiceCreate 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 NewInferenceServiceCreateWithDefaults() *InferenceServiceCreate {
this := InferenceServiceCreate{}
var desiredState InferenceServiceState = INFERENCESERVICESTATE_DEPLOYED
this.DesiredState = &desiredState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *InferenceServiceCreate) 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 *InferenceServiceCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *InferenceServiceCreate) 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 *InferenceServiceCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *InferenceServiceCreate) 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 *InferenceServiceCreate) 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 *InferenceServiceCreate) 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 *InferenceServiceCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *InferenceServiceCreate) 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 *InferenceServiceCreate) 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 *InferenceServiceCreate) 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 *InferenceServiceCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *InferenceServiceCreate) 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 *InferenceServiceCreate) 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 *InferenceServiceCreate) 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 *InferenceServiceCreate) SetName(v string) {
o.Name = &v
}
// GetModelVersionId returns the ModelVersionId field value if set, zero value otherwise.
func (o *InferenceServiceCreate) GetModelVersionId() string {
if o == nil || IsNil(o.ModelVersionId) {
var ret string
return ret
}
return *o.ModelVersionId
}
// GetModelVersionIdOk returns a tuple with the ModelVersionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceCreate) GetModelVersionIdOk() (*string, bool) {
if o == nil || IsNil(o.ModelVersionId) {
return nil, false
}
return o.ModelVersionId, true
}
// HasModelVersionId returns a boolean if a field has been set.
func (o *InferenceServiceCreate) HasModelVersionId() bool {
if o != nil && !IsNil(o.ModelVersionId) {
return true
}
return false
}
// SetModelVersionId gets a reference to the given string and assigns it to the ModelVersionId field.
func (o *InferenceServiceCreate) SetModelVersionId(v string) {
o.ModelVersionId = &v
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *InferenceServiceCreate) GetRuntime() string {
if o == nil || IsNil(o.Runtime) {
var ret string
return ret
}
return *o.Runtime
}
// GetRuntimeOk returns a tuple with the Runtime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceCreate) GetRuntimeOk() (*string, bool) {
if o == nil || IsNil(o.Runtime) {
return nil, false
}
return o.Runtime, true
}
// HasRuntime returns a boolean if a field has been set.
func (o *InferenceServiceCreate) HasRuntime() bool {
if o != nil && !IsNil(o.Runtime) {
return true
}
return false
}
// SetRuntime gets a reference to the given string and assigns it to the Runtime field.
func (o *InferenceServiceCreate) SetRuntime(v string) {
o.Runtime = &v
}
// GetDesiredState returns the DesiredState field value if set, zero value otherwise.
func (o *InferenceServiceCreate) GetDesiredState() InferenceServiceState {
if o == nil || IsNil(o.DesiredState) {
var ret InferenceServiceState
return ret
}
return *o.DesiredState
}
// GetDesiredStateOk returns a tuple with the DesiredState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceCreate) GetDesiredStateOk() (*InferenceServiceState, bool) {
if o == nil || IsNil(o.DesiredState) {
return nil, false
}
return o.DesiredState, true
}
// HasDesiredState returns a boolean if a field has been set.
func (o *InferenceServiceCreate) HasDesiredState() bool {
if o != nil && !IsNil(o.DesiredState) {
return true
}
return false
}
// SetDesiredState gets a reference to the given InferenceServiceState and assigns it to the DesiredState field.
func (o *InferenceServiceCreate) SetDesiredState(v InferenceServiceState) {
o.DesiredState = &v
}
// GetRegisteredModelId returns the RegisteredModelId field value
func (o *InferenceServiceCreate) GetRegisteredModelId() string {
if o == nil {
var ret string
return ret
}
return o.RegisteredModelId
}
// GetRegisteredModelIdOk returns a tuple with the RegisteredModelId field value
// and a boolean to check if the value has been set.
func (o *InferenceServiceCreate) GetRegisteredModelIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RegisteredModelId, true
}
// SetRegisteredModelId sets field value
func (o *InferenceServiceCreate) SetRegisteredModelId(v string) {
o.RegisteredModelId = v
}
// GetServingEnvironmentId returns the ServingEnvironmentId field value
func (o *InferenceServiceCreate) GetServingEnvironmentId() string {
if o == nil {
var ret string
return ret
}
return o.ServingEnvironmentId
}
// GetServingEnvironmentIdOk returns a tuple with the ServingEnvironmentId field value
// and a boolean to check if the value has been set.
func (o *InferenceServiceCreate) GetServingEnvironmentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ServingEnvironmentId, true
}
// SetServingEnvironmentId sets field value
func (o *InferenceServiceCreate) SetServingEnvironmentId(v string) {
o.ServingEnvironmentId = v
}
func (o InferenceServiceCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o InferenceServiceCreate) 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.ModelVersionId) {
toSerialize["modelVersionId"] = o.ModelVersionId
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
if !IsNil(o.DesiredState) {
toSerialize["desiredState"] = o.DesiredState
}
toSerialize["registeredModelId"] = o.RegisteredModelId
toSerialize["servingEnvironmentId"] = o.ServingEnvironmentId
return toSerialize, nil
}
type NullableInferenceServiceCreate struct {
value *InferenceServiceCreate
isSet bool
}
func (v NullableInferenceServiceCreate) Get() *InferenceServiceCreate {
return v.value
}
func (v *NullableInferenceServiceCreate) Set(val *InferenceServiceCreate) {
v.value = val
v.isSet = true
}
func (v NullableInferenceServiceCreate) IsSet() bool {
return v.isSet
}
func (v *NullableInferenceServiceCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInferenceServiceCreate(val *InferenceServiceCreate) *NullableInferenceServiceCreate {
return &NullableInferenceServiceCreate{value: val, isSet: true}
}
func (v NullableInferenceServiceCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInferenceServiceCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 InferenceServiceList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &InferenceServiceList{}
// InferenceServiceList List of InferenceServices.
type InferenceServiceList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
//
Items []InferenceService `json:"items"`
}
type _InferenceServiceList InferenceServiceList
// NewInferenceServiceList instantiates a new InferenceServiceList 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 NewInferenceServiceList(nextPageToken string, pageSize int32, size int32, items []InferenceService) *InferenceServiceList {
this := InferenceServiceList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewInferenceServiceListWithDefaults instantiates a new InferenceServiceList 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 NewInferenceServiceListWithDefaults() *InferenceServiceList {
this := InferenceServiceList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *InferenceServiceList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *InferenceServiceList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *InferenceServiceList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *InferenceServiceList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *InferenceServiceList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *InferenceServiceList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *InferenceServiceList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *InferenceServiceList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *InferenceServiceList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *InferenceServiceList) GetItems() []InferenceService {
if o == nil {
var ret []InferenceService
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *InferenceServiceList) GetItemsOk() ([]InferenceService, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *InferenceServiceList) SetItems(v []InferenceService) {
o.Items = v
}
func (o InferenceServiceList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o InferenceServiceList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableInferenceServiceList struct {
value *InferenceServiceList
isSet bool
}
func (v NullableInferenceServiceList) Get() *InferenceServiceList {
return v.value
}
func (v *NullableInferenceServiceList) Set(val *InferenceServiceList) {
v.value = val
v.isSet = true
}
func (v NullableInferenceServiceList) IsSet() bool {
return v.isSet
}
func (v *NullableInferenceServiceList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInferenceServiceList(val *InferenceServiceList) *NullableInferenceServiceList {
return &NullableInferenceServiceList{value: val, isSet: true}
}
func (v NullableInferenceServiceList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInferenceServiceList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// InferenceServiceState - DEPLOYED: A state indicating that the `InferenceService` should be deployed. - UNDEPLOYED: A state indicating that the `InferenceService` should be un-deployed. The state indicates the desired state of inference service. See the associated `ServeModel` for the actual status of service deployment action.
type InferenceServiceState string
// List of InferenceServiceState
const (
INFERENCESERVICESTATE_DEPLOYED InferenceServiceState = "DEPLOYED"
INFERENCESERVICESTATE_UNDEPLOYED InferenceServiceState = "UNDEPLOYED"
)
// All allowed values of InferenceServiceState enum
var AllowedInferenceServiceStateEnumValues = []InferenceServiceState{
"DEPLOYED",
"UNDEPLOYED",
}
func (v *InferenceServiceState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := InferenceServiceState(value)
for _, existing := range AllowedInferenceServiceStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid InferenceServiceState", value)
}
// NewInferenceServiceStateFromValue returns a pointer to a valid InferenceServiceState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewInferenceServiceStateFromValue(v string) (*InferenceServiceState, error) {
ev := InferenceServiceState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for InferenceServiceState: valid values are %v", v, AllowedInferenceServiceStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v InferenceServiceState) IsValid() bool {
for _, existing := range AllowedInferenceServiceStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to InferenceServiceState value
func (v InferenceServiceState) Ptr() *InferenceServiceState {
return &v
}
type NullableInferenceServiceState struct {
value *InferenceServiceState
isSet bool
}
func (v NullableInferenceServiceState) Get() *InferenceServiceState {
return v.value
}
func (v *NullableInferenceServiceState) Set(val *InferenceServiceState) {
v.value = val
v.isSet = true
}
func (v NullableInferenceServiceState) IsSet() bool {
return v.isSet
}
func (v *NullableInferenceServiceState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInferenceServiceState(val *InferenceServiceState) *NullableInferenceServiceState {
return &NullableInferenceServiceState{value: val, isSet: true}
}
func (v NullableInferenceServiceState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInferenceServiceState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 InferenceServiceUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &InferenceServiceUpdate{}
// InferenceServiceUpdate An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving.
type InferenceServiceUpdate 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"`
// ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served.
ModelVersionId *string `json:"modelVersionId,omitempty"`
// Model runtime.
Runtime *string `json:"runtime,omitempty"`
DesiredState *InferenceServiceState `json:"desiredState,omitempty"`
}
// NewInferenceServiceUpdate instantiates a new InferenceServiceUpdate 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 NewInferenceServiceUpdate() *InferenceServiceUpdate {
this := InferenceServiceUpdate{}
var desiredState InferenceServiceState = INFERENCESERVICESTATE_DEPLOYED
this.DesiredState = &desiredState
return &this
}
// NewInferenceServiceUpdateWithDefaults instantiates a new InferenceServiceUpdate 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 NewInferenceServiceUpdateWithDefaults() *InferenceServiceUpdate {
this := InferenceServiceUpdate{}
var desiredState InferenceServiceState = INFERENCESERVICESTATE_DEPLOYED
this.DesiredState = &desiredState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *InferenceServiceUpdate) 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 *InferenceServiceUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *InferenceServiceUpdate) 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 *InferenceServiceUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *InferenceServiceUpdate) 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 *InferenceServiceUpdate) 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 *InferenceServiceUpdate) 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 *InferenceServiceUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *InferenceServiceUpdate) 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 *InferenceServiceUpdate) 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 *InferenceServiceUpdate) 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 *InferenceServiceUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetModelVersionId returns the ModelVersionId field value if set, zero value otherwise.
func (o *InferenceServiceUpdate) GetModelVersionId() string {
if o == nil || IsNil(o.ModelVersionId) {
var ret string
return ret
}
return *o.ModelVersionId
}
// GetModelVersionIdOk returns a tuple with the ModelVersionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceUpdate) GetModelVersionIdOk() (*string, bool) {
if o == nil || IsNil(o.ModelVersionId) {
return nil, false
}
return o.ModelVersionId, true
}
// HasModelVersionId returns a boolean if a field has been set.
func (o *InferenceServiceUpdate) HasModelVersionId() bool {
if o != nil && !IsNil(o.ModelVersionId) {
return true
}
return false
}
// SetModelVersionId gets a reference to the given string and assigns it to the ModelVersionId field.
func (o *InferenceServiceUpdate) SetModelVersionId(v string) {
o.ModelVersionId = &v
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *InferenceServiceUpdate) GetRuntime() string {
if o == nil || IsNil(o.Runtime) {
var ret string
return ret
}
return *o.Runtime
}
// GetRuntimeOk returns a tuple with the Runtime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceUpdate) GetRuntimeOk() (*string, bool) {
if o == nil || IsNil(o.Runtime) {
return nil, false
}
return o.Runtime, true
}
// HasRuntime returns a boolean if a field has been set.
func (o *InferenceServiceUpdate) HasRuntime() bool {
if o != nil && !IsNil(o.Runtime) {
return true
}
return false
}
// SetRuntime gets a reference to the given string and assigns it to the Runtime field.
func (o *InferenceServiceUpdate) SetRuntime(v string) {
o.Runtime = &v
}
// GetDesiredState returns the DesiredState field value if set, zero value otherwise.
func (o *InferenceServiceUpdate) GetDesiredState() InferenceServiceState {
if o == nil || IsNil(o.DesiredState) {
var ret InferenceServiceState
return ret
}
return *o.DesiredState
}
// GetDesiredStateOk returns a tuple with the DesiredState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceUpdate) GetDesiredStateOk() (*InferenceServiceState, bool) {
if o == nil || IsNil(o.DesiredState) {
return nil, false
}
return o.DesiredState, true
}
// HasDesiredState returns a boolean if a field has been set.
func (o *InferenceServiceUpdate) HasDesiredState() bool {
if o != nil && !IsNil(o.DesiredState) {
return true
}
return false
}
// SetDesiredState gets a reference to the given InferenceServiceState and assigns it to the DesiredState field.
func (o *InferenceServiceUpdate) SetDesiredState(v InferenceServiceState) {
o.DesiredState = &v
}
func (o InferenceServiceUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o InferenceServiceUpdate) 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.ModelVersionId) {
toSerialize["modelVersionId"] = o.ModelVersionId
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
if !IsNil(o.DesiredState) {
toSerialize["desiredState"] = o.DesiredState
}
return toSerialize, nil
}
type NullableInferenceServiceUpdate struct {
value *InferenceServiceUpdate
isSet bool
}
func (v NullableInferenceServiceUpdate) Get() *InferenceServiceUpdate {
return v.value
}
func (v *NullableInferenceServiceUpdate) Set(val *InferenceServiceUpdate) {
v.value = val
v.isSet = true
}
func (v NullableInferenceServiceUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableInferenceServiceUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInferenceServiceUpdate(val *InferenceServiceUpdate) *NullableInferenceServiceUpdate {
return &NullableInferenceServiceUpdate{value: val, isSet: true}
}
func (v NullableInferenceServiceUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInferenceServiceUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 MetadataBoolValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataBoolValue{}
// MetadataBoolValue A bool property value.
type MetadataBoolValue struct {
BoolValue bool `json:"bool_value"`
MetadataType string `json:"metadataType"`
}
type _MetadataBoolValue MetadataBoolValue
// NewMetadataBoolValue instantiates a new MetadataBoolValue 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 NewMetadataBoolValue(boolValue bool, metadataType string) *MetadataBoolValue {
this := MetadataBoolValue{}
this.BoolValue = boolValue
this.MetadataType = metadataType
return &this
}
// NewMetadataBoolValueWithDefaults instantiates a new MetadataBoolValue 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 NewMetadataBoolValueWithDefaults() *MetadataBoolValue {
this := MetadataBoolValue{}
var metadataType string = "MetadataBoolValue"
this.MetadataType = metadataType
return &this
}
// GetBoolValue returns the BoolValue field value
func (o *MetadataBoolValue) GetBoolValue() bool {
if o == nil {
var ret bool
return ret
}
return o.BoolValue
}
// GetBoolValueOk returns a tuple with the BoolValue field value
// and a boolean to check if the value has been set.
func (o *MetadataBoolValue) GetBoolValueOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.BoolValue, true
}
// SetBoolValue sets field value
func (o *MetadataBoolValue) SetBoolValue(v bool) {
o.BoolValue = v
}
// GetMetadataType returns the MetadataType field value
func (o *MetadataBoolValue) GetMetadataType() string {
if o == nil {
var ret string
return ret
}
return o.MetadataType
}
// GetMetadataTypeOk returns a tuple with the MetadataType field value
// and a boolean to check if the value has been set.
func (o *MetadataBoolValue) GetMetadataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetadataType, true
}
// SetMetadataType sets field value
func (o *MetadataBoolValue) SetMetadataType(v string) {
o.MetadataType = v
}
func (o MetadataBoolValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataBoolValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["bool_value"] = o.BoolValue
toSerialize["metadataType"] = o.MetadataType
return toSerialize, nil
}
type NullableMetadataBoolValue struct {
value *MetadataBoolValue
isSet bool
}
func (v NullableMetadataBoolValue) Get() *MetadataBoolValue {
return v.value
}
func (v *NullableMetadataBoolValue) Set(val *MetadataBoolValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataBoolValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataBoolValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataBoolValue(val *MetadataBoolValue) *NullableMetadataBoolValue {
return &NullableMetadataBoolValue{value: val, isSet: true}
}
func (v NullableMetadataBoolValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataBoolValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 MetadataDoubleValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataDoubleValue{}
// MetadataDoubleValue A double property value.
type MetadataDoubleValue struct {
DoubleValue float64 `json:"double_value"`
MetadataType string `json:"metadataType"`
}
type _MetadataDoubleValue MetadataDoubleValue
// NewMetadataDoubleValue instantiates a new MetadataDoubleValue 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 NewMetadataDoubleValue(doubleValue float64, metadataType string) *MetadataDoubleValue {
this := MetadataDoubleValue{}
this.DoubleValue = doubleValue
this.MetadataType = metadataType
return &this
}
// NewMetadataDoubleValueWithDefaults instantiates a new MetadataDoubleValue 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 NewMetadataDoubleValueWithDefaults() *MetadataDoubleValue {
this := MetadataDoubleValue{}
var metadataType string = "MetadataDoubleValue"
this.MetadataType = metadataType
return &this
}
// GetDoubleValue returns the DoubleValue field value
func (o *MetadataDoubleValue) GetDoubleValue() float64 {
if o == nil {
var ret float64
return ret
}
return o.DoubleValue
}
// GetDoubleValueOk returns a tuple with the DoubleValue field value
// and a boolean to check if the value has been set.
func (o *MetadataDoubleValue) GetDoubleValueOk() (*float64, bool) {
if o == nil {
return nil, false
}
return &o.DoubleValue, true
}
// SetDoubleValue sets field value
func (o *MetadataDoubleValue) SetDoubleValue(v float64) {
o.DoubleValue = v
}
// GetMetadataType returns the MetadataType field value
func (o *MetadataDoubleValue) GetMetadataType() string {
if o == nil {
var ret string
return ret
}
return o.MetadataType
}
// GetMetadataTypeOk returns a tuple with the MetadataType field value
// and a boolean to check if the value has been set.
func (o *MetadataDoubleValue) GetMetadataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetadataType, true
}
// SetMetadataType sets field value
func (o *MetadataDoubleValue) SetMetadataType(v string) {
o.MetadataType = v
}
func (o MetadataDoubleValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataDoubleValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["double_value"] = o.DoubleValue
toSerialize["metadataType"] = o.MetadataType
return toSerialize, nil
}
type NullableMetadataDoubleValue struct {
value *MetadataDoubleValue
isSet bool
}
func (v NullableMetadataDoubleValue) Get() *MetadataDoubleValue {
return v.value
}
func (v *NullableMetadataDoubleValue) Set(val *MetadataDoubleValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataDoubleValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataDoubleValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataDoubleValue(val *MetadataDoubleValue) *NullableMetadataDoubleValue {
return &NullableMetadataDoubleValue{value: val, isSet: true}
}
func (v NullableMetadataDoubleValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataDoubleValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 MetadataIntValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataIntValue{}
// MetadataIntValue An integer (int64) property value.
type MetadataIntValue struct {
IntValue string `json:"int_value"`
MetadataType string `json:"metadataType"`
}
type _MetadataIntValue MetadataIntValue
// NewMetadataIntValue instantiates a new MetadataIntValue 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 NewMetadataIntValue(intValue string, metadataType string) *MetadataIntValue {
this := MetadataIntValue{}
this.IntValue = intValue
this.MetadataType = metadataType
return &this
}
// NewMetadataIntValueWithDefaults instantiates a new MetadataIntValue 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 NewMetadataIntValueWithDefaults() *MetadataIntValue {
this := MetadataIntValue{}
var metadataType string = "MetadataIntValue"
this.MetadataType = metadataType
return &this
}
// GetIntValue returns the IntValue field value
func (o *MetadataIntValue) GetIntValue() string {
if o == nil {
var ret string
return ret
}
return o.IntValue
}
// GetIntValueOk returns a tuple with the IntValue field value
// and a boolean to check if the value has been set.
func (o *MetadataIntValue) GetIntValueOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.IntValue, true
}
// SetIntValue sets field value
func (o *MetadataIntValue) SetIntValue(v string) {
o.IntValue = v
}
// GetMetadataType returns the MetadataType field value
func (o *MetadataIntValue) GetMetadataType() string {
if o == nil {
var ret string
return ret
}
return o.MetadataType
}
// GetMetadataTypeOk returns a tuple with the MetadataType field value
// and a boolean to check if the value has been set.
func (o *MetadataIntValue) GetMetadataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetadataType, true
}
// SetMetadataType sets field value
func (o *MetadataIntValue) SetMetadataType(v string) {
o.MetadataType = v
}
func (o MetadataIntValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataIntValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["int_value"] = o.IntValue
toSerialize["metadataType"] = o.MetadataType
return toSerialize, nil
}
type NullableMetadataIntValue struct {
value *MetadataIntValue
isSet bool
}
func (v NullableMetadataIntValue) Get() *MetadataIntValue {
return v.value
}
func (v *NullableMetadataIntValue) Set(val *MetadataIntValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataIntValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataIntValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataIntValue(val *MetadataIntValue) *NullableMetadataIntValue {
return &NullableMetadataIntValue{value: val, isSet: true}
}
func (v NullableMetadataIntValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataIntValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 MetadataProtoValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataProtoValue{}
// MetadataProtoValue A proto property value.
type MetadataProtoValue struct {
// url describing proto value
Type string `json:"type"`
// Base64 encoded bytes for proto value
ProtoValue string `json:"proto_value"`
MetadataType string `json:"metadataType"`
}
type _MetadataProtoValue MetadataProtoValue
// NewMetadataProtoValue instantiates a new MetadataProtoValue 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 NewMetadataProtoValue(type_ string, protoValue string, metadataType string) *MetadataProtoValue {
this := MetadataProtoValue{}
this.Type = type_
this.ProtoValue = protoValue
this.MetadataType = metadataType
return &this
}
// NewMetadataProtoValueWithDefaults instantiates a new MetadataProtoValue 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 NewMetadataProtoValueWithDefaults() *MetadataProtoValue {
this := MetadataProtoValue{}
var metadataType string = "MetadataProtoValue"
this.MetadataType = metadataType
return &this
}
// GetType returns the Type field value
func (o *MetadataProtoValue) GetType() string {
if o == nil {
var ret string
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *MetadataProtoValue) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *MetadataProtoValue) SetType(v string) {
o.Type = v
}
// GetProtoValue returns the ProtoValue field value
func (o *MetadataProtoValue) GetProtoValue() string {
if o == nil {
var ret string
return ret
}
return o.ProtoValue
}
// GetProtoValueOk returns a tuple with the ProtoValue field value
// and a boolean to check if the value has been set.
func (o *MetadataProtoValue) GetProtoValueOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ProtoValue, true
}
// SetProtoValue sets field value
func (o *MetadataProtoValue) SetProtoValue(v string) {
o.ProtoValue = v
}
// GetMetadataType returns the MetadataType field value
func (o *MetadataProtoValue) GetMetadataType() string {
if o == nil {
var ret string
return ret
}
return o.MetadataType
}
// GetMetadataTypeOk returns a tuple with the MetadataType field value
// and a boolean to check if the value has been set.
func (o *MetadataProtoValue) GetMetadataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetadataType, true
}
// SetMetadataType sets field value
func (o *MetadataProtoValue) SetMetadataType(v string) {
o.MetadataType = v
}
func (o MetadataProtoValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataProtoValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["type"] = o.Type
toSerialize["proto_value"] = o.ProtoValue
toSerialize["metadataType"] = o.MetadataType
return toSerialize, nil
}
type NullableMetadataProtoValue struct {
value *MetadataProtoValue
isSet bool
}
func (v NullableMetadataProtoValue) Get() *MetadataProtoValue {
return v.value
}
func (v *NullableMetadataProtoValue) Set(val *MetadataProtoValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataProtoValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataProtoValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataProtoValue(val *MetadataProtoValue) *NullableMetadataProtoValue {
return &NullableMetadataProtoValue{value: val, isSet: true}
}
func (v NullableMetadataProtoValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataProtoValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 MetadataStringValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataStringValue{}
// MetadataStringValue A string property value.
type MetadataStringValue struct {
StringValue string `json:"string_value"`
MetadataType string `json:"metadataType"`
}
type _MetadataStringValue MetadataStringValue
// NewMetadataStringValue instantiates a new MetadataStringValue 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 NewMetadataStringValue(stringValue string, metadataType string) *MetadataStringValue {
this := MetadataStringValue{}
this.StringValue = stringValue
this.MetadataType = metadataType
return &this
}
// NewMetadataStringValueWithDefaults instantiates a new MetadataStringValue 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 NewMetadataStringValueWithDefaults() *MetadataStringValue {
this := MetadataStringValue{}
var metadataType string = "MetadataStringValue"
this.MetadataType = metadataType
return &this
}
// GetStringValue returns the StringValue field value
func (o *MetadataStringValue) GetStringValue() string {
if o == nil {
var ret string
return ret
}
return o.StringValue
}
// GetStringValueOk returns a tuple with the StringValue field value
// and a boolean to check if the value has been set.
func (o *MetadataStringValue) GetStringValueOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.StringValue, true
}
// SetStringValue sets field value
func (o *MetadataStringValue) SetStringValue(v string) {
o.StringValue = v
}
// GetMetadataType returns the MetadataType field value
func (o *MetadataStringValue) GetMetadataType() string {
if o == nil {
var ret string
return ret
}
return o.MetadataType
}
// GetMetadataTypeOk returns a tuple with the MetadataType field value
// and a boolean to check if the value has been set.
func (o *MetadataStringValue) GetMetadataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetadataType, true
}
// SetMetadataType sets field value
func (o *MetadataStringValue) SetMetadataType(v string) {
o.MetadataType = v
}
func (o MetadataStringValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataStringValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["string_value"] = o.StringValue
toSerialize["metadataType"] = o.MetadataType
return toSerialize, nil
}
type NullableMetadataStringValue struct {
value *MetadataStringValue
isSet bool
}
func (v NullableMetadataStringValue) Get() *MetadataStringValue {
return v.value
}
func (v *NullableMetadataStringValue) Set(val *MetadataStringValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataStringValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataStringValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataStringValue(val *MetadataStringValue) *NullableMetadataStringValue {
return &NullableMetadataStringValue{value: val, isSet: true}
}
func (v NullableMetadataStringValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataStringValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 MetadataStructValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataStructValue{}
// MetadataStructValue A struct property value.
type MetadataStructValue struct {
// Base64 encoded bytes for struct value
StructValue string `json:"struct_value"`
MetadataType string `json:"metadataType"`
}
type _MetadataStructValue MetadataStructValue
// NewMetadataStructValue instantiates a new MetadataStructValue 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 NewMetadataStructValue(structValue string, metadataType string) *MetadataStructValue {
this := MetadataStructValue{}
this.StructValue = structValue
this.MetadataType = metadataType
return &this
}
// NewMetadataStructValueWithDefaults instantiates a new MetadataStructValue 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 NewMetadataStructValueWithDefaults() *MetadataStructValue {
this := MetadataStructValue{}
var metadataType string = "MetadataStructValue"
this.MetadataType = metadataType
return &this
}
// GetStructValue returns the StructValue field value
func (o *MetadataStructValue) GetStructValue() string {
if o == nil {
var ret string
return ret
}
return o.StructValue
}
// GetStructValueOk returns a tuple with the StructValue field value
// and a boolean to check if the value has been set.
func (o *MetadataStructValue) GetStructValueOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.StructValue, true
}
// SetStructValue sets field value
func (o *MetadataStructValue) SetStructValue(v string) {
o.StructValue = v
}
// GetMetadataType returns the MetadataType field value
func (o *MetadataStructValue) GetMetadataType() string {
if o == nil {
var ret string
return ret
}
return o.MetadataType
}
// GetMetadataTypeOk returns a tuple with the MetadataType field value
// and a boolean to check if the value has been set.
func (o *MetadataStructValue) GetMetadataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetadataType, true
}
// SetMetadataType sets field value
func (o *MetadataStructValue) SetMetadataType(v string) {
o.MetadataType = v
}
func (o MetadataStructValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataStructValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["struct_value"] = o.StructValue
toSerialize["metadataType"] = o.MetadataType
return toSerialize, nil
}
type NullableMetadataStructValue struct {
value *MetadataStructValue
isSet bool
}
func (v NullableMetadataStructValue) Get() *MetadataStructValue {
return v.value
}
func (v *NullableMetadataStructValue) Set(val *MetadataStructValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataStructValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataStructValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataStructValue(val *MetadataStructValue) *NullableMetadataStructValue {
return &NullableMetadataStructValue{value: val, isSet: true}
}
func (v NullableMetadataStructValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataStructValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// MetadataValue - A value in properties.
type MetadataValue struct {
MetadataBoolValue *MetadataBoolValue
MetadataDoubleValue *MetadataDoubleValue
MetadataIntValue *MetadataIntValue
MetadataProtoValue *MetadataProtoValue
MetadataStringValue *MetadataStringValue
MetadataStructValue *MetadataStructValue
}
// MetadataBoolValueAsMetadataValue is a convenience function that returns MetadataBoolValue wrapped in MetadataValue
func MetadataBoolValueAsMetadataValue(v *MetadataBoolValue) MetadataValue {
return MetadataValue{
MetadataBoolValue: v,
}
}
// MetadataDoubleValueAsMetadataValue is a convenience function that returns MetadataDoubleValue wrapped in MetadataValue
func MetadataDoubleValueAsMetadataValue(v *MetadataDoubleValue) MetadataValue {
return MetadataValue{
MetadataDoubleValue: v,
}
}
// MetadataIntValueAsMetadataValue is a convenience function that returns MetadataIntValue wrapped in MetadataValue
func MetadataIntValueAsMetadataValue(v *MetadataIntValue) MetadataValue {
return MetadataValue{
MetadataIntValue: v,
}
}
// MetadataProtoValueAsMetadataValue is a convenience function that returns MetadataProtoValue wrapped in MetadataValue
func MetadataProtoValueAsMetadataValue(v *MetadataProtoValue) MetadataValue {
return MetadataValue{
MetadataProtoValue: v,
}
}
// MetadataStringValueAsMetadataValue is a convenience function that returns MetadataStringValue wrapped in MetadataValue
func MetadataStringValueAsMetadataValue(v *MetadataStringValue) MetadataValue {
return MetadataValue{
MetadataStringValue: v,
}
}
// MetadataStructValueAsMetadataValue is a convenience function that returns MetadataStructValue wrapped in MetadataValue
func MetadataStructValueAsMetadataValue(v *MetadataStructValue) MetadataValue {
return MetadataValue{
MetadataStructValue: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *MetadataValue) UnmarshalJSON(data []byte) error {
var err error
// use discriminator value to speed up the lookup
var jsonDict map[string]interface{}
err = newStrictDecoder(data).Decode(&jsonDict)
if err != nil {
return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup")
}
// check if the discriminator value is 'MetadataBoolValue'
if jsonDict["metadataType"] == "MetadataBoolValue" {
// try to unmarshal JSON data into MetadataBoolValue
err = json.Unmarshal(data, &dst.MetadataBoolValue)
if err == nil {
return nil // data stored in dst.MetadataBoolValue, return on the first match
} else {
dst.MetadataBoolValue = nil
return fmt.Errorf("failed to unmarshal MetadataValue as MetadataBoolValue: %s", err.Error())
}
}
// check if the discriminator value is 'MetadataDoubleValue'
if jsonDict["metadataType"] == "MetadataDoubleValue" {
// try to unmarshal JSON data into MetadataDoubleValue
err = json.Unmarshal(data, &dst.MetadataDoubleValue)
if err == nil {
return nil // data stored in dst.MetadataDoubleValue, return on the first match
} else {
dst.MetadataDoubleValue = nil
return fmt.Errorf("failed to unmarshal MetadataValue as MetadataDoubleValue: %s", err.Error())
}
}
// check if the discriminator value is 'MetadataIntValue'
if jsonDict["metadataType"] == "MetadataIntValue" {
// try to unmarshal JSON data into MetadataIntValue
err = json.Unmarshal(data, &dst.MetadataIntValue)
if err == nil {
return nil // data stored in dst.MetadataIntValue, return on the first match
} else {
dst.MetadataIntValue = nil
return fmt.Errorf("failed to unmarshal MetadataValue as MetadataIntValue: %s", err.Error())
}
}
// check if the discriminator value is 'MetadataProtoValue'
if jsonDict["metadataType"] == "MetadataProtoValue" {
// try to unmarshal JSON data into MetadataProtoValue
err = json.Unmarshal(data, &dst.MetadataProtoValue)
if err == nil {
return nil // data stored in dst.MetadataProtoValue, return on the first match
} else {
dst.MetadataProtoValue = nil
return fmt.Errorf("failed to unmarshal MetadataValue as MetadataProtoValue: %s", err.Error())
}
}
// check if the discriminator value is 'MetadataStringValue'
if jsonDict["metadataType"] == "MetadataStringValue" {
// try to unmarshal JSON data into MetadataStringValue
err = json.Unmarshal(data, &dst.MetadataStringValue)
if err == nil {
return nil // data stored in dst.MetadataStringValue, return on the first match
} else {
dst.MetadataStringValue = nil
return fmt.Errorf("failed to unmarshal MetadataValue as MetadataStringValue: %s", err.Error())
}
}
// check if the discriminator value is 'MetadataStructValue'
if jsonDict["metadataType"] == "MetadataStructValue" {
// try to unmarshal JSON data into MetadataStructValue
err = json.Unmarshal(data, &dst.MetadataStructValue)
if err == nil {
return nil // data stored in dst.MetadataStructValue, return on the first match
} else {
dst.MetadataStructValue = nil
return fmt.Errorf("failed to unmarshal MetadataValue as MetadataStructValue: %s", err.Error())
}
}
return nil
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src MetadataValue) MarshalJSON() ([]byte, error) {
if src.MetadataBoolValue != nil {
return json.Marshal(&src.MetadataBoolValue)
}
if src.MetadataDoubleValue != nil {
return json.Marshal(&src.MetadataDoubleValue)
}
if src.MetadataIntValue != nil {
return json.Marshal(&src.MetadataIntValue)
}
if src.MetadataProtoValue != nil {
return json.Marshal(&src.MetadataProtoValue)
}
if src.MetadataStringValue != nil {
return json.Marshal(&src.MetadataStringValue)
}
if src.MetadataStructValue != nil {
return json.Marshal(&src.MetadataStructValue)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *MetadataValue) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.MetadataBoolValue != nil {
return obj.MetadataBoolValue
}
if obj.MetadataDoubleValue != nil {
return obj.MetadataDoubleValue
}
if obj.MetadataIntValue != nil {
return obj.MetadataIntValue
}
if obj.MetadataProtoValue != nil {
return obj.MetadataProtoValue
}
if obj.MetadataStringValue != nil {
return obj.MetadataStringValue
}
if obj.MetadataStructValue != nil {
return obj.MetadataStructValue
}
// all schemas are nil
return nil
}
// Get the actual instance value
func (obj MetadataValue) GetActualInstanceValue() interface{} {
if obj.MetadataBoolValue != nil {
return *obj.MetadataBoolValue
}
if obj.MetadataDoubleValue != nil {
return *obj.MetadataDoubleValue
}
if obj.MetadataIntValue != nil {
return *obj.MetadataIntValue
}
if obj.MetadataProtoValue != nil {
return *obj.MetadataProtoValue
}
if obj.MetadataStringValue != nil {
return *obj.MetadataStringValue
}
if obj.MetadataStructValue != nil {
return *obj.MetadataStructValue
}
// all schemas are nil
return nil
}
type NullableMetadataValue struct {
value *MetadataValue
isSet bool
}
func (v NullableMetadataValue) Get() *MetadataValue {
return v.value
}
func (v *NullableMetadataValue) Set(val *MetadataValue) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValue) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValue(val *MetadataValue) *NullableMetadataValue {
return &NullableMetadataValue{value: val, isSet: true}
}
func (v NullableMetadataValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 map[string]MetadataValue{}, 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)
}
/*
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 map[string]MetadataValue{}, 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)
}
/*
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 MetricList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetricList{}
// MetricList List of Metric entities.
type MetricList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
// Array of `Metric` entities.
Items []Metric `json:"items"`
}
type _MetricList MetricList
// NewMetricList instantiates a new MetricList 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 NewMetricList(nextPageToken string, pageSize int32, size int32, items []Metric) *MetricList {
this := MetricList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewMetricListWithDefaults instantiates a new MetricList 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 NewMetricListWithDefaults() *MetricList {
this := MetricList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *MetricList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *MetricList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *MetricList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *MetricList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *MetricList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *MetricList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *MetricList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *MetricList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *MetricList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *MetricList) GetItems() []Metric {
if o == nil {
var ret []Metric
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *MetricList) GetItemsOk() ([]Metric, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *MetricList) SetItems(v []Metric) {
o.Items = v
}
func (o MetricList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetricList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableMetricList struct {
value *MetricList
isSet bool
}
func (v NullableMetricList) Get() *MetricList {
return v.value
}
func (v *NullableMetricList) Set(val *MetricList) {
v.value = val
v.isSet = true
}
func (v NullableMetricList) IsSet() bool {
return v.isSet
}
func (v *NullableMetricList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetricList(val *MetricList) *NullableMetricList {
return &NullableMetricList{value: val, isSet: true}
}
func (v NullableMetricList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetricList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 map[string]MetadataValue{}, 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)
}
/*
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 ModelArtifact type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelArtifact{}
// ModelArtifact An ML model artifact.
type ModelArtifact 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
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"`
// 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"`
}
// NewModelArtifact instantiates a new ModelArtifact 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 NewModelArtifact() *ModelArtifact {
this := ModelArtifact{}
var artifactType string = "model-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewModelArtifactWithDefaults instantiates a new ModelArtifact 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 NewModelArtifactWithDefaults() *ModelArtifact {
this := ModelArtifact{}
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 *ModelArtifact) 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 *ModelArtifact) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ModelArtifact) 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 *ModelArtifact) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetExperimentId returns the ExperimentId field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetExperimentId(v string) {
o.ExperimentId = &v
}
// GetExperimentRunId returns the ExperimentRunId field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetExperimentRunId(v string) {
o.ExperimentRunId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetModelFormatName returns the ModelFormatName field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelFormatName(v string) {
o.ModelFormatName = &v
}
// GetStorageKey returns the StorageKey field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetStorageKey(v string) {
o.StorageKey = &v
}
// GetStoragePath returns the StoragePath field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetStoragePath(v string) {
o.StoragePath = &v
}
// GetModelFormatVersion returns the ModelFormatVersion field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelFormatVersion(v string) {
o.ModelFormatVersion = &v
}
// GetServiceAccountName returns the ServiceAccountName field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetServiceAccountName(v string) {
o.ServiceAccountName = &v
}
// GetModelSourceKind returns the ModelSourceKind field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelSourceKind(v string) {
o.ModelSourceKind = &v
}
// GetModelSourceClass returns the ModelSourceClass field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelSourceClass(v string) {
o.ModelSourceClass = &v
}
// GetModelSourceGroup returns the ModelSourceGroup field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelSourceGroup(v string) {
o.ModelSourceGroup = &v
}
// GetModelSourceId returns the ModelSourceId field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelSourceId(v string) {
o.ModelSourceId = &v
}
// GetModelSourceName returns the ModelSourceName field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetModelSourceName(v string) {
o.ModelSourceName = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetState(v ArtifactState) {
o.State = &v
}
func (o ModelArtifact) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelArtifact) 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.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 NullableModelArtifact struct {
value *ModelArtifact
isSet bool
}
func (v NullableModelArtifact) Get() *ModelArtifact {
return v.value
}
func (v *NullableModelArtifact) Set(val *ModelArtifact) {
v.value = val
v.isSet = true
}
func (v NullableModelArtifact) IsSet() bool {
return v.isSet
}
func (v *NullableModelArtifact) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelArtifact(val *ModelArtifact) *NullableModelArtifact {
return &NullableModelArtifact{value: val, isSet: true}
}
func (v NullableModelArtifact) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelArtifact) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ModelArtifactCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelArtifactCreate{}
// ModelArtifactCreate struct for ModelArtifactCreate
type ModelArtifactCreate 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,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"`
}
// NewModelArtifactCreate instantiates a new ModelArtifactCreate 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 NewModelArtifactCreate() *ModelArtifactCreate {
this := ModelArtifactCreate{}
var artifactType string = "model-artifact"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewModelArtifactCreateWithDefaults instantiates a new ModelArtifactCreate 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 NewModelArtifactCreateWithDefaults() *ModelArtifactCreate {
this := ModelArtifactCreate{}
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 *ModelArtifactCreate) 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 *ModelArtifactCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetName(v string) {
o.Name = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetModelFormatName returns the ModelFormatName field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelFormatName(v string) {
o.ModelFormatName = &v
}
// GetStorageKey returns the StorageKey field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetStorageKey(v string) {
o.StorageKey = &v
}
// GetStoragePath returns the StoragePath field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetStoragePath(v string) {
o.StoragePath = &v
}
// GetModelFormatVersion returns the ModelFormatVersion field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelFormatVersion(v string) {
o.ModelFormatVersion = &v
}
// GetServiceAccountName returns the ServiceAccountName field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetServiceAccountName(v string) {
o.ServiceAccountName = &v
}
// GetModelSourceKind returns the ModelSourceKind field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelSourceKind(v string) {
o.ModelSourceKind = &v
}
// GetModelSourceClass returns the ModelSourceClass field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelSourceClass(v string) {
o.ModelSourceClass = &v
}
// GetModelSourceGroup returns the ModelSourceGroup field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelSourceGroup(v string) {
o.ModelSourceGroup = &v
}
// GetModelSourceId returns the ModelSourceId field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelSourceId(v string) {
o.ModelSourceId = &v
}
// GetModelSourceName returns the ModelSourceName field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetModelSourceName(v string) {
o.ModelSourceName = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetState(v ArtifactState) {
o.State = &v
}
func (o ModelArtifactCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelArtifactCreate) 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.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 NullableModelArtifactCreate struct {
value *ModelArtifactCreate
isSet bool
}
func (v NullableModelArtifactCreate) Get() *ModelArtifactCreate {
return v.value
}
func (v *NullableModelArtifactCreate) Set(val *ModelArtifactCreate) {
v.value = val
v.isSet = true
}
func (v NullableModelArtifactCreate) IsSet() bool {
return v.isSet
}
func (v *NullableModelArtifactCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelArtifactCreate(val *ModelArtifactCreate) *NullableModelArtifactCreate {
return &NullableModelArtifactCreate{value: val, isSet: true}
}
func (v NullableModelArtifactCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelArtifactCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ModelArtifactList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelArtifactList{}
// ModelArtifactList List of ModelArtifact entities.
type ModelArtifactList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
// Array of `ModelArtifact` entities.
Items []ModelArtifact `json:"items"`
}
type _ModelArtifactList ModelArtifactList
// NewModelArtifactList instantiates a new ModelArtifactList 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 NewModelArtifactList(nextPageToken string, pageSize int32, size int32, items []ModelArtifact) *ModelArtifactList {
this := ModelArtifactList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewModelArtifactListWithDefaults instantiates a new ModelArtifactList 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 NewModelArtifactListWithDefaults() *ModelArtifactList {
this := ModelArtifactList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ModelArtifactList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ModelArtifactList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ModelArtifactList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ModelArtifactList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ModelArtifactList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ModelArtifactList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ModelArtifactList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ModelArtifactList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ModelArtifactList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ModelArtifactList) GetItems() []ModelArtifact {
if o == nil {
var ret []ModelArtifact
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ModelArtifactList) GetItemsOk() ([]ModelArtifact, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ModelArtifactList) SetItems(v []ModelArtifact) {
o.Items = v
}
func (o ModelArtifactList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelArtifactList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableModelArtifactList struct {
value *ModelArtifactList
isSet bool
}
func (v NullableModelArtifactList) Get() *ModelArtifactList {
return v.value
}
func (v *NullableModelArtifactList) Set(val *ModelArtifactList) {
v.value = val
v.isSet = true
}
func (v NullableModelArtifactList) IsSet() bool {
return v.isSet
}
func (v *NullableModelArtifactList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelArtifactList(val *ModelArtifactList) *NullableModelArtifactList {
return &NullableModelArtifactList{value: val, isSet: true}
}
func (v NullableModelArtifactList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelArtifactList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 map[string]MetadataValue{}, 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)
}
/*
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 ModelVersion type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelVersion{}
// ModelVersion Represents a ModelVersion belonging to a RegisteredModel.
type ModelVersion 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name string `json:"name"`
State *ModelVersionState `json:"state,omitempty"`
// Name of the author.
Author *string `json:"author,omitempty"`
// ID of the `RegisteredModel` to which this version belongs.
RegisteredModelId string `json:"registeredModelId"`
// 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"`
}
type _ModelVersion ModelVersion
// NewModelVersion instantiates a new ModelVersion 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 NewModelVersion(name string, registeredModelId string) *ModelVersion {
this := ModelVersion{}
this.Name = name
var state ModelVersionState = MODELVERSIONSTATE_LIVE
this.State = &state
this.RegisteredModelId = registeredModelId
return &this
}
// NewModelVersionWithDefaults instantiates a new ModelVersion 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 NewModelVersionWithDefaults() *ModelVersion {
this := ModelVersion{}
var state ModelVersionState = MODELVERSIONSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ModelVersion) 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 *ModelVersion) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *ModelVersion) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ModelVersion) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ModelVersion) SetName(v string) {
o.Name = v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ModelVersion) GetState() ModelVersionState {
if o == nil || IsNil(o.State) {
var ret ModelVersionState
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 *ModelVersion) GetStateOk() (*ModelVersionState, 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 *ModelVersion) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ModelVersionState and assigns it to the State field.
func (o *ModelVersion) SetState(v ModelVersionState) {
o.State = &v
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *ModelVersion) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelVersion) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *ModelVersion) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *ModelVersion) SetAuthor(v string) {
o.Author = &v
}
// GetRegisteredModelId returns the RegisteredModelId field value
func (o *ModelVersion) GetRegisteredModelId() string {
if o == nil {
var ret string
return ret
}
return o.RegisteredModelId
}
// GetRegisteredModelIdOk returns a tuple with the RegisteredModelId field value
// and a boolean to check if the value has been set.
func (o *ModelVersion) GetRegisteredModelIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RegisteredModelId, true
}
// SetRegisteredModelId sets field value
func (o *ModelVersion) SetRegisteredModelId(v string) {
o.RegisteredModelId = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
func (o ModelVersion) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelVersion) 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
}
toSerialize["name"] = o.Name
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
toSerialize["registeredModelId"] = o.RegisteredModelId
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.CreateTimeSinceEpoch) {
toSerialize["createTimeSinceEpoch"] = o.CreateTimeSinceEpoch
}
if !IsNil(o.LastUpdateTimeSinceEpoch) {
toSerialize["lastUpdateTimeSinceEpoch"] = o.LastUpdateTimeSinceEpoch
}
return toSerialize, nil
}
type NullableModelVersion struct {
value *ModelVersion
isSet bool
}
func (v NullableModelVersion) Get() *ModelVersion {
return v.value
}
func (v *NullableModelVersion) Set(val *ModelVersion) {
v.value = val
v.isSet = true
}
func (v NullableModelVersion) IsSet() bool {
return v.isSet
}
func (v *NullableModelVersion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelVersion(val *ModelVersion) *NullableModelVersion {
return &NullableModelVersion{value: val, isSet: true}
}
func (v NullableModelVersion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelVersion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ModelVersionCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelVersionCreate{}
// ModelVersionCreate Represents a ModelVersion belonging to a RegisteredModel.
type ModelVersionCreate 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 client provided name of the model's version. It must be unique among all the ModelVersions of the same type within a Model Registry instance and cannot be changed once set.
Name string `json:"name"`
State *ModelVersionState `json:"state,omitempty"`
// Name of the author.
Author *string `json:"author,omitempty"`
// ID of the `RegisteredModel` to which this version belongs.
RegisteredModelId string `json:"registeredModelId"`
}
type _ModelVersionCreate ModelVersionCreate
// NewModelVersionCreate instantiates a new ModelVersionCreate 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 NewModelVersionCreate(name string, registeredModelId string) *ModelVersionCreate {
this := ModelVersionCreate{}
this.Name = name
var state ModelVersionState = MODELVERSIONSTATE_LIVE
this.State = &state
this.RegisteredModelId = registeredModelId
return &this
}
// NewModelVersionCreateWithDefaults instantiates a new ModelVersionCreate 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 NewModelVersionCreateWithDefaults() *ModelVersionCreate {
this := ModelVersionCreate{}
var state ModelVersionState = MODELVERSIONSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ModelVersionCreate) 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 *ModelVersionCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ModelVersionCreate) 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 *ModelVersionCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelVersionCreate) 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 *ModelVersionCreate) 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 *ModelVersionCreate) 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 *ModelVersionCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ModelVersionCreate) 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 *ModelVersionCreate) 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 *ModelVersionCreate) 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 *ModelVersionCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *ModelVersionCreate) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ModelVersionCreate) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ModelVersionCreate) SetName(v string) {
o.Name = v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ModelVersionCreate) GetState() ModelVersionState {
if o == nil || IsNil(o.State) {
var ret ModelVersionState
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 *ModelVersionCreate) GetStateOk() (*ModelVersionState, 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 *ModelVersionCreate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ModelVersionState and assigns it to the State field.
func (o *ModelVersionCreate) SetState(v ModelVersionState) {
o.State = &v
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *ModelVersionCreate) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelVersionCreate) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *ModelVersionCreate) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *ModelVersionCreate) SetAuthor(v string) {
o.Author = &v
}
// GetRegisteredModelId returns the RegisteredModelId field value
func (o *ModelVersionCreate) GetRegisteredModelId() string {
if o == nil {
var ret string
return ret
}
return o.RegisteredModelId
}
// GetRegisteredModelIdOk returns a tuple with the RegisteredModelId field value
// and a boolean to check if the value has been set.
func (o *ModelVersionCreate) GetRegisteredModelIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RegisteredModelId, true
}
// SetRegisteredModelId sets field value
func (o *ModelVersionCreate) SetRegisteredModelId(v string) {
o.RegisteredModelId = v
}
func (o ModelVersionCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelVersionCreate) 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
}
toSerialize["name"] = o.Name
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
toSerialize["registeredModelId"] = o.RegisteredModelId
return toSerialize, nil
}
type NullableModelVersionCreate struct {
value *ModelVersionCreate
isSet bool
}
func (v NullableModelVersionCreate) Get() *ModelVersionCreate {
return v.value
}
func (v *NullableModelVersionCreate) Set(val *ModelVersionCreate) {
v.value = val
v.isSet = true
}
func (v NullableModelVersionCreate) IsSet() bool {
return v.isSet
}
func (v *NullableModelVersionCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelVersionCreate(val *ModelVersionCreate) *NullableModelVersionCreate {
return &NullableModelVersionCreate{value: val, isSet: true}
}
func (v NullableModelVersionCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelVersionCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ModelVersionList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelVersionList{}
// ModelVersionList List of ModelVersion entities.
type ModelVersionList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
// Array of `ModelVersion` entities.
Items []ModelVersion `json:"items"`
}
type _ModelVersionList ModelVersionList
// NewModelVersionList instantiates a new ModelVersionList 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 NewModelVersionList(nextPageToken string, pageSize int32, size int32, items []ModelVersion) *ModelVersionList {
this := ModelVersionList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewModelVersionListWithDefaults instantiates a new ModelVersionList 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 NewModelVersionListWithDefaults() *ModelVersionList {
this := ModelVersionList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ModelVersionList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ModelVersionList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ModelVersionList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ModelVersionList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ModelVersionList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ModelVersionList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ModelVersionList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ModelVersionList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ModelVersionList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ModelVersionList) GetItems() []ModelVersion {
if o == nil {
var ret []ModelVersion
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ModelVersionList) GetItemsOk() ([]ModelVersion, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ModelVersionList) SetItems(v []ModelVersion) {
o.Items = v
}
func (o ModelVersionList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelVersionList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableModelVersionList struct {
value *ModelVersionList
isSet bool
}
func (v NullableModelVersionList) Get() *ModelVersionList {
return v.value
}
func (v *NullableModelVersionList) Set(val *ModelVersionList) {
v.value = val
v.isSet = true
}
func (v NullableModelVersionList) IsSet() bool {
return v.isSet
}
func (v *NullableModelVersionList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelVersionList(val *ModelVersionList) *NullableModelVersionList {
return &NullableModelVersionList{value: val, isSet: true}
}
func (v NullableModelVersionList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelVersionList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ModelVersionState - LIVE: A state indicating that the `ModelVersion` exists - ARCHIVED: A state indicating that the `ModelVersion` has been archived.
type ModelVersionState string
// List of ModelVersionState
const (
MODELVERSIONSTATE_LIVE ModelVersionState = "LIVE"
MODELVERSIONSTATE_ARCHIVED ModelVersionState = "ARCHIVED"
)
// All allowed values of ModelVersionState enum
var AllowedModelVersionStateEnumValues = []ModelVersionState{
"LIVE",
"ARCHIVED",
}
func (v *ModelVersionState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ModelVersionState(value)
for _, existing := range AllowedModelVersionStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ModelVersionState", value)
}
// NewModelVersionStateFromValue returns a pointer to a valid ModelVersionState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewModelVersionStateFromValue(v string) (*ModelVersionState, error) {
ev := ModelVersionState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ModelVersionState: valid values are %v", v, AllowedModelVersionStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ModelVersionState) IsValid() bool {
for _, existing := range AllowedModelVersionStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ModelVersionState value
func (v ModelVersionState) Ptr() *ModelVersionState {
return &v
}
type NullableModelVersionState struct {
value *ModelVersionState
isSet bool
}
func (v NullableModelVersionState) Get() *ModelVersionState {
return v.value
}
func (v *NullableModelVersionState) Set(val *ModelVersionState) {
v.value = val
v.isSet = true
}
func (v NullableModelVersionState) IsSet() bool {
return v.isSet
}
func (v *NullableModelVersionState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelVersionState(val *ModelVersionState) *NullableModelVersionState {
return &NullableModelVersionState{value: val, isSet: true}
}
func (v NullableModelVersionState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelVersionState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ModelVersionUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelVersionUpdate{}
// ModelVersionUpdate Represents a ModelVersion belonging to a RegisteredModel.
type ModelVersionUpdate 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"`
State *ModelVersionState `json:"state,omitempty"`
// Name of the author.
Author *string `json:"author,omitempty"`
}
// NewModelVersionUpdate instantiates a new ModelVersionUpdate 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 NewModelVersionUpdate() *ModelVersionUpdate {
this := ModelVersionUpdate{}
var state ModelVersionState = MODELVERSIONSTATE_LIVE
this.State = &state
return &this
}
// NewModelVersionUpdateWithDefaults instantiates a new ModelVersionUpdate 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 NewModelVersionUpdateWithDefaults() *ModelVersionUpdate {
this := ModelVersionUpdate{}
var state ModelVersionState = MODELVERSIONSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ModelVersionUpdate) 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 *ModelVersionUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ModelVersionUpdate) 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 *ModelVersionUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelVersionUpdate) 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 *ModelVersionUpdate) 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 *ModelVersionUpdate) 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 *ModelVersionUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ModelVersionUpdate) 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 *ModelVersionUpdate) 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 *ModelVersionUpdate) 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 *ModelVersionUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ModelVersionUpdate) GetState() ModelVersionState {
if o == nil || IsNil(o.State) {
var ret ModelVersionState
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 *ModelVersionUpdate) GetStateOk() (*ModelVersionState, 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 *ModelVersionUpdate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given ModelVersionState and assigns it to the State field.
func (o *ModelVersionUpdate) SetState(v ModelVersionState) {
o.State = &v
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *ModelVersionUpdate) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelVersionUpdate) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *ModelVersionUpdate) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *ModelVersionUpdate) SetAuthor(v string) {
o.Author = &v
}
func (o ModelVersionUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelVersionUpdate) 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.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
return toSerialize, nil
}
type NullableModelVersionUpdate struct {
value *ModelVersionUpdate
isSet bool
}
func (v NullableModelVersionUpdate) Get() *ModelVersionUpdate {
return v.value
}
func (v *NullableModelVersionUpdate) Set(val *ModelVersionUpdate) {
v.value = val
v.isSet = true
}
func (v NullableModelVersionUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableModelVersionUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelVersionUpdate(val *ModelVersionUpdate) *NullableModelVersionUpdate {
return &NullableModelVersionUpdate{value: val, isSet: true}
}
func (v NullableModelVersionUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelVersionUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// OrderByField Supported fields for ordering result entities.
type OrderByField string
// List of OrderByField
const (
ORDERBYFIELD_CREATE_TIME OrderByField = "CREATE_TIME"
ORDERBYFIELD_LAST_UPDATE_TIME OrderByField = "LAST_UPDATE_TIME"
ORDERBYFIELD_ID OrderByField = "ID"
)
// All allowed values of OrderByField enum
var AllowedOrderByFieldEnumValues = []OrderByField{
"CREATE_TIME",
"LAST_UPDATE_TIME",
"ID",
}
func (v *OrderByField) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := OrderByField(value)
for _, existing := range AllowedOrderByFieldEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid OrderByField", value)
}
// NewOrderByFieldFromValue returns a pointer to a valid OrderByField
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewOrderByFieldFromValue(v string) (*OrderByField, error) {
ev := OrderByField(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for OrderByField: valid values are %v", v, AllowedOrderByFieldEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v OrderByField) IsValid() bool {
for _, existing := range AllowedOrderByFieldEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to OrderByField value
func (v OrderByField) Ptr() *OrderByField {
return &v
}
type NullableOrderByField struct {
value *OrderByField
isSet bool
}
func (v NullableOrderByField) Get() *OrderByField {
return v.value
}
func (v *NullableOrderByField) Set(val *OrderByField) {
v.value = val
v.isSet = true
}
func (v NullableOrderByField) IsSet() bool {
return v.isSet
}
func (v *NullableOrderByField) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOrderByField(val *OrderByField) *NullableOrderByField {
return &NullableOrderByField{value: val, isSet: true}
}
func (v NullableOrderByField) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOrderByField) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 Parameter type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Parameter{}
// Parameter A parameter representing a configuration parameter used in model training or execution.
type Parameter 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 parameter (e.g., \"learning_rate\", \"batch_size\", \"epochs\").
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 value of the parameter.
Value *string `json:"value,omitempty"`
ParameterType *ParameterType `json:"parameterType,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewParameter instantiates a new Parameter 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 NewParameter() *Parameter {
this := Parameter{}
var artifactType string = "parameter"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewParameterWithDefaults instantiates a new Parameter 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 NewParameterWithDefaults() *Parameter {
this := Parameter{}
var artifactType string = "parameter"
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 *Parameter) 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 *Parameter) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *Parameter) 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 *Parameter) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetExperimentId returns the ExperimentId field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetExperimentId(v string) {
o.ExperimentId = &v
}
// GetExperimentRunId returns the ExperimentRunId field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetExperimentRunId(v string) {
o.ExperimentRunId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *Parameter) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
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 *Parameter) GetValueOk() (*string, 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 *Parameter) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *Parameter) SetValue(v string) {
o.Value = &v
}
// GetParameterType returns the ParameterType field value if set, zero value otherwise.
func (o *Parameter) GetParameterType() ParameterType {
if o == nil || IsNil(o.ParameterType) {
var ret ParameterType
return ret
}
return *o.ParameterType
}
// GetParameterTypeOk returns a tuple with the ParameterType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Parameter) GetParameterTypeOk() (*ParameterType, bool) {
if o == nil || IsNil(o.ParameterType) {
return nil, false
}
return o.ParameterType, true
}
// HasParameterType returns a boolean if a field has been set.
func (o *Parameter) HasParameterType() bool {
if o != nil && !IsNil(o.ParameterType) {
return true
}
return false
}
// SetParameterType gets a reference to the given ParameterType and assigns it to the ParameterType field.
func (o *Parameter) SetParameterType(v ParameterType) {
o.ParameterType = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Parameter) 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 *Parameter) 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 *Parameter) 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 *Parameter) SetState(v ArtifactState) {
o.State = &v
}
func (o Parameter) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Parameter) 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.ParameterType) {
toSerialize["parameterType"] = o.ParameterType
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableParameter struct {
value *Parameter
isSet bool
}
func (v NullableParameter) Get() *Parameter {
return v.value
}
func (v *NullableParameter) Set(val *Parameter) {
v.value = val
v.isSet = true
}
func (v NullableParameter) IsSet() bool {
return v.isSet
}
func (v *NullableParameter) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableParameter(val *Parameter) *NullableParameter {
return &NullableParameter{value: val, isSet: true}
}
func (v NullableParameter) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableParameter) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ParameterCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ParameterCreate{}
// ParameterCreate A parameter to be created.
type ParameterCreate 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 parameter (e.g., \"learning_rate\", \"batch_size\", \"epochs\").
Name *string `json:"name,omitempty"`
ArtifactType *string `json:"artifactType,omitempty"`
// The value of the parameter.
Value *string `json:"value,omitempty"`
ParameterType *ParameterType `json:"parameterType,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewParameterCreate instantiates a new ParameterCreate 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 NewParameterCreate() *ParameterCreate {
this := ParameterCreate{}
var artifactType string = "parameter"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewParameterCreateWithDefaults instantiates a new ParameterCreate 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 NewParameterCreateWithDefaults() *ParameterCreate {
this := ParameterCreate{}
var artifactType string = "parameter"
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 *ParameterCreate) 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 *ParameterCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ParameterCreate) 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 *ParameterCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) SetName(v string) {
o.Name = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *ParameterCreate) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
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 *ParameterCreate) GetValueOk() (*string, 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 *ParameterCreate) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *ParameterCreate) SetValue(v string) {
o.Value = &v
}
// GetParameterType returns the ParameterType field value if set, zero value otherwise.
func (o *ParameterCreate) GetParameterType() ParameterType {
if o == nil || IsNil(o.ParameterType) {
var ret ParameterType
return ret
}
return *o.ParameterType
}
// GetParameterTypeOk returns a tuple with the ParameterType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ParameterCreate) GetParameterTypeOk() (*ParameterType, bool) {
if o == nil || IsNil(o.ParameterType) {
return nil, false
}
return o.ParameterType, true
}
// HasParameterType returns a boolean if a field has been set.
func (o *ParameterCreate) HasParameterType() bool {
if o != nil && !IsNil(o.ParameterType) {
return true
}
return false
}
// SetParameterType gets a reference to the given ParameterType and assigns it to the ParameterType field.
func (o *ParameterCreate) SetParameterType(v ParameterType) {
o.ParameterType = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) 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 *ParameterCreate) SetState(v ArtifactState) {
o.State = &v
}
func (o ParameterCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ParameterCreate) 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.ParameterType) {
toSerialize["parameterType"] = o.ParameterType
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableParameterCreate struct {
value *ParameterCreate
isSet bool
}
func (v NullableParameterCreate) Get() *ParameterCreate {
return v.value
}
func (v *NullableParameterCreate) Set(val *ParameterCreate) {
v.value = val
v.isSet = true
}
func (v NullableParameterCreate) IsSet() bool {
return v.isSet
}
func (v *NullableParameterCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableParameterCreate(val *ParameterCreate) *NullableParameterCreate {
return &NullableParameterCreate{value: val, isSet: true}
}
func (v NullableParameterCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableParameterCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// ParameterType The data type of the parameter (e.g., \"string\", \"number\", \"boolean\", \"object\").
type ParameterType string
// List of ParameterType
const (
PARAMETERTYPE_STRING ParameterType = "string"
PARAMETERTYPE_NUMBER ParameterType = "number"
PARAMETERTYPE_BOOLEAN ParameterType = "boolean"
PARAMETERTYPE_OBJECT ParameterType = "object"
)
// All allowed values of ParameterType enum
var AllowedParameterTypeEnumValues = []ParameterType{
"string",
"number",
"boolean",
"object",
}
func (v *ParameterType) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ParameterType(value)
for _, existing := range AllowedParameterTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ParameterType", value)
}
// NewParameterTypeFromValue returns a pointer to a valid ParameterType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewParameterTypeFromValue(v string) (*ParameterType, error) {
ev := ParameterType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ParameterType: valid values are %v", v, AllowedParameterTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ParameterType) IsValid() bool {
for _, existing := range AllowedParameterTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ParameterType value
func (v ParameterType) Ptr() *ParameterType {
return &v
}
type NullableParameterType struct {
value *ParameterType
isSet bool
}
func (v NullableParameterType) Get() *ParameterType {
return v.value
}
func (v *NullableParameterType) Set(val *ParameterType) {
v.value = val
v.isSet = true
}
func (v NullableParameterType) IsSet() bool {
return v.isSet
}
func (v *NullableParameterType) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableParameterType(val *ParameterType) *NullableParameterType {
return &NullableParameterType{value: val, isSet: true}
}
func (v NullableParameterType) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableParameterType) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ParameterUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ParameterUpdate{}
// ParameterUpdate A parameter to be updated.
type ParameterUpdate 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 value of the parameter.
Value *string `json:"value,omitempty"`
ParameterType *ParameterType `json:"parameterType,omitempty"`
State *ArtifactState `json:"state,omitempty"`
}
// NewParameterUpdate instantiates a new ParameterUpdate 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 NewParameterUpdate() *ParameterUpdate {
this := ParameterUpdate{}
var artifactType string = "parameter"
this.ArtifactType = &artifactType
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewParameterUpdateWithDefaults instantiates a new ParameterUpdate 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 NewParameterUpdateWithDefaults() *ParameterUpdate {
this := ParameterUpdate{}
var artifactType string = "parameter"
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 *ParameterUpdate) 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 *ParameterUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ParameterUpdate) 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 *ParameterUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetArtifactType returns the ArtifactType field value if set, zero value otherwise.
func (o *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) SetArtifactType(v string) {
o.ArtifactType = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *ParameterUpdate) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
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 *ParameterUpdate) GetValueOk() (*string, 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 *ParameterUpdate) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *ParameterUpdate) SetValue(v string) {
o.Value = &v
}
// GetParameterType returns the ParameterType field value if set, zero value otherwise.
func (o *ParameterUpdate) GetParameterType() ParameterType {
if o == nil || IsNil(o.ParameterType) {
var ret ParameterType
return ret
}
return *o.ParameterType
}
// GetParameterTypeOk returns a tuple with the ParameterType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ParameterUpdate) GetParameterTypeOk() (*ParameterType, bool) {
if o == nil || IsNil(o.ParameterType) {
return nil, false
}
return o.ParameterType, true
}
// HasParameterType returns a boolean if a field has been set.
func (o *ParameterUpdate) HasParameterType() bool {
if o != nil && !IsNil(o.ParameterType) {
return true
}
return false
}
// SetParameterType gets a reference to the given ParameterType and assigns it to the ParameterType field.
func (o *ParameterUpdate) SetParameterType(v ParameterType) {
o.ParameterType = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) 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 *ParameterUpdate) SetState(v ArtifactState) {
o.State = &v
}
func (o ParameterUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ParameterUpdate) 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.ParameterType) {
toSerialize["parameterType"] = o.ParameterType
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableParameterUpdate struct {
value *ParameterUpdate
isSet bool
}
func (v NullableParameterUpdate) Get() *ParameterUpdate {
return v.value
}
func (v *NullableParameterUpdate) Set(val *ParameterUpdate) {
v.value = val
v.isSet = true
}
func (v NullableParameterUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableParameterUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableParameterUpdate(val *ParameterUpdate) *NullableParameterUpdate {
return &NullableParameterUpdate{value: val, isSet: true}
}
func (v NullableParameterUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableParameterUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 RegisteredModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RegisteredModel{}
// RegisteredModel A registered model in model registry. A registered model has ModelVersion children.
type RegisteredModel struct {
// User provided custom properties which are not defined by its type.
CustomProperties map[string]MetadataValue `json:"customProperties,omitempty"`
// Human-readable description of the model.
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 client provided name of the model. It must be unique among all the RegisteredModels of the same type within a Model Registry instance and cannot be changed once set.
Name string `json:"name"`
// 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"`
// Model documentation in Markdown.
Readme *string `json:"readme,omitempty"`
// Maturity level of the model.
Maturity *string `json:"maturity,omitempty"`
// List of supported languages (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
Language []string `json:"language,omitempty"`
// List of tasks the model is designed for.
Tasks []string `json:"tasks,omitempty"`
// Name of the organization or entity that provides the model.
Provider *string `json:"provider,omitempty"`
// URL to the model's logo. A [data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data) is recommended.
Logo *string `json:"logo,omitempty"`
// Short name of the model's license.
License *string `json:"license,omitempty"`
// URL to the license text.
LicenseLink *string `json:"licenseLink,omitempty"`
LibraryName *string `json:"libraryName,omitempty"`
Owner *string `json:"owner,omitempty"`
State *RegisteredModelState `json:"state,omitempty"`
}
type _RegisteredModel RegisteredModel
// NewRegisteredModel instantiates a new RegisteredModel 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 NewRegisteredModel(name string) *RegisteredModel {
this := RegisteredModel{}
this.Name = name
var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE
this.State = &state
return &this
}
// NewRegisteredModelWithDefaults instantiates a new RegisteredModel 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 NewRegisteredModelWithDefaults() *RegisteredModel {
this := RegisteredModel{}
var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *RegisteredModel) 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 *RegisteredModel) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *RegisteredModel) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *RegisteredModel) SetName(v string) {
o.Name = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetReadme returns the Readme field value if set, zero value otherwise.
func (o *RegisteredModel) GetReadme() string {
if o == nil || IsNil(o.Readme) {
var ret string
return ret
}
return *o.Readme
}
// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetReadmeOk() (*string, bool) {
if o == nil || IsNil(o.Readme) {
return nil, false
}
return o.Readme, true
}
// HasReadme returns a boolean if a field has been set.
func (o *RegisteredModel) HasReadme() bool {
if o != nil && !IsNil(o.Readme) {
return true
}
return false
}
// SetReadme gets a reference to the given string and assigns it to the Readme field.
func (o *RegisteredModel) SetReadme(v string) {
o.Readme = &v
}
// GetMaturity returns the Maturity field value if set, zero value otherwise.
func (o *RegisteredModel) GetMaturity() string {
if o == nil || IsNil(o.Maturity) {
var ret string
return ret
}
return *o.Maturity
}
// GetMaturityOk returns a tuple with the Maturity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetMaturityOk() (*string, bool) {
if o == nil || IsNil(o.Maturity) {
return nil, false
}
return o.Maturity, true
}
// HasMaturity returns a boolean if a field has been set.
func (o *RegisteredModel) HasMaturity() bool {
if o != nil && !IsNil(o.Maturity) {
return true
}
return false
}
// SetMaturity gets a reference to the given string and assigns it to the Maturity field.
func (o *RegisteredModel) SetMaturity(v string) {
o.Maturity = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *RegisteredModel) GetLanguage() []string {
if o == nil || IsNil(o.Language) {
var ret []string
return ret
}
return o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetLanguageOk() ([]string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *RegisteredModel) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given []string and assigns it to the Language field.
func (o *RegisteredModel) SetLanguage(v []string) {
o.Language = v
}
// GetTasks returns the Tasks field value if set, zero value otherwise.
func (o *RegisteredModel) GetTasks() []string {
if o == nil || IsNil(o.Tasks) {
var ret []string
return ret
}
return o.Tasks
}
// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetTasksOk() ([]string, bool) {
if o == nil || IsNil(o.Tasks) {
return nil, false
}
return o.Tasks, true
}
// HasTasks returns a boolean if a field has been set.
func (o *RegisteredModel) HasTasks() bool {
if o != nil && !IsNil(o.Tasks) {
return true
}
return false
}
// SetTasks gets a reference to the given []string and assigns it to the Tasks field.
func (o *RegisteredModel) SetTasks(v []string) {
o.Tasks = v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *RegisteredModel) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *RegisteredModel) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *RegisteredModel) SetProvider(v string) {
o.Provider = &v
}
// GetLogo returns the Logo field value if set, zero value otherwise.
func (o *RegisteredModel) GetLogo() string {
if o == nil || IsNil(o.Logo) {
var ret string
return ret
}
return *o.Logo
}
// GetLogoOk returns a tuple with the Logo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetLogoOk() (*string, bool) {
if o == nil || IsNil(o.Logo) {
return nil, false
}
return o.Logo, true
}
// HasLogo returns a boolean if a field has been set.
func (o *RegisteredModel) HasLogo() bool {
if o != nil && !IsNil(o.Logo) {
return true
}
return false
}
// SetLogo gets a reference to the given string and assigns it to the Logo field.
func (o *RegisteredModel) SetLogo(v string) {
o.Logo = &v
}
// GetLicense returns the License field value if set, zero value otherwise.
func (o *RegisteredModel) GetLicense() string {
if o == nil || IsNil(o.License) {
var ret string
return ret
}
return *o.License
}
// GetLicenseOk returns a tuple with the License field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetLicenseOk() (*string, bool) {
if o == nil || IsNil(o.License) {
return nil, false
}
return o.License, true
}
// HasLicense returns a boolean if a field has been set.
func (o *RegisteredModel) HasLicense() bool {
if o != nil && !IsNil(o.License) {
return true
}
return false
}
// SetLicense gets a reference to the given string and assigns it to the License field.
func (o *RegisteredModel) SetLicense(v string) {
o.License = &v
}
// GetLicenseLink returns the LicenseLink field value if set, zero value otherwise.
func (o *RegisteredModel) GetLicenseLink() string {
if o == nil || IsNil(o.LicenseLink) {
var ret string
return ret
}
return *o.LicenseLink
}
// GetLicenseLinkOk returns a tuple with the LicenseLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetLicenseLinkOk() (*string, bool) {
if o == nil || IsNil(o.LicenseLink) {
return nil, false
}
return o.LicenseLink, true
}
// HasLicenseLink returns a boolean if a field has been set.
func (o *RegisteredModel) HasLicenseLink() bool {
if o != nil && !IsNil(o.LicenseLink) {
return true
}
return false
}
// SetLicenseLink gets a reference to the given string and assigns it to the LicenseLink field.
func (o *RegisteredModel) SetLicenseLink(v string) {
o.LicenseLink = &v
}
// GetLibraryName returns the LibraryName field value if set, zero value otherwise.
func (o *RegisteredModel) GetLibraryName() string {
if o == nil || IsNil(o.LibraryName) {
var ret string
return ret
}
return *o.LibraryName
}
// GetLibraryNameOk returns a tuple with the LibraryName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetLibraryNameOk() (*string, bool) {
if o == nil || IsNil(o.LibraryName) {
return nil, false
}
return o.LibraryName, true
}
// HasLibraryName returns a boolean if a field has been set.
func (o *RegisteredModel) HasLibraryName() bool {
if o != nil && !IsNil(o.LibraryName) {
return true
}
return false
}
// SetLibraryName gets a reference to the given string and assigns it to the LibraryName field.
func (o *RegisteredModel) SetLibraryName(v string) {
o.LibraryName = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *RegisteredModel) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModel) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *RegisteredModel) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *RegisteredModel) SetOwner(v string) {
o.Owner = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *RegisteredModel) GetState() RegisteredModelState {
if o == nil || IsNil(o.State) {
var ret RegisteredModelState
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 *RegisteredModel) GetStateOk() (*RegisteredModelState, 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 *RegisteredModel) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given RegisteredModelState and assigns it to the State field.
func (o *RegisteredModel) SetState(v RegisteredModelState) {
o.State = &v
}
func (o RegisteredModel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RegisteredModel) 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
}
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.Readme) {
toSerialize["readme"] = o.Readme
}
if !IsNil(o.Maturity) {
toSerialize["maturity"] = o.Maturity
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Tasks) {
toSerialize["tasks"] = o.Tasks
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Logo) {
toSerialize["logo"] = o.Logo
}
if !IsNil(o.License) {
toSerialize["license"] = o.License
}
if !IsNil(o.LicenseLink) {
toSerialize["licenseLink"] = o.LicenseLink
}
if !IsNil(o.LibraryName) {
toSerialize["libraryName"] = o.LibraryName
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableRegisteredModel struct {
value *RegisteredModel
isSet bool
}
func (v NullableRegisteredModel) Get() *RegisteredModel {
return v.value
}
func (v *NullableRegisteredModel) Set(val *RegisteredModel) {
v.value = val
v.isSet = true
}
func (v NullableRegisteredModel) IsSet() bool {
return v.isSet
}
func (v *NullableRegisteredModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRegisteredModel(val *RegisteredModel) *NullableRegisteredModel {
return &NullableRegisteredModel{value: val, isSet: true}
}
func (v NullableRegisteredModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRegisteredModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 RegisteredModelCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RegisteredModelCreate{}
// RegisteredModelCreate A registered model in model registry. A registered model has ModelVersion children.
type RegisteredModelCreate struct {
// User provided custom properties which are not defined by its type.
CustomProperties map[string]MetadataValue `json:"customProperties,omitempty"`
// Human-readable description of the model.
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 client provided name of the model. It must be unique among all the RegisteredModels of the same type within a Model Registry instance and cannot be changed once set.
Name string `json:"name"`
// Model documentation in Markdown.
Readme *string `json:"readme,omitempty"`
// Maturity level of the model.
Maturity *string `json:"maturity,omitempty"`
// List of supported languages (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
Language []string `json:"language,omitempty"`
// List of tasks the model is designed for.
Tasks []string `json:"tasks,omitempty"`
// Name of the organization or entity that provides the model.
Provider *string `json:"provider,omitempty"`
// URL to the model's logo. A [data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data) is recommended.
Logo *string `json:"logo,omitempty"`
// Short name of the model's license.
License *string `json:"license,omitempty"`
// URL to the license text.
LicenseLink *string `json:"licenseLink,omitempty"`
LibraryName *string `json:"libraryName,omitempty"`
Owner *string `json:"owner,omitempty"`
State *RegisteredModelState `json:"state,omitempty"`
}
type _RegisteredModelCreate RegisteredModelCreate
// NewRegisteredModelCreate instantiates a new RegisteredModelCreate 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 NewRegisteredModelCreate(name string) *RegisteredModelCreate {
this := RegisteredModelCreate{}
this.Name = name
var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE
this.State = &state
return &this
}
// NewRegisteredModelCreateWithDefaults instantiates a new RegisteredModelCreate 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 NewRegisteredModelCreateWithDefaults() *RegisteredModelCreate {
this := RegisteredModelCreate{}
var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *RegisteredModelCreate) 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 *RegisteredModelCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *RegisteredModelCreate) 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 *RegisteredModelCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *RegisteredModelCreate) 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 *RegisteredModelCreate) 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 *RegisteredModelCreate) 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 *RegisteredModelCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *RegisteredModelCreate) 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 *RegisteredModelCreate) 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 *RegisteredModelCreate) 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 *RegisteredModelCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *RegisteredModelCreate) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *RegisteredModelCreate) SetName(v string) {
o.Name = v
}
// GetReadme returns the Readme field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetReadme() string {
if o == nil || IsNil(o.Readme) {
var ret string
return ret
}
return *o.Readme
}
// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetReadmeOk() (*string, bool) {
if o == nil || IsNil(o.Readme) {
return nil, false
}
return o.Readme, true
}
// HasReadme returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasReadme() bool {
if o != nil && !IsNil(o.Readme) {
return true
}
return false
}
// SetReadme gets a reference to the given string and assigns it to the Readme field.
func (o *RegisteredModelCreate) SetReadme(v string) {
o.Readme = &v
}
// GetMaturity returns the Maturity field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetMaturity() string {
if o == nil || IsNil(o.Maturity) {
var ret string
return ret
}
return *o.Maturity
}
// GetMaturityOk returns a tuple with the Maturity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetMaturityOk() (*string, bool) {
if o == nil || IsNil(o.Maturity) {
return nil, false
}
return o.Maturity, true
}
// HasMaturity returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasMaturity() bool {
if o != nil && !IsNil(o.Maturity) {
return true
}
return false
}
// SetMaturity gets a reference to the given string and assigns it to the Maturity field.
func (o *RegisteredModelCreate) SetMaturity(v string) {
o.Maturity = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetLanguage() []string {
if o == nil || IsNil(o.Language) {
var ret []string
return ret
}
return o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetLanguageOk() ([]string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given []string and assigns it to the Language field.
func (o *RegisteredModelCreate) SetLanguage(v []string) {
o.Language = v
}
// GetTasks returns the Tasks field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetTasks() []string {
if o == nil || IsNil(o.Tasks) {
var ret []string
return ret
}
return o.Tasks
}
// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetTasksOk() ([]string, bool) {
if o == nil || IsNil(o.Tasks) {
return nil, false
}
return o.Tasks, true
}
// HasTasks returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasTasks() bool {
if o != nil && !IsNil(o.Tasks) {
return true
}
return false
}
// SetTasks gets a reference to the given []string and assigns it to the Tasks field.
func (o *RegisteredModelCreate) SetTasks(v []string) {
o.Tasks = v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *RegisteredModelCreate) SetProvider(v string) {
o.Provider = &v
}
// GetLogo returns the Logo field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetLogo() string {
if o == nil || IsNil(o.Logo) {
var ret string
return ret
}
return *o.Logo
}
// GetLogoOk returns a tuple with the Logo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetLogoOk() (*string, bool) {
if o == nil || IsNil(o.Logo) {
return nil, false
}
return o.Logo, true
}
// HasLogo returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasLogo() bool {
if o != nil && !IsNil(o.Logo) {
return true
}
return false
}
// SetLogo gets a reference to the given string and assigns it to the Logo field.
func (o *RegisteredModelCreate) SetLogo(v string) {
o.Logo = &v
}
// GetLicense returns the License field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetLicense() string {
if o == nil || IsNil(o.License) {
var ret string
return ret
}
return *o.License
}
// GetLicenseOk returns a tuple with the License field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetLicenseOk() (*string, bool) {
if o == nil || IsNil(o.License) {
return nil, false
}
return o.License, true
}
// HasLicense returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasLicense() bool {
if o != nil && !IsNil(o.License) {
return true
}
return false
}
// SetLicense gets a reference to the given string and assigns it to the License field.
func (o *RegisteredModelCreate) SetLicense(v string) {
o.License = &v
}
// GetLicenseLink returns the LicenseLink field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetLicenseLink() string {
if o == nil || IsNil(o.LicenseLink) {
var ret string
return ret
}
return *o.LicenseLink
}
// GetLicenseLinkOk returns a tuple with the LicenseLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetLicenseLinkOk() (*string, bool) {
if o == nil || IsNil(o.LicenseLink) {
return nil, false
}
return o.LicenseLink, true
}
// HasLicenseLink returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasLicenseLink() bool {
if o != nil && !IsNil(o.LicenseLink) {
return true
}
return false
}
// SetLicenseLink gets a reference to the given string and assigns it to the LicenseLink field.
func (o *RegisteredModelCreate) SetLicenseLink(v string) {
o.LicenseLink = &v
}
// GetLibraryName returns the LibraryName field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetLibraryName() string {
if o == nil || IsNil(o.LibraryName) {
var ret string
return ret
}
return *o.LibraryName
}
// GetLibraryNameOk returns a tuple with the LibraryName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetLibraryNameOk() (*string, bool) {
if o == nil || IsNil(o.LibraryName) {
return nil, false
}
return o.LibraryName, true
}
// HasLibraryName returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasLibraryName() bool {
if o != nil && !IsNil(o.LibraryName) {
return true
}
return false
}
// SetLibraryName gets a reference to the given string and assigns it to the LibraryName field.
func (o *RegisteredModelCreate) SetLibraryName(v string) {
o.LibraryName = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelCreate) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *RegisteredModelCreate) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *RegisteredModelCreate) SetOwner(v string) {
o.Owner = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *RegisteredModelCreate) GetState() RegisteredModelState {
if o == nil || IsNil(o.State) {
var ret RegisteredModelState
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 *RegisteredModelCreate) GetStateOk() (*RegisteredModelState, 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 *RegisteredModelCreate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given RegisteredModelState and assigns it to the State field.
func (o *RegisteredModelCreate) SetState(v RegisteredModelState) {
o.State = &v
}
func (o RegisteredModelCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RegisteredModelCreate) 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
}
toSerialize["name"] = o.Name
if !IsNil(o.Readme) {
toSerialize["readme"] = o.Readme
}
if !IsNil(o.Maturity) {
toSerialize["maturity"] = o.Maturity
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Tasks) {
toSerialize["tasks"] = o.Tasks
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Logo) {
toSerialize["logo"] = o.Logo
}
if !IsNil(o.License) {
toSerialize["license"] = o.License
}
if !IsNil(o.LicenseLink) {
toSerialize["licenseLink"] = o.LicenseLink
}
if !IsNil(o.LibraryName) {
toSerialize["libraryName"] = o.LibraryName
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableRegisteredModelCreate struct {
value *RegisteredModelCreate
isSet bool
}
func (v NullableRegisteredModelCreate) Get() *RegisteredModelCreate {
return v.value
}
func (v *NullableRegisteredModelCreate) Set(val *RegisteredModelCreate) {
v.value = val
v.isSet = true
}
func (v NullableRegisteredModelCreate) IsSet() bool {
return v.isSet
}
func (v *NullableRegisteredModelCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRegisteredModelCreate(val *RegisteredModelCreate) *NullableRegisteredModelCreate {
return &NullableRegisteredModelCreate{value: val, isSet: true}
}
func (v NullableRegisteredModelCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRegisteredModelCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 RegisteredModelList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RegisteredModelList{}
// RegisteredModelList List of RegisteredModels.
type RegisteredModelList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
//
Items []RegisteredModel `json:"items"`
}
type _RegisteredModelList RegisteredModelList
// NewRegisteredModelList instantiates a new RegisteredModelList 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 NewRegisteredModelList(nextPageToken string, pageSize int32, size int32, items []RegisteredModel) *RegisteredModelList {
this := RegisteredModelList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewRegisteredModelListWithDefaults instantiates a new RegisteredModelList 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 NewRegisteredModelListWithDefaults() *RegisteredModelList {
this := RegisteredModelList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *RegisteredModelList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *RegisteredModelList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *RegisteredModelList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *RegisteredModelList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *RegisteredModelList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *RegisteredModelList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *RegisteredModelList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *RegisteredModelList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *RegisteredModelList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *RegisteredModelList) GetItems() []RegisteredModel {
if o == nil {
var ret []RegisteredModel
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *RegisteredModelList) GetItemsOk() ([]RegisteredModel, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *RegisteredModelList) SetItems(v []RegisteredModel) {
o.Items = v
}
func (o RegisteredModelList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RegisteredModelList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableRegisteredModelList struct {
value *RegisteredModelList
isSet bool
}
func (v NullableRegisteredModelList) Get() *RegisteredModelList {
return v.value
}
func (v *NullableRegisteredModelList) Set(val *RegisteredModelList) {
v.value = val
v.isSet = true
}
func (v NullableRegisteredModelList) IsSet() bool {
return v.isSet
}
func (v *NullableRegisteredModelList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRegisteredModelList(val *RegisteredModelList) *NullableRegisteredModelList {
return &NullableRegisteredModelList{value: val, isSet: true}
}
func (v NullableRegisteredModelList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRegisteredModelList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// RegisteredModelState - LIVE: A state indicating that the `RegisteredModel` exists - ARCHIVED: A state indicating that the `RegisteredModel` has been archived.
type RegisteredModelState string
// List of RegisteredModelState
const (
REGISTEREDMODELSTATE_LIVE RegisteredModelState = "LIVE"
REGISTEREDMODELSTATE_ARCHIVED RegisteredModelState = "ARCHIVED"
)
// All allowed values of RegisteredModelState enum
var AllowedRegisteredModelStateEnumValues = []RegisteredModelState{
"LIVE",
"ARCHIVED",
}
func (v *RegisteredModelState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := RegisteredModelState(value)
for _, existing := range AllowedRegisteredModelStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid RegisteredModelState", value)
}
// NewRegisteredModelStateFromValue returns a pointer to a valid RegisteredModelState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewRegisteredModelStateFromValue(v string) (*RegisteredModelState, error) {
ev := RegisteredModelState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for RegisteredModelState: valid values are %v", v, AllowedRegisteredModelStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v RegisteredModelState) IsValid() bool {
for _, existing := range AllowedRegisteredModelStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to RegisteredModelState value
func (v RegisteredModelState) Ptr() *RegisteredModelState {
return &v
}
type NullableRegisteredModelState struct {
value *RegisteredModelState
isSet bool
}
func (v NullableRegisteredModelState) Get() *RegisteredModelState {
return v.value
}
func (v *NullableRegisteredModelState) Set(val *RegisteredModelState) {
v.value = val
v.isSet = true
}
func (v NullableRegisteredModelState) IsSet() bool {
return v.isSet
}
func (v *NullableRegisteredModelState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRegisteredModelState(val *RegisteredModelState) *NullableRegisteredModelState {
return &NullableRegisteredModelState{value: val, isSet: true}
}
func (v NullableRegisteredModelState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRegisteredModelState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 RegisteredModelUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RegisteredModelUpdate{}
// RegisteredModelUpdate A registered model in model registry. A registered model has ModelVersion children.
type RegisteredModelUpdate struct {
// User provided custom properties which are not defined by its type.
CustomProperties map[string]MetadataValue `json:"customProperties,omitempty"`
// Human-readable description of the model.
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"`
// Model documentation in Markdown.
Readme *string `json:"readme,omitempty"`
// Maturity level of the model.
Maturity *string `json:"maturity,omitempty"`
// List of supported languages (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
Language []string `json:"language,omitempty"`
// List of tasks the model is designed for.
Tasks []string `json:"tasks,omitempty"`
// Name of the organization or entity that provides the model.
Provider *string `json:"provider,omitempty"`
// URL to the model's logo. A [data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data) is recommended.
Logo *string `json:"logo,omitempty"`
// Short name of the model's license.
License *string `json:"license,omitempty"`
// URL to the license text.
LicenseLink *string `json:"licenseLink,omitempty"`
LibraryName *string `json:"libraryName,omitempty"`
Owner *string `json:"owner,omitempty"`
State *RegisteredModelState `json:"state,omitempty"`
}
// NewRegisteredModelUpdate instantiates a new RegisteredModelUpdate 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 NewRegisteredModelUpdate() *RegisteredModelUpdate {
this := RegisteredModelUpdate{}
var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE
this.State = &state
return &this
}
// NewRegisteredModelUpdateWithDefaults instantiates a new RegisteredModelUpdate 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 NewRegisteredModelUpdateWithDefaults() *RegisteredModelUpdate {
this := RegisteredModelUpdate{}
var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) 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 *RegisteredModelUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) 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 *RegisteredModelUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) 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 *RegisteredModelUpdate) 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 *RegisteredModelUpdate) 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 *RegisteredModelUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) 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 *RegisteredModelUpdate) 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 *RegisteredModelUpdate) 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 *RegisteredModelUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetReadme returns the Readme field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetReadme() string {
if o == nil || IsNil(o.Readme) {
var ret string
return ret
}
return *o.Readme
}
// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetReadmeOk() (*string, bool) {
if o == nil || IsNil(o.Readme) {
return nil, false
}
return o.Readme, true
}
// HasReadme returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasReadme() bool {
if o != nil && !IsNil(o.Readme) {
return true
}
return false
}
// SetReadme gets a reference to the given string and assigns it to the Readme field.
func (o *RegisteredModelUpdate) SetReadme(v string) {
o.Readme = &v
}
// GetMaturity returns the Maturity field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetMaturity() string {
if o == nil || IsNil(o.Maturity) {
var ret string
return ret
}
return *o.Maturity
}
// GetMaturityOk returns a tuple with the Maturity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetMaturityOk() (*string, bool) {
if o == nil || IsNil(o.Maturity) {
return nil, false
}
return o.Maturity, true
}
// HasMaturity returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasMaturity() bool {
if o != nil && !IsNil(o.Maturity) {
return true
}
return false
}
// SetMaturity gets a reference to the given string and assigns it to the Maturity field.
func (o *RegisteredModelUpdate) SetMaturity(v string) {
o.Maturity = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetLanguage() []string {
if o == nil || IsNil(o.Language) {
var ret []string
return ret
}
return o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetLanguageOk() ([]string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given []string and assigns it to the Language field.
func (o *RegisteredModelUpdate) SetLanguage(v []string) {
o.Language = v
}
// GetTasks returns the Tasks field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetTasks() []string {
if o == nil || IsNil(o.Tasks) {
var ret []string
return ret
}
return o.Tasks
}
// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetTasksOk() ([]string, bool) {
if o == nil || IsNil(o.Tasks) {
return nil, false
}
return o.Tasks, true
}
// HasTasks returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasTasks() bool {
if o != nil && !IsNil(o.Tasks) {
return true
}
return false
}
// SetTasks gets a reference to the given []string and assigns it to the Tasks field.
func (o *RegisteredModelUpdate) SetTasks(v []string) {
o.Tasks = v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *RegisteredModelUpdate) SetProvider(v string) {
o.Provider = &v
}
// GetLogo returns the Logo field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetLogo() string {
if o == nil || IsNil(o.Logo) {
var ret string
return ret
}
return *o.Logo
}
// GetLogoOk returns a tuple with the Logo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetLogoOk() (*string, bool) {
if o == nil || IsNil(o.Logo) {
return nil, false
}
return o.Logo, true
}
// HasLogo returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasLogo() bool {
if o != nil && !IsNil(o.Logo) {
return true
}
return false
}
// SetLogo gets a reference to the given string and assigns it to the Logo field.
func (o *RegisteredModelUpdate) SetLogo(v string) {
o.Logo = &v
}
// GetLicense returns the License field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetLicense() string {
if o == nil || IsNil(o.License) {
var ret string
return ret
}
return *o.License
}
// GetLicenseOk returns a tuple with the License field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetLicenseOk() (*string, bool) {
if o == nil || IsNil(o.License) {
return nil, false
}
return o.License, true
}
// HasLicense returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasLicense() bool {
if o != nil && !IsNil(o.License) {
return true
}
return false
}
// SetLicense gets a reference to the given string and assigns it to the License field.
func (o *RegisteredModelUpdate) SetLicense(v string) {
o.License = &v
}
// GetLicenseLink returns the LicenseLink field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetLicenseLink() string {
if o == nil || IsNil(o.LicenseLink) {
var ret string
return ret
}
return *o.LicenseLink
}
// GetLicenseLinkOk returns a tuple with the LicenseLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetLicenseLinkOk() (*string, bool) {
if o == nil || IsNil(o.LicenseLink) {
return nil, false
}
return o.LicenseLink, true
}
// HasLicenseLink returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasLicenseLink() bool {
if o != nil && !IsNil(o.LicenseLink) {
return true
}
return false
}
// SetLicenseLink gets a reference to the given string and assigns it to the LicenseLink field.
func (o *RegisteredModelUpdate) SetLicenseLink(v string) {
o.LicenseLink = &v
}
// GetLibraryName returns the LibraryName field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetLibraryName() string {
if o == nil || IsNil(o.LibraryName) {
var ret string
return ret
}
return *o.LibraryName
}
// GetLibraryNameOk returns a tuple with the LibraryName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetLibraryNameOk() (*string, bool) {
if o == nil || IsNil(o.LibraryName) {
return nil, false
}
return o.LibraryName, true
}
// HasLibraryName returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasLibraryName() bool {
if o != nil && !IsNil(o.LibraryName) {
return true
}
return false
}
// SetLibraryName gets a reference to the given string and assigns it to the LibraryName field.
func (o *RegisteredModelUpdate) SetLibraryName(v string) {
o.LibraryName = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelUpdate) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *RegisteredModelUpdate) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *RegisteredModelUpdate) SetOwner(v string) {
o.Owner = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *RegisteredModelUpdate) GetState() RegisteredModelState {
if o == nil || IsNil(o.State) {
var ret RegisteredModelState
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 *RegisteredModelUpdate) GetStateOk() (*RegisteredModelState, 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 *RegisteredModelUpdate) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given RegisteredModelState and assigns it to the State field.
func (o *RegisteredModelUpdate) SetState(v RegisteredModelState) {
o.State = &v
}
func (o RegisteredModelUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RegisteredModelUpdate) 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.Readme) {
toSerialize["readme"] = o.Readme
}
if !IsNil(o.Maturity) {
toSerialize["maturity"] = o.Maturity
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Tasks) {
toSerialize["tasks"] = o.Tasks
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Logo) {
toSerialize["logo"] = o.Logo
}
if !IsNil(o.License) {
toSerialize["license"] = o.License
}
if !IsNil(o.LicenseLink) {
toSerialize["licenseLink"] = o.LicenseLink
}
if !IsNil(o.LibraryName) {
toSerialize["libraryName"] = o.LibraryName
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableRegisteredModelUpdate struct {
value *RegisteredModelUpdate
isSet bool
}
func (v NullableRegisteredModelUpdate) Get() *RegisteredModelUpdate {
return v.value
}
func (v *NullableRegisteredModelUpdate) Set(val *RegisteredModelUpdate) {
v.value = val
v.isSet = true
}
func (v NullableRegisteredModelUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableRegisteredModelUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRegisteredModelUpdate(val *RegisteredModelUpdate) *NullableRegisteredModelUpdate {
return &NullableRegisteredModelUpdate{value: val, isSet: true}
}
func (v NullableRegisteredModelUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRegisteredModelUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServeModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServeModel{}
// ServeModel An ML model serving action.
type ServeModel 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
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"`
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// ID of the `ModelVersion` that was served in `InferenceService`.
ModelVersionId string `json:"modelVersionId"`
}
type _ServeModel ServeModel
// NewServeModel instantiates a new ServeModel 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 NewServeModel(modelVersionId string) *ServeModel {
this := ServeModel{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
this.ModelVersionId = modelVersionId
return &this
}
// NewServeModelWithDefaults instantiates a new ServeModel 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 NewServeModelWithDefaults() *ServeModel {
this := ServeModel{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ServeModel) 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 *ServeModel) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) 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 *ServeModel) 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 *ServeModel) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) 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 *ServeModel) 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 *ServeModel) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) 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 *ServeModel) 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 *ServeModel) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) 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 *ServeModel) 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 *ServeModel) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) 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 *ServeModel) 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 *ServeModel) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ServeModel) 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 *ServeModel) 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 *ServeModel) 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 *ServeModel) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
// GetLastKnownState returns the LastKnownState field value if set, zero value otherwise.
func (o *ServeModel) GetLastKnownState() ExecutionState {
if o == nil || IsNil(o.LastKnownState) {
var ret ExecutionState
return ret
}
return *o.LastKnownState
}
// GetLastKnownStateOk returns a tuple with the LastKnownState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServeModel) GetLastKnownStateOk() (*ExecutionState, bool) {
if o == nil || IsNil(o.LastKnownState) {
return nil, false
}
return o.LastKnownState, true
}
// HasLastKnownState returns a boolean if a field has been set.
func (o *ServeModel) HasLastKnownState() bool {
if o != nil && !IsNil(o.LastKnownState) {
return true
}
return false
}
// SetLastKnownState gets a reference to the given ExecutionState and assigns it to the LastKnownState field.
func (o *ServeModel) SetLastKnownState(v ExecutionState) {
o.LastKnownState = &v
}
// GetModelVersionId returns the ModelVersionId field value
func (o *ServeModel) GetModelVersionId() string {
if o == nil {
var ret string
return ret
}
return o.ModelVersionId
}
// GetModelVersionIdOk returns a tuple with the ModelVersionId field value
// and a boolean to check if the value has been set.
func (o *ServeModel) GetModelVersionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ModelVersionId, true
}
// SetModelVersionId sets field value
func (o *ServeModel) SetModelVersionId(v string) {
o.ModelVersionId = v
}
func (o ServeModel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServeModel) 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.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
toSerialize["modelVersionId"] = o.ModelVersionId
return toSerialize, nil
}
type NullableServeModel struct {
value *ServeModel
isSet bool
}
func (v NullableServeModel) Get() *ServeModel {
return v.value
}
func (v *NullableServeModel) Set(val *ServeModel) {
v.value = val
v.isSet = true
}
func (v NullableServeModel) IsSet() bool {
return v.isSet
}
func (v *NullableServeModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServeModel(val *ServeModel) *NullableServeModel {
return &NullableServeModel{value: val, isSet: true}
}
func (v NullableServeModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServeModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServeModelCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServeModelCreate{}
// ServeModelCreate An ML model serving action.
type ServeModelCreate 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 client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.
Name *string `json:"name,omitempty"`
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// ID of the `ModelVersion` that was served in `InferenceService`.
ModelVersionId string `json:"modelVersionId"`
}
type _ServeModelCreate ServeModelCreate
// NewServeModelCreate instantiates a new ServeModelCreate 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 NewServeModelCreate(modelVersionId string) *ServeModelCreate {
this := ServeModelCreate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
this.ModelVersionId = modelVersionId
return &this
}
// NewServeModelCreateWithDefaults instantiates a new ServeModelCreate 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 NewServeModelCreateWithDefaults() *ServeModelCreate {
this := ServeModelCreate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ServeModelCreate) 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 *ServeModelCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ServeModelCreate) 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 *ServeModelCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ServeModelCreate) 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 *ServeModelCreate) 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 *ServeModelCreate) 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 *ServeModelCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ServeModelCreate) 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 *ServeModelCreate) 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 *ServeModelCreate) 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 *ServeModelCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ServeModelCreate) 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 *ServeModelCreate) 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 *ServeModelCreate) 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 *ServeModelCreate) SetName(v string) {
o.Name = &v
}
// GetLastKnownState returns the LastKnownState field value if set, zero value otherwise.
func (o *ServeModelCreate) GetLastKnownState() ExecutionState {
if o == nil || IsNil(o.LastKnownState) {
var ret ExecutionState
return ret
}
return *o.LastKnownState
}
// GetLastKnownStateOk returns a tuple with the LastKnownState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServeModelCreate) GetLastKnownStateOk() (*ExecutionState, bool) {
if o == nil || IsNil(o.LastKnownState) {
return nil, false
}
return o.LastKnownState, true
}
// HasLastKnownState returns a boolean if a field has been set.
func (o *ServeModelCreate) HasLastKnownState() bool {
if o != nil && !IsNil(o.LastKnownState) {
return true
}
return false
}
// SetLastKnownState gets a reference to the given ExecutionState and assigns it to the LastKnownState field.
func (o *ServeModelCreate) SetLastKnownState(v ExecutionState) {
o.LastKnownState = &v
}
// GetModelVersionId returns the ModelVersionId field value
func (o *ServeModelCreate) GetModelVersionId() string {
if o == nil {
var ret string
return ret
}
return o.ModelVersionId
}
// GetModelVersionIdOk returns a tuple with the ModelVersionId field value
// and a boolean to check if the value has been set.
func (o *ServeModelCreate) GetModelVersionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ModelVersionId, true
}
// SetModelVersionId sets field value
func (o *ServeModelCreate) SetModelVersionId(v string) {
o.ModelVersionId = v
}
func (o ServeModelCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServeModelCreate) 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.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
toSerialize["modelVersionId"] = o.ModelVersionId
return toSerialize, nil
}
type NullableServeModelCreate struct {
value *ServeModelCreate
isSet bool
}
func (v NullableServeModelCreate) Get() *ServeModelCreate {
return v.value
}
func (v *NullableServeModelCreate) Set(val *ServeModelCreate) {
v.value = val
v.isSet = true
}
func (v NullableServeModelCreate) IsSet() bool {
return v.isSet
}
func (v *NullableServeModelCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServeModelCreate(val *ServeModelCreate) *NullableServeModelCreate {
return &NullableServeModelCreate{value: val, isSet: true}
}
func (v NullableServeModelCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServeModelCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServeModelList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServeModelList{}
// ServeModelList List of ServeModel entities.
type ServeModelList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
// Array of `ModelArtifact` entities.
Items []ServeModel `json:"items"`
}
type _ServeModelList ServeModelList
// NewServeModelList instantiates a new ServeModelList 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 NewServeModelList(nextPageToken string, pageSize int32, size int32, items []ServeModel) *ServeModelList {
this := ServeModelList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewServeModelListWithDefaults instantiates a new ServeModelList 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 NewServeModelListWithDefaults() *ServeModelList {
this := ServeModelList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ServeModelList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ServeModelList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ServeModelList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ServeModelList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ServeModelList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ServeModelList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ServeModelList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ServeModelList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ServeModelList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ServeModelList) GetItems() []ServeModel {
if o == nil {
var ret []ServeModel
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ServeModelList) GetItemsOk() ([]ServeModel, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ServeModelList) SetItems(v []ServeModel) {
o.Items = v
}
func (o ServeModelList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServeModelList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableServeModelList struct {
value *ServeModelList
isSet bool
}
func (v NullableServeModelList) Get() *ServeModelList {
return v.value
}
func (v *NullableServeModelList) Set(val *ServeModelList) {
v.value = val
v.isSet = true
}
func (v NullableServeModelList) IsSet() bool {
return v.isSet
}
func (v *NullableServeModelList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServeModelList(val *ServeModelList) *NullableServeModelList {
return &NullableServeModelList{value: val, isSet: true}
}
func (v NullableServeModelList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServeModelList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServeModelUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServeModelUpdate{}
// ServeModelUpdate An ML model serving action.
type ServeModelUpdate 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"`
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
}
// NewServeModelUpdate instantiates a new ServeModelUpdate 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 NewServeModelUpdate() *ServeModelUpdate {
this := ServeModelUpdate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// NewServeModelUpdateWithDefaults instantiates a new ServeModelUpdate 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 NewServeModelUpdateWithDefaults() *ServeModelUpdate {
this := ServeModelUpdate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ServeModelUpdate) 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 *ServeModelUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ServeModelUpdate) 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 *ServeModelUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ServeModelUpdate) 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 *ServeModelUpdate) 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 *ServeModelUpdate) 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 *ServeModelUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ServeModelUpdate) 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 *ServeModelUpdate) 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 *ServeModelUpdate) 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 *ServeModelUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetLastKnownState returns the LastKnownState field value if set, zero value otherwise.
func (o *ServeModelUpdate) GetLastKnownState() ExecutionState {
if o == nil || IsNil(o.LastKnownState) {
var ret ExecutionState
return ret
}
return *o.LastKnownState
}
// GetLastKnownStateOk returns a tuple with the LastKnownState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServeModelUpdate) GetLastKnownStateOk() (*ExecutionState, bool) {
if o == nil || IsNil(o.LastKnownState) {
return nil, false
}
return o.LastKnownState, true
}
// HasLastKnownState returns a boolean if a field has been set.
func (o *ServeModelUpdate) HasLastKnownState() bool {
if o != nil && !IsNil(o.LastKnownState) {
return true
}
return false
}
// SetLastKnownState gets a reference to the given ExecutionState and assigns it to the LastKnownState field.
func (o *ServeModelUpdate) SetLastKnownState(v ExecutionState) {
o.LastKnownState = &v
}
func (o ServeModelUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServeModelUpdate) 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.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
return toSerialize, nil
}
type NullableServeModelUpdate struct {
value *ServeModelUpdate
isSet bool
}
func (v NullableServeModelUpdate) Get() *ServeModelUpdate {
return v.value
}
func (v *NullableServeModelUpdate) Set(val *ServeModelUpdate) {
v.value = val
v.isSet = true
}
func (v NullableServeModelUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableServeModelUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServeModelUpdate(val *ServeModelUpdate) *NullableServeModelUpdate {
return &NullableServeModelUpdate{value: val, isSet: true}
}
func (v NullableServeModelUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServeModelUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServingEnvironment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServingEnvironment{}
// ServingEnvironment A Model Serving environment for serving `RegisteredModels`.
type ServingEnvironment 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 of the ServingEnvironment.
Name string `json:"name"`
// 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"`
}
type _ServingEnvironment ServingEnvironment
// NewServingEnvironment instantiates a new ServingEnvironment 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 NewServingEnvironment(name string) *ServingEnvironment {
this := ServingEnvironment{}
this.Name = name
return &this
}
// NewServingEnvironmentWithDefaults instantiates a new ServingEnvironment 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 NewServingEnvironmentWithDefaults() *ServingEnvironment {
this := ServingEnvironment{}
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ServingEnvironment) 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 *ServingEnvironment) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *ServingEnvironment) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ServingEnvironment) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ServingEnvironment) SetName(v string) {
o.Name = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
func (o ServingEnvironment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServingEnvironment) 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
}
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
}
return toSerialize, nil
}
type NullableServingEnvironment struct {
value *ServingEnvironment
isSet bool
}
func (v NullableServingEnvironment) Get() *ServingEnvironment {
return v.value
}
func (v *NullableServingEnvironment) Set(val *ServingEnvironment) {
v.value = val
v.isSet = true
}
func (v NullableServingEnvironment) IsSet() bool {
return v.isSet
}
func (v *NullableServingEnvironment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServingEnvironment(val *ServingEnvironment) *NullableServingEnvironment {
return &NullableServingEnvironment{value: val, isSet: true}
}
func (v NullableServingEnvironment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServingEnvironment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServingEnvironmentCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServingEnvironmentCreate{}
// ServingEnvironmentCreate A Model Serving environment for serving `RegisteredModels`.
type ServingEnvironmentCreate 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 of the ServingEnvironment.
Name string `json:"name"`
}
type _ServingEnvironmentCreate ServingEnvironmentCreate
// NewServingEnvironmentCreate instantiates a new ServingEnvironmentCreate 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 NewServingEnvironmentCreate(name string) *ServingEnvironmentCreate {
this := ServingEnvironmentCreate{}
this.Name = name
return &this
}
// NewServingEnvironmentCreateWithDefaults instantiates a new ServingEnvironmentCreate 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 NewServingEnvironmentCreateWithDefaults() *ServingEnvironmentCreate {
this := ServingEnvironmentCreate{}
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) SetExternalId(v string) {
o.ExternalId = &v
}
// GetName returns the Name field value
func (o *ServingEnvironmentCreate) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ServingEnvironmentCreate) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ServingEnvironmentCreate) SetName(v string) {
o.Name = v
}
func (o ServingEnvironmentCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServingEnvironmentCreate) 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
}
toSerialize["name"] = o.Name
return toSerialize, nil
}
type NullableServingEnvironmentCreate struct {
value *ServingEnvironmentCreate
isSet bool
}
func (v NullableServingEnvironmentCreate) Get() *ServingEnvironmentCreate {
return v.value
}
func (v *NullableServingEnvironmentCreate) Set(val *ServingEnvironmentCreate) {
v.value = val
v.isSet = true
}
func (v NullableServingEnvironmentCreate) IsSet() bool {
return v.isSet
}
func (v *NullableServingEnvironmentCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServingEnvironmentCreate(val *ServingEnvironmentCreate) *NullableServingEnvironmentCreate {
return &NullableServingEnvironmentCreate{value: val, isSet: true}
}
func (v NullableServingEnvironmentCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServingEnvironmentCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServingEnvironmentList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServingEnvironmentList{}
// ServingEnvironmentList List of ServingEnvironments.
type ServingEnvironmentList struct {
// Token to use to retrieve next page of results.
NextPageToken string `json:"nextPageToken"`
// Maximum number of resources to return in the result.
PageSize int32 `json:"pageSize"`
// Number of items in result list.
Size int32 `json:"size"`
//
Items []ServingEnvironment `json:"items"`
}
type _ServingEnvironmentList ServingEnvironmentList
// NewServingEnvironmentList instantiates a new ServingEnvironmentList 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 NewServingEnvironmentList(nextPageToken string, pageSize int32, size int32, items []ServingEnvironment) *ServingEnvironmentList {
this := ServingEnvironmentList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
this.Items = items
return &this
}
// NewServingEnvironmentListWithDefaults instantiates a new ServingEnvironmentList 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 NewServingEnvironmentListWithDefaults() *ServingEnvironmentList {
this := ServingEnvironmentList{}
return &this
}
// GetNextPageToken returns the NextPageToken field value
func (o *ServingEnvironmentList) GetNextPageToken() string {
if o == nil {
var ret string
return ret
}
return o.NextPageToken
}
// GetNextPageTokenOk returns a tuple with the NextPageToken field value
// and a boolean to check if the value has been set.
func (o *ServingEnvironmentList) GetNextPageTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NextPageToken, true
}
// SetNextPageToken sets field value
func (o *ServingEnvironmentList) SetNextPageToken(v string) {
o.NextPageToken = v
}
// GetPageSize returns the PageSize field value
func (o *ServingEnvironmentList) GetPageSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value
// and a boolean to check if the value has been set.
func (o *ServingEnvironmentList) GetPageSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PageSize, true
}
// SetPageSize sets field value
func (o *ServingEnvironmentList) SetPageSize(v int32) {
o.PageSize = v
}
// GetSize returns the Size field value
func (o *ServingEnvironmentList) GetSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *ServingEnvironmentList) GetSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *ServingEnvironmentList) SetSize(v int32) {
o.Size = v
}
// GetItems returns the Items field value
func (o *ServingEnvironmentList) GetItems() []ServingEnvironment {
if o == nil {
var ret []ServingEnvironment
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ServingEnvironmentList) GetItemsOk() ([]ServingEnvironment, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ServingEnvironmentList) SetItems(v []ServingEnvironment) {
o.Items = v
}
func (o ServingEnvironmentList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServingEnvironmentList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nextPageToken"] = o.NextPageToken
toSerialize["pageSize"] = o.PageSize
toSerialize["size"] = o.Size
toSerialize["items"] = o.Items
return toSerialize, nil
}
type NullableServingEnvironmentList struct {
value *ServingEnvironmentList
isSet bool
}
func (v NullableServingEnvironmentList) Get() *ServingEnvironmentList {
return v.value
}
func (v *NullableServingEnvironmentList) Set(val *ServingEnvironmentList) {
v.value = val
v.isSet = true
}
func (v NullableServingEnvironmentList) IsSet() bool {
return v.isSet
}
func (v *NullableServingEnvironmentList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServingEnvironmentList(val *ServingEnvironmentList) *NullableServingEnvironmentList {
return &NullableServingEnvironmentList{value: val, isSet: true}
}
func (v NullableServingEnvironmentList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServingEnvironmentList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 ServingEnvironmentUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ServingEnvironmentUpdate{}
// ServingEnvironmentUpdate A Model Serving environment for serving `RegisteredModels`.
type ServingEnvironmentUpdate 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"`
}
// NewServingEnvironmentUpdate instantiates a new ServingEnvironmentUpdate 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 NewServingEnvironmentUpdate() *ServingEnvironmentUpdate {
this := ServingEnvironmentUpdate{}
return &this
}
// NewServingEnvironmentUpdateWithDefaults instantiates a new ServingEnvironmentUpdate 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 NewServingEnvironmentUpdateWithDefaults() *ServingEnvironmentUpdate {
this := ServingEnvironmentUpdate{}
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) GetCustomPropertiesOk() (map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return map[string]MetadataValue{}, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) SetDescription(v string) {
o.Description = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) 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 *ServingEnvironmentUpdate) SetExternalId(v string) {
o.ExternalId = &v
}
func (o ServingEnvironmentUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ServingEnvironmentUpdate) 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
}
return toSerialize, nil
}
type NullableServingEnvironmentUpdate struct {
value *ServingEnvironmentUpdate
isSet bool
}
func (v NullableServingEnvironmentUpdate) Get() *ServingEnvironmentUpdate {
return v.value
}
func (v *NullableServingEnvironmentUpdate) Set(val *ServingEnvironmentUpdate) {
v.value = val
v.isSet = true
}
func (v NullableServingEnvironmentUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableServingEnvironmentUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableServingEnvironmentUpdate(val *ServingEnvironmentUpdate) *NullableServingEnvironmentUpdate {
return &NullableServingEnvironmentUpdate{value: val, isSet: true}
}
func (v NullableServingEnvironmentUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableServingEnvironmentUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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"
"fmt"
)
// SortOrder Supported sort direction for ordering result entities.
type SortOrder string
// List of SortOrder
const (
SORTORDER_ASC SortOrder = "ASC"
SORTORDER_DESC SortOrder = "DESC"
)
// All allowed values of SortOrder enum
var AllowedSortOrderEnumValues = []SortOrder{
"ASC",
"DESC",
}
func (v *SortOrder) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := SortOrder(value)
for _, existing := range AllowedSortOrderEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid SortOrder", value)
}
// NewSortOrderFromValue returns a pointer to a valid SortOrder
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewSortOrderFromValue(v string) (*SortOrder, error) {
ev := SortOrder(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for SortOrder: valid values are %v", v, AllowedSortOrderEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v SortOrder) IsValid() bool {
for _, existing := range AllowedSortOrderEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to SortOrder value
func (v SortOrder) Ptr() *SortOrder {
return &v
}
type NullableSortOrder struct {
value *SortOrder
isSet bool
}
func (v NullableSortOrder) Get() *SortOrder {
return v.value
}
func (v *NullableSortOrder) Set(val *SortOrder) {
v.value = val
v.isSet = true
}
func (v NullableSortOrder) IsSet() bool {
return v.isSet
}
func (v *NullableSortOrder) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSortOrder(val *SortOrder) *NullableSortOrder {
return &NullableSortOrder{value: val, isSet: true}
}
func (v NullableSortOrder) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSortOrder) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
/*
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 (
"net/http"
)
// APIResponse stores the API response returned by the server.
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the OpenAPI operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
// NewAPIResponse returns a new APIResponse object.
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}
return response
}
// NewAPIResponseWithError returns a new APIResponse object with the provided error message.
func NewAPIResponseWithError(errorMessage string) *APIResponse {
response := &APIResponse{Message: errorMessage}
return response
}
/*
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 (
"bytes"
"encoding/json"
"fmt"
"reflect"
"time"
)
// PtrBool is a helper routine that returns a pointer to given boolean value.
func PtrBool(v bool) *bool { return &v }
// PtrInt is a helper routine that returns a pointer to given integer value.
func PtrInt(v int) *int { return &v }
// PtrInt32 is a helper routine that returns a pointer to given integer value.
func PtrInt32(v int32) *int32 { return &v }
// PtrInt64 is a helper routine that returns a pointer to given integer value.
func PtrInt64(v int64) *int64 { return &v }
// PtrFloat32 is a helper routine that returns a pointer to given float value.
func PtrFloat32(v float32) *float32 { return &v }
// PtrFloat64 is a helper routine that returns a pointer to given float value.
func PtrFloat64(v float64) *float64 { return &v }
// PtrString is a helper routine that returns a pointer to given string value.
func PtrString(v string) *string { return &v }
// PtrTime is helper routine that returns a pointer to given Time value.
func PtrTime(v time.Time) *time.Time { return &v }
type NullableBool struct {
value *bool
isSet bool
}
func (v NullableBool) Get() *bool {
return v.value
}
func (v *NullableBool) Set(val *bool) {
v.value = val
v.isSet = true
}
func (v NullableBool) IsSet() bool {
return v.isSet
}
func (v *NullableBool) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBool(val *bool) *NullableBool {
return &NullableBool{value: val, isSet: true}
}
func (v NullableBool) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBool) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt struct {
value *int
isSet bool
}
func (v NullableInt) Get() *int {
return v.value
}
func (v *NullableInt) Set(val *int) {
v.value = val
v.isSet = true
}
func (v NullableInt) IsSet() bool {
return v.isSet
}
func (v *NullableInt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt(val *int) *NullableInt {
return &NullableInt{value: val, isSet: true}
}
func (v NullableInt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt32 struct {
value *int32
isSet bool
}
func (v NullableInt32) Get() *int32 {
return v.value
}
func (v *NullableInt32) Set(val *int32) {
v.value = val
v.isSet = true
}
func (v NullableInt32) IsSet() bool {
return v.isSet
}
func (v *NullableInt32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt32(val *int32) *NullableInt32 {
return &NullableInt32{value: val, isSet: true}
}
func (v NullableInt32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt64 struct {
value *int64
isSet bool
}
func (v NullableInt64) Get() *int64 {
return v.value
}
func (v *NullableInt64) Set(val *int64) {
v.value = val
v.isSet = true
}
func (v NullableInt64) IsSet() bool {
return v.isSet
}
func (v *NullableInt64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt64(val *int64) *NullableInt64 {
return &NullableInt64{value: val, isSet: true}
}
func (v NullableInt64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat32 struct {
value *float32
isSet bool
}
func (v NullableFloat32) Get() *float32 {
return v.value
}
func (v *NullableFloat32) Set(val *float32) {
v.value = val
v.isSet = true
}
func (v NullableFloat32) IsSet() bool {
return v.isSet
}
func (v *NullableFloat32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat32(val *float32) *NullableFloat32 {
return &NullableFloat32{value: val, isSet: true}
}
func (v NullableFloat32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat64 struct {
value *float64
isSet bool
}
func (v NullableFloat64) Get() *float64 {
return v.value
}
func (v *NullableFloat64) Set(val *float64) {
v.value = val
v.isSet = true
}
func (v NullableFloat64) IsSet() bool {
return v.isSet
}
func (v *NullableFloat64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat64(val *float64) *NullableFloat64 {
return &NullableFloat64{value: val, isSet: true}
}
func (v NullableFloat64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableString struct {
value *string
isSet bool
}
func (v NullableString) Get() *string {
return v.value
}
func (v *NullableString) Set(val *string) {
v.value = val
v.isSet = true
}
func (v NullableString) IsSet() bool {
return v.isSet
}
func (v *NullableString) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableString(val *string) *NullableString {
return &NullableString{value: val, isSet: true}
}
func (v NullableString) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableString) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableTime struct {
value *time.Time
isSet bool
}
func (v NullableTime) Get() *time.Time {
return v.value
}
func (v *NullableTime) Set(val *time.Time) {
v.value = val
v.isSet = true
}
func (v NullableTime) IsSet() bool {
return v.isSet
}
func (v *NullableTime) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTime(val *time.Time) *NullableTime {
return &NullableTime{value: val, isSet: true}
}
func (v NullableTime) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTime) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
// IsNil checks if an input is nil
func IsNil(i interface{}) bool {
if i == nil {
return true
}
switch reflect.TypeOf(i).Kind() {
case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice:
return reflect.ValueOf(i).IsNil()
case reflect.Array:
return reflect.ValueOf(i).IsZero()
}
return false
}
type MappedNullable interface {
ToMap() (map[string]interface{}, error)
}
// A wrapper for strict JSON decoding
func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) error {
return fmt.Errorf(format, a...)
}