1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16syntax = "proto2";
17
18package androidx.health.platform.client.proto;
19
20import "data.proto";
21import "time.proto";
22
23option java_package = "androidx.health.platform.client.proto";
24option java_outer_classname = "RequestProto";
25
26message SimpleDataRequest {
27  optional DataPoint data_point = 1;
28}
29
30message ReadDataPointRequest {
31  optional DataType data_type = 1;
32  optional string uid = 2;
33  optional string client_id = 3;
34}
35
36message RequestContext {
37  optional string calling_package = 1;
38  optional int32 sdk_version = 2;
39  optional string permission_token = 3;
40  optional bool is_in_foreground = 4;
41}
42
43message UpsertDataRequest {
44  repeated DataPoint data_point = 1;
45}
46
47message DataTypeIdPair {
48  optional DataType data_type = 1;
49  optional string id = 2;
50}
51
52message DeleteDataRequest {
53  repeated DataTypeIdPair uids = 1;
54  repeated DataTypeIdPair client_ids = 2;
55}
56
57message DeleteDataRangeRequest {
58  optional TimeSpec time_spec = 1;
59  repeated DataType data_type = 2;
60}
61
62message ReadDataRequest {
63  optional DataTypeIdPair data_type_id_pair = 1;
64}
65
66message ReadDataRangeRequest {
67  optional TimeSpec time_spec = 1;
68  optional DataType data_type = 2;
69  repeated DataOrigin data_origin_filters = 3;
70  optional bool asc_ordering = 7 [default = true];
71  optional int32 limit = 4;
72  optional int32 page_size = 5;
73  optional string page_token = 6;
74}
75
76message AggregateMetricSpec {
77  optional string data_type_name = 1;
78  // count, duration, etc
79  optional string aggregation_type = 2;
80  optional string field_name = 3;
81}
82
83// Flattened aggregation
84message AggregateDataRequest {
85  optional TimeSpec time_spec = 1;
86  repeated AggregateMetricSpec metric_spec = 2;
87  repeated DataOrigin data_origin = 3;
88  optional int64 slice_duration_millis = 4;
89  optional string slice_period = 5;
90}
91
92message GetChangesTokenRequest {
93  repeated DataType data_type = 1;
94  repeated DataOrigin data_origin_filters = 2;
95}
96
97message GetChangesRequest {
98  optional string changes_token = 1;
99}
100
101message RegisterForDataNotificationsRequest {
102  optional string notificationIntentAction = 1;
103  repeated DataType data_types = 2;
104}
105
106message UnregisterFromDataNotificationsRequest {
107  optional string notificationIntentAction = 1;
108}
109
110message UpsertExerciseRouteRequest {
111  optional string sessionUid = 1;
112  optional DataPoint exerciseRoute = 2;
113}
114
115message ReadExerciseRouteRequest {
116  optional string sessionUid = 1;
117}
118