xref: /aosp_15_r20/external/mobile-data-download/proto/client_config.proto (revision 6fa6b5e213d87a73421ed761ee7d492115d5f98c)
1// Copyright 2022 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.
14syntax = "proto2";
15
16package com.google.android.libraries.mobiledatadownload;
17
18import "google/protobuf/any.proto";
19
20option java_package = "com.google.mobiledatadownload";
21option java_outer_classname = "ClientConfigProto";
22option objc_class_prefix = "ICN";
23
24// Next id: 15
25message ClientFileGroup {
26  // Unique name to identify the group, that the client wants to read.
27  optional string group_name = 1;
28
29  optional string owner_package = 3;
30
31  // The account associated to the file group.
32  optional string account = 6;
33
34  optional int32 version_number = 4;
35
36  enum Status {
37    UNSPECIFIED = 0;
38
39    // This group is downloaded and ready to use.
40    DOWNLOADED = 1;
41
42    // This group is pending download, and should be downloaded by calling
43    // the download API before it can be used.
44    //
45    // file.file_uri will not be set if the status is set to pending.
46    PENDING = 2;
47
48    // This group has finished downloading, but custom validation has
49    // not yet been performed. This state is only expected to be seen
50    // in the CustomFileGroupValidator.
51    PENDING_CUSTOM_VALIDATION = 3;
52  }
53
54  // Status of the client file group.
55  optional Status status = 5;
56
57  // List of files in the group.
58  repeated ClientFile file = 2;
59
60  // Unique identifier of a DataFileGroup config (i.e. a "snapshot") created
61  // when using MDD Ingress API.
62  //
63  // NOTE: This field name and description are not finalized yet! Reach out to
64  // <internal>@ to discuss using this field.
65  optional int64 build_id = 8;
66
67  // A fingerprint allowing clients to identify a DataFileGroup
68  // config based on a given set of properties (i.e. a "partition" of
69  // any file group properties). This can be used by clients as an exact match
70  // for a class of DataFileGroups during targeting or as a compatibility check.
71  //
72  // NOTE: This field name and description are not finalized yet! Reach out to
73  // <internal>@ to discuss using this field.
74  optional string variant_id = 12;
75
76  // The locales compatible with the file group. This can be different from the
77  // device locale.
78  //
79  // Values in this list may be exact locales (e.g. "en-US") or language-only
80  // ("en-*").
81  // Example 1: locale = ["en-US"]; // compatible with "en-US" only
82  // Example 2: locale = ["en-US", "en-CA"]; // compatible with "en-US" or
83  //                                         // "en-CA"
84  // Example 3: locale = ["en-*"]; // compatible with all "en" locales
85  repeated string locale = 10;
86
87  reserved 11;
88
89  // Custom metadata attached to the group.
90  //
91  // This allows clients to include specific metadata about the group for their
92  // own processing purposes. The metadata must be included when the group is
93  // added to MDD, then it will be available here when retrieving the group.
94  //
95  // This property should only be used if absolutely necessary. Please consult
96  // with <internal>@ if you have questions about this property or a potential
97  // use-case.
98  optional .google.protobuf.Any custom_metadata = 13;
99
100  reserved 14;
101
102  reserved 7, 9;
103}
104
105// Next id: 6
106message ClientFile {
107  // Unique name to identify the file within the group.
108  optional string file_id = 1;
109
110  // File Uri that can be opened using FileStorage library (<internal>).
111  optional string file_uri = 2;
112
113  // The full size of the file as specified in byte_size field of the config
114  // given to MDD. For files unzipped from zip file with zip download
115  // transforms, it will be the actual file size on disk.
116  optional int32 full_size_in_bytes = 3;
117
118  // The download size of the file as specified in downloaded_file_byte_size
119  // field (<internal>) of the
120  // config given to MDD. It could be used to track and calculate the download
121  // progress.
122  optional int32 download_size_in_bytes = 4;
123
124  // Custom metadata attached to the file
125  //
126  // This allows clients to include specific metadata about the file for their
127  // own processing purposes. The metadata must be included when the file's
128  // group is added to MDD, then it will be available here when retrieving the
129  // containing group.
130  //
131  // This property should only be used if absolutely necessary. Please consult
132  // with <internal>@ if you have questions about this property or a potential
133  // use-case.
134  optional .google.protobuf.Any custom_metadata = 5;
135}
136