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/**
19 * Service definition for Sheets (v4).
20 *
21 * <p>
22 * Reads and writes Google Sheets.</p>
23 *
24 * <p>
25 * For more information about this service, see the API
26 * <a href="https://developers.google.com/sheets/" target="_blank">Documentation</a>
27 * </p>
28 *
29 * @author Google, Inc.
30 */
31class Google_Service_Sheets extends Google_Service
32{
33  /** See, edit, create, and delete all of your Google Drive files. */
34  const DRIVE =
35      "https://www.googleapis.com/auth/drive";
36  /** View and manage Google Drive files and folders that you have opened or created with this app. */
37  const DRIVE_FILE =
38      "https://www.googleapis.com/auth/drive.file";
39  /** See and download all your Google Drive files. */
40  const DRIVE_READONLY =
41      "https://www.googleapis.com/auth/drive.readonly";
42  /** See, edit, create, and delete your spreadsheets in Google Drive. */
43  const SPREADSHEETS =
44      "https://www.googleapis.com/auth/spreadsheets";
45  /** View your Google Spreadsheets. */
46  const SPREADSHEETS_READONLY =
47      "https://www.googleapis.com/auth/spreadsheets.readonly";
48
49  public $spreadsheets;
50  public $spreadsheets_developerMetadata;
51  public $spreadsheets_sheets;
52  public $spreadsheets_values;
53
54  /**
55   * Constructs the internal representation of the Sheets service.
56   *
57   * @param Google_Client $client
58   */
59  public function __construct(Google_Client $client)
60  {
61    parent::__construct($client);
62    $this->rootUrl = 'https://sheets.googleapis.com/';
63    $this->servicePath = '';
64    $this->batchPath = 'batch';
65    $this->version = 'v4';
66    $this->serviceName = 'sheets';
67
68    $this->spreadsheets = new Google_Service_Sheets_Resource_Spreadsheets(
69        $this,
70        $this->serviceName,
71        'spreadsheets',
72        array(
73          'methods' => array(
74            'batchUpdate' => array(
75              'path' => 'v4/spreadsheets/{spreadsheetId}:batchUpdate',
76              'httpMethod' => 'POST',
77              'parameters' => array(
78                'spreadsheetId' => array(
79                  'location' => 'path',
80                  'type' => 'string',
81                  'required' => true,
82                ),
83              ),
84            ),'create' => array(
85              'path' => 'v4/spreadsheets',
86              'httpMethod' => 'POST',
87              'parameters' => array(),
88            ),'get' => array(
89              'path' => 'v4/spreadsheets/{spreadsheetId}',
90              'httpMethod' => 'GET',
91              'parameters' => array(
92                'spreadsheetId' => array(
93                  'location' => 'path',
94                  'type' => 'string',
95                  'required' => true,
96                ),
97                'ranges' => array(
98                  'location' => 'query',
99                  'type' => 'string',
100                  'repeated' => true,
101                ),
102                'includeGridData' => array(
103                  'location' => 'query',
104                  'type' => 'boolean',
105                ),
106              ),
107            ),'getByDataFilter' => array(
108              'path' => 'v4/spreadsheets/{spreadsheetId}:getByDataFilter',
109              'httpMethod' => 'POST',
110              'parameters' => array(
111                'spreadsheetId' => array(
112                  'location' => 'path',
113                  'type' => 'string',
114                  'required' => true,
115                ),
116              ),
117            ),
118          )
119        )
120    );
121    $this->spreadsheets_developerMetadata = new Google_Service_Sheets_Resource_SpreadsheetsDeveloperMetadata(
122        $this,
123        $this->serviceName,
124        'developerMetadata',
125        array(
126          'methods' => array(
127            'get' => array(
128              'path' => 'v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}',
129              'httpMethod' => 'GET',
130              'parameters' => array(
131                'spreadsheetId' => array(
132                  'location' => 'path',
133                  'type' => 'string',
134                  'required' => true,
135                ),
136                'metadataId' => array(
137                  'location' => 'path',
138                  'type' => 'integer',
139                  'required' => true,
140                ),
141              ),
142            ),'search' => array(
143              'path' => 'v4/spreadsheets/{spreadsheetId}/developerMetadata:search',
144              'httpMethod' => 'POST',
145              'parameters' => array(
146                'spreadsheetId' => array(
147                  'location' => 'path',
148                  'type' => 'string',
149                  'required' => true,
150                ),
151              ),
152            ),
153          )
154        )
155    );
156    $this->spreadsheets_sheets = new Google_Service_Sheets_Resource_SpreadsheetsSheets(
157        $this,
158        $this->serviceName,
159        'sheets',
160        array(
161          'methods' => array(
162            'copyTo' => array(
163              'path' => 'v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo',
164              'httpMethod' => 'POST',
165              'parameters' => array(
166                'spreadsheetId' => array(
167                  'location' => 'path',
168                  'type' => 'string',
169                  'required' => true,
170                ),
171                'sheetId' => array(
172                  'location' => 'path',
173                  'type' => 'integer',
174                  'required' => true,
175                ),
176              ),
177            ),
178          )
179        )
180    );
181    $this->spreadsheets_values = new Google_Service_Sheets_Resource_SpreadsheetsValues(
182        $this,
183        $this->serviceName,
184        'values',
185        array(
186          'methods' => array(
187            'append' => array(
188              'path' => 'v4/spreadsheets/{spreadsheetId}/values/{range}:append',
189              'httpMethod' => 'POST',
190              'parameters' => array(
191                'spreadsheetId' => array(
192                  'location' => 'path',
193                  'type' => 'string',
194                  'required' => true,
195                ),
196                'range' => array(
197                  'location' => 'path',
198                  'type' => 'string',
199                  'required' => true,
200                ),
201                'insertDataOption' => array(
202                  'location' => 'query',
203                  'type' => 'string',
204                ),
205                'valueInputOption' => array(
206                  'location' => 'query',
207                  'type' => 'string',
208                ),
209                'responseDateTimeRenderOption' => array(
210                  'location' => 'query',
211                  'type' => 'string',
212                ),
213                'includeValuesInResponse' => array(
214                  'location' => 'query',
215                  'type' => 'boolean',
216                ),
217                'responseValueRenderOption' => array(
218                  'location' => 'query',
219                  'type' => 'string',
220                ),
221              ),
222            ),'batchClear' => array(
223              'path' => 'v4/spreadsheets/{spreadsheetId}/values:batchClear',
224              'httpMethod' => 'POST',
225              'parameters' => array(
226                'spreadsheetId' => array(
227                  'location' => 'path',
228                  'type' => 'string',
229                  'required' => true,
230                ),
231              ),
232            ),'batchClearByDataFilter' => array(
233              'path' => 'v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter',
234              'httpMethod' => 'POST',
235              'parameters' => array(
236                'spreadsheetId' => array(
237                  'location' => 'path',
238                  'type' => 'string',
239                  'required' => true,
240                ),
241              ),
242            ),'batchGet' => array(
243              'path' => 'v4/spreadsheets/{spreadsheetId}/values:batchGet',
244              'httpMethod' => 'GET',
245              'parameters' => array(
246                'spreadsheetId' => array(
247                  'location' => 'path',
248                  'type' => 'string',
249                  'required' => true,
250                ),
251                'valueRenderOption' => array(
252                  'location' => 'query',
253                  'type' => 'string',
254                ),
255                'dateTimeRenderOption' => array(
256                  'location' => 'query',
257                  'type' => 'string',
258                ),
259                'ranges' => array(
260                  'location' => 'query',
261                  'type' => 'string',
262                  'repeated' => true,
263                ),
264                'majorDimension' => array(
265                  'location' => 'query',
266                  'type' => 'string',
267                ),
268              ),
269            ),'batchGetByDataFilter' => array(
270              'path' => 'v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter',
271              'httpMethod' => 'POST',
272              'parameters' => array(
273                'spreadsheetId' => array(
274                  'location' => 'path',
275                  'type' => 'string',
276                  'required' => true,
277                ),
278              ),
279            ),'batchUpdate' => array(
280              'path' => 'v4/spreadsheets/{spreadsheetId}/values:batchUpdate',
281              'httpMethod' => 'POST',
282              'parameters' => array(
283                'spreadsheetId' => array(
284                  'location' => 'path',
285                  'type' => 'string',
286                  'required' => true,
287                ),
288              ),
289            ),'batchUpdateByDataFilter' => array(
290              'path' => 'v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter',
291              'httpMethod' => 'POST',
292              'parameters' => array(
293                'spreadsheetId' => array(
294                  'location' => 'path',
295                  'type' => 'string',
296                  'required' => true,
297                ),
298              ),
299            ),'clear' => array(
300              'path' => 'v4/spreadsheets/{spreadsheetId}/values/{range}:clear',
301              'httpMethod' => 'POST',
302              'parameters' => array(
303                'spreadsheetId' => array(
304                  'location' => 'path',
305                  'type' => 'string',
306                  'required' => true,
307                ),
308                'range' => array(
309                  'location' => 'path',
310                  'type' => 'string',
311                  'required' => true,
312                ),
313              ),
314            ),'get' => array(
315              'path' => 'v4/spreadsheets/{spreadsheetId}/values/{range}',
316              'httpMethod' => 'GET',
317              'parameters' => array(
318                'spreadsheetId' => array(
319                  'location' => 'path',
320                  'type' => 'string',
321                  'required' => true,
322                ),
323                'range' => array(
324                  'location' => 'path',
325                  'type' => 'string',
326                  'required' => true,
327                ),
328                'majorDimension' => array(
329                  'location' => 'query',
330                  'type' => 'string',
331                ),
332                'valueRenderOption' => array(
333                  'location' => 'query',
334                  'type' => 'string',
335                ),
336                'dateTimeRenderOption' => array(
337                  'location' => 'query',
338                  'type' => 'string',
339                ),
340              ),
341            ),'update' => array(
342              'path' => 'v4/spreadsheets/{spreadsheetId}/values/{range}',
343              'httpMethod' => 'PUT',
344              'parameters' => array(
345                'spreadsheetId' => array(
346                  'location' => 'path',
347                  'type' => 'string',
348                  'required' => true,
349                ),
350                'range' => array(
351                  'location' => 'path',
352                  'type' => 'string',
353                  'required' => true,
354                ),
355                'responseValueRenderOption' => array(
356                  'location' => 'query',
357                  'type' => 'string',
358                ),
359                'valueInputOption' => array(
360                  'location' => 'query',
361                  'type' => 'string',
362                ),
363                'responseDateTimeRenderOption' => array(
364                  'location' => 'query',
365                  'type' => 'string',
366                ),
367                'includeValuesInResponse' => array(
368                  'location' => 'query',
369                  'type' => 'boolean',
370                ),
371              ),
372            ),
373          )
374        )
375    );
376  }
377}
378