1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.automl.v1;
18
19import "google/api/resource.proto";
20import "google/cloud/automl/v1/image.proto";
21import "google/cloud/automl/v1/text.proto";
22import "google/cloud/automl/v1/translation.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.AutoML.V1";
26option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb";
27option java_multiple_files = true;
28option java_package = "com.google.cloud.automl.v1";
29option php_namespace = "Google\\Cloud\\AutoMl\\V1";
30option ruby_package = "Google::Cloud::AutoML::V1";
31
32// API proto representing a trained machine learning model.
33message Model {
34  option (google.api.resource) = {
35    type: "automl.googleapis.com/Model"
36    pattern: "projects/{project}/locations/{location}/models/{model}"
37  };
38
39  // Deployment state of the model.
40  enum DeploymentState {
41    // Should not be used, an un-set enum has this value by default.
42    DEPLOYMENT_STATE_UNSPECIFIED = 0;
43
44    // Model is deployed.
45    DEPLOYED = 1;
46
47    // Model is not deployed.
48    UNDEPLOYED = 2;
49  }
50
51  // Required.
52  // The model metadata that is specific to the problem type.
53  // Must match the metadata type of the dataset used to train the model.
54  oneof model_metadata {
55    // Metadata for translation models.
56    TranslationModelMetadata translation_model_metadata = 15;
57
58    // Metadata for image classification models.
59    ImageClassificationModelMetadata image_classification_model_metadata = 13;
60
61    // Metadata for text classification models.
62    TextClassificationModelMetadata text_classification_model_metadata = 14;
63
64    // Metadata for image object detection models.
65    ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
66
67    // Metadata for text extraction models.
68    TextExtractionModelMetadata text_extraction_model_metadata = 19;
69
70    // Metadata for text sentiment models.
71    TextSentimentModelMetadata text_sentiment_model_metadata = 22;
72  }
73
74  // Output only. Resource name of the model.
75  // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
76  string name = 1;
77
78  // Required. The name of the model to show in the interface. The name can be
79  // up to 32 characters long and can consist only of ASCII Latin letters A-Z
80  // and a-z, underscores
81  // (_), and ASCII digits 0-9. It must start with a letter.
82  string display_name = 2;
83
84  // Required. The resource ID of the dataset used to create the model. The dataset must
85  // come from the same ancestor project and location.
86  string dataset_id = 3;
87
88  // Output only. Timestamp when the model training finished  and can be used for prediction.
89  google.protobuf.Timestamp create_time = 7;
90
91  // Output only. Timestamp when this model was last updated.
92  google.protobuf.Timestamp update_time = 11;
93
94  // Output only. Deployment state of the model. A model can only serve
95  // prediction requests after it gets deployed.
96  DeploymentState deployment_state = 8;
97
98  // Used to perform a consistent read-modify-write updates. If not set, a blind
99  // "overwrite" update happens.
100  string etag = 10;
101
102  // Optional. The labels with user-defined metadata to organize your model.
103  //
104  // Label keys and values can be no longer than 64 characters
105  // (Unicode codepoints), can only contain lowercase letters, numeric
106  // characters, underscores and dashes. International characters are allowed.
107  // Label values are optional. Label keys must start with a letter.
108  //
109  // See https://goo.gl/xmQnxf for more information on and examples of labels.
110  map<string, string> labels = 34;
111}
112