Script.php
8.94 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<?php
/*
* Copyright 2010 Google Inc.
*
* 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.
*/
/**
* Service definition for Script (v1).
*
* <p>
* An API for executing Google Apps Script projects.</p>
*
* <p>
* For more information about this service, see the API
* <a href="https://developers.google.com/apps-script/execution/rest/v1/run" target="_blank">Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_Service_Script extends Google_Service
{
/** View and manage your mail. */
const MAIL_GOOGLE_COM =
"https://mail.google.com/";
/** Manage your calendars. */
const WWW_GOOGLE_COM_CALENDAR_FEEDS =
"https://www.google.com/calendar/feeds";
/** Manage your contacts. */
const WWW_GOOGLE_COM_M8_FEEDS =
"https://www.google.com/m8/feeds";
/** View and manage the provisioning of groups on your domain. */
const ADMIN_DIRECTORY_GROUP =
"https://www.googleapis.com/auth/admin.directory.group";
/** View and manage the provisioning of users on your domain. */
const ADMIN_DIRECTORY_USER =
"https://www.googleapis.com/auth/admin.directory.user";
/** View and manage the files in your Google Drive. */
const DRIVE =
"https://www.googleapis.com/auth/drive";
/** View and manage your forms in Google Drive. */
const FORMS =
"https://www.googleapis.com/auth/forms";
/** View and manage forms that this application has been installed in. */
const FORMS_CURRENTONLY =
"https://www.googleapis.com/auth/forms.currentonly";
/** View and manage your Google Groups. */
const GROUPS =
"https://www.googleapis.com/auth/groups";
/** View your email address. */
const USERINFO_EMAIL =
"https://www.googleapis.com/auth/userinfo.email";
public $scripts;
/**
* Constructs the internal representation of the Script service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client)
{
parent::__construct($client);
$this->rootUrl = 'https://script.googleapis.com/';
$this->servicePath = '';
$this->version = 'v1';
$this->serviceName = 'script';
$this->scripts = new Google_Service_Script_Scripts_Resource(
$this,
$this->serviceName,
'scripts',
array(
'methods' => array(
'run' => array(
'path' => 'v1/scripts/{scriptId}:run',
'httpMethod' => 'POST',
'parameters' => array(
'scriptId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),
)
)
);
}
}
/**
* The "scripts" collection of methods.
* Typical usage is:
* <code>
* $scriptService = new Google_Service_Script(...);
* $scripts = $scriptService->scripts;
* </code>
*/
class Google_Service_Script_Scripts_Resource extends Google_Service_Resource
{
/**
* Runs a function in an Apps Script project that has been deployed for use with
* the Apps Script Execution API. This method requires authorization with an
* OAuth 2.0 token that includes at least one of the scopes listed in the
* [Authentication](#authentication) section; script projects that do not
* require authorization cannot be executed through this API. To find the
* correct scopes to include in the authentication token, open the project in
* the script editor, then select **File > Project properties** and click the
* **Scopes** tab. (scripts.run)
*
* @param string $scriptId The project key of the script to be executed. To find
* the project key, open the project in the script editor, then select **File >
* Project properties**.
* @param Google_ExecutionRequest $postBody
* @param array $optParams Optional parameters.
* @return Google_Service_Script_Operation
*/
public function run($scriptId, Google_Service_Script_ExecutionRequest $postBody, $optParams = array())
{
$params = array('scriptId' => $scriptId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('run', array($params), "Google_Service_Script_Operation");
}
}
class Google_Service_Script_ExecutionError extends Google_Collection
{
protected $collection_key = 'scriptStackTraceElements';
protected $internal_gapi_mappings = array(
);
public $errorMessage;
public $errorType;
protected $scriptStackTraceElementsType = 'Google_Service_Script_ScriptStackTraceElement';
protected $scriptStackTraceElementsDataType = 'array';
public function setErrorMessage($errorMessage)
{
$this->errorMessage = $errorMessage;
}
public function getErrorMessage()
{
return $this->errorMessage;
}
public function setErrorType($errorType)
{
$this->errorType = $errorType;
}
public function getErrorType()
{
return $this->errorType;
}
public function setScriptStackTraceElements($scriptStackTraceElements)
{
$this->scriptStackTraceElements = $scriptStackTraceElements;
}
public function getScriptStackTraceElements()
{
return $this->scriptStackTraceElements;
}
}
class Google_Service_Script_ExecutionRequest extends Google_Collection
{
protected $collection_key = 'parameters';
protected $internal_gapi_mappings = array(
);
public $devMode;
public $function;
public $parameters;
public $sessionState;
public function setDevMode($devMode)
{
$this->devMode = $devMode;
}
public function getDevMode()
{
return $this->devMode;
}
public function setFunction($function)
{
$this->function = $function;
}
public function getFunction()
{
return $this->function;
}
public function setParameters($parameters)
{
$this->parameters = $parameters;
}
public function getParameters()
{
return $this->parameters;
}
public function setSessionState($sessionState)
{
$this->sessionState = $sessionState;
}
public function getSessionState()
{
return $this->sessionState;
}
}
class Google_Service_Script_ExecutionResponse extends Google_Model
{
protected $internal_gapi_mappings = array(
);
public $result;
public function setResult($result)
{
$this->result = $result;
}
public function getResult()
{
return $this->result;
}
}
class Google_Service_Script_Operation extends Google_Model
{
protected $internal_gapi_mappings = array(
);
public $done;
protected $errorType = 'Google_Service_Script_Status';
protected $errorDataType = '';
public $metadata;
public $name;
public $response;
public function setDone($done)
{
$this->done = $done;
}
public function getDone()
{
return $this->done;
}
public function setError(Google_Service_Script_Status $error)
{
$this->error = $error;
}
public function getError()
{
return $this->error;
}
public function setMetadata($metadata)
{
$this->metadata = $metadata;
}
public function getMetadata()
{
return $this->metadata;
}
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
public function setResponse($response)
{
$this->response = $response;
}
public function getResponse()
{
return $this->response;
}
}
class Google_Service_Script_OperationMetadata extends Google_Model
{
}
class Google_Service_Script_OperationResponse extends Google_Model
{
}
class Google_Service_Script_ScriptStackTraceElement extends Google_Model
{
protected $internal_gapi_mappings = array(
);
public $function;
public $lineNumber;
public function setFunction($function)
{
$this->function = $function;
}
public function getFunction()
{
return $this->function;
}
public function setLineNumber($lineNumber)
{
$this->lineNumber = $lineNumber;
}
public function getLineNumber()
{
return $this->lineNumber;
}
}
class Google_Service_Script_Status extends Google_Collection
{
protected $collection_key = 'details';
protected $internal_gapi_mappings = array(
);
public $code;
public $details;
public $message;
public function setCode($code)
{
$this->code = $code;
}
public function getCode()
{
return $this->code;
}
public function setDetails($details)
{
$this->details = $details;
}
public function getDetails()
{
return $this->details;
}
public function setMessage($message)
{
$this->message = $message;
}
public function getMessage()
{
return $this->message;
}
}
class Google_Service_Script_StatusDetails extends Google_Model
{
}