1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service;
|
---|
19 |
|
---|
20 | use Google\Client;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Service definition for Fitness (v1).
|
---|
24 | *
|
---|
25 | * <p>
|
---|
26 | * The Fitness API for managing users' fitness tracking data.</p>
|
---|
27 | *
|
---|
28 | * <p>
|
---|
29 | * For more information about this service, see the API
|
---|
30 | * <a href="https://developers.google.com/fit/rest/v1/get-started" target="_blank">Documentation</a>
|
---|
31 | * </p>
|
---|
32 | *
|
---|
33 | * @author Google, Inc.
|
---|
34 | */
|
---|
35 | class Fitness extends \Google\Service
|
---|
36 | {
|
---|
37 | /** Use Google Fit to see and store your physical activity data. */
|
---|
38 | const FITNESS_ACTIVITY_READ =
|
---|
39 | "https://www.googleapis.com/auth/fitness.activity.read";
|
---|
40 | /** Add to your Google Fit physical activity data. */
|
---|
41 | const FITNESS_ACTIVITY_WRITE =
|
---|
42 | "https://www.googleapis.com/auth/fitness.activity.write";
|
---|
43 | /** See info about your blood glucose in Google Fit. I consent to Google sharing my blood glucose information with this app.. */
|
---|
44 | const FITNESS_BLOOD_GLUCOSE_READ =
|
---|
45 | "https://www.googleapis.com/auth/fitness.blood_glucose.read";
|
---|
46 | /** Add info about your blood glucose to Google Fit. I consent to Google using my blood glucose information with this app.. */
|
---|
47 | const FITNESS_BLOOD_GLUCOSE_WRITE =
|
---|
48 | "https://www.googleapis.com/auth/fitness.blood_glucose.write";
|
---|
49 | /** See info about your blood pressure in Google Fit. I consent to Google sharing my blood pressure information with this app.. */
|
---|
50 | const FITNESS_BLOOD_PRESSURE_READ =
|
---|
51 | "https://www.googleapis.com/auth/fitness.blood_pressure.read";
|
---|
52 | /** Add info about your blood pressure in Google Fit. I consent to Google using my blood pressure information with this app.. */
|
---|
53 | const FITNESS_BLOOD_PRESSURE_WRITE =
|
---|
54 | "https://www.googleapis.com/auth/fitness.blood_pressure.write";
|
---|
55 | /** See info about your body measurements in Google Fit. */
|
---|
56 | const FITNESS_BODY_READ =
|
---|
57 | "https://www.googleapis.com/auth/fitness.body.read";
|
---|
58 | /** Add info about your body measurements to Google Fit. */
|
---|
59 | const FITNESS_BODY_WRITE =
|
---|
60 | "https://www.googleapis.com/auth/fitness.body.write";
|
---|
61 | /** See info about your body temperature in Google Fit. I consent to Google sharing my body temperature information with this app.. */
|
---|
62 | const FITNESS_BODY_TEMPERATURE_READ =
|
---|
63 | "https://www.googleapis.com/auth/fitness.body_temperature.read";
|
---|
64 | /** Add to info about your body temperature in Google Fit. I consent to Google using my body temperature information with this app.. */
|
---|
65 | const FITNESS_BODY_TEMPERATURE_WRITE =
|
---|
66 | "https://www.googleapis.com/auth/fitness.body_temperature.write";
|
---|
67 | /** See your heart rate data in Google Fit. I consent to Google sharing my heart rate information with this app.. */
|
---|
68 | const FITNESS_HEART_RATE_READ =
|
---|
69 | "https://www.googleapis.com/auth/fitness.heart_rate.read";
|
---|
70 | /** Add to your heart rate data in Google Fit. I consent to Google using my heart rate information with this app.. */
|
---|
71 | const FITNESS_HEART_RATE_WRITE =
|
---|
72 | "https://www.googleapis.com/auth/fitness.heart_rate.write";
|
---|
73 | /** See your Google Fit speed and distance data. */
|
---|
74 | const FITNESS_LOCATION_READ =
|
---|
75 | "https://www.googleapis.com/auth/fitness.location.read";
|
---|
76 | /** Add to your Google Fit location data. */
|
---|
77 | const FITNESS_LOCATION_WRITE =
|
---|
78 | "https://www.googleapis.com/auth/fitness.location.write";
|
---|
79 | /** See info about your nutrition in Google Fit. */
|
---|
80 | const FITNESS_NUTRITION_READ =
|
---|
81 | "https://www.googleapis.com/auth/fitness.nutrition.read";
|
---|
82 | /** Add to info about your nutrition in Google Fit. */
|
---|
83 | const FITNESS_NUTRITION_WRITE =
|
---|
84 | "https://www.googleapis.com/auth/fitness.nutrition.write";
|
---|
85 | /** See info about your oxygen saturation in Google Fit. I consent to Google sharing my oxygen saturation information with this app.. */
|
---|
86 | const FITNESS_OXYGEN_SATURATION_READ =
|
---|
87 | "https://www.googleapis.com/auth/fitness.oxygen_saturation.read";
|
---|
88 | /** Add info about your oxygen saturation in Google Fit. I consent to Google using my oxygen saturation information with this app.. */
|
---|
89 | const FITNESS_OXYGEN_SATURATION_WRITE =
|
---|
90 | "https://www.googleapis.com/auth/fitness.oxygen_saturation.write";
|
---|
91 | /** See info about your reproductive health in Google Fit. I consent to Google sharing my reproductive health information with this app.. */
|
---|
92 | const FITNESS_REPRODUCTIVE_HEALTH_READ =
|
---|
93 | "https://www.googleapis.com/auth/fitness.reproductive_health.read";
|
---|
94 | /** Add info about your reproductive health in Google Fit. I consent to Google using my reproductive health information with this app.. */
|
---|
95 | const FITNESS_REPRODUCTIVE_HEALTH_WRITE =
|
---|
96 | "https://www.googleapis.com/auth/fitness.reproductive_health.write";
|
---|
97 | /** See your sleep data in Google Fit. I consent to Google sharing my sleep information with this app.. */
|
---|
98 | const FITNESS_SLEEP_READ =
|
---|
99 | "https://www.googleapis.com/auth/fitness.sleep.read";
|
---|
100 | /** Add to your sleep data in Google Fit. I consent to Google using my sleep information with this app.. */
|
---|
101 | const FITNESS_SLEEP_WRITE =
|
---|
102 | "https://www.googleapis.com/auth/fitness.sleep.write";
|
---|
103 |
|
---|
104 | public $users_dataSources;
|
---|
105 | public $users_dataSources_dataPointChanges;
|
---|
106 | public $users_dataSources_datasets;
|
---|
107 | public $users_dataset;
|
---|
108 | public $users_sessions;
|
---|
109 | public $rootUrlTemplate;
|
---|
110 |
|
---|
111 | /**
|
---|
112 | * Constructs the internal representation of the Fitness service.
|
---|
113 | *
|
---|
114 | * @param Client|array $clientOrConfig The client used to deliver requests, or a
|
---|
115 | * config array to pass to a new Client instance.
|
---|
116 | * @param string $rootUrl The root URL used for requests to the service.
|
---|
117 | */
|
---|
118 | public function __construct($clientOrConfig = [], $rootUrl = null)
|
---|
119 | {
|
---|
120 | parent::__construct($clientOrConfig);
|
---|
121 | $this->rootUrl = $rootUrl ?: 'https://fitness.googleapis.com/';
|
---|
122 | $this->rootUrlTemplate = $rootUrl ?: 'https://fitness.UNIVERSE_DOMAIN/';
|
---|
123 | $this->servicePath = 'fitness/v1/users/';
|
---|
124 | $this->batchPath = 'batch';
|
---|
125 | $this->version = 'v1';
|
---|
126 | $this->serviceName = 'fitness';
|
---|
127 |
|
---|
128 | $this->users_dataSources = new Fitness\Resource\UsersDataSources(
|
---|
129 | $this,
|
---|
130 | $this->serviceName,
|
---|
131 | 'dataSources',
|
---|
132 | [
|
---|
133 | 'methods' => [
|
---|
134 | 'create' => [
|
---|
135 | 'path' => '{userId}/dataSources',
|
---|
136 | 'httpMethod' => 'POST',
|
---|
137 | 'parameters' => [
|
---|
138 | 'userId' => [
|
---|
139 | 'location' => 'path',
|
---|
140 | 'type' => 'string',
|
---|
141 | 'required' => true,
|
---|
142 | ],
|
---|
143 | ],
|
---|
144 | ],'delete' => [
|
---|
145 | 'path' => '{userId}/dataSources/{dataSourceId}',
|
---|
146 | 'httpMethod' => 'DELETE',
|
---|
147 | 'parameters' => [
|
---|
148 | 'userId' => [
|
---|
149 | 'location' => 'path',
|
---|
150 | 'type' => 'string',
|
---|
151 | 'required' => true,
|
---|
152 | ],
|
---|
153 | 'dataSourceId' => [
|
---|
154 | 'location' => 'path',
|
---|
155 | 'type' => 'string',
|
---|
156 | 'required' => true,
|
---|
157 | ],
|
---|
158 | ],
|
---|
159 | ],'get' => [
|
---|
160 | 'path' => '{userId}/dataSources/{dataSourceId}',
|
---|
161 | 'httpMethod' => 'GET',
|
---|
162 | 'parameters' => [
|
---|
163 | 'userId' => [
|
---|
164 | 'location' => 'path',
|
---|
165 | 'type' => 'string',
|
---|
166 | 'required' => true,
|
---|
167 | ],
|
---|
168 | 'dataSourceId' => [
|
---|
169 | 'location' => 'path',
|
---|
170 | 'type' => 'string',
|
---|
171 | 'required' => true,
|
---|
172 | ],
|
---|
173 | ],
|
---|
174 | ],'list' => [
|
---|
175 | 'path' => '{userId}/dataSources',
|
---|
176 | 'httpMethod' => 'GET',
|
---|
177 | 'parameters' => [
|
---|
178 | 'userId' => [
|
---|
179 | 'location' => 'path',
|
---|
180 | 'type' => 'string',
|
---|
181 | 'required' => true,
|
---|
182 | ],
|
---|
183 | 'dataTypeName' => [
|
---|
184 | 'location' => 'query',
|
---|
185 | 'type' => 'string',
|
---|
186 | 'repeated' => true,
|
---|
187 | ],
|
---|
188 | ],
|
---|
189 | ],'update' => [
|
---|
190 | 'path' => '{userId}/dataSources/{dataSourceId}',
|
---|
191 | 'httpMethod' => 'PUT',
|
---|
192 | 'parameters' => [
|
---|
193 | 'userId' => [
|
---|
194 | 'location' => 'path',
|
---|
195 | 'type' => 'string',
|
---|
196 | 'required' => true,
|
---|
197 | ],
|
---|
198 | 'dataSourceId' => [
|
---|
199 | 'location' => 'path',
|
---|
200 | 'type' => 'string',
|
---|
201 | 'required' => true,
|
---|
202 | ],
|
---|
203 | ],
|
---|
204 | ],
|
---|
205 | ]
|
---|
206 | ]
|
---|
207 | );
|
---|
208 | $this->users_dataSources_dataPointChanges = new Fitness\Resource\UsersDataSourcesDataPointChanges(
|
---|
209 | $this,
|
---|
210 | $this->serviceName,
|
---|
211 | 'dataPointChanges',
|
---|
212 | [
|
---|
213 | 'methods' => [
|
---|
214 | 'list' => [
|
---|
215 | 'path' => '{userId}/dataSources/{dataSourceId}/dataPointChanges',
|
---|
216 | 'httpMethod' => 'GET',
|
---|
217 | 'parameters' => [
|
---|
218 | 'userId' => [
|
---|
219 | 'location' => 'path',
|
---|
220 | 'type' => 'string',
|
---|
221 | 'required' => true,
|
---|
222 | ],
|
---|
223 | 'dataSourceId' => [
|
---|
224 | 'location' => 'path',
|
---|
225 | 'type' => 'string',
|
---|
226 | 'required' => true,
|
---|
227 | ],
|
---|
228 | 'limit' => [
|
---|
229 | 'location' => 'query',
|
---|
230 | 'type' => 'integer',
|
---|
231 | ],
|
---|
232 | 'pageToken' => [
|
---|
233 | 'location' => 'query',
|
---|
234 | 'type' => 'string',
|
---|
235 | ],
|
---|
236 | ],
|
---|
237 | ],
|
---|
238 | ]
|
---|
239 | ]
|
---|
240 | );
|
---|
241 | $this->users_dataSources_datasets = new Fitness\Resource\UsersDataSourcesDatasets(
|
---|
242 | $this,
|
---|
243 | $this->serviceName,
|
---|
244 | 'datasets',
|
---|
245 | [
|
---|
246 | 'methods' => [
|
---|
247 | 'delete' => [
|
---|
248 | 'path' => '{userId}/dataSources/{dataSourceId}/datasets/{datasetId}',
|
---|
249 | 'httpMethod' => 'DELETE',
|
---|
250 | 'parameters' => [
|
---|
251 | 'userId' => [
|
---|
252 | 'location' => 'path',
|
---|
253 | 'type' => 'string',
|
---|
254 | 'required' => true,
|
---|
255 | ],
|
---|
256 | 'dataSourceId' => [
|
---|
257 | 'location' => 'path',
|
---|
258 | 'type' => 'string',
|
---|
259 | 'required' => true,
|
---|
260 | ],
|
---|
261 | 'datasetId' => [
|
---|
262 | 'location' => 'path',
|
---|
263 | 'type' => 'string',
|
---|
264 | 'required' => true,
|
---|
265 | ],
|
---|
266 | ],
|
---|
267 | ],'get' => [
|
---|
268 | 'path' => '{userId}/dataSources/{dataSourceId}/datasets/{datasetId}',
|
---|
269 | 'httpMethod' => 'GET',
|
---|
270 | 'parameters' => [
|
---|
271 | 'userId' => [
|
---|
272 | 'location' => 'path',
|
---|
273 | 'type' => 'string',
|
---|
274 | 'required' => true,
|
---|
275 | ],
|
---|
276 | 'dataSourceId' => [
|
---|
277 | 'location' => 'path',
|
---|
278 | 'type' => 'string',
|
---|
279 | 'required' => true,
|
---|
280 | ],
|
---|
281 | 'datasetId' => [
|
---|
282 | 'location' => 'path',
|
---|
283 | 'type' => 'string',
|
---|
284 | 'required' => true,
|
---|
285 | ],
|
---|
286 | 'limit' => [
|
---|
287 | 'location' => 'query',
|
---|
288 | 'type' => 'integer',
|
---|
289 | ],
|
---|
290 | 'pageToken' => [
|
---|
291 | 'location' => 'query',
|
---|
292 | 'type' => 'string',
|
---|
293 | ],
|
---|
294 | ],
|
---|
295 | ],'patch' => [
|
---|
296 | 'path' => '{userId}/dataSources/{dataSourceId}/datasets/{datasetId}',
|
---|
297 | 'httpMethod' => 'PATCH',
|
---|
298 | 'parameters' => [
|
---|
299 | 'userId' => [
|
---|
300 | 'location' => 'path',
|
---|
301 | 'type' => 'string',
|
---|
302 | 'required' => true,
|
---|
303 | ],
|
---|
304 | 'dataSourceId' => [
|
---|
305 | 'location' => 'path',
|
---|
306 | 'type' => 'string',
|
---|
307 | 'required' => true,
|
---|
308 | ],
|
---|
309 | 'datasetId' => [
|
---|
310 | 'location' => 'path',
|
---|
311 | 'type' => 'string',
|
---|
312 | 'required' => true,
|
---|
313 | ],
|
---|
314 | ],
|
---|
315 | ],
|
---|
316 | ]
|
---|
317 | ]
|
---|
318 | );
|
---|
319 | $this->users_dataset = new Fitness\Resource\UsersDataset(
|
---|
320 | $this,
|
---|
321 | $this->serviceName,
|
---|
322 | 'dataset',
|
---|
323 | [
|
---|
324 | 'methods' => [
|
---|
325 | 'aggregate' => [
|
---|
326 | 'path' => '{userId}/dataset:aggregate',
|
---|
327 | 'httpMethod' => 'POST',
|
---|
328 | 'parameters' => [
|
---|
329 | 'userId' => [
|
---|
330 | 'location' => 'path',
|
---|
331 | 'type' => 'string',
|
---|
332 | 'required' => true,
|
---|
333 | ],
|
---|
334 | ],
|
---|
335 | ],
|
---|
336 | ]
|
---|
337 | ]
|
---|
338 | );
|
---|
339 | $this->users_sessions = new Fitness\Resource\UsersSessions(
|
---|
340 | $this,
|
---|
341 | $this->serviceName,
|
---|
342 | 'sessions',
|
---|
343 | [
|
---|
344 | 'methods' => [
|
---|
345 | 'delete' => [
|
---|
346 | 'path' => '{userId}/sessions/{sessionId}',
|
---|
347 | 'httpMethod' => 'DELETE',
|
---|
348 | 'parameters' => [
|
---|
349 | 'userId' => [
|
---|
350 | 'location' => 'path',
|
---|
351 | 'type' => 'string',
|
---|
352 | 'required' => true,
|
---|
353 | ],
|
---|
354 | 'sessionId' => [
|
---|
355 | 'location' => 'path',
|
---|
356 | 'type' => 'string',
|
---|
357 | 'required' => true,
|
---|
358 | ],
|
---|
359 | ],
|
---|
360 | ],'list' => [
|
---|
361 | 'path' => '{userId}/sessions',
|
---|
362 | 'httpMethod' => 'GET',
|
---|
363 | 'parameters' => [
|
---|
364 | 'userId' => [
|
---|
365 | 'location' => 'path',
|
---|
366 | 'type' => 'string',
|
---|
367 | 'required' => true,
|
---|
368 | ],
|
---|
369 | 'activityType' => [
|
---|
370 | 'location' => 'query',
|
---|
371 | 'type' => 'integer',
|
---|
372 | 'repeated' => true,
|
---|
373 | ],
|
---|
374 | 'endTime' => [
|
---|
375 | 'location' => 'query',
|
---|
376 | 'type' => 'string',
|
---|
377 | ],
|
---|
378 | 'includeDeleted' => [
|
---|
379 | 'location' => 'query',
|
---|
380 | 'type' => 'boolean',
|
---|
381 | ],
|
---|
382 | 'pageToken' => [
|
---|
383 | 'location' => 'query',
|
---|
384 | 'type' => 'string',
|
---|
385 | ],
|
---|
386 | 'startTime' => [
|
---|
387 | 'location' => 'query',
|
---|
388 | 'type' => 'string',
|
---|
389 | ],
|
---|
390 | ],
|
---|
391 | ],'update' => [
|
---|
392 | 'path' => '{userId}/sessions/{sessionId}',
|
---|
393 | 'httpMethod' => 'PUT',
|
---|
394 | 'parameters' => [
|
---|
395 | 'userId' => [
|
---|
396 | 'location' => 'path',
|
---|
397 | 'type' => 'string',
|
---|
398 | 'required' => true,
|
---|
399 | ],
|
---|
400 | 'sessionId' => [
|
---|
401 | 'location' => 'path',
|
---|
402 | 'type' => 'string',
|
---|
403 | 'required' => true,
|
---|
404 | ],
|
---|
405 | ],
|
---|
406 | ],
|
---|
407 | ]
|
---|
408 | ]
|
---|
409 | );
|
---|
410 | }
|
---|
411 | }
|
---|
412 |
|
---|
413 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
414 | class_alias(Fitness::class, 'Google_Service_Fitness');
|
---|