Refactor model registry openapi definition. (#66)

* Refactor openapi definition

* Add name query parameter for model_version url, fix Artifact oneOf definition

* Added sortOrder query param

* Fix allOf composites for BaseArtifactUpdate and ModelArtifactUpdate

* Add model-serving metadata resources, openapi-generator-cli, and generated model, server, and proxy cmd

* Fix allOf types for InferenceServiceCreate and InferenceServiceUpdate
This commit is contained in:
Dhiraj Bokde 2023-10-18 09:15:17 -07:00 committed by GitHub
parent c664d5fe9d
commit 659ec4e776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 22936 additions and 374 deletions

47
.openapi-generator-ignore Normal file
View File

@ -0,0 +1,47 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
# model and client files
internal/model/openapi/api
internal/model/openapi/api/**
internal/model/openapi/git_push.sh
internal/model/openapi/.gitignore
internal/model/openapi/.travis.yml
internal/model/openapi/.openapi-generator-ignore
internal/model/openapi/README.md
internal/model/openapi/docs/**.md
internal/model/openapi/test
internal/model/openapi/test/**
internal/model/openapi/**all_of.go
internal/model/openapi/go.mod
internal/model/openapi/go.sum
# server files to ignore
internal/server/openapi/api
internal/server/openapi/api/**
internal/server/openapi/.openapi-generator-ignore
internal/server/openapi/README.md
internal/server/openapi/main.go
internal/server/openapi/model_*.go

View File

@ -8,9 +8,12 @@ COPY ["go.mod", "go.sum", "./"]
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
USER root
COPY ["Makefile", "main.go", "gqlgen.yml", "./"]
# install npm and java for openapi-generator-cli
RUN yum install -y nodejs npm java-11
# Copy the go source
COPY ["Makefile", "main.go", "gqlgen.yml", ".openapi-generator-ignore", "openapitools.json", "./"]
# Download protoc compiler v24.3
RUN wget -q https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip -O protoc.zip && \

View File

@ -26,13 +26,38 @@ gen/graph: internal/model/graph/models_gen.go
internal/model/graph/models_gen.go: api/graphql/*.graphqls gqlgen.yml
gqlgen generate
# validate the openapi schema
.PHONY: openapi/validate
openapi/validate: bin/openapi-generator-cli
openapi-generator-cli validate -i api/openapi/model-registry.yaml
# generate the openapi server implementation
# note: run manually only when model-registry.yaml api changes, for model changes gen/openapi is run automatically
.PHONY: gen/openapi-server
gen/openapi-server: bin/openapi-generator-cli openapi/validate
openapi-generator-cli generate \
-i api/openapi/model-registry.yaml -g go-server -o internal/server/openapi --package-name openapi \
--ignore-file-override ./.openapi-generator-ignore --additional-properties=outputAsLibrary=true,enumClassPrefix=true,router=chi,sourceFolder=,onlyInterfaces=true
gofmt -w internal/server/openapi
# generate the openapi schema model and client
.PHONY: gen/openapi
gen/openapi: bin/openapi-generator-cli openapi/validate internal/model/openapi/client.go
internal/model/openapi/client.go: api/openapi/model-registry.yaml
rm -rf internal/model/openapi
openapi-generator-cli generate \
-i api/openapi/model-registry.yaml -g go -o internal/model/openapi --package-name openapi \
--ignore-file-override ./.openapi-generator-ignore --additional-properties=isGoSubmodule=true,enumClassPrefix=true,useOneOfDiscriminatorLookup=true
gofmt -w internal/model/openapi
.PHONY: vet
vet:
go vet ./...
.PHONY: clean
clean:
rm -Rf ./model-registry internal/ml_metadata/proto/*.go internal/model/graph/models_gen.go internal/converter/generated/converter.go
rm -Rf ./model-registry internal/ml_metadata/proto/*.go internal/model/graph/models_gen.go internal/converter/generated/converter.go internal/model/openapi
bin/go-enum:
GOBIN=$(PROJECT_BIN) go install github.com/searKing/golang/tools/go-enum@v1.2.97
@ -52,8 +77,26 @@ bin/golangci-lint:
bin/goverter:
GOBIN=$(PROJECT_PATH)/bin go install github.com/jmattheis/goverter/cmd/goverter@v0.18.0
OPENAPI_GENERATOR ?= ${PROJECT_BIN}/openapi-generator-cli
NPM ?= "$(shell which npm)"
bin/openapi-generator-cli:
ifeq (, $(shell which ${NPM} 2> /dev/null))
@echo "npm is not available please install it to be able to install openapi-generator"
exit 1
endif
ifeq (, $(shell which ${PROJECT_BIN}/openapi-generator-cli 2> /dev/null))
@{ \
set -e ;\
mkdir -p ${PROJECT_BIN} ;\
mkdir -p ${PROJECT_BIN}/openapi-generator-installation ;\
cd ${PROJECT_BIN} ;\
${NPM} install -g --prefix ${PROJECT_BIN}/openapi-generator-installation @openapitools/openapi-generator-cli ;\
ln -s openapi-generator-installation/bin/openapi-generator-cli openapi-generator-cli ;\
}
endif
.PHONY: deps
deps: bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/gqlgen bin/golangci-lint bin/goverter
deps: bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/gqlgen bin/golangci-lint bin/goverter bin/openapi-generator-cli
.PHONY: vendor
vendor:
@ -64,7 +107,7 @@ build: gen vet lint
go build
.PHONY: gen
gen: deps gen/grpc gen/graph gen/converter
gen: deps gen/grpc gen/openapi gen/graph gen/converter
go generate ./...
.PHONY: lint
@ -86,6 +129,10 @@ metadata.sqlite.db: run/migrate
run/server: gen metadata.sqlite.db
go run main.go serve --logtostderr=true
.PHONY: run/proxy
run/proxy: gen
go run main.go proxy --logtostderr=true
.PHONY: run/client
run/client: gen
python test/python/test_mlmetadata.py

View File

@ -7,6 +7,8 @@ It adds other features on top of the functionality offered by the gRPC interface
## Pre-requisites:
- go >= 1.19
- protoc v24.3 - [Protocol Buffers v24.3 Release](https://github.com/protocolbuffers/protobuf/releases/tag/v24.3)
- npm >= 10.2.0 - [Installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- Java >= 11.0
- python 3.9
## Building
Run the following command to build the server binary:
@ -17,6 +19,13 @@ The generated binary uses spf13 cmdline args. More information on using the serv
```
./model-registry --help
```
## OpenAPI Proxy Server
### Starting the OpenAPI Proxy Server
Run the following command to start the OpenAPI proxy server:
```
make run/proxy &
```
The proxy service implements the OpenAPI defined in [model-registry.yaml](api/openapi/model-registry.yaml) to create an Open Data Hub specific REST API that stores metadata in an ml-metadata CPP server.
## Server
### Creating/Migrating Server DB
The server uses a local SQLite DB file (`metadata.sqlite.db` by default), which can be configured using the `-d` cmdline option.

File diff suppressed because it is too large Load Diff

View File

@ -1,369 +0,0 @@
openapi: 3.0.2
info:
title: Model Registry API
version: 1.0.0
description: 'See also https://github.com/opendatahub-io/model-registry/issues/44#issue-1919724627'
paths:
/environments:
summary: Path used to manage the list of environments.
description: >-
The REST endpoint/path used to list and create zero or more `Environment` entities. This path
contains a `GET` and `POST` operation to perform the list and create tasks, respectively.
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Environment'
description: Successful response - returns an array of `Environment` entities.
operationId: getEnvironments
summary: List All Environments
description: Gets a list of all `Environment` entities.
post:
requestBody:
description: A new `Environment` to be created.
content:
application/json:
schema:
$ref: '#/components/schemas/Environment'
required: true
responses:
'201':
description: Successful response.
operationId: createEnvironment
summary: Create a Environment
description: Creates a new instance of a `Environment`.
delete:
parameters:
-
name: name
description: ''
schema: {}
in: query
responses:
'200':
description: Successfully deleted `Environment` having `name`.
summary: Delete an Environment
description: 'Placed here only to avoid subpaths, can be re-drawn.'
/search:
description: |-
TBD: We feel this might be redundant with `models/` and `models/{name}`.
We suggest instead to:
1. avoid usage of Query param (that might "explode" as search grows)
2. provide search criteria in the body
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RegisteredModel'
description: Get all `RegisteredModel`s matching the supplied criteria.
summary: Search models
parameters:
-
name: name
description: ''
schema:
type: string
in: query
-
name: id
description: ''
schema:
type: string
in: query
-
name: tag
description: ''
schema:
type: string
in: query
-
name: label
description: ''
schema:
type: string
in: query
/models:
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RegisteredModel'
description: List all
summary: List all Models
description: List all `RegisteredModel` and belonging `VersionedModel`(s).
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/VersionedModel'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/VersionedModel'
description: Successfully created a `VersionedModel` for a Registered model.
summary: Assign a version to a registered model
description: |-
If a `RegisteredModel` for `model_name` already exists, this `VersionedModel`
will be assigned to it, else a new `RegisteredModel` will be created.
If a `model_name` is not provided, a random one will be used.
The `id` is generated in the backend by the registry.
It could be implemented as a progressive number, to be decided.
The `id`s are unique within a RegisteredModel.
The `version` is a user-provided symbolic name, for instance semantic versioning
The `version` if provided must be unique and non-already-existing within a
RegisterdModel and must not be the same as any of the `id`s.
'/models/{name}/versions/{version}':
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/VersionedModel'
description: get `VersionedModel` for model name and version
summary: Get Version details
delete:
responses:
'200':
description: Successfully archive a `VersionedModel`.
summary: Archive a VersionedModel
description: 'This does NOT delete any `VersionedModel`, but archives and deprecate it.'
patch:
requestBody:
description: 'The `uri`, `id`, `version` and other non-updatable fields will be ignored.'
content:
application/json:
schema:
$ref: '#/components/schemas/VersionedModel'
required: true
responses:
'200':
description: Successfully upated a `VersionedModel` in the updatable and provided fields.
description: |-
Updates a `VersionedModel` only for the updatable fields, such as label, tags,
description.
Some fields will not be updated even if supplied, such as `model_uri`, `id`,
`version`.
parameters:
-
name: name
schema:
type: string
in: path
required: true
-
name: version
schema:
type: string
in: path
required: true
'/models/{name}':
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RegisteredModel'
description: Retrieves the `RegisteredModel`.
summary: Return a given RegisteredModel
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/VersionedModel'
responses:
'200':
description: Successfully registered a versionedmodel under a registered model.
summary: Register a VersionedModel under a given name
description: |-
TBD: this as a potential alternative or complementary of `/models` POST
where the model's name is provided as a Path param instead.
parameters:
-
name: name
schema:
type: string
in: path
required: true
components:
schemas:
Environment:
title: Root Type for Environment
description: ''
type: object
properties:
name:
type: string
uri:
type: string
example:
name: My Environment
uri: 'http://localhost:8080'
RegisteredModel:
title: Root Type for RegisteredModel
description: ''
type: object
properties:
name:
type: string
labels:
type: array
items:
type: string
versions:
type: array
items:
$ref: '#/components/schemas/VersionedModel'
example:
name: my ML pricing model
labels:
- tutorial
- linreg
versions:
-
model_name: my ML pricing model
id: ae123-78932-64893
version: v1
model_uri: 's3://89492-46893-54692'
tags:
- Staging
labels:
- tutorial
- linreg
environments:
-
name: My Environment
uri: 'http://localhost:8080'
created date: '20231002T12:34:56'
updated date: '20231002T12:34:56'
author: 'John Doe, data scientist'
origin: 'dsp://123'
metadata:
accuracy: 99
artifacts:
-
name: dataset
type: csv
uri: 's3://67489-46393-63469'
metadata:
authority: US Census
VersionedModel:
title: Root Type for VersionedModel
description: ''
required:
- model_uri
type: object
properties:
id:
type: string
version:
type: string
tags:
type: array
items:
type: string
labels:
type: array
items:
type: string
environments:
type: array
items:
$ref: '#/components/schemas/Environment'
created date:
format: date-time
type: string
updated date:
format: date-time
type: string
model_name:
type: string
author:
description: ''
type: string
example: '"John Doe, data scientist"'
metadata:
description: ''
type: object
model_uri:
description: ''
type: string
artifacts:
description: ''
type: array
items:
$ref: '#/components/schemas/Artifact'
origin:
description: 'For instance, the DSP id which realized the model'
type: string
example:
model_name: my ML pricing model
id: ae123-78932-64893
version: v1
model_uri: 's3://89492-46893-54692'
tags:
- Staging
labels:
- tutorial
- linreg
environments:
-
name: My Environment
uri: 'http://localhost:8080'
created date: '20231002T12:34:56'
updated date: '20231002T12:34:56'
author: 'John Doe, data scientist'
origin: 'dsp://123'
metadata:
accuracy: 99
artifacts:
-
name: dataset
type: csv
uri: 's3://67489-46393-63469'
metadata:
authority: US Census
Artifact:
title: Root Type for Artifact
description: ''
type: object
properties:
type:
type: string
uri:
type: string
metadata:
type: object
properties:
authority:
type: string
name:
description: ''
type: string
example:
name: dataset
type: csv
uri: 's3://67489-46393-63469'
metadata:
authority: US Census

50
cmd/proxy.go Normal file
View File

@ -0,0 +1,50 @@
package cmd
import (
"fmt"
"github.com/golang/glog"
"github.com/opendatahub-io/model-registry/internal/server/openapi"
"github.com/spf13/cobra"
"log"
"net/http"
)
var (
// proxyCmd represents the proxy command
proxyCmd = &cobra.Command{
Use: "proxy",
Short: "Starts the ml-metadata go OpenAPI proxy",
Long: `This command launches the ml-metadata go OpenAPI proxy server.
The server connects to a mlmd CPP server. It supports options to customize the
hostname and port where it listens.'`,
RunE: runProxyServer,
}
)
func runProxyServer(cmd *cobra.Command, args []string) error {
glog.Infof("proxy server started at %s:%v", cfg.Hostname, cfg.Port)
ModelRegistryServiceAPIService := openapi.NewModelRegistryServiceAPIService()
ModelRegistryServiceAPIController := openapi.NewModelRegistryServiceAPIController(ModelRegistryServiceAPIService)
router := openapi.NewRouter(ModelRegistryServiceAPIController)
log.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", cfg.Hostname, cfg.Port), router))
return nil
}
func init() {
rootCmd.AddCommand(proxyCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// proxyCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
proxyCmd.Flags().StringVarP(&cfg.Hostname, "hostname", "n", cfg.Hostname, "Proxy server listen hostname")
proxyCmd.Flags().IntVarP(&cfg.Port, "port", "p", cfg.Port, "Proxy server listen port")
}

1
go.mod
View File

@ -4,6 +4,7 @@ go 1.19
require (
github.com/99designs/gqlgen v0.17.36
github.com/go-chi/chi/v5 v5.0.10
github.com/golang/glog v1.1.0
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0
github.com/searKing/golang/tools/go-enum v1.2.97

2
go.sum
View File

@ -70,6 +70,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=

View File

@ -0,0 +1,53 @@
api_model_registry_service.go
client.go
configuration.go
model_artifact.go
model_artifact_list.go
model_artifact_state.go
model_base_artifact.go
model_base_artifact_create.go
model_base_artifact_update.go
model_base_execution.go
model_base_execution_create.go
model_base_execution_update.go
model_base_resource.go
model_base_resource_create.go
model_base_resource_list.go
model_base_resource_update.go
model_error.go
model_execution_state.go
model_inference_service.go
model_inference_service_create.go
model_inference_service_list.go
model_inference_service_update.go
model_metadata_value.go
model_metadata_value_one_of.go
model_metadata_value_one_of_1.go
model_metadata_value_one_of_2.go
model_metadata_value_one_of_3.go
model_metadata_value_one_of_4.go
model_metadata_value_one_of_5.go
model_model_artifact.go
model_model_artifact_create.go
model_model_artifact_list.go
model_model_artifact_update.go
model_model_version.go
model_model_version_create.go
model_model_version_list.go
model_model_version_update.go
model_order_by_field.go
model_registered_model.go
model_registered_model_create.go
model_registered_model_list.go
model_registered_model_update.go
model_serve_model.go
model_serve_model_create.go
model_serve_model_list.go
model_serve_model_update.go
model_serving_environment.go
model_serving_environment_create.go
model_serving_environment_list.go
model_serving_environment_update.go
model_sort_order.go
response.go
utils.go

View File

@ -0,0 +1 @@
7.0.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,666 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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)/(?:vnd\.[^;]+\+)?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 v1.0.0
// 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 {
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{}, 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, collectionType)
return
}
if t, ok := obj.(time.Time); ok {
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), 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)
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), 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(), collectionType)
}
return
case reflect.Interface:
fallthrough
case reflect.Ptr:
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), 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)
err = os.Remove(f.Name())
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)
err = os.Remove((*f).Name())
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
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) error {
return fmt.Errorf(format, a...)
}
// A wrapper for strict JSON decoding
func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// 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))
}

View File

@ -0,0 +1,217 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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",
},
},
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)
}

View File

@ -0,0 +1,123 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
ModelArtifact *ModelArtifact
}
// ModelArtifactAsArtifact is a convenience function that returns ModelArtifact wrapped in Artifact
func ModelArtifactAsArtifact(v *ModelArtifact) Artifact {
return Artifact{
ModelArtifact: 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 'ModelArtifact'
if jsonDict["artifactType"] == "ModelArtifact" {
// 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 '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())
}
}
return nil
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src Artifact) MarshalJSON() ([]byte, error) {
if src.ModelArtifact != nil {
return json.Marshal(&src.ModelArtifact)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *Artifact) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.ModelArtifact != nil {
return obj.ModelArtifact
}
// 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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *ArtifactList {
this := ArtifactList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *ArtifactList) GetItems() []Artifact {
if o == nil || IsNil(o.Items) {
var ret []Artifact
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ArtifactList) GetItemsOk() ([]Artifact, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *ArtifactList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []Artifact and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,120 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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)
}

View File

@ -0,0 +1,414 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 struct for BaseArtifact
type BaseArtifact struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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 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"`
// 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"`
// Output only. 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"`
ArtifactType string `json:"artifactType"`
}
// 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(artifactType string) *BaseArtifact {
this := BaseArtifact{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
this.ArtifactType = artifactType
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{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
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 nil, 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
}
// 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
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) 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 *BaseArtifact) SetState(v ArtifactState) {
o.State = &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
}
// GetArtifactType returns the ArtifactType field value
func (o *BaseArtifact) GetArtifactType() string {
if o == nil {
var ret string
return ret
}
return o.ArtifactType
}
// GetArtifactTypeOk returns a tuple with the ArtifactType field value
// and a boolean to check if the value has been set.
func (o *BaseArtifact) GetArtifactTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ArtifactType, true
}
// SetArtifactType sets field value
func (o *BaseArtifact) SetArtifactType(v string) {
o.ArtifactType = 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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
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
}
toSerialize["artifactType"] = o.ArtifactType
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)
}

View File

@ -0,0 +1,276 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the BaseArtifactCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseArtifactCreate{}
// BaseArtifactCreate struct for BaseArtifactCreate
type BaseArtifactCreate struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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 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"`
// 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"`
}
// NewBaseArtifactCreate instantiates a new BaseArtifactCreate 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 NewBaseArtifactCreate() *BaseArtifactCreate {
this := BaseArtifactCreate{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewBaseArtifactCreateWithDefaults instantiates a new BaseArtifactCreate 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 NewBaseArtifactCreateWithDefaults() *BaseArtifactCreate {
this := BaseArtifactCreate{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseArtifactCreate) 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 *BaseArtifactCreate) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseArtifactCreate) 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 *BaseArtifactCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetExternalID returns the ExternalID field value if set, zero value otherwise.
func (o *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) SetExternalID(v string) {
o.ExternalID = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) SetState(v ArtifactState) {
o.State = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) 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 *BaseArtifactCreate) SetName(v string) {
o.Name = &v
}
func (o BaseArtifactCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseArtifactCreate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
return toSerialize, nil
}
type NullableBaseArtifactCreate struct {
value *BaseArtifactCreate
isSet bool
}
func (v NullableBaseArtifactCreate) Get() *BaseArtifactCreate {
return v.value
}
func (v *NullableBaseArtifactCreate) Set(val *BaseArtifactCreate) {
v.value = val
v.isSet = true
}
func (v NullableBaseArtifactCreate) IsSet() bool {
return v.isSet
}
func (v *NullableBaseArtifactCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseArtifactCreate(val *BaseArtifactCreate) *NullableBaseArtifactCreate {
return &NullableBaseArtifactCreate{value: val, isSet: true}
}
func (v NullableBaseArtifactCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseArtifactCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,239 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the BaseArtifactUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseArtifactUpdate{}
// BaseArtifactUpdate struct for BaseArtifactUpdate
type BaseArtifactUpdate struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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 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"`
}
// NewBaseArtifactUpdate instantiates a new BaseArtifactUpdate 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 NewBaseArtifactUpdate() *BaseArtifactUpdate {
this := BaseArtifactUpdate{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// NewBaseArtifactUpdateWithDefaults instantiates a new BaseArtifactUpdate 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 NewBaseArtifactUpdateWithDefaults() *BaseArtifactUpdate {
this := BaseArtifactUpdate{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseArtifactUpdate) 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 *BaseArtifactUpdate) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseArtifactUpdate) 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 *BaseArtifactUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetExternalID returns the ExternalID field value if set, zero value otherwise.
func (o *BaseArtifactUpdate) 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 *BaseArtifactUpdate) 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 *BaseArtifactUpdate) 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 *BaseArtifactUpdate) SetExternalID(v string) {
o.ExternalID = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *BaseArtifactUpdate) 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 *BaseArtifactUpdate) 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 *BaseArtifactUpdate) 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 *BaseArtifactUpdate) SetUri(v string) {
o.Uri = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *BaseArtifactUpdate) 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 *BaseArtifactUpdate) 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 *BaseArtifactUpdate) 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 *BaseArtifactUpdate) SetState(v ArtifactState) {
o.State = &v
}
func (o BaseArtifactUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseArtifactUpdate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableBaseArtifactUpdate struct {
value *BaseArtifactUpdate
isSet bool
}
func (v NullableBaseArtifactUpdate) Get() *BaseArtifactUpdate {
return v.value
}
func (v *NullableBaseArtifactUpdate) Set(val *BaseArtifactUpdate) {
v.value = val
v.isSet = true
}
func (v NullableBaseArtifactUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableBaseArtifactUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseArtifactUpdate(val *BaseArtifactUpdate) *NullableBaseArtifactUpdate {
return &NullableBaseArtifactUpdate{value: val, isSet: true}
}
func (v NullableBaseArtifactUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseArtifactUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,350 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the BaseExecution type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseExecution{}
// BaseExecution struct for BaseExecution
type BaseExecution struct {
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
// Output only. 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"`
}
// NewBaseExecution instantiates a new BaseExecution 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 NewBaseExecution() *BaseExecution {
this := BaseExecution{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// NewBaseExecutionWithDefaults instantiates a new BaseExecution 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 NewBaseExecutionWithDefaults() *BaseExecution {
this := BaseExecution{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// GetLastKnownState returns the LastKnownState field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) SetLastKnownState(v ExecutionState) {
o.LastKnownState = &v
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseExecution) 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 *BaseExecution) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetExternalID returns the ExternalID field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) SetExternalID(v string) {
o.ExternalID = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) SetName(v string) {
o.Name = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) SetId(v string) {
o.Id = &v
}
// GetCreateTimeSinceEpoch returns the CreateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) SetCreateTimeSinceEpoch(v string) {
o.CreateTimeSinceEpoch = &v
}
// GetLastUpdateTimeSinceEpoch returns the LastUpdateTimeSinceEpoch field value if set, zero value otherwise.
func (o *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) 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 *BaseExecution) SetLastUpdateTimeSinceEpoch(v string) {
o.LastUpdateTimeSinceEpoch = &v
}
func (o BaseExecution) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseExecution) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
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
}
return toSerialize, nil
}
type NullableBaseExecution struct {
value *BaseExecution
isSet bool
}
func (v NullableBaseExecution) Get() *BaseExecution {
return v.value
}
func (v *NullableBaseExecution) Set(val *BaseExecution) {
v.value = val
v.isSet = true
}
func (v NullableBaseExecution) IsSet() bool {
return v.isSet
}
func (v *NullableBaseExecution) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseExecution(val *BaseExecution) *NullableBaseExecution {
return &NullableBaseExecution{value: val, isSet: true}
}
func (v NullableBaseExecution) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseExecution) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,239 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the BaseExecutionCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseExecutionCreate{}
// BaseExecutionCreate struct for BaseExecutionCreate
type BaseExecutionCreate struct {
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
}
// NewBaseExecutionCreate instantiates a new BaseExecutionCreate 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 NewBaseExecutionCreate() *BaseExecutionCreate {
this := BaseExecutionCreate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// NewBaseExecutionCreateWithDefaults instantiates a new BaseExecutionCreate 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 NewBaseExecutionCreateWithDefaults() *BaseExecutionCreate {
this := BaseExecutionCreate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// GetLastKnownState returns the LastKnownState field value if set, zero value otherwise.
func (o *BaseExecutionCreate) 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 *BaseExecutionCreate) 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 *BaseExecutionCreate) 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 *BaseExecutionCreate) SetLastKnownState(v ExecutionState) {
o.LastKnownState = &v
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseExecutionCreate) 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 *BaseExecutionCreate) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseExecutionCreate) 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 *BaseExecutionCreate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetExternalID returns the ExternalID field value if set, zero value otherwise.
func (o *BaseExecutionCreate) 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 *BaseExecutionCreate) 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 *BaseExecutionCreate) 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 *BaseExecutionCreate) SetExternalID(v string) {
o.ExternalID = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BaseExecutionCreate) 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 *BaseExecutionCreate) 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 *BaseExecutionCreate) 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 *BaseExecutionCreate) SetName(v string) {
o.Name = &v
}
func (o BaseExecutionCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseExecutionCreate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
return toSerialize, nil
}
type NullableBaseExecutionCreate struct {
value *BaseExecutionCreate
isSet bool
}
func (v NullableBaseExecutionCreate) Get() *BaseExecutionCreate {
return v.value
}
func (v *NullableBaseExecutionCreate) Set(val *BaseExecutionCreate) {
v.value = val
v.isSet = true
}
func (v NullableBaseExecutionCreate) IsSet() bool {
return v.isSet
}
func (v *NullableBaseExecutionCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseExecutionCreate(val *BaseExecutionCreate) *NullableBaseExecutionCreate {
return &NullableBaseExecutionCreate{value: val, isSet: true}
}
func (v NullableBaseExecutionCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseExecutionCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,202 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the BaseExecutionUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseExecutionUpdate{}
// BaseExecutionUpdate struct for BaseExecutionUpdate
type BaseExecutionUpdate struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
}
// NewBaseExecutionUpdate instantiates a new BaseExecutionUpdate 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 NewBaseExecutionUpdate() *BaseExecutionUpdate {
this := BaseExecutionUpdate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// NewBaseExecutionUpdateWithDefaults instantiates a new BaseExecutionUpdate 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 NewBaseExecutionUpdateWithDefaults() *BaseExecutionUpdate {
this := BaseExecutionUpdate{}
var lastKnownState ExecutionState = EXECUTIONSTATE_UNKNOWN
this.LastKnownState = &lastKnownState
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *BaseExecutionUpdate) 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 *BaseExecutionUpdate) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *BaseExecutionUpdate) 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 *BaseExecutionUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// GetExternalID returns the ExternalID field value if set, zero value otherwise.
func (o *BaseExecutionUpdate) 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 *BaseExecutionUpdate) 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 *BaseExecutionUpdate) 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 *BaseExecutionUpdate) SetExternalID(v string) {
o.ExternalID = &v
}
// GetLastKnownState returns the LastKnownState field value if set, zero value otherwise.
func (o *BaseExecutionUpdate) 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 *BaseExecutionUpdate) 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 *BaseExecutionUpdate) 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 *BaseExecutionUpdate) SetLastKnownState(v ExecutionState) {
o.LastKnownState = &v
}
func (o BaseExecutionUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseExecutionUpdate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
return toSerialize, nil
}
type NullableBaseExecutionUpdate struct {
value *BaseExecutionUpdate
isSet bool
}
func (v NullableBaseExecutionUpdate) Get() *BaseExecutionUpdate {
return v.value
}
func (v *NullableBaseExecutionUpdate) Set(val *BaseExecutionUpdate) {
v.value = val
v.isSet = true
}
func (v NullableBaseExecutionUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableBaseExecutionUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseExecutionUpdate(val *BaseExecutionUpdate) *NullableBaseExecutionUpdate {
return &NullableBaseExecutionUpdate{value: val, isSet: true}
}
func (v NullableBaseExecutionUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseExecutionUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,310 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
// Output only. 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"`
}
// 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
}
// 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 nil, 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
}
// 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
}
// 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
}
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.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
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
}
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)
}

View File

@ -0,0 +1,199 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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 nil, 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
}
// 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.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)
}

View File

@ -0,0 +1,172 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
}
// 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)
}

View File

@ -0,0 +1,162 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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 nil, 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
}
// 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.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)
}

View File

@ -0,0 +1,144 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
}
// 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)
}

View File

@ -0,0 +1,120 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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)
}

View File

@ -0,0 +1,403 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
// Output only. 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"`
// ID of the `RegisteredModel` to serve.
RegisteredModelId string `json:"registeredModelId"`
// ID of the parent `ServingEnvironment` for this `InferenceService` entity.
ServingEnvironmentId string `json:"servingEnvironmentId"`
}
// 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{}
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{}
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 nil, 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
}
// 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
}
// 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.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
}
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)
}

View File

@ -0,0 +1,292 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
// ID of the `RegisteredModel` to serve.
RegisteredModelId string `json:"registeredModelId"`
// ID of the parent `ServingEnvironment` for this `InferenceService` entity.
ServingEnvironmentId string `json:"servingEnvironmentId"`
}
// 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{}
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{}
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 nil, 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
}
// 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
}
// 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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.ModelVersionId) {
toSerialize["modelVersionId"] = o.ModelVersionId
}
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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *InferenceServiceList {
this := InferenceServiceList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *InferenceServiceList) GetItems() []InferenceService {
if o == nil || IsNil(o.Items) {
var ret []InferenceService
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InferenceServiceList) GetItemsOk() ([]InferenceService, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *InferenceServiceList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []InferenceService and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,199 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
}
// 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{}
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{}
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 nil, 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
}
// 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
}
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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.ModelVersionId) {
toSerialize["modelVersionId"] = o.ModelVersionId
}
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)
}

View File

@ -0,0 +1,265 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
MetadataValueOneOf *MetadataValueOneOf
MetadataValueOneOf1 *MetadataValueOneOf1
MetadataValueOneOf2 *MetadataValueOneOf2
MetadataValueOneOf3 *MetadataValueOneOf3
MetadataValueOneOf4 *MetadataValueOneOf4
MetadataValueOneOf5 *MetadataValueOneOf5
}
// MetadataValueOneOfAsMetadataValue is a convenience function that returns MetadataValueOneOf wrapped in MetadataValue
func MetadataValueOneOfAsMetadataValue(v *MetadataValueOneOf) MetadataValue {
return MetadataValue{
MetadataValueOneOf: v,
}
}
// MetadataValueOneOf1AsMetadataValue is a convenience function that returns MetadataValueOneOf1 wrapped in MetadataValue
func MetadataValueOneOf1AsMetadataValue(v *MetadataValueOneOf1) MetadataValue {
return MetadataValue{
MetadataValueOneOf1: v,
}
}
// MetadataValueOneOf2AsMetadataValue is a convenience function that returns MetadataValueOneOf2 wrapped in MetadataValue
func MetadataValueOneOf2AsMetadataValue(v *MetadataValueOneOf2) MetadataValue {
return MetadataValue{
MetadataValueOneOf2: v,
}
}
// MetadataValueOneOf3AsMetadataValue is a convenience function that returns MetadataValueOneOf3 wrapped in MetadataValue
func MetadataValueOneOf3AsMetadataValue(v *MetadataValueOneOf3) MetadataValue {
return MetadataValue{
MetadataValueOneOf3: v,
}
}
// MetadataValueOneOf4AsMetadataValue is a convenience function that returns MetadataValueOneOf4 wrapped in MetadataValue
func MetadataValueOneOf4AsMetadataValue(v *MetadataValueOneOf4) MetadataValue {
return MetadataValue{
MetadataValueOneOf4: v,
}
}
// MetadataValueOneOf5AsMetadataValue is a convenience function that returns MetadataValueOneOf5 wrapped in MetadataValue
func MetadataValueOneOf5AsMetadataValue(v *MetadataValueOneOf5) MetadataValue {
return MetadataValue{
MetadataValueOneOf5: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *MetadataValue) UnmarshalJSON(data []byte) error {
var err error
match := 0
// try to unmarshal data into MetadataValueOneOf
err = json.Unmarshal(data, &dst.MetadataValueOneOf)
if err == nil {
jsonMetadataValueOneOf, _ := json.Marshal(dst.MetadataValueOneOf)
if string(jsonMetadataValueOneOf) == "{}" { // empty struct
dst.MetadataValueOneOf = nil
} else {
match++
}
} else {
dst.MetadataValueOneOf = nil
}
// try to unmarshal data into MetadataValueOneOf1
err = json.Unmarshal(data, &dst.MetadataValueOneOf1)
if err == nil {
jsonMetadataValueOneOf1, _ := json.Marshal(dst.MetadataValueOneOf1)
if string(jsonMetadataValueOneOf1) == "{}" { // empty struct
dst.MetadataValueOneOf1 = nil
} else {
match++
}
} else {
dst.MetadataValueOneOf1 = nil
}
// try to unmarshal data into MetadataValueOneOf2
err = json.Unmarshal(data, &dst.MetadataValueOneOf2)
if err == nil {
jsonMetadataValueOneOf2, _ := json.Marshal(dst.MetadataValueOneOf2)
if string(jsonMetadataValueOneOf2) == "{}" { // empty struct
dst.MetadataValueOneOf2 = nil
} else {
match++
}
} else {
dst.MetadataValueOneOf2 = nil
}
// try to unmarshal data into MetadataValueOneOf3
err = json.Unmarshal(data, &dst.MetadataValueOneOf3)
if err == nil {
jsonMetadataValueOneOf3, _ := json.Marshal(dst.MetadataValueOneOf3)
if string(jsonMetadataValueOneOf3) == "{}" { // empty struct
dst.MetadataValueOneOf3 = nil
} else {
match++
}
} else {
dst.MetadataValueOneOf3 = nil
}
// try to unmarshal data into MetadataValueOneOf4
err = json.Unmarshal(data, &dst.MetadataValueOneOf4)
if err == nil {
jsonMetadataValueOneOf4, _ := json.Marshal(dst.MetadataValueOneOf4)
if string(jsonMetadataValueOneOf4) == "{}" { // empty struct
dst.MetadataValueOneOf4 = nil
} else {
match++
}
} else {
dst.MetadataValueOneOf4 = nil
}
// try to unmarshal data into MetadataValueOneOf5
err = json.Unmarshal(data, &dst.MetadataValueOneOf5)
if err == nil {
jsonMetadataValueOneOf5, _ := json.Marshal(dst.MetadataValueOneOf5)
if string(jsonMetadataValueOneOf5) == "{}" { // empty struct
dst.MetadataValueOneOf5 = nil
} else {
match++
}
} else {
dst.MetadataValueOneOf5 = nil
}
if match > 1 { // more than 1 match
// reset to nil
dst.MetadataValueOneOf = nil
dst.MetadataValueOneOf1 = nil
dst.MetadataValueOneOf2 = nil
dst.MetadataValueOneOf3 = nil
dst.MetadataValueOneOf4 = nil
dst.MetadataValueOneOf5 = nil
return fmt.Errorf("data matches more than one schema in oneOf(MetadataValue)")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("data failed to match schemas in oneOf(MetadataValue)")
}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src MetadataValue) MarshalJSON() ([]byte, error) {
if src.MetadataValueOneOf != nil {
return json.Marshal(&src.MetadataValueOneOf)
}
if src.MetadataValueOneOf1 != nil {
return json.Marshal(&src.MetadataValueOneOf1)
}
if src.MetadataValueOneOf2 != nil {
return json.Marshal(&src.MetadataValueOneOf2)
}
if src.MetadataValueOneOf3 != nil {
return json.Marshal(&src.MetadataValueOneOf3)
}
if src.MetadataValueOneOf4 != nil {
return json.Marshal(&src.MetadataValueOneOf4)
}
if src.MetadataValueOneOf5 != nil {
return json.Marshal(&src.MetadataValueOneOf5)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *MetadataValue) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.MetadataValueOneOf != nil {
return obj.MetadataValueOneOf
}
if obj.MetadataValueOneOf1 != nil {
return obj.MetadataValueOneOf1
}
if obj.MetadataValueOneOf2 != nil {
return obj.MetadataValueOneOf2
}
if obj.MetadataValueOneOf3 != nil {
return obj.MetadataValueOneOf3
}
if obj.MetadataValueOneOf4 != nil {
return obj.MetadataValueOneOf4
}
if obj.MetadataValueOneOf5 != nil {
return obj.MetadataValueOneOf5
}
// 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)
}

View File

@ -0,0 +1,124 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetadataValueOneOf type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataValueOneOf{}
// MetadataValueOneOf struct for MetadataValueOneOf
type MetadataValueOneOf struct {
IntValue *string `json:"int_value,omitempty"`
}
// NewMetadataValueOneOf instantiates a new MetadataValueOneOf 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 NewMetadataValueOneOf() *MetadataValueOneOf {
this := MetadataValueOneOf{}
return &this
}
// NewMetadataValueOneOfWithDefaults instantiates a new MetadataValueOneOf 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 NewMetadataValueOneOfWithDefaults() *MetadataValueOneOf {
this := MetadataValueOneOf{}
return &this
}
// GetIntValue returns the IntValue field value if set, zero value otherwise.
func (o *MetadataValueOneOf) GetIntValue() string {
if o == nil || IsNil(o.IntValue) {
var ret string
return ret
}
return *o.IntValue
}
// GetIntValueOk returns a tuple with the IntValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf) GetIntValueOk() (*string, bool) {
if o == nil || IsNil(o.IntValue) {
return nil, false
}
return o.IntValue, true
}
// HasIntValue returns a boolean if a field has been set.
func (o *MetadataValueOneOf) HasIntValue() bool {
if o != nil && !IsNil(o.IntValue) {
return true
}
return false
}
// SetIntValue gets a reference to the given string and assigns it to the IntValue field.
func (o *MetadataValueOneOf) SetIntValue(v string) {
o.IntValue = &v
}
func (o MetadataValueOneOf) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataValueOneOf) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.IntValue) {
toSerialize["int_value"] = o.IntValue
}
return toSerialize, nil
}
type NullableMetadataValueOneOf struct {
value *MetadataValueOneOf
isSet bool
}
func (v NullableMetadataValueOneOf) Get() *MetadataValueOneOf {
return v.value
}
func (v *NullableMetadataValueOneOf) Set(val *MetadataValueOneOf) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValueOneOf) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValueOneOf) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValueOneOf(val *MetadataValueOneOf) *NullableMetadataValueOneOf {
return &NullableMetadataValueOneOf{value: val, isSet: true}
}
func (v NullableMetadataValueOneOf) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValueOneOf) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,124 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetadataValueOneOf1 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataValueOneOf1{}
// MetadataValueOneOf1 struct for MetadataValueOneOf1
type MetadataValueOneOf1 struct {
DoubleValue *float64 `json:"double_value,omitempty"`
}
// NewMetadataValueOneOf1 instantiates a new MetadataValueOneOf1 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 NewMetadataValueOneOf1() *MetadataValueOneOf1 {
this := MetadataValueOneOf1{}
return &this
}
// NewMetadataValueOneOf1WithDefaults instantiates a new MetadataValueOneOf1 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 NewMetadataValueOneOf1WithDefaults() *MetadataValueOneOf1 {
this := MetadataValueOneOf1{}
return &this
}
// GetDoubleValue returns the DoubleValue field value if set, zero value otherwise.
func (o *MetadataValueOneOf1) GetDoubleValue() float64 {
if o == nil || IsNil(o.DoubleValue) {
var ret float64
return ret
}
return *o.DoubleValue
}
// GetDoubleValueOk returns a tuple with the DoubleValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf1) GetDoubleValueOk() (*float64, bool) {
if o == nil || IsNil(o.DoubleValue) {
return nil, false
}
return o.DoubleValue, true
}
// HasDoubleValue returns a boolean if a field has been set.
func (o *MetadataValueOneOf1) HasDoubleValue() bool {
if o != nil && !IsNil(o.DoubleValue) {
return true
}
return false
}
// SetDoubleValue gets a reference to the given float64 and assigns it to the DoubleValue field.
func (o *MetadataValueOneOf1) SetDoubleValue(v float64) {
o.DoubleValue = &v
}
func (o MetadataValueOneOf1) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataValueOneOf1) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.DoubleValue) {
toSerialize["double_value"] = o.DoubleValue
}
return toSerialize, nil
}
type NullableMetadataValueOneOf1 struct {
value *MetadataValueOneOf1
isSet bool
}
func (v NullableMetadataValueOneOf1) Get() *MetadataValueOneOf1 {
return v.value
}
func (v *NullableMetadataValueOneOf1) Set(val *MetadataValueOneOf1) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValueOneOf1) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValueOneOf1) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValueOneOf1(val *MetadataValueOneOf1) *NullableMetadataValueOneOf1 {
return &NullableMetadataValueOneOf1{value: val, isSet: true}
}
func (v NullableMetadataValueOneOf1) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValueOneOf1) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,124 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetadataValueOneOf2 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataValueOneOf2{}
// MetadataValueOneOf2 struct for MetadataValueOneOf2
type MetadataValueOneOf2 struct {
StringValue *string `json:"string_value,omitempty"`
}
// NewMetadataValueOneOf2 instantiates a new MetadataValueOneOf2 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 NewMetadataValueOneOf2() *MetadataValueOneOf2 {
this := MetadataValueOneOf2{}
return &this
}
// NewMetadataValueOneOf2WithDefaults instantiates a new MetadataValueOneOf2 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 NewMetadataValueOneOf2WithDefaults() *MetadataValueOneOf2 {
this := MetadataValueOneOf2{}
return &this
}
// GetStringValue returns the StringValue field value if set, zero value otherwise.
func (o *MetadataValueOneOf2) GetStringValue() string {
if o == nil || IsNil(o.StringValue) {
var ret string
return ret
}
return *o.StringValue
}
// GetStringValueOk returns a tuple with the StringValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf2) GetStringValueOk() (*string, bool) {
if o == nil || IsNil(o.StringValue) {
return nil, false
}
return o.StringValue, true
}
// HasStringValue returns a boolean if a field has been set.
func (o *MetadataValueOneOf2) HasStringValue() bool {
if o != nil && !IsNil(o.StringValue) {
return true
}
return false
}
// SetStringValue gets a reference to the given string and assigns it to the StringValue field.
func (o *MetadataValueOneOf2) SetStringValue(v string) {
o.StringValue = &v
}
func (o MetadataValueOneOf2) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataValueOneOf2) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.StringValue) {
toSerialize["string_value"] = o.StringValue
}
return toSerialize, nil
}
type NullableMetadataValueOneOf2 struct {
value *MetadataValueOneOf2
isSet bool
}
func (v NullableMetadataValueOneOf2) Get() *MetadataValueOneOf2 {
return v.value
}
func (v *NullableMetadataValueOneOf2) Set(val *MetadataValueOneOf2) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValueOneOf2) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValueOneOf2) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValueOneOf2(val *MetadataValueOneOf2) *NullableMetadataValueOneOf2 {
return &NullableMetadataValueOneOf2{value: val, isSet: true}
}
func (v NullableMetadataValueOneOf2) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValueOneOf2) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,125 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetadataValueOneOf3 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataValueOneOf3{}
// MetadataValueOneOf3 struct for MetadataValueOneOf3
type MetadataValueOneOf3 struct {
// Base64 encoded bytes for struct value
StructValue *string `json:"struct_value,omitempty"`
}
// NewMetadataValueOneOf3 instantiates a new MetadataValueOneOf3 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 NewMetadataValueOneOf3() *MetadataValueOneOf3 {
this := MetadataValueOneOf3{}
return &this
}
// NewMetadataValueOneOf3WithDefaults instantiates a new MetadataValueOneOf3 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 NewMetadataValueOneOf3WithDefaults() *MetadataValueOneOf3 {
this := MetadataValueOneOf3{}
return &this
}
// GetStructValue returns the StructValue field value if set, zero value otherwise.
func (o *MetadataValueOneOf3) GetStructValue() string {
if o == nil || IsNil(o.StructValue) {
var ret string
return ret
}
return *o.StructValue
}
// GetStructValueOk returns a tuple with the StructValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf3) GetStructValueOk() (*string, bool) {
if o == nil || IsNil(o.StructValue) {
return nil, false
}
return o.StructValue, true
}
// HasStructValue returns a boolean if a field has been set.
func (o *MetadataValueOneOf3) HasStructValue() bool {
if o != nil && !IsNil(o.StructValue) {
return true
}
return false
}
// SetStructValue gets a reference to the given string and assigns it to the StructValue field.
func (o *MetadataValueOneOf3) SetStructValue(v string) {
o.StructValue = &v
}
func (o MetadataValueOneOf3) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataValueOneOf3) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.StructValue) {
toSerialize["struct_value"] = o.StructValue
}
return toSerialize, nil
}
type NullableMetadataValueOneOf3 struct {
value *MetadataValueOneOf3
isSet bool
}
func (v NullableMetadataValueOneOf3) Get() *MetadataValueOneOf3 {
return v.value
}
func (v *NullableMetadataValueOneOf3) Set(val *MetadataValueOneOf3) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValueOneOf3) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValueOneOf3) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValueOneOf3(val *MetadataValueOneOf3) *NullableMetadataValueOneOf3 {
return &NullableMetadataValueOneOf3{value: val, isSet: true}
}
func (v NullableMetadataValueOneOf3) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValueOneOf3) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,162 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetadataValueOneOf4 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataValueOneOf4{}
// MetadataValueOneOf4 struct for MetadataValueOneOf4
type MetadataValueOneOf4 struct {
// url describing proto value
Type *string `json:"type,omitempty"`
// Base64 encoded bytes for proto value
ProtoValue *string `json:"proto_value,omitempty"`
}
// NewMetadataValueOneOf4 instantiates a new MetadataValueOneOf4 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 NewMetadataValueOneOf4() *MetadataValueOneOf4 {
this := MetadataValueOneOf4{}
return &this
}
// NewMetadataValueOneOf4WithDefaults instantiates a new MetadataValueOneOf4 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 NewMetadataValueOneOf4WithDefaults() *MetadataValueOneOf4 {
this := MetadataValueOneOf4{}
return &this
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *MetadataValueOneOf4) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf4) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *MetadataValueOneOf4) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *MetadataValueOneOf4) SetType(v string) {
o.Type = &v
}
// GetProtoValue returns the ProtoValue field value if set, zero value otherwise.
func (o *MetadataValueOneOf4) GetProtoValue() string {
if o == nil || IsNil(o.ProtoValue) {
var ret string
return ret
}
return *o.ProtoValue
}
// GetProtoValueOk returns a tuple with the ProtoValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf4) GetProtoValueOk() (*string, bool) {
if o == nil || IsNil(o.ProtoValue) {
return nil, false
}
return o.ProtoValue, true
}
// HasProtoValue returns a boolean if a field has been set.
func (o *MetadataValueOneOf4) HasProtoValue() bool {
if o != nil && !IsNil(o.ProtoValue) {
return true
}
return false
}
// SetProtoValue gets a reference to the given string and assigns it to the ProtoValue field.
func (o *MetadataValueOneOf4) SetProtoValue(v string) {
o.ProtoValue = &v
}
func (o MetadataValueOneOf4) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataValueOneOf4) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.ProtoValue) {
toSerialize["proto_value"] = o.ProtoValue
}
return toSerialize, nil
}
type NullableMetadataValueOneOf4 struct {
value *MetadataValueOneOf4
isSet bool
}
func (v NullableMetadataValueOneOf4) Get() *MetadataValueOneOf4 {
return v.value
}
func (v *NullableMetadataValueOneOf4) Set(val *MetadataValueOneOf4) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValueOneOf4) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValueOneOf4) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValueOneOf4(val *MetadataValueOneOf4) *NullableMetadataValueOneOf4 {
return &NullableMetadataValueOneOf4{value: val, isSet: true}
}
func (v NullableMetadataValueOneOf4) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValueOneOf4) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,124 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the MetadataValueOneOf5 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetadataValueOneOf5{}
// MetadataValueOneOf5 struct for MetadataValueOneOf5
type MetadataValueOneOf5 struct {
BoolValue *bool `json:"bool_value,omitempty"`
}
// NewMetadataValueOneOf5 instantiates a new MetadataValueOneOf5 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 NewMetadataValueOneOf5() *MetadataValueOneOf5 {
this := MetadataValueOneOf5{}
return &this
}
// NewMetadataValueOneOf5WithDefaults instantiates a new MetadataValueOneOf5 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 NewMetadataValueOneOf5WithDefaults() *MetadataValueOneOf5 {
this := MetadataValueOneOf5{}
return &this
}
// GetBoolValue returns the BoolValue field value if set, zero value otherwise.
func (o *MetadataValueOneOf5) GetBoolValue() bool {
if o == nil || IsNil(o.BoolValue) {
var ret bool
return ret
}
return *o.BoolValue
}
// GetBoolValueOk returns a tuple with the BoolValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetadataValueOneOf5) GetBoolValueOk() (*bool, bool) {
if o == nil || IsNil(o.BoolValue) {
return nil, false
}
return o.BoolValue, true
}
// HasBoolValue returns a boolean if a field has been set.
func (o *MetadataValueOneOf5) HasBoolValue() bool {
if o != nil && !IsNil(o.BoolValue) {
return true
}
return false
}
// SetBoolValue gets a reference to the given bool and assigns it to the BoolValue field.
func (o *MetadataValueOneOf5) SetBoolValue(v bool) {
o.BoolValue = &v
}
func (o MetadataValueOneOf5) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetadataValueOneOf5) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BoolValue) {
toSerialize["bool_value"] = o.BoolValue
}
return toSerialize, nil
}
type NullableMetadataValueOneOf5 struct {
value *MetadataValueOneOf5
isSet bool
}
func (v NullableMetadataValueOneOf5) Get() *MetadataValueOneOf5 {
return v.value
}
func (v *NullableMetadataValueOneOf5) Set(val *MetadataValueOneOf5) {
v.value = val
v.isSet = true
}
func (v NullableMetadataValueOneOf5) IsSet() bool {
return v.isSet
}
func (v *NullableMetadataValueOneOf5) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetadataValueOneOf5(val *MetadataValueOneOf5) *NullableMetadataValueOneOf5 {
return &NullableMetadataValueOneOf5{value: val, isSet: true}
}
func (v NullableMetadataValueOneOf5) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetadataValueOneOf5) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,636 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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 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"`
// 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"`
// Output only. 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"`
ArtifactType string `json:"artifactType"`
// Name of the model format.
ModelFormatName *string `json:"modelFormatName,omitempty"`
// Model runtime.
Runtime *string `json:"runtime,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"`
}
// 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(artifactType string) *ModelArtifact {
this := ModelArtifact{}
var state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
this.ArtifactType = artifactType
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 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 nil, 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
}
// 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
}
// 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
}
// 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
}
// GetArtifactType returns the ArtifactType field value
func (o *ModelArtifact) GetArtifactType() string {
if o == nil {
var ret string
return ret
}
return o.ArtifactType
}
// GetArtifactTypeOk returns a tuple with the ArtifactType field value
// and a boolean to check if the value has been set.
func (o *ModelArtifact) GetArtifactTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ArtifactType, true
}
// SetArtifactType sets field value
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
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) 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 *ModelArtifact) SetRuntime(v string) {
o.Runtime = &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
}
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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
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
}
toSerialize["artifactType"] = o.ArtifactType
if !IsNil(o.ModelFormatName) {
toSerialize["modelFormatName"] = o.ModelFormatName
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
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
}
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)
}

View File

@ -0,0 +1,498 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 An ML model artifact.
type ModelArtifactCreate struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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 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"`
// 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"`
// Name of the model format.
ModelFormatName *string `json:"modelFormatName,omitempty"`
// Model runtime.
Runtime *string `json:"runtime,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"`
}
// 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 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 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 nil, 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
}
// 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
}
// 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
}
// 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
}
// 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
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) 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 *ModelArtifactCreate) SetRuntime(v string) {
o.Runtime = &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
}
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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.ModelFormatName) {
toSerialize["modelFormatName"] = o.ModelFormatName
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
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
}
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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *ModelArtifactList {
this := ModelArtifactList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *ModelArtifactList) GetItems() []ModelArtifact {
if o == nil || IsNil(o.Items) {
var ret []ModelArtifact
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactList) GetItemsOk() ([]ModelArtifact, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *ModelArtifactList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []ModelArtifact and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,461 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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.
type ModelArtifactUpdate struct {
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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 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"`
// Name of the model format.
ModelFormatName *string `json:"modelFormatName,omitempty"`
// Model runtime.
Runtime *string `json:"runtime,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"`
}
// 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 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 state ArtifactState = ARTIFACTSTATE_UNKNOWN
this.State = &state
return &this
}
// GetCustomProperties returns the CustomProperties field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) GetCustomProperties() map[string]MetadataValue {
if o == nil || IsNil(o.CustomProperties) {
var ret map[string]MetadataValue
return ret
}
return *o.CustomProperties
}
// GetCustomPropertiesOk returns a tuple with the CustomProperties field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelArtifactUpdate) GetCustomPropertiesOk() (*map[string]MetadataValue, bool) {
if o == nil || IsNil(o.CustomProperties) {
return nil, false
}
return o.CustomProperties, true
}
// HasCustomProperties returns a boolean if a field has been set.
func (o *ModelArtifactUpdate) HasCustomProperties() bool {
if o != nil && !IsNil(o.CustomProperties) {
return true
}
return false
}
// SetCustomProperties gets a reference to the given map[string]MetadataValue and assigns it to the CustomProperties field.
func (o *ModelArtifactUpdate) SetCustomProperties(v map[string]MetadataValue) {
o.CustomProperties = &v
}
// 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
}
// 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
}
// 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
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) 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 *ModelArtifactUpdate) SetRuntime(v string) {
o.Runtime = &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
}
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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.ModelFormatName) {
toSerialize["modelFormatName"] = o.ModelFormatName
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
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
}
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)
}

View File

@ -0,0 +1,310 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
// Output only. 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"`
}
// 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() *ModelVersion {
this := ModelVersion{}
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{}
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 nil, 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
}
// 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 if set, zero value otherwise.
func (o *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) 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 *ModelVersion) SetName(v string) {
o.Name = &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.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
}
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)
}

View File

@ -0,0 +1,226 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
// ID of the `RegisteredModel` to which this version belongs.
RegisteredModelID string `json:"registeredModelID"`
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
}
// 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(registeredModelID string) *ModelVersionCreate {
this := ModelVersionCreate{}
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{}
return &this
}
// 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
}
// 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 nil, 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
}
// 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 if set, zero value otherwise.
func (o *ModelVersionCreate) 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 *ModelVersionCreate) 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 *ModelVersionCreate) 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 *ModelVersionCreate) SetName(v string) {
o.Name = &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{}{}
toSerialize["registeredModelID"] = o.RegisteredModelID
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *ModelVersionList {
this := ModelVersionList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *ModelVersionList) GetItems() []ModelVersion {
if o == nil || IsNil(o.Items) {
var ret []ModelVersion
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelVersionList) GetItemsOk() ([]ModelVersion, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *ModelVersionList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []ModelVersion and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,162 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
}
// 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{}
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{}
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 nil, 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
}
// 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
}
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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
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)
}

View File

@ -0,0 +1,112 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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)
}

View File

@ -0,0 +1,310 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
// Output only. 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"`
}
// 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() *RegisteredModel {
this := RegisteredModel{}
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{}
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 nil, 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
}
// 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 if set, zero value otherwise.
func (o *RegisteredModel) 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 *RegisteredModel) 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 *RegisteredModel) 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 *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
}
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.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
}
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)
}

View File

@ -0,0 +1,199 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
}
// 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() *RegisteredModelCreate {
this := RegisteredModelCreate{}
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{}
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 nil, 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
}
// 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 if set, zero value otherwise.
func (o *RegisteredModelCreate) 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 *RegisteredModelCreate) 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 *RegisteredModelCreate) 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 *RegisteredModelCreate) SetName(v string) {
o.Name = &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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *RegisteredModelList {
this := RegisteredModelList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *RegisteredModelList) GetItems() []RegisteredModel {
if o == nil || IsNil(o.Items) {
var ret []RegisteredModel
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegisteredModelList) GetItemsOk() ([]RegisteredModel, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *RegisteredModelList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []RegisteredModel and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,162 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
}
// 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{}
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{}
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 nil, 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
}
// 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
}
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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
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)
}

View File

@ -0,0 +1,378 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
// Output only. 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` that was served in `InferenceService`.
ModelVersionId string `json:"modelVersionId"`
}
// 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
}
// 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
}
// 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 nil, 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
}
// 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
}
// 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.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
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
}
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)
}

View File

@ -0,0 +1,267 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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` that was served in `InferenceService`.
ModelVersionId string `json:"modelVersionId"`
}
// 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
}
// 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
}
// 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 nil, 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
}
// 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
}
// 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.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *ServeModelList {
this := ServeModelList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *ServeModelList) GetItems() []ServeModel {
if o == nil || IsNil(o.Items) {
var ret []ServeModel
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServeModelList) GetItemsOk() ([]ServeModel, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *ServeModelList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []ServeModel and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,202 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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 {
LastKnownState *ExecutionState `json:"lastKnownState,omitempty"`
// User provided custom properties which are not defined by its type.
CustomProperties *map[string]MetadataValue `json:"customProperties,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"`
}
// 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
}
// 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
}
// 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 nil, 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
}
// 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
}
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.LastKnownState) {
toSerialize["lastKnownState"] = o.LastKnownState
}
if !IsNil(o.CustomProperties) {
toSerialize["customProperties"] = o.CustomProperties
}
if !IsNil(o.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
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)
}

View File

@ -0,0 +1,310 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
// Output only. 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"`
}
// 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() *ServingEnvironment {
this := ServingEnvironment{}
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 nil, 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
}
// 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 if set, zero value otherwise.
func (o *ServingEnvironment) 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 *ServingEnvironment) 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 *ServingEnvironment) 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 *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.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
}
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)
}

View File

@ -0,0 +1,199 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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"`
}
// 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() *ServingEnvironmentCreate {
this := ServingEnvironmentCreate{}
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 nil, 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
}
// 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 if set, zero value otherwise.
func (o *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) 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 *ServingEnvironmentCreate) 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 *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.ExternalID) {
toSerialize["externalID"] = o.ExternalID
}
if !IsNil(o.Name) {
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)
}

View File

@ -0,0 +1,209 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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,omitempty"`
}
// 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) *ServingEnvironmentList {
this := ServingEnvironmentList{}
this.NextPageToken = nextPageToken
this.PageSize = pageSize
this.Size = size
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 if set, zero value otherwise.
func (o *ServingEnvironmentList) GetItems() []ServingEnvironment {
if o == nil || IsNil(o.Items) {
var ret []ServingEnvironment
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServingEnvironmentList) GetItemsOk() ([]ServingEnvironment, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *ServingEnvironmentList) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []ServingEnvironment and assigns it to the Items field.
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
if !IsNil(o.Items) {
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)
}

View File

@ -0,0 +1,162 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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"`
// 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 nil, 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
}
// 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.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)
}

View File

@ -0,0 +1,110 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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)
}

View File

@ -0,0 +1,47 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// 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
}

View File

@ -0,0 +1,347 @@
/*
Model Registry REST API
REST API for Model Registry to create and manage ML model metadata
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"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 v.value.MarshalJSON()
}
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)
}

View File

@ -0,0 +1,55 @@
api.go
api_model_registry_service.go
error.go
helpers.go
impl.go
logger.go
model_artifact.go
model_artifact_list.go
model_artifact_state.go
model_base_artifact.go
model_base_artifact_create.go
model_base_artifact_update.go
model_base_execution.go
model_base_execution_create.go
model_base_execution_update.go
model_base_resource.go
model_base_resource_create.go
model_base_resource_list.go
model_base_resource_update.go
model_error.go
model_execution_state.go
model_inference_service.go
model_inference_service_create.go
model_inference_service_list.go
model_inference_service_update.go
model_metadata_value.go
model_metadata_value_one_of.go
model_metadata_value_one_of_1.go
model_metadata_value_one_of_2.go
model_metadata_value_one_of_3.go
model_metadata_value_one_of_4.go
model_metadata_value_one_of_5.go
model_model_artifact.go
model_model_artifact_create.go
model_model_artifact_list.go
model_model_artifact_update.go
model_model_version.go
model_model_version_create.go
model_model_version_list.go
model_model_version_update.go
model_order_by_field.go
model_registered_model.go
model_registered_model_create.go
model_registered_model_list.go
model_registered_model_update.go
model_serve_model.go
model_serve_model_create.go
model_serve_model_list.go
model_serve_model_update.go
model_serving_environment.go
model_serving_environment_create.go
model_serving_environment_list.go
model_serving_environment_update.go
model_sort_order.go
routers.go

View File

@ -0,0 +1 @@
7.0.1

View File

@ -0,0 +1,99 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"context"
model "github.com/opendatahub-io/model-registry/internal/model/openapi"
"net/http"
)
// ModelRegistryServiceAPIRouter defines the required methods for binding the api requests to a responses for the ModelRegistryServiceAPI
// The ModelRegistryServiceAPIRouter implementation should parse necessary information from the http request,
// pass the data to a ModelRegistryServiceAPIServicer to perform the required actions, then write the service results to the http response.
type ModelRegistryServiceAPIRouter interface {
CreateEnvironmentInferenceService(http.ResponseWriter, *http.Request)
CreateInferenceService(http.ResponseWriter, *http.Request)
CreateInferenceServiceServe(http.ResponseWriter, *http.Request)
CreateModelArtifact(http.ResponseWriter, *http.Request)
CreateModelVersion(http.ResponseWriter, *http.Request)
CreateModelVersionArtifact(http.ResponseWriter, *http.Request)
CreateRegisteredModel(http.ResponseWriter, *http.Request)
CreateRegisteredModelVersion(http.ResponseWriter, *http.Request)
CreateServingEnvironment(http.ResponseWriter, *http.Request)
FindInferenceService(http.ResponseWriter, *http.Request)
FindModelArtifact(http.ResponseWriter, *http.Request)
FindModelVersion(http.ResponseWriter, *http.Request)
FindRegisteredModel(http.ResponseWriter, *http.Request)
FindServingEnvironment(http.ResponseWriter, *http.Request)
GetEnvironmentInferenceServices(http.ResponseWriter, *http.Request)
GetInferenceService(http.ResponseWriter, *http.Request)
GetInferenceServiceModel(http.ResponseWriter, *http.Request)
GetInferenceServiceServes(http.ResponseWriter, *http.Request)
GetInferenceServiceVersion(http.ResponseWriter, *http.Request)
GetInferenceServices(http.ResponseWriter, *http.Request)
GetModelArtifact(http.ResponseWriter, *http.Request)
GetModelArtifacts(http.ResponseWriter, *http.Request)
GetModelVersion(http.ResponseWriter, *http.Request)
GetModelVersionArtifacts(http.ResponseWriter, *http.Request)
GetModelVersions(http.ResponseWriter, *http.Request)
GetRegisteredModel(http.ResponseWriter, *http.Request)
GetRegisteredModelVersions(http.ResponseWriter, *http.Request)
GetRegisteredModels(http.ResponseWriter, *http.Request)
GetServingEnvironment(http.ResponseWriter, *http.Request)
GetServingEnvironments(http.ResponseWriter, *http.Request)
UpdateInferenceService(http.ResponseWriter, *http.Request)
UpdateModelArtifact(http.ResponseWriter, *http.Request)
UpdateModelVersion(http.ResponseWriter, *http.Request)
UpdateRegisteredModel(http.ResponseWriter, *http.Request)
UpdateServingEnvironment(http.ResponseWriter, *http.Request)
}
// ModelRegistryServiceAPIServicer defines the api actions for the ModelRegistryServiceAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can be ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type ModelRegistryServiceAPIServicer interface {
CreateEnvironmentInferenceService(context.Context, string, model.InferenceServiceCreate) (ImplResponse, error)
CreateInferenceService(context.Context, model.InferenceServiceCreate) (ImplResponse, error)
CreateInferenceServiceServe(context.Context, string, model.ServeModelCreate) (ImplResponse, error)
CreateModelArtifact(context.Context, model.ModelArtifactCreate) (ImplResponse, error)
CreateModelVersion(context.Context, model.ModelVersionCreate) (ImplResponse, error)
CreateModelVersionArtifact(context.Context, string, model.Artifact) (ImplResponse, error)
CreateRegisteredModel(context.Context, model.RegisteredModelCreate) (ImplResponse, error)
CreateRegisteredModelVersion(context.Context, string, model.ModelVersion) (ImplResponse, error)
CreateServingEnvironment(context.Context, model.ServingEnvironmentCreate) (ImplResponse, error)
FindInferenceService(context.Context, string, string) (ImplResponse, error)
FindModelArtifact(context.Context, string, string) (ImplResponse, error)
FindModelVersion(context.Context, string, string) (ImplResponse, error)
FindRegisteredModel(context.Context, string, string) (ImplResponse, error)
FindServingEnvironment(context.Context, string, string) (ImplResponse, error)
GetEnvironmentInferenceServices(context.Context, string, string, string, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetInferenceService(context.Context, string) (ImplResponse, error)
GetInferenceServiceModel(context.Context, string) (ImplResponse, error)
GetInferenceServiceServes(context.Context, string, string, string, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetInferenceServiceVersion(context.Context, string) (ImplResponse, error)
GetInferenceServices(context.Context, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetModelArtifact(context.Context, string) (ImplResponse, error)
GetModelArtifacts(context.Context, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetModelVersion(context.Context, string) (ImplResponse, error)
GetModelVersionArtifacts(context.Context, string, string, string, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetModelVersions(context.Context, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetRegisteredModel(context.Context, string) (ImplResponse, error)
GetRegisteredModelVersions(context.Context, string, string, string, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetRegisteredModels(context.Context, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
GetServingEnvironment(context.Context, string) (ImplResponse, error)
GetServingEnvironments(context.Context, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
UpdateInferenceService(context.Context, string, model.InferenceServiceUpdate) (ImplResponse, error)
UpdateModelArtifact(context.Context, string, model.ModelArtifactUpdate) (ImplResponse, error)
UpdateModelVersion(context.Context, string, model.ModelVersion) (ImplResponse, error)
UpdateRegisteredModel(context.Context, string, model.RegisteredModelUpdate) (ImplResponse, error)
UpdateServingEnvironment(context.Context, string, model.ServingEnvironmentUpdate) (ImplResponse, error)
}

View File

@ -0,0 +1,948 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"encoding/json"
"net/http"
"strings"
"github.com/go-chi/chi/v5"
model "github.com/opendatahub-io/model-registry/internal/model/openapi"
)
// ModelRegistryServiceAPIController binds http requests to an api service and writes the service results to the http response
type ModelRegistryServiceAPIController struct {
service ModelRegistryServiceAPIServicer
errorHandler ErrorHandler
}
// ModelRegistryServiceAPIOption for how the controller is set up.
type ModelRegistryServiceAPIOption func(*ModelRegistryServiceAPIController)
// WithModelRegistryServiceAPIErrorHandler inject ErrorHandler into controller
func WithModelRegistryServiceAPIErrorHandler(h ErrorHandler) ModelRegistryServiceAPIOption {
return func(c *ModelRegistryServiceAPIController) {
c.errorHandler = h
}
}
// NewModelRegistryServiceAPIController creates a default api controller
func NewModelRegistryServiceAPIController(s ModelRegistryServiceAPIServicer, opts ...ModelRegistryServiceAPIOption) Router {
controller := &ModelRegistryServiceAPIController{
service: s,
errorHandler: DefaultErrorHandler,
}
for _, opt := range opts {
opt(controller)
}
return controller
}
// Routes returns all the api routes for the ModelRegistryServiceAPIController
func (c *ModelRegistryServiceAPIController) Routes() Routes {
return Routes{
"CreateEnvironmentInferenceService": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/serving_environments/{servingenvironmentId}/inference_services",
c.CreateEnvironmentInferenceService,
},
"CreateInferenceService": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/inference_services",
c.CreateInferenceService,
},
"CreateInferenceServiceServe": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}/serves",
c.CreateInferenceServiceServe,
},
"CreateModelArtifact": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/model_artifacts",
c.CreateModelArtifact,
},
"CreateModelVersion": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/model_versions",
c.CreateModelVersion,
},
"CreateModelVersionArtifact": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/model_versions/{modelversionId}/artifacts",
c.CreateModelVersionArtifact,
},
"CreateRegisteredModel": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/registered_models",
c.CreateRegisteredModel,
},
"CreateRegisteredModelVersion": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/registered_models/{registeredmodelId}/versions",
c.CreateRegisteredModelVersion,
},
"CreateServingEnvironment": Route{
strings.ToUpper("Post"),
"/api/model_registry/v1alpha1/serving_environments",
c.CreateServingEnvironment,
},
"FindInferenceService": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/inference_service",
c.FindInferenceService,
},
"FindModelArtifact": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_artifact",
c.FindModelArtifact,
},
"FindModelVersion": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_version",
c.FindModelVersion,
},
"FindRegisteredModel": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/registered_model",
c.FindRegisteredModel,
},
"FindServingEnvironment": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/serving_environment",
c.FindServingEnvironment,
},
"GetEnvironmentInferenceServices": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/serving_environments/{servingenvironmentId}/inference_services",
c.GetEnvironmentInferenceServices,
},
"GetInferenceService": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}",
c.GetInferenceService,
},
"GetInferenceServiceModel": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}/model",
c.GetInferenceServiceModel,
},
"GetInferenceServiceServes": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}/serves",
c.GetInferenceServiceServes,
},
"GetInferenceServiceVersion": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}/version",
c.GetInferenceServiceVersion,
},
"GetInferenceServices": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/inference_services",
c.GetInferenceServices,
},
"GetModelArtifact": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_artifacts/{modelartifactId}",
c.GetModelArtifact,
},
"GetModelArtifacts": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_artifacts",
c.GetModelArtifacts,
},
"GetModelVersion": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_versions/{modelversionId}",
c.GetModelVersion,
},
"GetModelVersionArtifacts": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_versions/{modelversionId}/artifacts",
c.GetModelVersionArtifacts,
},
"GetModelVersions": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/model_versions",
c.GetModelVersions,
},
"GetRegisteredModel": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/registered_models/{registeredmodelId}",
c.GetRegisteredModel,
},
"GetRegisteredModelVersions": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/registered_models/{registeredmodelId}/versions",
c.GetRegisteredModelVersions,
},
"GetRegisteredModels": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/registered_models",
c.GetRegisteredModels,
},
"GetServingEnvironment": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/serving_environments/{servingenvironmentId}",
c.GetServingEnvironment,
},
"GetServingEnvironments": Route{
strings.ToUpper("Get"),
"/api/model_registry/v1alpha1/serving_environments",
c.GetServingEnvironments,
},
"UpdateInferenceService": Route{
strings.ToUpper("Patch"),
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}",
c.UpdateInferenceService,
},
"UpdateModelArtifact": Route{
strings.ToUpper("Patch"),
"/api/model_registry/v1alpha1/model_artifacts/{modelartifactId}",
c.UpdateModelArtifact,
},
"UpdateModelVersion": Route{
strings.ToUpper("Patch"),
"/api/model_registry/v1alpha1/model_versions/{modelversionId}",
c.UpdateModelVersion,
},
"UpdateRegisteredModel": Route{
strings.ToUpper("Patch"),
"/api/model_registry/v1alpha1/registered_models/{registeredmodelId}",
c.UpdateRegisteredModel,
},
"UpdateServingEnvironment": Route{
strings.ToUpper("Patch"),
"/api/model_registry/v1alpha1/serving_environments/{servingenvironmentId}",
c.UpdateServingEnvironment,
},
}
}
// CreateEnvironmentInferenceService - Create a InferenceService in ServingEnvironment
func (c *ModelRegistryServiceAPIController) CreateEnvironmentInferenceService(w http.ResponseWriter, r *http.Request) {
servingenvironmentIdParam := chi.URLParam(r, "servingenvironmentId")
inferenceServiceCreateParam := model.InferenceServiceCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&inferenceServiceCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertInferenceServiceCreateRequired(inferenceServiceCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertInferenceServiceCreateConstraints(inferenceServiceCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateEnvironmentInferenceService(r.Context(), servingenvironmentIdParam, inferenceServiceCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateInferenceService - Create a InferenceService
func (c *ModelRegistryServiceAPIController) CreateInferenceService(w http.ResponseWriter, r *http.Request) {
inferenceServiceCreateParam := model.InferenceServiceCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&inferenceServiceCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertInferenceServiceCreateRequired(inferenceServiceCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertInferenceServiceCreateConstraints(inferenceServiceCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateInferenceService(r.Context(), inferenceServiceCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateInferenceServiceServe - Create a ServeModel action in a InferenceService
func (c *ModelRegistryServiceAPIController) CreateInferenceServiceServe(w http.ResponseWriter, r *http.Request) {
inferenceserviceIdParam := chi.URLParam(r, "inferenceserviceId")
serveModelCreateParam := model.ServeModelCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&serveModelCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertServeModelCreateRequired(serveModelCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertServeModelCreateConstraints(serveModelCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateInferenceServiceServe(r.Context(), inferenceserviceIdParam, serveModelCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateModelArtifact - Create a ModelArtifact
func (c *ModelRegistryServiceAPIController) CreateModelArtifact(w http.ResponseWriter, r *http.Request) {
modelArtifactCreateParam := model.ModelArtifactCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&modelArtifactCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertModelArtifactCreateRequired(modelArtifactCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertModelArtifactCreateConstraints(modelArtifactCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateModelArtifact(r.Context(), modelArtifactCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateModelVersion - Create a ModelVersion
func (c *ModelRegistryServiceAPIController) CreateModelVersion(w http.ResponseWriter, r *http.Request) {
modelVersionCreateParam := model.ModelVersionCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&modelVersionCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertModelVersionCreateRequired(modelVersionCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertModelVersionCreateConstraints(modelVersionCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateModelVersion(r.Context(), modelVersionCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateModelVersionArtifact - Create an Artifact in a ModelVersion
func (c *ModelRegistryServiceAPIController) CreateModelVersionArtifact(w http.ResponseWriter, r *http.Request) {
modelversionIdParam := chi.URLParam(r, "modelversionId")
artifactParam := model.Artifact{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&artifactParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertArtifactRequired(artifactParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertArtifactConstraints(artifactParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateModelVersionArtifact(r.Context(), modelversionIdParam, artifactParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateRegisteredModel - Create a RegisteredModel
func (c *ModelRegistryServiceAPIController) CreateRegisteredModel(w http.ResponseWriter, r *http.Request) {
registeredModelCreateParam := model.RegisteredModelCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&registeredModelCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertRegisteredModelCreateRequired(registeredModelCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertRegisteredModelCreateConstraints(registeredModelCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateRegisteredModel(r.Context(), registeredModelCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateRegisteredModelVersion - Create a ModelVersion in RegisteredModel
func (c *ModelRegistryServiceAPIController) CreateRegisteredModelVersion(w http.ResponseWriter, r *http.Request) {
registeredmodelIdParam := chi.URLParam(r, "registeredmodelId")
modelVersionParam := model.ModelVersion{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&modelVersionParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertModelVersionRequired(modelVersionParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertModelVersionConstraints(modelVersionParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateRegisteredModelVersion(r.Context(), registeredmodelIdParam, modelVersionParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// CreateServingEnvironment - Create a ServingEnvironment
func (c *ModelRegistryServiceAPIController) CreateServingEnvironment(w http.ResponseWriter, r *http.Request) {
servingEnvironmentCreateParam := model.ServingEnvironmentCreate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&servingEnvironmentCreateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertServingEnvironmentCreateRequired(servingEnvironmentCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertServingEnvironmentCreateConstraints(servingEnvironmentCreateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.CreateServingEnvironment(r.Context(), servingEnvironmentCreateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// FindInferenceService - Get an InferenceServices that matches search parameters.
func (c *ModelRegistryServiceAPIController) FindInferenceService(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
result, err := c.service.FindInferenceService(r.Context(), nameParam, externalIDParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// FindModelArtifact - Get a ModelArtifact that matches search parameters.
func (c *ModelRegistryServiceAPIController) FindModelArtifact(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
result, err := c.service.FindModelArtifact(r.Context(), nameParam, externalIDParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// FindModelVersion - Get a ModelVersion that matches search parameters.
func (c *ModelRegistryServiceAPIController) FindModelVersion(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
result, err := c.service.FindModelVersion(r.Context(), nameParam, externalIDParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// FindRegisteredModel - Get a RegisteredModel that matches search parameters.
func (c *ModelRegistryServiceAPIController) FindRegisteredModel(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
result, err := c.service.FindRegisteredModel(r.Context(), nameParam, externalIDParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// FindServingEnvironment - Find ServingEnvironment
func (c *ModelRegistryServiceAPIController) FindServingEnvironment(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
result, err := c.service.FindServingEnvironment(r.Context(), nameParam, externalIDParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetEnvironmentInferenceServices - List All ServingEnvironment's InferenceServices
func (c *ModelRegistryServiceAPIController) GetEnvironmentInferenceServices(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
servingenvironmentIdParam := chi.URLParam(r, "servingenvironmentId")
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetEnvironmentInferenceServices(r.Context(), servingenvironmentIdParam, nameParam, externalIDParam, pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetInferenceService - Get a InferenceService
func (c *ModelRegistryServiceAPIController) GetInferenceService(w http.ResponseWriter, r *http.Request) {
inferenceserviceIdParam := chi.URLParam(r, "inferenceserviceId")
result, err := c.service.GetInferenceService(r.Context(), inferenceserviceIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetInferenceServiceModel - Get InferenceService's RegisteredModel
func (c *ModelRegistryServiceAPIController) GetInferenceServiceModel(w http.ResponseWriter, r *http.Request) {
inferenceserviceIdParam := chi.URLParam(r, "inferenceserviceId")
result, err := c.service.GetInferenceServiceModel(r.Context(), inferenceserviceIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetInferenceServiceServes - List All InferenceService's ServeModel actions
func (c *ModelRegistryServiceAPIController) GetInferenceServiceServes(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
inferenceserviceIdParam := chi.URLParam(r, "inferenceserviceId")
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetInferenceServiceServes(r.Context(), inferenceserviceIdParam, nameParam, externalIDParam, pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetInferenceServiceVersion - Get InferenceService's ModelVersion
func (c *ModelRegistryServiceAPIController) GetInferenceServiceVersion(w http.ResponseWriter, r *http.Request) {
inferenceserviceIdParam := chi.URLParam(r, "inferenceserviceId")
result, err := c.service.GetInferenceServiceVersion(r.Context(), inferenceserviceIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetInferenceServices - List All InferenceServices
func (c *ModelRegistryServiceAPIController) GetInferenceServices(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetInferenceServices(r.Context(), pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetModelArtifact - Get a ModelArtifact
func (c *ModelRegistryServiceAPIController) GetModelArtifact(w http.ResponseWriter, r *http.Request) {
modelartifactIdParam := chi.URLParam(r, "modelartifactId")
result, err := c.service.GetModelArtifact(r.Context(), modelartifactIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetModelArtifacts - List All ModelArtifacts
func (c *ModelRegistryServiceAPIController) GetModelArtifacts(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetModelArtifacts(r.Context(), pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetModelVersion - Get a ModelVersion
func (c *ModelRegistryServiceAPIController) GetModelVersion(w http.ResponseWriter, r *http.Request) {
modelversionIdParam := chi.URLParam(r, "modelversionId")
result, err := c.service.GetModelVersion(r.Context(), modelversionIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetModelVersionArtifacts - List All ModelVersion's artifacts
func (c *ModelRegistryServiceAPIController) GetModelVersionArtifacts(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
modelversionIdParam := chi.URLParam(r, "modelversionId")
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetModelVersionArtifacts(r.Context(), modelversionIdParam, nameParam, externalIDParam, pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetModelVersions - List All ModelVersions
func (c *ModelRegistryServiceAPIController) GetModelVersions(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetModelVersions(r.Context(), pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetRegisteredModel - Get a RegisteredModel
func (c *ModelRegistryServiceAPIController) GetRegisteredModel(w http.ResponseWriter, r *http.Request) {
registeredmodelIdParam := chi.URLParam(r, "registeredmodelId")
result, err := c.service.GetRegisteredModel(r.Context(), registeredmodelIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetRegisteredModelVersions - List All RegisteredModel's ModelVersions
func (c *ModelRegistryServiceAPIController) GetRegisteredModelVersions(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
registeredmodelIdParam := chi.URLParam(r, "registeredmodelId")
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetRegisteredModelVersions(r.Context(), registeredmodelIdParam, nameParam, externalIDParam, pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetRegisteredModels - List All RegisteredModels
func (c *ModelRegistryServiceAPIController) GetRegisteredModels(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetRegisteredModels(r.Context(), pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetServingEnvironment - Get a ServingEnvironment
func (c *ModelRegistryServiceAPIController) GetServingEnvironment(w http.ResponseWriter, r *http.Request) {
servingenvironmentIdParam := chi.URLParam(r, "servingenvironmentId")
result, err := c.service.GetServingEnvironment(r.Context(), servingenvironmentIdParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// GetServingEnvironments - List All ServingEnvironments
func (c *ModelRegistryServiceAPIController) GetServingEnvironments(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
pageSizeParam := query.Get("pageSize")
orderByParam := query.Get("orderBy")
sortOrderParam := query.Get("sortOrder")
nextPageTokenParam := query.Get("nextPageToken")
result, err := c.service.GetServingEnvironments(r.Context(), pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// UpdateInferenceService - Update a InferenceService
func (c *ModelRegistryServiceAPIController) UpdateInferenceService(w http.ResponseWriter, r *http.Request) {
inferenceserviceIdParam := chi.URLParam(r, "inferenceserviceId")
inferenceServiceUpdateParam := model.InferenceServiceUpdate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&inferenceServiceUpdateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertInferenceServiceUpdateRequired(inferenceServiceUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertInferenceServiceUpdateConstraints(inferenceServiceUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.UpdateInferenceService(r.Context(), inferenceserviceIdParam, inferenceServiceUpdateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// UpdateModelArtifact - Update a ModelArtifact
func (c *ModelRegistryServiceAPIController) UpdateModelArtifact(w http.ResponseWriter, r *http.Request) {
modelartifactIdParam := chi.URLParam(r, "modelartifactId")
modelArtifactUpdateParam := model.ModelArtifactUpdate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&modelArtifactUpdateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertModelArtifactUpdateRequired(modelArtifactUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertModelArtifactUpdateConstraints(modelArtifactUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.UpdateModelArtifact(r.Context(), modelartifactIdParam, modelArtifactUpdateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// UpdateModelVersion - Update a ModelVersion
func (c *ModelRegistryServiceAPIController) UpdateModelVersion(w http.ResponseWriter, r *http.Request) {
modelversionIdParam := chi.URLParam(r, "modelversionId")
modelVersionParam := model.ModelVersion{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&modelVersionParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertModelVersionRequired(modelVersionParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertModelVersionConstraints(modelVersionParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.UpdateModelVersion(r.Context(), modelversionIdParam, modelVersionParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// UpdateRegisteredModel - Update a RegisteredModel
func (c *ModelRegistryServiceAPIController) UpdateRegisteredModel(w http.ResponseWriter, r *http.Request) {
registeredmodelIdParam := chi.URLParam(r, "registeredmodelId")
registeredModelUpdateParam := model.RegisteredModelUpdate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&registeredModelUpdateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertRegisteredModelUpdateRequired(registeredModelUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertRegisteredModelUpdateConstraints(registeredModelUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.UpdateRegisteredModel(r.Context(), registeredmodelIdParam, registeredModelUpdateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}
// UpdateServingEnvironment - Update a ServingEnvironment
func (c *ModelRegistryServiceAPIController) UpdateServingEnvironment(w http.ResponseWriter, r *http.Request) {
servingenvironmentIdParam := chi.URLParam(r, "servingenvironmentId")
servingEnvironmentUpdateParam := model.ServingEnvironmentUpdate{}
d := json.NewDecoder(r.Body)
d.DisallowUnknownFields()
if err := d.Decode(&servingEnvironmentUpdateParam); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
if err := AssertServingEnvironmentUpdateRequired(servingEnvironmentUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
if err := AssertServingEnvironmentUpdateConstraints(servingEnvironmentUpdateParam); err != nil {
c.errorHandler(w, r, err, nil)
return
}
result, err := c.service.UpdateServingEnvironment(r.Context(), servingenvironmentIdParam, servingEnvironmentUpdateParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, w)
}

View File

@ -0,0 +1,764 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"context"
"errors"
model "github.com/opendatahub-io/model-registry/internal/model/openapi"
"net/http"
)
// ModelRegistryServiceAPIService is a service that implements the logic for the ModelRegistryServiceAPIServicer
// This service should implement the business logic for every endpoint for the ModelRegistryServiceAPI API.
// Include any external packages or services that will be required by this service.
type ModelRegistryServiceAPIService struct {
}
// NewModelRegistryServiceAPIService creates a default api service
func NewModelRegistryServiceAPIService() ModelRegistryServiceAPIServicer {
return &ModelRegistryServiceAPIService{}
}
// CreateEnvironmentInferenceService - Create a InferenceService in ServingEnvironment
func (s *ModelRegistryServiceAPIService) CreateEnvironmentInferenceService(ctx context.Context, servingenvironmentId string, inferenceServiceCreate model.InferenceServiceCreate) (ImplResponse, error) {
// TODO - update CreateEnvironmentInferenceService with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, InferenceService{}) or use other options such as http.Ok ...
// return Response(201, InferenceService{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateEnvironmentInferenceService method not implemented")
}
// CreateInferenceService - Create a InferenceService
func (s *ModelRegistryServiceAPIService) CreateInferenceService(ctx context.Context, inferenceServiceCreate model.InferenceServiceCreate) (ImplResponse, error) {
// TODO - update CreateInferenceService with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, InferenceService{}) or use other options such as http.Ok ...
// return Response(200, InferenceService{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateInferenceService method not implemented")
}
// CreateInferenceServiceServe - Create a ServeModel action in a InferenceService
func (s *ModelRegistryServiceAPIService) CreateInferenceServiceServe(ctx context.Context, inferenceserviceId string, serveModelCreate model.ServeModelCreate) (ImplResponse, error) {
// TODO - update CreateInferenceServiceServe with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, ServeModel{}) or use other options such as http.Ok ...
// return Response(201, ServeModel{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateInferenceServiceServe method not implemented")
}
// CreateModelArtifact - Create a ModelArtifact
func (s *ModelRegistryServiceAPIService) CreateModelArtifact(ctx context.Context, modelArtifactCreate model.ModelArtifactCreate) (ImplResponse, error) {
// TODO - update CreateModelArtifact with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, ModelArtifact{}) or use other options such as http.Ok ...
// return Response(201, ModelArtifact{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateModelArtifact method not implemented")
}
// CreateModelVersion - Create a ModelVersion
func (s *ModelRegistryServiceAPIService) CreateModelVersion(ctx context.Context, modelVersionCreate model.ModelVersionCreate) (ImplResponse, error) {
// TODO - update CreateModelVersion with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, ModelVersion{}) or use other options such as http.Ok ...
// return Response(201, ModelVersion{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateModelVersion method not implemented")
}
// CreateModelVersionArtifact - Create an Artifact in a ModelVersion
func (s *ModelRegistryServiceAPIService) CreateModelVersionArtifact(ctx context.Context, modelversionId string, artifact model.Artifact) (ImplResponse, error) {
// TODO - update CreateModelVersionArtifact with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, Artifact{}) or use other options such as http.Ok ...
// return Response(200, Artifact{}), nil
// TODO: Uncomment the next line to return response Response(201, Artifact{}) or use other options such as http.Ok ...
// return Response(201, Artifact{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateModelVersionArtifact method not implemented")
}
// CreateRegisteredModel - Create a RegisteredModel
func (s *ModelRegistryServiceAPIService) CreateRegisteredModel(ctx context.Context, registeredModelCreate model.RegisteredModelCreate) (ImplResponse, error) {
// TODO - update CreateRegisteredModel with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, RegisteredModel{}) or use other options such as http.Ok ...
// return Response(201, RegisteredModel{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateRegisteredModel method not implemented")
}
// CreateRegisteredModelVersion - Create a ModelVersion in RegisteredModel
func (s *ModelRegistryServiceAPIService) CreateRegisteredModelVersion(ctx context.Context, registeredmodelId string, modelVersion model.ModelVersion) (ImplResponse, error) {
// TODO - update CreateRegisteredModelVersion with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, ModelVersion{}) or use other options such as http.Ok ...
// return Response(201, ModelVersion{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateRegisteredModelVersion method not implemented")
}
// CreateServingEnvironment - Create a ServingEnvironment
func (s *ModelRegistryServiceAPIService) CreateServingEnvironment(ctx context.Context, servingEnvironmentCreate model.ServingEnvironmentCreate) (ImplResponse, error) {
// TODO - update CreateServingEnvironment with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(201, ServingEnvironment{}) or use other options such as http.Ok ...
// return Response(201, ServingEnvironment{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("CreateServingEnvironment method not implemented")
}
// FindInferenceService - Get an InferenceServices that matches search parameters.
func (s *ModelRegistryServiceAPIService) FindInferenceService(ctx context.Context, name string, externalID string) (ImplResponse, error) {
// TODO - update FindInferenceService with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, InferenceService{}) or use other options such as http.Ok ...
// return Response(200, InferenceService{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("FindInferenceService method not implemented")
}
// FindModelArtifact - Get a ModelArtifact that matches search parameters.
func (s *ModelRegistryServiceAPIService) FindModelArtifact(ctx context.Context, name string, externalID string) (ImplResponse, error) {
// TODO - update FindModelArtifact with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelArtifact{}) or use other options such as http.Ok ...
// return Response(200, ModelArtifact{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("FindModelArtifact method not implemented")
}
// FindModelVersion - Get a ModelVersion that matches search parameters.
func (s *ModelRegistryServiceAPIService) FindModelVersion(ctx context.Context, name string, externalID string) (ImplResponse, error) {
// TODO - update FindModelVersion with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelVersion{}) or use other options such as http.Ok ...
// return Response(200, ModelVersion{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("FindModelVersion method not implemented")
}
// FindRegisteredModel - Get a RegisteredModel that matches search parameters.
func (s *ModelRegistryServiceAPIService) FindRegisteredModel(ctx context.Context, name string, externalID string) (ImplResponse, error) {
// TODO - update FindRegisteredModel with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, RegisteredModel{}) or use other options such as http.Ok ...
// return Response(200, RegisteredModel{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("FindRegisteredModel method not implemented")
}
// FindServingEnvironment - Find ServingEnvironment
func (s *ModelRegistryServiceAPIService) FindServingEnvironment(ctx context.Context, name string, externalID string) (ImplResponse, error) {
// TODO - update FindServingEnvironment with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ServingEnvironment{}) or use other options such as http.Ok ...
// return Response(200, ServingEnvironment{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("FindServingEnvironment method not implemented")
}
// GetEnvironmentInferenceServices - List All ServingEnvironment&#39;s InferenceServices
func (s *ModelRegistryServiceAPIService) GetEnvironmentInferenceServices(ctx context.Context, servingenvironmentId string, name string, externalID string, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetEnvironmentInferenceServices with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, InferenceServiceList{}) or use other options such as http.Ok ...
// return Response(200, InferenceServiceList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetEnvironmentInferenceServices method not implemented")
}
// GetInferenceService - Get a InferenceService
func (s *ModelRegistryServiceAPIService) GetInferenceService(ctx context.Context, inferenceserviceId string) (ImplResponse, error) {
// TODO - update GetInferenceService with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, InferenceService{}) or use other options such as http.Ok ...
// return Response(200, InferenceService{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetInferenceService method not implemented")
}
// GetInferenceServiceModel - Get InferenceService&#39;s RegisteredModel
func (s *ModelRegistryServiceAPIService) GetInferenceServiceModel(ctx context.Context, inferenceserviceId string) (ImplResponse, error) {
// TODO - update GetInferenceServiceModel with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, RegisteredModel{}) or use other options such as http.Ok ...
// return Response(200, RegisteredModel{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetInferenceServiceModel method not implemented")
}
// GetInferenceServiceServes - List All InferenceService&#39;s ServeModel actions
func (s *ModelRegistryServiceAPIService) GetInferenceServiceServes(ctx context.Context, inferenceserviceId string, name string, externalID string, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetInferenceServiceServes with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ServeModelList{}) or use other options such as http.Ok ...
// return Response(200, ServeModelList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetInferenceServiceServes method not implemented")
}
// GetInferenceServiceVersion - Get InferenceService&#39;s ModelVersion
func (s *ModelRegistryServiceAPIService) GetInferenceServiceVersion(ctx context.Context, inferenceserviceId string) (ImplResponse, error) {
// TODO - update GetInferenceServiceVersion with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelVersion{}) or use other options such as http.Ok ...
// return Response(200, ModelVersion{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetInferenceServiceVersion method not implemented")
}
// GetInferenceServices - List All InferenceServices
func (s *ModelRegistryServiceAPIService) GetInferenceServices(ctx context.Context, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetInferenceServices with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, InferenceServiceList{}) or use other options such as http.Ok ...
// return Response(200, InferenceServiceList{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetInferenceServices method not implemented")
}
// GetModelArtifact - Get a ModelArtifact
func (s *ModelRegistryServiceAPIService) GetModelArtifact(ctx context.Context, modelartifactId string) (ImplResponse, error) {
// TODO - update GetModelArtifact with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelArtifact{}) or use other options such as http.Ok ...
// return Response(200, ModelArtifact{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetModelArtifact method not implemented")
}
// GetModelArtifacts - List All ModelArtifacts
func (s *ModelRegistryServiceAPIService) GetModelArtifacts(ctx context.Context, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetModelArtifacts with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelArtifactList{}) or use other options such as http.Ok ...
// return Response(200, ModelArtifactList{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetModelArtifacts method not implemented")
}
// GetModelVersion - Get a ModelVersion
func (s *ModelRegistryServiceAPIService) GetModelVersion(ctx context.Context, modelversionId string) (ImplResponse, error) {
// TODO - update GetModelVersion with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelVersion{}) or use other options such as http.Ok ...
// return Response(200, ModelVersion{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetModelVersion method not implemented")
}
// GetModelVersionArtifacts - List All ModelVersion&#39;s artifacts
func (s *ModelRegistryServiceAPIService) GetModelVersionArtifacts(ctx context.Context, modelversionId string, name string, externalID string, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetModelVersionArtifacts with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ArtifactList{}) or use other options such as http.Ok ...
// return Response(200, ArtifactList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetModelVersionArtifacts method not implemented")
}
// GetModelVersions - List All ModelVersions
func (s *ModelRegistryServiceAPIService) GetModelVersions(ctx context.Context, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetModelVersions with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelVersionList{}) or use other options such as http.Ok ...
// return Response(200, ModelVersionList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetModelVersions method not implemented")
}
// GetRegisteredModel - Get a RegisteredModel
func (s *ModelRegistryServiceAPIService) GetRegisteredModel(ctx context.Context, registeredmodelId string) (ImplResponse, error) {
// TODO - update GetRegisteredModel with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, RegisteredModel{}) or use other options such as http.Ok ...
// return Response(200, RegisteredModel{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetRegisteredModel method not implemented")
}
// GetRegisteredModelVersions - List All RegisteredModel&#39;s ModelVersions
func (s *ModelRegistryServiceAPIService) GetRegisteredModelVersions(ctx context.Context, registeredmodelId string, name string, externalID string, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetRegisteredModelVersions with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelVersionList{}) or use other options such as http.Ok ...
// return Response(200, ModelVersionList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetRegisteredModelVersions method not implemented")
}
// GetRegisteredModels - List All RegisteredModels
func (s *ModelRegistryServiceAPIService) GetRegisteredModels(ctx context.Context, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetRegisteredModels with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, RegisteredModelList{}) or use other options such as http.Ok ...
// return Response(200, RegisteredModelList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetRegisteredModels method not implemented")
}
// GetServingEnvironment - Get a ServingEnvironment
func (s *ModelRegistryServiceAPIService) GetServingEnvironment(ctx context.Context, servingenvironmentId string) (ImplResponse, error) {
// TODO - update GetServingEnvironment with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ServingEnvironment{}) or use other options such as http.Ok ...
// return Response(200, ServingEnvironment{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetServingEnvironment method not implemented")
}
// GetServingEnvironments - List All ServingEnvironments
func (s *ModelRegistryServiceAPIService) GetServingEnvironments(ctx context.Context, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
// TODO - update GetServingEnvironments with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ServingEnvironmentList{}) or use other options such as http.Ok ...
// return Response(200, ServingEnvironmentList{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("GetServingEnvironments method not implemented")
}
// UpdateInferenceService - Update a InferenceService
func (s *ModelRegistryServiceAPIService) UpdateInferenceService(ctx context.Context, inferenceserviceId string, inferenceServiceUpdate model.InferenceServiceUpdate) (ImplResponse, error) {
// TODO - update UpdateInferenceService with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, InferenceService{}) or use other options such as http.Ok ...
// return Response(200, InferenceService{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("UpdateInferenceService method not implemented")
}
// UpdateModelArtifact - Update a ModelArtifact
func (s *ModelRegistryServiceAPIService) UpdateModelArtifact(ctx context.Context, modelartifactId string, modelArtifactUpdate model.ModelArtifactUpdate) (ImplResponse, error) {
// TODO - update UpdateModelArtifact with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelArtifact{}) or use other options such as http.Ok ...
// return Response(200, ModelArtifact{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("UpdateModelArtifact method not implemented")
}
// UpdateModelVersion - Update a ModelVersion
func (s *ModelRegistryServiceAPIService) UpdateModelVersion(ctx context.Context, modelversionId string, modelVersion model.ModelVersion) (ImplResponse, error) {
// TODO - update UpdateModelVersion with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ModelVersion{}) or use other options such as http.Ok ...
// return Response(200, ModelVersion{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("UpdateModelVersion method not implemented")
}
// UpdateRegisteredModel - Update a RegisteredModel
func (s *ModelRegistryServiceAPIService) UpdateRegisteredModel(ctx context.Context, registeredmodelId string, registeredModelUpdate model.RegisteredModelUpdate) (ImplResponse, error) {
// TODO - update UpdateRegisteredModel with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, RegisteredModel{}) or use other options such as http.Ok ...
// return Response(200, RegisteredModel{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("UpdateRegisteredModel method not implemented")
}
// UpdateServingEnvironment - Update a ServingEnvironment
func (s *ModelRegistryServiceAPIService) UpdateServingEnvironment(ctx context.Context, servingenvironmentId string, servingEnvironmentUpdate model.ServingEnvironmentUpdate) (ImplResponse, error) {
// TODO - update UpdateServingEnvironment with the required logic for this service method.
// Add api_model_registry_service_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, ServingEnvironment{}) or use other options such as http.Ok ...
// return Response(200, ServingEnvironment{}), nil
// TODO: Uncomment the next line to return response Response(400, Error{}) or use other options such as http.Ok ...
// return Response(400, Error{}), nil
// TODO: Uncomment the next line to return response Response(401, Error{}) or use other options such as http.Ok ...
// return Response(401, Error{}), nil
// TODO: Uncomment the next line to return response Response(404, Error{}) or use other options such as http.Ok ...
// return Response(404, Error{}), nil
// TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok ...
// return Response(500, Error{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("UpdateServingEnvironment method not implemented")
}

View File

@ -0,0 +1,62 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"errors"
"fmt"
"net/http"
)
var (
// ErrTypeAssertionError is thrown when type an interface does not match the asserted type
ErrTypeAssertionError = errors.New("unable to assert type")
)
// ParsingError indicates that an error has occurred when parsing request parameters
type ParsingError struct {
Err error
}
func (e *ParsingError) Unwrap() error {
return e.Err
}
func (e *ParsingError) Error() string {
return e.Err.Error()
}
// RequiredError indicates that an error has occurred when parsing request parameters
type RequiredError struct {
Field string
}
func (e *RequiredError) Error() string {
return fmt.Sprintf("required field '%s' is zero value.", e.Field)
}
// ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if
// you would like errors to be handled differently from the DefaultErrorHandler
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
// DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing
// request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.
func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) {
if _, ok := err.(*ParsingError); ok {
// Handle parsing errors
EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), w)
} else if _, ok := err.(*RequiredError); ok {
// Handle missing required errors
EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), w)
} else {
// Handle all other errors
EncodeJSONResponse(err.Error(), &result.Code, w)
}
}

View File

@ -0,0 +1,60 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"reflect"
)
// Response return a ImplResponse struct filled
func Response(code int, body interface{}) ImplResponse {
return ImplResponse{
Code: code,
Body: body,
}
}
// IsZeroValue checks if the val is the zero-ed value.
func IsZeroValue(val interface{}) bool {
return val == nil || reflect.DeepEqual(val, reflect.Zero(reflect.TypeOf(val)).Interface())
}
// AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback.
// This method traverse nested slices in a preorder fashion.
func AssertRecurseInterfaceRequired[T any](obj interface{}, callback func(T) error) error {
return AssertRecurseValueRequired(reflect.ValueOf(obj), callback)
}
// AssertRecurseValueRequired checks each struct in the nested slice against the callback.
// This method traverse nested slices in a preorder fashion. ErrTypeAssertionError is thrown if
// the underlying struct does not match type T.
func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) error) error {
switch value.Kind() {
// If it is a struct we check using callback
case reflect.Struct:
obj, ok := value.Interface().(T)
if !ok {
return ErrTypeAssertionError
}
if err := callback(obj); err != nil {
return err
}
// If it is a slice we continue recursion
case reflect.Slice:
for i := 0; i < value.Len(); i += 1 {
if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil {
return err
}
}
}
return nil
}

View File

@ -0,0 +1,16 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
// ImplResponse defines an implementation response with error code and the associated body
type ImplResponse struct {
Code int
Body interface{}
}

View File

@ -0,0 +1,32 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"log"
"net/http"
"time"
)
func Logger(inner http.Handler, name string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
inner.ServeHTTP(w, r)
log.Printf(
"%s %s %s %s",
r.Method,
r.RequestURI,
name,
time.Since(start),
)
})
}

View File

@ -0,0 +1,297 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"encoding/json"
"errors"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/golang/glog"
"io"
"mime/multipart"
"net/http"
"os"
"strconv"
"strings"
)
//lint:file-ignore U1000 Ignore all unused code, it's generated
// A Route defines the parameters for an api endpoint
type Route struct {
Method string
Pattern string
HandlerFunc http.HandlerFunc
}
// Routes is a map of defined api endpoints
type Routes map[string]Route
// Router defines the required methods for retrieving api routes
type Router interface {
Routes() Routes
}
const errMsgRequiredMissing = "required parameter is missing"
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
// NewRouter creates a new router for any number of api routers
func NewRouter(routers ...Router) chi.Router {
router := chi.NewRouter()
router.Use(middleware.Logger)
for _, api := range routers {
for _, route := range api.Routes() {
handler := route.HandlerFunc
router.Method(route.Method, route.Pattern, handler)
}
}
return router
}
// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) {
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
if status != nil {
w.WriteHeader(*status)
} else {
w.WriteHeader(http.StatusOK)
}
if i != nil {
if err := json.NewEncoder(w).Encode(i); err != nil {
// FIXME: is it too late to inform the client of an error at this point??
glog.Errorf("error encoding JSON response: %v", err)
}
}
}
// ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error) {
_, fileHeader, err := r.FormFile(key)
if err != nil {
return nil, err
}
return readFileHeaderToTempFile(fileHeader)
}
// ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files
func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error) {
if err := r.ParseMultipartForm(32 << 20); err != nil {
return nil, err
}
files := make([]*os.File, 0, len(r.MultipartForm.File[key]))
for _, fileHeader := range r.MultipartForm.File[key] {
file, err := readFileHeaderToTempFile(fileHeader)
if err != nil {
return nil, err
}
files = append(files, file)
}
return files, nil
}
// readFileHeaderToTempFile reads multipart.FileHeader and writes it to a temporary file
func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error) {
formFile, err := fileHeader.Open()
if err != nil {
return nil, err
}
defer formFile.Close()
fileBytes, err := io.ReadAll(formFile)
if err != nil {
return nil, err
}
file, err := os.CreateTemp("", fileHeader.Filename)
if err != nil {
return nil, err
}
defer file.Close()
// FIXME: return values are ignored!!!
_, _ = file.Write(fileBytes)
return file, nil
}
type Number interface {
~int32 | ~int64 | ~float32 | ~float64
}
type ParseString[T Number | string | bool] func(v string) (T, error)
// parseFloat64 parses a string parameter to an float64.
func parseFloat64(param string) (float64, error) {
if param == "" {
return 0, nil
}
return strconv.ParseFloat(param, 64)
}
// parseFloat32 parses a string parameter to an float32.
func parseFloat32(param string) (float32, error) {
if param == "" {
return 0, nil
}
v, err := strconv.ParseFloat(param, 32)
return float32(v), err
}
// parseInt64 parses a string parameter to an int64.
func parseInt64(param string) (int64, error) {
if param == "" {
return 0, nil
}
return strconv.ParseInt(param, 10, 64)
}
// parseInt32 parses a string parameter to an int32.
func parseInt32(param string) (int32, error) {
if param == "" {
return 0, nil
}
val, err := strconv.ParseInt(param, 10, 32)
return int32(val), err
}
// parseBool parses a string parameter to an bool.
func parseBool(param string) (bool, error) {
if param == "" {
return false, nil
}
return strconv.ParseBool(param)
}
type Operation[T Number | string | bool] func(actual string) (T, bool, error)
func WithRequire[T Number | string | bool](parse ParseString[T]) Operation[T] {
var empty T
return func(actual string) (T, bool, error) {
if actual == "" {
return empty, false, errors.New(errMsgRequiredMissing)
}
v, err := parse(actual)
return v, false, err
}
}
func WithDefaultOrParse[T Number | string | bool](def T, parse ParseString[T]) Operation[T] {
return func(actual string) (T, bool, error) {
if actual == "" {
return def, true, nil
}
v, err := parse(actual)
return v, false, err
}
}
func WithParse[T Number | string | bool](parse ParseString[T]) Operation[T] {
return func(actual string) (T, bool, error) {
v, err := parse(actual)
return v, false, err
}
}
type Constraint[T Number | string | bool] func(actual T) error
func WithMinimum[T Number](expected T) Constraint[T] {
return func(actual T) error {
if actual < expected {
return errors.New(errMsgMinValueConstraint)
}
return nil
}
}
func WithMaximum[T Number](expected T) Constraint[T] {
return func(actual T) error {
if actual > expected {
return errors.New(errMsgMaxValueConstraint)
}
return nil
}
}
// parseNumericParameter parses a numeric parameter to its respective type.
func parseNumericParameter[T Number](param string, fn Operation[T], checks ...Constraint[T]) (T, error) {
v, ok, err := fn(param)
if err != nil {
return 0, err
}
if !ok {
for _, check := range checks {
if err := check(v); err != nil {
return 0, err
}
}
}
return v, nil
}
// parseBoolParameter parses a string parameter to a bool
func parseBoolParameter(param string, fn Operation[bool]) (bool, error) {
v, _, err := fn(param)
return v, err
}
// parseNumericArrayParameter parses a string parameter containing array of values to its respective type.
func parseNumericArrayParameter[T Number](param, delim string, required bool, fn Operation[T], checks ...Constraint[T]) ([]T, error) {
if param == "" {
if required {
return nil, errors.New(errMsgRequiredMissing)
}
return nil, nil
}
str := strings.Split(param, delim)
values := make([]T, len(str))
for i, s := range str {
v, ok, err := fn(s)
if err != nil {
return nil, err
}
if !ok {
for _, check := range checks {
if err := check(v); err != nil {
return nil, err
}
}
}
values[i] = v
}
return values, nil
}

View File

@ -0,0 +1,652 @@
/*
* Model Registry REST API
*
* REST API for Model Registry to create and manage ML model metadata
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
model "github.com/opendatahub-io/model-registry/internal/model/openapi"
)
// AssertArtifactRequired checks if the required fields are not zero-ed
func AssertArtifactRequired(obj model.Artifact) error {
elements := map[string]interface{}{
"artifactType": obj.ModelArtifact.ArtifactType,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertArtifactConstraints checks if the values respects the defined constraints
func AssertArtifactConstraints(obj model.Artifact) error {
return nil
}
// AssertArtifactListRequired checks if the required fields are not zero-ed
func AssertArtifactListRequired(obj model.ArtifactList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertArtifactRequired(el); err != nil {
return err
}
}
return nil
}
// AssertArtifactListConstraints checks if the values respects the defined constraints
func AssertArtifactListConstraints(obj model.ArtifactList) error {
return nil
}
// AssertArtifactStateRequired checks if the required fields are not zero-ed
func AssertArtifactStateRequired(obj model.ArtifactState) error {
return nil
}
// AssertArtifactStateConstraints checks if the values respects the defined constraints
func AssertArtifactStateConstraints(obj model.ArtifactState) error {
return nil
}
// AssertBaseArtifactCreateRequired checks if the required fields are not zero-ed
func AssertBaseArtifactCreateRequired(obj model.BaseArtifactCreate) error {
return nil
}
// AssertBaseArtifactCreateConstraints checks if the values respects the defined constraints
func AssertBaseArtifactCreateConstraints(obj model.BaseArtifactCreate) error {
return nil
}
// AssertBaseArtifactRequired checks if the required fields are not zero-ed
func AssertBaseArtifactRequired(obj model.BaseArtifact) error {
elements := map[string]interface{}{
"artifactType": obj.ArtifactType,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertBaseArtifactConstraints checks if the values respects the defined constraints
func AssertBaseArtifactConstraints(obj model.BaseArtifact) error {
return nil
}
// AssertBaseArtifactUpdateRequired checks if the required fields are not zero-ed
func AssertBaseArtifactUpdateRequired(obj model.BaseArtifactUpdate) error {
return nil
}
// AssertBaseArtifactUpdateConstraints checks if the values respects the defined constraints
func AssertBaseArtifactUpdateConstraints(obj model.BaseArtifactUpdate) error {
return nil
}
// AssertBaseExecutionCreateRequired checks if the required fields are not zero-ed
func AssertBaseExecutionCreateRequired(obj model.BaseExecutionCreate) error {
return nil
}
// AssertBaseExecutionCreateConstraints checks if the values respects the defined constraints
func AssertBaseExecutionCreateConstraints(obj model.BaseExecutionCreate) error {
return nil
}
// AssertBaseExecutionRequired checks if the required fields are not zero-ed
func AssertBaseExecutionRequired(obj model.BaseExecution) error {
return nil
}
// AssertBaseExecutionConstraints checks if the values respects the defined constraints
func AssertBaseExecutionConstraints(obj model.BaseExecution) error {
return nil
}
// AssertBaseExecutionUpdateRequired checks if the required fields are not zero-ed
func AssertBaseExecutionUpdateRequired(obj model.BaseExecutionUpdate) error {
return nil
}
// AssertBaseExecutionUpdateConstraints checks if the values respects the defined constraints
func AssertBaseExecutionUpdateConstraints(obj model.BaseExecutionUpdate) error {
return nil
}
// AssertBaseResourceCreateRequired checks if the required fields are not zero-ed
func AssertBaseResourceCreateRequired(obj model.BaseResourceCreate) error {
return nil
}
// AssertBaseResourceCreateConstraints checks if the values respects the defined constraints
func AssertBaseResourceCreateConstraints(obj model.BaseResourceCreate) error {
return nil
}
// AssertBaseResourceRequired checks if the required fields are not zero-ed
func AssertBaseResourceRequired(obj model.BaseResource) error {
return nil
}
// AssertBaseResourceConstraints checks if the values respects the defined constraints
func AssertBaseResourceConstraints(obj model.BaseResource) error {
return nil
}
// AssertBaseResourceListRequired checks if the required fields are not zero-ed
func AssertBaseResourceListRequired(obj model.BaseResourceList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertBaseResourceListConstraints checks if the values respects the defined constraints
func AssertBaseResourceListConstraints(obj model.BaseResourceList) error {
return nil
}
// AssertBaseResourceUpdateRequired checks if the required fields are not zero-ed
func AssertBaseResourceUpdateRequired(obj model.BaseResourceUpdate) error {
return nil
}
// AssertBaseResourceUpdateConstraints checks if the values respects the defined constraints
func AssertBaseResourceUpdateConstraints(obj model.BaseResourceUpdate) error {
return nil
}
// AssertErrorRequired checks if the required fields are not zero-ed
func AssertErrorRequired(obj model.Error) error {
elements := map[string]interface{}{
"code": obj.Code,
"message": obj.Message,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertErrorConstraints checks if the values respects the defined constraints
func AssertErrorConstraints(obj model.Error) error {
return nil
}
// AssertExecutionStateRequired checks if the required fields are not zero-ed
func AssertExecutionStateRequired(obj model.ExecutionState) error {
return nil
}
// AssertExecutionStateConstraints checks if the values respects the defined constraints
func AssertExecutionStateConstraints(obj model.ExecutionState) error {
return nil
}
// AssertInferenceServiceCreateRequired checks if the required fields are not zero-ed
func AssertInferenceServiceCreateRequired(obj model.InferenceServiceCreate) error {
elements := map[string]interface{}{
"registeredModelId": obj.RegisteredModelId,
"servingEnvironmentId": obj.ServingEnvironmentId,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertInferenceServiceCreateConstraints checks if the values respects the defined constraints
func AssertInferenceServiceCreateConstraints(obj model.InferenceServiceCreate) error {
return nil
}
// AssertInferenceServiceRequired checks if the required fields are not zero-ed
func AssertInferenceServiceRequired(obj model.InferenceService) error {
return nil
}
// AssertInferenceServiceConstraints checks if the values respects the defined constraints
func AssertInferenceServiceConstraints(obj model.InferenceService) error {
return nil
}
// AssertInferenceServiceListRequired checks if the required fields are not zero-ed
func AssertInferenceServiceListRequired(obj model.InferenceServiceList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertInferenceServiceRequired(el); err != nil {
return err
}
}
return nil
}
// AssertInferenceServiceListConstraints checks if the values respects the defined constraints
func AssertInferenceServiceListConstraints(obj model.InferenceServiceList) error {
return nil
}
// AssertInferenceServiceUpdateRequired checks if the required fields are not zero-ed
func AssertInferenceServiceUpdateRequired(obj model.InferenceServiceUpdate) error {
return nil
}
// AssertInferenceServiceUpdateConstraints checks if the values respects the defined constraints
func AssertInferenceServiceUpdateConstraints(obj model.InferenceServiceUpdate) error {
return nil
}
// AssertMetadataValueRequired checks if the required fields are not zero-ed
func AssertMetadataValueRequired(obj model.MetadataValue) error {
return nil
}
// AssertMetadataValueConstraints checks if the values respects the defined constraints
func AssertMetadataValueConstraints(obj model.MetadataValue) error {
return nil
}
// AssertModelArtifactCreateRequired checks if the required fields are not zero-ed
func AssertModelArtifactCreateRequired(obj model.ModelArtifactCreate) error {
return nil
}
// AssertModelArtifactCreateConstraints checks if the values respects the defined constraints
func AssertModelArtifactCreateConstraints(obj model.ModelArtifactCreate) error {
return nil
}
// AssertModelArtifactRequired checks if the required fields are not zero-ed
func AssertModelArtifactRequired(obj model.ModelArtifact) error {
elements := map[string]interface{}{
"artifactType": obj.ArtifactType,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertModelArtifactConstraints checks if the values respects the defined constraints
func AssertModelArtifactConstraints(obj model.ModelArtifact) error {
return nil
}
// AssertModelArtifactListRequired checks if the required fields are not zero-ed
func AssertModelArtifactListRequired(obj model.ModelArtifactList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertModelArtifactRequired(el); err != nil {
return err
}
}
return nil
}
// AssertModelArtifactListConstraints checks if the values respects the defined constraints
func AssertModelArtifactListConstraints(obj model.ModelArtifactList) error {
return nil
}
// AssertModelArtifactUpdateRequired checks if the required fields are not zero-ed
func AssertModelArtifactUpdateRequired(obj model.ModelArtifactUpdate) error {
return nil
}
// AssertModelArtifactUpdateConstraints checks if the values respects the defined constraints
func AssertModelArtifactUpdateConstraints(obj model.ModelArtifactUpdate) error {
return nil
}
// AssertModelVersionCreateRequired checks if the required fields are not zero-ed
func AssertModelVersionCreateRequired(obj model.ModelVersionCreate) error {
elements := map[string]interface{}{
"registeredModelID": obj.RegisteredModelID,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertModelVersionCreateConstraints checks if the values respects the defined constraints
func AssertModelVersionCreateConstraints(obj model.ModelVersionCreate) error {
return nil
}
// AssertModelVersionRequired checks if the required fields are not zero-ed
func AssertModelVersionRequired(obj model.ModelVersion) error {
return nil
}
// AssertModelVersionConstraints checks if the values respects the defined constraints
func AssertModelVersionConstraints(obj model.ModelVersion) error {
return nil
}
// AssertModelVersionListRequired checks if the required fields are not zero-ed
func AssertModelVersionListRequired(obj model.ModelVersionList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertModelVersionRequired(el); err != nil {
return err
}
}
return nil
}
// AssertModelVersionListConstraints checks if the values respects the defined constraints
func AssertModelVersionListConstraints(obj model.ModelVersionList) error {
return nil
}
// AssertModelVersionUpdateRequired checks if the required fields are not zero-ed
func AssertModelVersionUpdateRequired(obj model.ModelVersionUpdate) error {
return nil
}
// AssertModelVersionUpdateConstraints checks if the values respects the defined constraints
func AssertModelVersionUpdateConstraints(obj model.ModelVersionUpdate) error {
return nil
}
// AssertOrderByFieldRequired checks if the required fields are not zero-ed
func AssertOrderByFieldRequired(obj model.OrderByField) error {
return nil
}
// AssertOrderByFieldConstraints checks if the values respects the defined constraints
func AssertOrderByFieldConstraints(obj model.OrderByField) error {
return nil
}
// AssertRegisteredModelCreateRequired checks if the required fields are not zero-ed
func AssertRegisteredModelCreateRequired(obj model.RegisteredModelCreate) error {
return nil
}
// AssertRegisteredModelCreateConstraints checks if the values respects the defined constraints
func AssertRegisteredModelCreateConstraints(obj model.RegisteredModelCreate) error {
return nil
}
// AssertRegisteredModelRequired checks if the required fields are not zero-ed
func AssertRegisteredModelRequired(obj model.RegisteredModel) error {
return nil
}
// AssertRegisteredModelConstraints checks if the values respects the defined constraints
func AssertRegisteredModelConstraints(obj model.RegisteredModel) error {
return nil
}
// AssertRegisteredModelListRequired checks if the required fields are not zero-ed
func AssertRegisteredModelListRequired(obj model.RegisteredModelList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertRegisteredModelRequired(el); err != nil {
return err
}
}
return nil
}
// AssertRegisteredModelListConstraints checks if the values respects the defined constraints
func AssertRegisteredModelListConstraints(obj model.RegisteredModelList) error {
return nil
}
// AssertRegisteredModelUpdateRequired checks if the required fields are not zero-ed
func AssertRegisteredModelUpdateRequired(obj model.RegisteredModelUpdate) error {
return nil
}
// AssertRegisteredModelUpdateConstraints checks if the values respects the defined constraints
func AssertRegisteredModelUpdateConstraints(obj model.RegisteredModelUpdate) error {
return nil
}
// AssertServeModelCreateRequired checks if the required fields are not zero-ed
func AssertServeModelCreateRequired(obj model.ServeModelCreate) error {
elements := map[string]interface{}{
"modelVersionId": obj.ModelVersionId,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertServeModelCreateConstraints checks if the values respects the defined constraints
func AssertServeModelCreateConstraints(obj model.ServeModelCreate) error {
return nil
}
// AssertServeModelRequired checks if the required fields are not zero-ed
func AssertServeModelRequired(obj model.ServeModel) error {
elements := map[string]interface{}{
"modelVersionId": obj.ModelVersionId,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertServeModelConstraints checks if the values respects the defined constraints
func AssertServeModelConstraints(obj model.ServeModel) error {
return nil
}
// AssertServeModelListRequired checks if the required fields are not zero-ed
func AssertServeModelListRequired(obj model.ServeModelList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertServeModelRequired(el); err != nil {
return err
}
}
return nil
}
// AssertServeModelListConstraints checks if the values respects the defined constraints
func AssertServeModelListConstraints(obj model.ServeModelList) error {
return nil
}
// AssertServeModelUpdateRequired checks if the required fields are not zero-ed
func AssertServeModelUpdateRequired(obj model.ServeModelUpdate) error {
return nil
}
// AssertServeModelUpdateConstraints checks if the values respects the defined constraints
func AssertServeModelUpdateConstraints(obj model.ServeModelUpdate) error {
return nil
}
// AssertServingEnvironmentCreateRequired checks if the required fields are not zero-ed
func AssertServingEnvironmentCreateRequired(obj model.ServingEnvironmentCreate) error {
return nil
}
// AssertServingEnvironmentCreateConstraints checks if the values respects the defined constraints
func AssertServingEnvironmentCreateConstraints(obj model.ServingEnvironmentCreate) error {
return nil
}
// AssertServingEnvironmentRequired checks if the required fields are not zero-ed
func AssertServingEnvironmentRequired(obj model.ServingEnvironment) error {
return nil
}
// AssertServingEnvironmentConstraints checks if the values respects the defined constraints
func AssertServingEnvironmentConstraints(obj model.ServingEnvironment) error {
return nil
}
// AssertServingEnvironmentListRequired checks if the required fields are not zero-ed
func AssertServingEnvironmentListRequired(obj model.ServingEnvironmentList) error {
elements := map[string]interface{}{
"nextPageToken": obj.NextPageToken,
"pageSize": obj.PageSize,
"size": obj.Size,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Items {
if err := AssertServingEnvironmentRequired(el); err != nil {
return err
}
}
return nil
}
// AssertServingEnvironmentListConstraints checks if the values respects the defined constraints
func AssertServingEnvironmentListConstraints(obj model.ServingEnvironmentList) error {
return nil
}
// AssertServingEnvironmentUpdateRequired checks if the required fields are not zero-ed
func AssertServingEnvironmentUpdateRequired(obj model.ServingEnvironmentUpdate) error {
return nil
}
// AssertServingEnvironmentUpdateConstraints checks if the values respects the defined constraints
func AssertServingEnvironmentUpdateConstraints(obj model.ServingEnvironmentUpdate) error {
return nil
}
// AssertSortOrderRequired checks if the required fields are not zero-ed
func AssertSortOrderRequired(obj model.SortOrder) error {
return nil
}
// AssertSortOrderConstraints checks if the values respects the defined constraints
func AssertSortOrderConstraints(obj model.SortOrder) error {
return nil
}

7
openapitools.json Normal file
View File

@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.0.1"
}
}