xref: /aosp_15_r20/external/googleapis/google/ai/generativelanguage/v1beta/file.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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.ai.generativelanguage.v1beta;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb";
24option java_multiple_files = true;
25option java_outer_classname = "FileProto";
26option java_package = "com.google.ai.generativelanguage.v1beta";
27
28// A file uploaded to the API.
29message File {
30  option (google.api.resource) = {
31    type: "generativelanguage.googleapis.com/File"
32    pattern: "files/{file}"
33    plural: "files"
34    singular: "file"
35  };
36
37  // Immutable. Identifier. The `File` resource name. The ID (name excluding the
38  // "files/" prefix) can contain up to 40 characters that are lowercase
39  // alphanumeric or dashes (-). The ID cannot start or end with a dash. If the
40  // name is empty on create, a unique name will be generated. Example:
41  // `files/123-456`
42  string name = 1 [
43    (google.api.field_behavior) = IDENTIFIER,
44    (google.api.field_behavior) = IMMUTABLE
45  ];
46
47  // Optional. The human-readable display name for the `File`. The display name
48  // must be no more than 512 characters in length, including spaces. Example:
49  // "Welcome Image"
50  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
51
52  // Output only. MIME type of the file.
53  string mime_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
54
55  // Output only. Size of the file in bytes.
56  int64 size_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
57
58  // Output only. The timestamp of when the `File` was created.
59  google.protobuf.Timestamp create_time = 5
60      [(google.api.field_behavior) = OUTPUT_ONLY];
61
62  // Output only. The timestamp of when the `File` was last updated.
63  google.protobuf.Timestamp update_time = 6
64      [(google.api.field_behavior) = OUTPUT_ONLY];
65
66  // Output only. The timestamp of when the `File` will be deleted. Only set if
67  // the `File` is scheduled to expire.
68  google.protobuf.Timestamp expiration_time = 7
69      [(google.api.field_behavior) = OUTPUT_ONLY];
70
71  // Output only. SHA-256 hash of the uploaded bytes.
72  bytes sha256_hash = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
73
74  // Output only. The uri of the `File`.
75  string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
76}
77