summaryrefslogtreecommitdiff
path: root/proto/client_config.proto
blob: f6260c700f68f086b7b3676c2e661567d5693658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto2";

package com.google.android.libraries.mdi.download;

import "google/protobuf/any.proto";

//option jspb_use_correct_proto2_semantics = false;  // <internal>
option java_package = "com.google.mobiledatadownload";
option java_outer_classname = "ClientConfigProto";
option objc_class_prefix = "ICN";

// Next id: 15
message ClientFileGroup {
  // Unique name to identify the group, that the client wants to read.
  optional string group_name = 1;

  optional string owner_package = 3;

  // The account associated to the file group.
  optional string account = 6;

  optional int32 version_number = 4;

  enum Status {
    UNSPECIFIED = 0;

    // This group is downloaded and ready to use.
    DOWNLOADED = 1;

    // This group is pending download, and should be downloaded by calling
    // the download API before it can be used.
    //
    // file.file_uri will not be set if the status is set to pending.
    PENDING = 2;

    // This group has finished downloading, but custom validation has
    // not yet been performed. This state is only expected to be seen
    // in the CustomFileGroupValidator.
    PENDING_CUSTOM_VALIDATION = 3;
  }

  // Status of the client file group.
  optional Status status = 5;

  // List of files in the group.
  repeated ClientFile file = 2;

  // Unique identifier of a DataFileGroup config (i.e. a "snapshot") created
  // when using MDD Ingress API.
  //
  // NOTE: This field name and description are not finalized yet! Reach out to
  // <internal>@ to discuss using this field.
  optional int64 build_id = 8;

  // A fingerprint allowing clients to identify a DataFileGroup
  // config based on a given set of properties (i.e. a "partition" of
  // any file group properties). This can be used by clients as an exact match
  // for a class of DataFileGroups during targeting or as a compatibility check.
  //
  // NOTE: This field name and description are not finalized yet! Reach out to
  // <internal>@ to discuss using this field.
  optional string variant_id = 12;

  // The locales compatible with the file group. This can be different from the
  // device locale.
  //
  // Values in this list may be exact locales (e.g. "en-US") or language-only
  // ("en-*").
  // Example 1: locale = ["en-US"]; // compatible with "en-US" only
  // Example 2: locale = ["en-US", "en-CA"]; // compatible with "en-US" or
  //                                         // "en-CA"
  // Example 3: locale = ["en-*"]; // compatible with all "en" locales
  repeated string locale = 10;

  reserved 11;

  // Custom metadata attached to the group.
  //
  // This allows clients to include specific metadata about the group for their
  // own processing purposes. The metadata must be included when the group is
  // added to MDD, then it will be available here when retrieving the group.
  //
  // This property should only be used if absolutely necessary. Please consult
  // with <internal>@ if you have questions about this property or a potential
  // use-case.
  optional .google.protobuf.Any custom_metadata = 13;

  reserved 14;

  reserved 7, 9;
}

// Next id: 6
message ClientFile {
  // Unique name to identify the file within the group.
  optional string file_id = 1;

  // File Uri that can be opened using FileStorage library (<internal>).
  optional string file_uri = 2;

  // The full size of the file as specified in byte_size field of the config
  // given to MDD. For files unzipped from zip file with zip download
  // transforms, it will be the actual file size on disk.
  optional int32 full_size_in_bytes = 3;

  // The download size of the file as specified in downloaded_file_byte_size
  // field (<internal>) of the
  // config given to MDD. It could be used to track and calculate the download
  // progress.
  optional int32 download_size_in_bytes = 4;

  // Custom metadata attached to the file
  //
  // This allows clients to include specific metadata about the file for their
  // own processing purposes. The metadata must be included when the file's
  // group is added to MDD, then it will be available here when retrieving the
  // containing group.
  //
  // This property should only be used if absolutely necessary. Please consult
  // with <internal>@ if you have questions about this property or a potential
  // use-case.
  optional .google.protobuf.Any custom_metadata = 5;
}