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