1// Copyright 2023 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.aiplatform.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/aiplatform/v1/user_action_reference.proto";
22import "google/protobuf/struct.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.AIPlatform.V1";
26option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
27option java_multiple_files = true;
28option java_outer_classname = "AnnotationProto";
29option java_package = "com.google.cloud.aiplatform.v1";
30option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
31option ruby_package = "Google::Cloud::AIPlatform::V1";
32
33// Used to assign specific AnnotationSpec to a particular area of a DataItem or
34// the whole part of the DataItem.
35message Annotation {
36  option (google.api.resource) = {
37    type: "aiplatform.googleapis.com/Annotation"
38    pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}"
39  };
40
41  // Output only. Resource name of the Annotation.
42  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
43
44  // Required. Google Cloud Storage URI points to a YAML file describing
45  // [payload][google.cloud.aiplatform.v1.Annotation.payload]. The schema is
46  // defined as an [OpenAPI 3.0.2 Schema
47  // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
48  // The schema files that can be used here are found in
49  // gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the
50  // chosen schema must be consistent with the parent Dataset's
51  // [metadata][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri].
52  string payload_schema_uri = 2 [(google.api.field_behavior) = REQUIRED];
53
54  // Required. The schema of the payload can be found in
55  // [payload_schema][google.cloud.aiplatform.v1.Annotation.payload_schema_uri].
56  google.protobuf.Value payload = 3 [(google.api.field_behavior) = REQUIRED];
57
58  // Output only. Timestamp when this Annotation was created.
59  google.protobuf.Timestamp create_time = 4
60      [(google.api.field_behavior) = OUTPUT_ONLY];
61
62  // Output only. Timestamp when this Annotation was last updated.
63  google.protobuf.Timestamp update_time = 7
64      [(google.api.field_behavior) = OUTPUT_ONLY];
65
66  // Optional. Used to perform consistent read-modify-write updates. If not set,
67  // a blind "overwrite" update happens.
68  string etag = 8 [(google.api.field_behavior) = OPTIONAL];
69
70  // Output only. The source of the Annotation.
71  UserActionReference annotation_source = 5
72      [(google.api.field_behavior) = OUTPUT_ONLY];
73
74  // Optional. The labels with user-defined metadata to organize your
75  // Annotations.
76  //
77  // Label keys and values can be no longer than 64 characters
78  // (Unicode codepoints), can only contain lowercase letters, numeric
79  // characters, underscores and dashes. International characters are allowed.
80  // No more than 64 user labels can be associated with one Annotation(System
81  // labels are excluded).
82  //
83  // See https://goo.gl/xmQnxf for more information and examples of labels.
84  // System reserved label keys are prefixed with "aiplatform.googleapis.com/"
85  // and are immutable. Following system labels exist for each Annotation:
86  //
87  // * "aiplatform.googleapis.com/annotation_set_name":
88  //   optional, name of the UI's annotation set this Annotation belongs to.
89  //   If not set, the Annotation is not visible in the UI.
90  //
91  // * "aiplatform.googleapis.com/payload_schema":
92  //   output only, its value is the
93  //   [payload_schema's][google.cloud.aiplatform.v1.Annotation.payload_schema_uri]
94  //   title.
95  map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
96}
97