model

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package model contains types as defined by the http api.

Index

Constants

View Source
const (
	// 2021-07-20T01:40:11.187+0000
	TimeFormat = "2006-01-02T15:04:05.999-0700"
	// 2021-07-20T01:40:09.560+00:00
	TimeFormat2 = "2006-01-02T15:04:05.999-07:00"
)

There are multiple time formats coming back from the API

View Source
const (
	DateFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

func SortVersions

func SortVersions(stringVersions []string) []string

Types

type AccessKey

type AccessKey struct {
	Prefix         string    `json:"prefix"`
	Name           string    `json:"name"`
	Description    string    `json:"description"`
	IsDefault      bool      `json:"isDefault"`
	IsHighPriority bool      `json:"isHighPriority"`
	Status         string    `json:"status"`
	CreatedAt      ModzyTime `json:"createdAt"`
}

type AccountingProject

type AccountingProject struct {
	Identifier  string      `json:"identifier"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Status      string      `json:"status"`
	Visibility  string      `json:"visibility"`
	AccessKeys  []AccessKey `json:"accessKeys"`
	User        UserSummary `json:"user"`
	CreatedAt   ModzyTime   `json:"createdAt"`
	UpdatedAt   ModzyTime   `json:"updatedAt"`
}

type AccountingUser

type AccountingUser struct {
	Identifier         string    `json:"identifier"`
	FirstName          string    `json:"firstName"`
	LastName           string    `json:"lastName"`
	Email              string    `json:"email"`
	Status             string    `json:"status"`
	LastActiveDateTime ModzyTime `json:"lastActiveDateTime"`
	Visited            bool      `json:"visited"`
	Onboarded          bool      `json:"onboarded"`
}

type ActiveModelSummary

type ActiveModelSummary struct {
	Ranking     int    `json:"ranking"`
	Identifier  string `json:"modelIdentifier"`
	Name        string `json:"name"`
	Version     string `json:"modelVersion"`
	ElapsedTime int    `json:"elapsedTime"`
	Jobs        int    `json:"jobs"`
}

type ActiveUserSummary

type ActiveUserSummary struct {
	Ranking     int    `json:"ranking"`
	Identifier  string `json:"modelIdentifier"`
	FirstName   string `json:"firstName"`
	LastName    string `json:"lastName"`
	Email       string `json:"email"`
	ElapsedTime int    `json:"elapsedTime"`
	Jobs        int    `json:"jobs"`
}

type AlertsList

type AlertsList []AlertsListType

type AlertsListType

type AlertsListType struct {
	Type  string `json:"type"`
	Count int    `json:"count"`
}

type DataProcessedSummary

type DataProcessedSummary struct {
	RecentBytes   int64   `json:"recent"`
	PreviousBytes int64   `json:"previous"`
	Percentage    float64 `json:"percentage"`
}

type DataProcessingRecent

type DataProcessingRecent struct {
	Date  ModzyDate `json:"date"`
	Bytes int64     `json:"value"`
}

type EmbeddedInput

type EmbeddedInput struct {
	Type    string                       `json:"type"`
	Sources map[string]EmbeddedInputItem `json:"sources"`
}

type EmbeddedInputItem

type EmbeddedInputItem map[string]string

type Entitlement

type Entitlement struct {
	Identifier      string `json:"identifier"`
	Description     string `json:"description"`
	LongDescription string `json:"longDescription"`
	Weight          int    `json:"weight"`
}

type JDBCInput

type JDBCInput struct {
	Type     string `json:"type"`
	URL      string `json:"url,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Driver   string `json:"driver,omitempty"`
	Query    string `json:"query,omitempty"`
}

type JobDetails

type JobDetails struct {
	JobIdentifier            string               `json:"jobIdentifier"`
	SubmittedBy              string               `json:"submittedBy"`
	AccountIdentifier        string               `json:"accountIdentifier"`
	Model                    ModelNamedIdentifier `json:"model"`
	Status                   string               `json:"status"`
	CreatedAt                ModzyTime            `json:"createdAt"`
	UpdatedAt                ModzyTime            `json:"updatedAt"`
	SubmittedAt              ModzyTime            `json:"submittedAt"`
	Total                    int                  `json:"total"`
	Pending                  int                  `json:"pending"`
	Completed                int                  `json:"completed"`
	Failed                   int                  `json:"failed"`
	ElapsedTime              int                  `json:"elapsedTime"`
	QueueTime                int                  `json:"queueTime"`
	User                     User                 `json:"user"`
	JobInputs                []JobInputIdentifier `json:"jobInputs"`
	Explain                  bool                 `json:"explain"`
	HoursDeleteInput         int                  `json:"hoursDeleteInput"`
	Team                     Team                 `json:"team"`
	ImageClassificationModel bool                 `json:"imageClassificationModel"`
}

type JobFeatures

type JobFeatures struct {
	InputChunkMaximumSize string `json:"inputChunkMaximumSize"`
	MaximumInputChunks    int    `json:"maximumInputChunks"`
	MaximumInputsPerJob   int    `json:"maximumInputsPerJob"`
}

type JobInputIdentifier

type JobInputIdentifier struct {
	Identifier string `json:"identifier"`
}

type JobResult

type JobResult struct {
	Status      string                 `json:"status"`
	Engine      string                 `json:"engine"`
	Error       string                 `json:"error"`
	StartTime   ModzyTime              `json:"startTime"`
	UpdateTime  ModzyTime              `json:"updateTime"`
	EndTime     ModzyTime              `json:"endTime"`
	ElapsedTime int                    `json:"elapsedTime"`
	Data        map[string]interface{} `json:"data"`
}

func (*JobResult) UnmarshalJSON

func (j *JobResult) UnmarshalJSON(b []byte) error

UnmarshalJSON custom unmarshal in order to fill in ResultData with extra fields

type JobResults

type JobResults struct {
	JobIdentifier string    `json:"jobIdentifier"`
	Total         int       `json:"total"`
	Completed     int       `json:"completed"`
	Failed        int       `json:"failed"`
	Finished      bool      `json:"finished"`
	SubmittedBy   string    `json:"submittedByKey"`
	Explained     bool      `json:"explained"`
	SubmittedAt   ModzyTime `json:"submittedAt"`

	JobQueueTime     int `json:"jobQueueTime"`
	JobProcessedTime int `json:"jobProcessedTime"`
	JobElapsedTime   int `json:"jobElapsedTime"`

	Results  map[string]JobResult `json:"results"`
	Failures map[string]JobResult `json:"failures"`
}

type License

type License struct {
	CompanyName       string `json:"companyName"`
	ProcessingEngines string `json:"processingEngines"`
}

type MinimumEngines

type MinimumEngines struct {
	MinimumProcessingEnginesSum int `json:"minimumProcessingEnginesSum"`
}

type ModelContainerImage

type ModelContainerImage struct {
	UploadStatus       string `json:"uploadStatus"`
	LoadStatus         string `json:"loadStatus"`
	UploadPercentage   int    `json:"uploadPercentage"`
	LoadPercentage     int    `json:"loadPercentage"`
	ContainerImageSize int    `json:"containerImageSize"`
	RegistryHost       string `json:"registryHost"`
}

type ModelDetails

type ModelDetails struct {
	ModelID             string          `json:"modelID"`
	LatestVersion       string          `json:"latestVersion"`
	LatestActiveVersion string          `json:"latestActiveVersion"`
	Versions            SortedVersions  `json:"versions"`
	Author              string          `json:"author"`
	Name                string          `json:"name"`
	Description         string          `json:"description"`
	Permalink           string          `json:"permalink"`
	Features            []ModelFeature  `json:"features"`
	IsActive            bool            `json:"isActive"`
	IsRecommended       bool            `json:"isRecommended"`
	IsCommercial        bool            `json:"isCommercial"`
	Tags                []ModelTag      `json:"tags"`
	Images              []ModelImage    `json:"images"`
	SnapshotImages      []ModelImage    `json:"snapshotImages"`
	LastActiveDateTime  ModzyTime       `json:"lastActiveDateTime"`
	Visibility          ModelVisibility `json:"visibility"`
}

type ModelDetailsTimeout

type ModelDetailsTimeout struct {
	Status int `json:"status"`
	Run    int `json:"run"`
}

type ModelFeature

type ModelFeature struct {
	Identifier  string `json:"identifier"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type ModelIdentifier

type ModelIdentifier struct {
	Identifier string `json:"identifier"`
	Version    string `json:"version"`
}

type ModelImage

type ModelImage struct {
	URL          string `json:"url"`
	Caption      string `json:"caption"`
	Alt          string `json:"alt"`
	RelationType string `json:"relationType"`
}

type ModelLoadStatus

type ModelLoadStatus struct {
	Step       int    `json:"step"`
	StepName   string `json:"stepName"`
	Percentage int    `json:"percentage"`
}

type ModelMetdata

type ModelMetdata struct {
	ModelID            string          `json:"modelId"`
	LatestVersion      string          `json:"latestVersion"`
	Versions           SortedVersions  `json:"versions"`
	Author             string          `json:"author"`
	Name               string          `json:"name"`
	Description        string          `json:"description"`
	Permalink          string          `json:"permalink"`
	Features           []ModelFeature  `json:"features"`
	IsActive           bool            `json:"isActive"`
	IsRecommended      bool            `json:"isRecommended"`
	IsCommercial       bool            `json:"isCommercial"`
	Tags               []ModelTag      `json:"tags"`
	Images             []ModelImage    `json:"images"`
	LastActiveDateTime ModzyTime       `json:"lastActiveDateTime"`
	CreatedByEmail     string          `json:"createdByEmail"`
	Visibility         ModelVisibility `json:"visibility"`
}

type ModelNamedIdentifier

type ModelNamedIdentifier struct {
	Identifier string `json:"identifier"`
	Version    string `json:"version"`
	Name       string `json:"name"`
}

type ModelRunStatus

type ModelRunStatus struct {
	Step       int                  `json:"step"`
	StepName   string               `json:"stepName"`
	Percentage int                  `json:"percentage"`
	Result     ModelRunStatusResult `json:"result"`
}

type ModelRunStatusResult

type ModelRunStatusResult struct {
	Status      string    `json:"status"`
	Enging      string    `json:"engine"`
	StartTime   ModzyTime `json:"startTime"`
	EndTime     ModzyTime `json:"endTime"`
	UpdateDate  ModzyTime `json:"updateTime"`
	ElapsedTime int       `json:"elapsedTime"`
}

type ModelTag

type ModelTag struct {
	Identifier    string       `json:"identifier"`
	Name          string       `json:"name"`
	DataType      string       `json:"dataType"`
	IsCategorical bool         `json:"isCategorical"`
	Images        []ModelImage `json:"images"`
}

type ModelVersion

type ModelVersion struct {
	Version string `json:"version"`
}

type ModelVersionDetails

type ModelVersionDetails struct {
	ModelID               string                         `json:"-"`
	Version               string                         `json:"version"`
	CreatedAt             ModzyTime                      `json:"createdAt"`
	UpdatedAt             ModzyTime                      `json:"updatedAt"`
	InputValidationSchema json.RawMessage                `json:"inputValidationSchema"`
	Timeout               ModelDetailsTimeout            `json:"timeout"`
	Requirement           json.RawMessage                `json:"requirement"`
	ContainerImage        ModelContainerImage            `json:"containerImage"`
	LoadStatus            ModelLoadStatus                `json:"loadStatus"`
	RunStatus             ModelRunStatus                 `json:"runStatus"`
	Inputs                []ModelVersionDetailsInput     `json:"inputs"`
	SampleInput           string                         `json:"sampleInput"`
	Outputs               []ModelVersionDetailsOutput    `json:"outputs"`
	SampleOutput          string                         `json:"sampleOutput"`
	Statistics            []ModelVersionDetailsStatistic `json:"statistics"`
	IsActive              bool                           `json:"isActive"`
	LongDescription       string                         `json:"longDescription"`
	TechnicalDetails      string                         `json:"technicalDetails"`
	ImagePrefix           string                         `json:"imagePrefix"`
	IsAvailable           bool                           `json:"isAvailable"`
	SourceType            string                         `json:"sourceType"`
	VersionHistory        string                         `json:"versionHistory"`
	Status                string                         `json:"status"`
	PerformanceSummary    string                         `json:"performanceSummary"`
	Model                 ModelMetdata                   `json:"model"`
	Processing            ModelVersionDetailsProcessing  `json:"processing"`
}

type ModelVersionDetailsInput

type ModelVersionDetailsInput struct {
	Name               string `json:"name"`
	AcceptedMediaTypes string `json:"acceptedMediaTypes"`
	MaximumSize        int64  `json:"maximumSize"`
	Description        string `json:"description"`
}

type ModelVersionDetailsOutput

type ModelVersionDetailsOutput struct {
	Name        string `json:"name"`
	MediaType   string `json:"mediaTypes"`
	MaximumSize int64  `json:"maximumSize"`
	Description string `json:"description"`
}

type ModelVersionDetailsProcessing

type ModelVersionDetailsProcessing struct {
	MinimumParallelCapacity int `json:"minimumParallelCapacity"`
	MaximumParallelCapacity int `json:"maximumParallelCapacity"`
}

type ModelVersionDetailsStatistic

type ModelVersionDetailsStatistic struct {
	Label       string  `json:"label"`
	Category    string  `json:"category"`
	Type        string  `json:"type"`
	Description string  `json:"description"`
	Highlight   bool    `json:"highlight"`
	Order       int     `json:"order"`
	Value       float64 `json:"value"`
}

type ModelVersionSummary

type ModelVersionSummary struct {
	ID            string         `json:"modelId"`
	LatestVersion string         `json:"latestVersion"`
	Versions      SortedVersions `json:"versions"`
}

type ModelVisibility

type ModelVisibility struct {
	Scope string   `json:"scope"`
	Teams []string `json:"teams"`
}

type ModelWithTags

type ModelWithTags struct {
	Identifier string     `json:"identifier"`
	Name       string     `json:"name"`
	Tags       []ModelTag `json:"tags"`
}

type ModzyDate

type ModzyDate struct {
	time.Time
}

func (ModzyDate) MarshalJSON

func (mt ModzyDate) MarshalJSON() ([]byte, error)

func (ModzyDate) String

func (mt ModzyDate) String() string

func (*ModzyDate) UnmarshalJSON

func (mt *ModzyDate) UnmarshalJSON(b []byte) error

type ModzyTime

type ModzyTime struct {
	time.Time
}

func (ModzyTime) MarshalJSON

func (mt ModzyTime) MarshalJSON() ([]byte, error)

func (ModzyTime) String

func (mt ModzyTime) String() string

func (*ModzyTime) UnmarshalJSON

func (mt *ModzyTime) UnmarshalJSON(b []byte) error

type PredictionsMadeRecent

type PredictionsMadeRecent struct {
	Date  ModzyDate `json:"date"`
	Bytes int64     `json:"value"`
}

type PredictionsMadeSummary

type PredictionsMadeSummary struct {
	RecentPredictions   int64   `json:"recent"`
	PreviousPredictions int64   `json:"previous"`
	Percentage          float64 `json:"percentage"`
}

type PrometheusData

type PrometheusData struct {
	ResultType string             `json:"resultType"`
	Results    []PrometheusResult `json:"result"`
}

type PrometheusResponse

type PrometheusResponse struct {
	Data PrometheusData `json:"data"`
}

type PrometheusResult

type PrometheusResult struct {
	Metric interface{}       `json:"metric"`
	Values []json.RawMessage `json:"values"`
}

type RelatedModel

type RelatedModel struct {
	ModelID       string         `json:"identifier"`
	LatestVersion string         `json:"latestVersion"`
	Versions      SortedVersions `json:"versions"`
	Author        string         `json:"author"`
	Name          string         `json:"name"`
	Description   string         `json:"description"`
	Permalink     string         `json:"permalink"`
	Features      []ModelFeature `json:"features"`
	IsActive      bool           `json:"isActive"`
	IsRecommended bool           `json:"isRecommended"`
	Tags          []ModelTag     `json:"tags"`
	Images        []ModelImage   `json:"images"`
}

type ResourcesProcessingModel

type ResourcesProcessingModel struct {
	Identifier           string                                  `json:"identifier"`
	Version              string                                  `json:"version"`
	DeployedAt           ModzyTime                               `json:"deployedAt"`
	Engines              []ResourcesProcessingModelEngine        `json:"engines"`
	Inputs               ResourcesProcessingModelInputs          `json:"inputs"`
	Jobs                 ResourcesProcessingModelJobs            `json:"jobs"`
	Situations           []string                                `json:"situations"`
	ModelDeploymentState ResourcesProcessingModelDeploymentState `json:"modelDeploymentState"`
}

type ResourcesProcessingModelDeploymentState

type ResourcesProcessingModelDeploymentState struct {
	HasError       bool `json:"hasError"`
	Ready          bool `json:"ready"`
	BeingMonitored bool `json:"beingMonitored"`
}

type ResourcesProcessingModelEngine

type ResourcesProcessingModelEngine struct {
	Name       string                                    `json:"name"`
	CreatedAt  ModzyTime                                 `json:"createdAt"`
	Ready      bool                                      `json:"ready"`
	Conditions []ResourcesProcessingModelEngineCondition `json:"conditions"`
}

type ResourcesProcessingModelEngineCondition

type ResourcesProcessingModelEngineCondition struct {
	Type   string `json:"type"`
	Status string `json:"status"`
}

type ResourcesProcessingModelInputs

type ResourcesProcessingModelInputs struct {
	Queued int `json:"queued"`
}

type ResourcesProcessingModelJobs

type ResourcesProcessingModelJobs struct {
	Queued int `json:"queued"`
}

type S3Input

type S3Input struct {
	Type            string                 `json:"type"`
	AccessKeyID     string                 `json:"accessKeyID,omitempty"`
	SecretAccessKey string                 `json:"secretAccessKey,omitempty"`
	Region          string                 `json:"region,omitempty"`
	Sources         map[string]S3InputItem `json:"sources"`
}

type S3InputItem

type S3InputItem map[string]S3InputItemKey

type S3InputItemKey

type S3InputItemKey struct {
	Bucket string `json:"bucket"`
	Key    string `json:"key"`
}

type SortedVersions

type SortedVersions []string

func (*SortedVersions) UnmarshalJSON

func (sv *SortedVersions) UnmarshalJSON(data []byte) error

type SubmitChunkedJob

type SubmitChunkedJob struct {
	Model   SubmitJobModelInfo `json:"model"`
	Explain bool               `json:"explain,omitempty"`
	Timeout int                `json:"timeout,omitempty"`
}

type SubmitEmbeddedJob

type SubmitEmbeddedJob struct {
	Model   SubmitJobModelInfo `json:"model"`
	Explain bool               `json:"explain,omitempty"`
	Timeout int                `json:"timeout,omitempty"`
	Input   EmbeddedInput      `json:"input,omitempty"`
}

type SubmitJDBCJob

type SubmitJDBCJob struct {
	Model   SubmitJobModelInfo `json:"model"`
	Explain bool               `json:"explain,omitempty"`
	Timeout int                `json:"timeout,omitempty"`
	Input   JDBCInput          `json:"input,omitempty"`
}

type SubmitJobModelInfo

type SubmitJobModelInfo struct {
	Identifier string `json:"identifier"`
	Version    string `json:"version"`
}

type SubmitJobResponse

type SubmitJobResponse struct {
	Model                    ModelIdentifier         `json:"model"`
	Explain                  bool                    `json:"explain"`
	Timeout                  int                     `json:"timeout"`
	AccountIdentifier        string                  `json:"accountIdentifier"`
	TotalInputs              int                     `json:"totalInputs"`
	JobIdentifier            string                  `json:"jobIdentifier"`
	JobType                  string                  `json:"jobType"`
	AccessKey                string                  `json:"accessKey"`
	JobInputs                SubmitJobResponseInputs `json:"jobInputs"`
	InputByteAmount          int                     `json:"inputByteAmount"`
	SubmittedAt              ModzyTime               `json:"submittedAt"`
	ImageClassificationModel bool                    `json:"imageClassificationModel"`
}

type SubmitJobResponseInputs

type SubmitJobResponseInputs struct {
	Identifier []string `json:"identifier"`
}

type SubmitS3Job

type SubmitS3Job struct {
	Model   SubmitJobModelInfo `json:"model"`
	Explain bool               `json:"explain,omitempty"`
	Timeout int                `json:"timeout,omitempty"`
	Input   S3Input            `json:"input,omitempty"`
}

type SubmitTextJob

type SubmitTextJob struct {
	Model   SubmitJobModelInfo `json:"model"`
	Explain bool               `json:"explain,omitempty"`
	Timeout int                `json:"timeout,omitempty"`
	Input   TextInput          `json:"input,omitempty"`
}

type Team

type Team struct {
	Identifier string `json:"identifier"`
}

type TextInput

type TextInput struct {
	Type    string                   `json:"type"`
	Sources map[string]TextInputItem `json:"sources"`
}

type TextInputItem

type TextInputItem map[string]string

type User

type User struct {
	Identifier         string `json:"identifier"`
	FirstName          string `json:"firstName"`
	LastName           string `json:"lastName"`
	Email              string `json:"email"`
	ExternalIdentifier string `json:"externalIdentifier"`
	PictureURL         string `json:"pictureURL"`
	Status             string `json:"status"`
	Title              string `json:"title"`
	// TODO: type this
	AccessKeys []interface{} `json:"accessKeys"`
}

type UserSummary

type UserSummary struct {
	Identifier string `json:"identifier"`
	FirstName  string `json:"firstName"`
	LastName   string `json:"lastName"`
	Email      string `json:"email"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL