blob: a05f270c3d602e9068562db10ccc50034ec25a02 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="script_v1.html">Apps Script API</a> . <a href="script_v1.projects.html">projects</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="script_v1.projects.deployments.html">deployments()</a></code>
79</p>
80<p class="firstline">Returns the deployments Resource.</p>
81
82<p class="toc_element">
83 <code><a href="script_v1.projects.versions.html">versions()</a></code>
84</p>
85<p class="firstline">Returns the versions Resource.</p>
86
87<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070088 <code><a href="#create">create(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<p class="firstline">Creates a new, empty script project with no script files and a base</p>
90<p class="toc_element">
91 <code><a href="#get">get(scriptId, x__xgafv=None)</a></code></p>
92<p class="firstline">Gets a script project's metadata.</p>
93<p class="toc_element">
94 <code><a href="#getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</a></code></p>
95<p class="firstline">Gets the content of the script project, including the code source and</p>
96<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070097 <code><a href="#getMetrics">getMetrics(scriptId, metricsGranularity=None, metricsFilter_deploymentId=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098<p class="firstline">Get metrics data for scripts, such as number of executions and</p>
99<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 <code><a href="#updateContent">updateContent(scriptId, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101<p class="firstline">Updates the content of the specified script project.</p>
102<h3>Method Details</h3>
103<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700104 <code class="details" id="create">create(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700105 <pre>Creates a new, empty script project with no script files and a base
106manifest file.
107
108Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110 The object takes the form of:
111
112{ # Request to create a script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700113 &quot;title&quot;: &quot;A String&quot;, # The title for the project.
114 &quot;parentId&quot;: &quot;A String&quot;, # The Drive ID of a parent file that the created script project is bound to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700115 # This is usually the ID of a Google Doc, Google Sheet, Google Form, or
116 # Google Slides file. If not set, a standalone script project is created.
117 }
118
119 x__xgafv: string, V1 error format.
120 Allowed values
121 1 - v1 error format
122 2 - v2 error format
123
124Returns:
125 An object of the form:
126
127 { # The script project resource.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700128 &quot;updateTime&quot;: &quot;A String&quot;, # When the script was last updated.
129 &quot;creator&quot;: { # A simple user profile resource. # User who originally created the script.
130 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
131 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
132 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
133 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
134 },
135 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700136 &quot;title&quot;: &quot;A String&quot;, # The title for the project.
137 &quot;parentId&quot;: &quot;A String&quot;, # The parent&#x27;s Drive ID that the script will be attached to. This is usually
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700138 # the ID of a Google Document or Google Sheet. This filed is optional, and
139 # if not set, a stand-alone script will be created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 &quot;lastModifyUser&quot;: { # A simple user profile resource. # User who last modified the script.
Bu Sun Kim65020912020-05-20 12:08:20 -0700141 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
142 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
143 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700144 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700145 },
146 &quot;createTime&quot;: &quot;A String&quot;, # When the script was created.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700147 }</pre>
148</div>
149
150<div class="method">
151 <code class="details" id="get">get(scriptId, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700152 <pre>Gets a script project&#x27;s metadata.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700153
154Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700155 scriptId: string, The script project&#x27;s Drive ID. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700156 x__xgafv: string, V1 error format.
157 Allowed values
158 1 - v1 error format
159 2 - v2 error format
160
161Returns:
162 An object of the form:
163
164 { # The script project resource.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700165 &quot;updateTime&quot;: &quot;A String&quot;, # When the script was last updated.
166 &quot;creator&quot;: { # A simple user profile resource. # User who originally created the script.
167 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
168 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
169 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
170 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
171 },
172 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &quot;title&quot;: &quot;A String&quot;, # The title for the project.
174 &quot;parentId&quot;: &quot;A String&quot;, # The parent&#x27;s Drive ID that the script will be attached to. This is usually
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175 # the ID of a Google Document or Google Sheet. This filed is optional, and
176 # if not set, a stand-alone script will be created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700177 &quot;lastModifyUser&quot;: { # A simple user profile resource. # User who last modified the script.
Bu Sun Kim65020912020-05-20 12:08:20 -0700178 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
179 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
180 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700181 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700182 },
183 &quot;createTime&quot;: &quot;A String&quot;, # When the script was created.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700184 }</pre>
185</div>
186
187<div class="method">
188 <code class="details" id="getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</code>
189 <pre>Gets the content of the script project, including the code source and
190metadata for each script file.
191
192Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 scriptId: string, The script project&#x27;s Drive ID. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700194 versionNumber: integer, The version number of the project to retrieve. If not provided, the
Bu Sun Kim65020912020-05-20 12:08:20 -0700195project&#x27;s HEAD version is returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 x__xgafv: string, V1 error format.
197 Allowed values
198 1 - v1 error format
199 2 - v2 error format
200
201Returns:
202 An object of the form:
203
204 { # The Content resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700205 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
206 &quot;files&quot;: [ # The list of script project files.
207 # One of the files is a script manifest; it must be named &quot;appsscript&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700208 # must have type of JSON, and include the manifest configurations for the
209 # project.
210 { # An individual file within a script project.
211 # A file is a third-party source code created by one or more
212 # developers. It can be a server-side JS code, HTML, or a
213 # configuration file. Each script project can contain multiple files.
Bu Sun Kim65020912020-05-20 12:08:20 -0700214 &quot;functionSet&quot;: { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any.
215 &quot;values&quot;: [ # A list of functions composing the set.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700216 { # Represents a function in a script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700217 &quot;name&quot;: &quot;A String&quot;, # The function name in the script project.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700218 },
219 ],
220 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700221 &quot;lastModifyUser&quot;: { # A simple user profile resource. # The user who modified the file most recently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700222 # This read-only field is only visible to users who have WRITER
223 # permission for the script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
225 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
226 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700227 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700228 },
229 &quot;createTime&quot;: &quot;A String&quot;, # Creation date timestamp.
230 # This read-only field is only visible to users who have WRITER
231 # permission for the script project.
232 &quot;updateTime&quot;: &quot;A String&quot;, # Last modified date timestamp.
233 # This read-only field is only visible to users who have WRITER
234 # permission for the script project.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700235 &quot;source&quot;: &quot;A String&quot;, # The file content.
236 &quot;name&quot;: &quot;A String&quot;, # The name of the file. The file extension is not part of the file
237 # name, which can be identified from the type field.
238 &quot;type&quot;: &quot;A String&quot;, # The type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700239 },
240 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700241 }</pre>
242</div>
243
244<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700245 <code class="details" id="getMetrics">getMetrics(scriptId, metricsGranularity=None, metricsFilter_deploymentId=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700246 <pre>Get metrics data for scripts, such as number of executions and
247active users.
248
249Args:
250 scriptId: string, Required field indicating the script to get metrics for. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700251 metricsGranularity: string, Required field indicating what granularity of metrics are returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700252 metricsFilter_deploymentId: string, Optional field indicating a specific deployment to retrieve metrics from.
253 x__xgafv: string, V1 error format.
254 Allowed values
255 1 - v1 error format
256 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700257
258Returns:
259 An object of the form:
260
261 { # Resource containing usage stats for a given script, based on the supplied
262 # filter and mask present in the request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;activeUsers&quot;: [ # Number of active users.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700264 { # Metrics value that holds number of executions counted.
Bu Sun Kim65020912020-05-20 12:08:20 -0700265 &quot;endTime&quot;: &quot;A String&quot;, # Required field indicating the end time of the interval.
266 &quot;startTime&quot;: &quot;A String&quot;, # Required field indicating the start time of the interval.
267 &quot;value&quot;: &quot;A String&quot;, # Indicates the number of executions counted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 },
269 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 &quot;failedExecutions&quot;: [ # Number of failed executions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700271 { # Metrics value that holds number of executions counted.
Bu Sun Kim65020912020-05-20 12:08:20 -0700272 &quot;endTime&quot;: &quot;A String&quot;, # Required field indicating the end time of the interval.
273 &quot;startTime&quot;: &quot;A String&quot;, # Required field indicating the start time of the interval.
274 &quot;value&quot;: &quot;A String&quot;, # Indicates the number of executions counted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700275 },
276 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700277 &quot;totalExecutions&quot;: [ # Number of total executions.
278 { # Metrics value that holds number of executions counted.
279 &quot;endTime&quot;: &quot;A String&quot;, # Required field indicating the end time of the interval.
280 &quot;startTime&quot;: &quot;A String&quot;, # Required field indicating the start time of the interval.
281 &quot;value&quot;: &quot;A String&quot;, # Indicates the number of executions counted.
282 },
283 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700284 }</pre>
285</div>
286
287<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700288 <code class="details" id="updateContent">updateContent(scriptId, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700289 <pre>Updates the content of the specified script project.
290This content is stored as the HEAD version, and is used when the script is
291executed as a trigger, in the script editor, in add-on preview mode, or as
292a web app or Apps Script API in development mode. This clears all the
293existing files in the project.
294
295Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700296 scriptId: string, The script project&#x27;s Drive ID. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700297 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700298 The object takes the form of:
299
300{ # The Content resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700301 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
302 &quot;files&quot;: [ # The list of script project files.
303 # One of the files is a script manifest; it must be named &quot;appsscript&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700304 # must have type of JSON, and include the manifest configurations for the
305 # project.
306 { # An individual file within a script project.
307 # A file is a third-party source code created by one or more
308 # developers. It can be a server-side JS code, HTML, or a
309 # configuration file. Each script project can contain multiple files.
Bu Sun Kim65020912020-05-20 12:08:20 -0700310 &quot;functionSet&quot;: { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any.
311 &quot;values&quot;: [ # A list of functions composing the set.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700312 { # Represents a function in a script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700313 &quot;name&quot;: &quot;A String&quot;, # The function name in the script project.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700314 },
315 ],
316 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700317 &quot;lastModifyUser&quot;: { # A simple user profile resource. # The user who modified the file most recently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700318 # This read-only field is only visible to users who have WRITER
319 # permission for the script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700320 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
321 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
322 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700323 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700324 },
325 &quot;createTime&quot;: &quot;A String&quot;, # Creation date timestamp.
326 # This read-only field is only visible to users who have WRITER
327 # permission for the script project.
328 &quot;updateTime&quot;: &quot;A String&quot;, # Last modified date timestamp.
329 # This read-only field is only visible to users who have WRITER
330 # permission for the script project.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700331 &quot;source&quot;: &quot;A String&quot;, # The file content.
332 &quot;name&quot;: &quot;A String&quot;, # The name of the file. The file extension is not part of the file
333 # name, which can be identified from the type field.
334 &quot;type&quot;: &quot;A String&quot;, # The type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700335 },
336 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700337}
338
339 x__xgafv: string, V1 error format.
340 Allowed values
341 1 - v1 error format
342 2 - v2 error format
343
344Returns:
345 An object of the form:
346
347 { # The Content resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700348 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
349 &quot;files&quot;: [ # The list of script project files.
350 # One of the files is a script manifest; it must be named &quot;appsscript&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700351 # must have type of JSON, and include the manifest configurations for the
352 # project.
353 { # An individual file within a script project.
354 # A file is a third-party source code created by one or more
355 # developers. It can be a server-side JS code, HTML, or a
356 # configuration file. Each script project can contain multiple files.
Bu Sun Kim65020912020-05-20 12:08:20 -0700357 &quot;functionSet&quot;: { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any.
358 &quot;values&quot;: [ # A list of functions composing the set.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 { # Represents a function in a script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700360 &quot;name&quot;: &quot;A String&quot;, # The function name in the script project.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700361 },
362 ],
363 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700364 &quot;lastModifyUser&quot;: { # A simple user profile resource. # The user who modified the file most recently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700365 # This read-only field is only visible to users who have WRITER
366 # permission for the script project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
368 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
369 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700370 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700371 },
372 &quot;createTime&quot;: &quot;A String&quot;, # Creation date timestamp.
373 # This read-only field is only visible to users who have WRITER
374 # permission for the script project.
375 &quot;updateTime&quot;: &quot;A String&quot;, # Last modified date timestamp.
376 # This read-only field is only visible to users who have WRITER
377 # permission for the script project.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700378 &quot;source&quot;: &quot;A String&quot;, # The file content.
379 &quot;name&quot;: &quot;A String&quot;, # The name of the file. The file extension is not part of the file
380 # name, which can be identified from the type field.
381 &quot;type&quot;: &quot;A String&quot;, # The type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700382 },
383 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700384 }</pre>
385</div>
386
387</body></html>