blob: 2446bbc1397389e7c904845c4a971d09b3634dbf [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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088 <code><a href="#close">close()</a></code></p>
89<p class="firstline">Close httplib2 connections.</p>
90<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070091 <code><a href="#create">create(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070092<p class="firstline">Creates a new, empty script project with no script files and a base manifest file.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070093<p class="toc_element">
94 <code><a href="#get">get(scriptId, x__xgafv=None)</a></code></p>
95<p class="firstline">Gets a script project's metadata.</p>
96<p class="toc_element">
97 <code><a href="#getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070098<p class="firstline">Gets the content of the script project, including the code source and metadata for each script file.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070099<p class="toc_element">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800100 <code><a href="#getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, metricsGranularity=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700101<p class="firstline">Get metrics data for scripts, such as number of executions and active users.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700102<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700103 <code><a href="#updateContent">updateContent(scriptId, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700104<p class="firstline">Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700105<h3>Method Details</h3>
106<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700107 <code class="details" id="close">close()</code>
108 <pre>Close httplib2 connections.</pre>
109</div>
110
111<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700112 <code class="details" id="create">create(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700113 <pre>Creates a new, empty script project with no script files and a base manifest file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700114
115Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700116 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117 The object takes the form of:
118
119{ # Request to create a script project.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800120 &quot;parentId&quot;: &quot;A String&quot;, # The Drive ID of a parent file that the created script project is bound to. This is usually the ID of a Google Doc, Google Sheet, Google Form, or Google Slides file. If not set, a standalone script project is created.
121 &quot;title&quot;: &quot;A String&quot;, # The title for the project.
122}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700123
124 x__xgafv: string, V1 error format.
125 Allowed values
126 1 - v1 error format
127 2 - v2 error format
128
129Returns:
130 An object of the form:
131
132 { # The script project resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800133 &quot;createTime&quot;: &quot;A String&quot;, # When the script was created.
134 &quot;creator&quot;: { # A simple user profile resource. # User who originally created the script.
135 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
136 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
137 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
138 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
139 },
140 &quot;lastModifyUser&quot;: { # A simple user profile resource. # User who last modified the script.
141 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
142 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
143 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
144 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
145 },
146 &quot;parentId&quot;: &quot;A String&quot;, # The parent&#x27;s Drive ID that the script will be attached to. This is usually the ID of a Google Document or Google Sheet. This filed is optional, and if not set, a stand-alone script will be created.
147 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
148 &quot;title&quot;: &quot;A String&quot;, # The title for the project.
149 &quot;updateTime&quot;: &quot;A String&quot;, # When the script was last updated.
150}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700151</div>
152
153<div class="method">
154 <code class="details" id="get">get(scriptId, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700155 <pre>Gets a script project&#x27;s metadata.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700156
157Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 scriptId: string, The script project&#x27;s Drive ID. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700159 x__xgafv: string, V1 error format.
160 Allowed values
161 1 - v1 error format
162 2 - v2 error format
163
164Returns:
165 An object of the form:
166
167 { # The script project resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800168 &quot;createTime&quot;: &quot;A String&quot;, # When the script was created.
169 &quot;creator&quot;: { # A simple user profile resource. # User who originally created the script.
170 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
171 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
172 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
173 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
174 },
175 &quot;lastModifyUser&quot;: { # A simple user profile resource. # User who last modified the script.
176 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
177 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
178 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
179 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
180 },
181 &quot;parentId&quot;: &quot;A String&quot;, # The parent&#x27;s Drive ID that the script will be attached to. This is usually the ID of a Google Document or Google Sheet. This filed is optional, and if not set, a stand-alone script will be created.
182 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
183 &quot;title&quot;: &quot;A String&quot;, # The title for the project.
184 &quot;updateTime&quot;: &quot;A String&quot;, # When the script was last updated.
185}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700186</div>
187
188<div class="method">
189 <code class="details" id="getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700190 <pre>Gets the content of the script project, including the code source and metadata for each script file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191
192Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 scriptId: string, The script project&#x27;s Drive ID. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700194 versionNumber: integer, The version number of the project to retrieve. If not provided, the project&#x27;s HEAD version is returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700195 x__xgafv: string, V1 error format.
196 Allowed values
197 1 - v1 error format
198 2 - v2 error format
199
200Returns:
201 An object of the form:
202
203 { # The Content resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800204 &quot;files&quot;: [ # The list of script project files. One of the files is a script manifest; it must be named &quot;appsscript&quot;, must have type of JSON, and include the manifest configurations for the project.
205 { # An individual file within a script project. A file is a third-party source code created by one or more developers. It can be a server-side JS code, HTML, or a configuration file. Each script project can contain multiple files.
206 &quot;createTime&quot;: &quot;A String&quot;, # Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.
207 &quot;functionSet&quot;: { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any.
208 &quot;values&quot;: [ # A list of functions composing the set.
209 { # Represents a function in a script project.
210 &quot;name&quot;: &quot;A String&quot;, # The function name in the script project.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800211 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800212 ],
213 },
214 &quot;lastModifyUser&quot;: { # A simple user profile resource. # The user who modified the file most recently. This read-only field is only visible to users who have WRITER permission for the script project.
215 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
216 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
217 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
218 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
219 },
220 &quot;name&quot;: &quot;A String&quot;, # The name of the file. The file extension is not part of the file name, which can be identified from the type field.
221 &quot;source&quot;: &quot;A String&quot;, # The file content.
222 &quot;type&quot;: &quot;A String&quot;, # The type of the file.
223 &quot;updateTime&quot;: &quot;A String&quot;, # Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.
224 },
225 ],
226 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
227}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700228</div>
229
230<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800231 <code class="details" id="getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, metricsGranularity=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700232 <pre>Get metrics data for scripts, such as number of executions and active users.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700233
234Args:
235 scriptId: string, Required field indicating the script to get metrics for. (required)
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800236 metricsFilter_deploymentId: string, Optional field indicating a specific deployment to retrieve metrics from.
Bu Sun Kim65020912020-05-20 12:08:20 -0700237 metricsGranularity: string, Required field indicating what granularity of metrics are returned.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700238 Allowed values
239 UNSPECIFIED_GRANULARITY - Default metric granularity used to query no metrics.
240 WEEKLY - Represents weekly metrics.
241 DAILY - Represents daily metrics over a period of 7 days.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700242 x__xgafv: string, V1 error format.
243 Allowed values
244 1 - v1 error format
245 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700246
247Returns:
248 An object of the form:
249
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700250 { # Resource containing usage stats for a given script, based on the supplied filter and mask present in the request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800251 &quot;activeUsers&quot;: [ # Number of active users.
252 { # Metrics value that holds number of executions counted.
253 &quot;endTime&quot;: &quot;A String&quot;, # Required field indicating the end time of the interval.
254 &quot;startTime&quot;: &quot;A String&quot;, # Required field indicating the start time of the interval.
255 &quot;value&quot;: &quot;A String&quot;, # Indicates the number of executions counted.
256 },
257 ],
258 &quot;failedExecutions&quot;: [ # Number of failed executions.
259 { # Metrics value that holds number of executions counted.
260 &quot;endTime&quot;: &quot;A String&quot;, # Required field indicating the end time of the interval.
261 &quot;startTime&quot;: &quot;A String&quot;, # Required field indicating the start time of the interval.
262 &quot;value&quot;: &quot;A String&quot;, # Indicates the number of executions counted.
263 },
264 ],
265 &quot;totalExecutions&quot;: [ # Number of total executions.
266 { # Metrics value that holds number of executions counted.
267 &quot;endTime&quot;: &quot;A String&quot;, # Required field indicating the end time of the interval.
268 &quot;startTime&quot;: &quot;A String&quot;, # Required field indicating the start time of the interval.
269 &quot;value&quot;: &quot;A String&quot;, # Indicates the number of executions counted.
270 },
271 ],
272}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700273</div>
274
275<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700276 <code class="details" id="updateContent">updateContent(scriptId, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700277 <pre>Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700278
279Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700280 scriptId: string, The script project&#x27;s Drive ID. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700281 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700282 The object takes the form of:
283
284{ # The Content resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800285 &quot;files&quot;: [ # The list of script project files. One of the files is a script manifest; it must be named &quot;appsscript&quot;, must have type of JSON, and include the manifest configurations for the project.
286 { # An individual file within a script project. A file is a third-party source code created by one or more developers. It can be a server-side JS code, HTML, or a configuration file. Each script project can contain multiple files.
287 &quot;createTime&quot;: &quot;A String&quot;, # Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.
288 &quot;functionSet&quot;: { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any.
289 &quot;values&quot;: [ # A list of functions composing the set.
290 { # Represents a function in a script project.
291 &quot;name&quot;: &quot;A String&quot;, # The function name in the script project.
292 },
293 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700294 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800295 &quot;lastModifyUser&quot;: { # A simple user profile resource. # The user who modified the file most recently. This read-only field is only visible to users who have WRITER permission for the script project.
296 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
297 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
298 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
299 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
300 },
301 &quot;name&quot;: &quot;A String&quot;, # The name of the file. The file extension is not part of the file name, which can be identified from the type field.
302 &quot;source&quot;: &quot;A String&quot;, # The file content.
303 &quot;type&quot;: &quot;A String&quot;, # The type of the file.
304 &quot;updateTime&quot;: &quot;A String&quot;, # Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.
305 },
306 ],
307 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
308}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700309
310 x__xgafv: string, V1 error format.
311 Allowed values
312 1 - v1 error format
313 2 - v2 error format
314
315Returns:
316 An object of the form:
317
318 { # The Content resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800319 &quot;files&quot;: [ # The list of script project files. One of the files is a script manifest; it must be named &quot;appsscript&quot;, must have type of JSON, and include the manifest configurations for the project.
320 { # An individual file within a script project. A file is a third-party source code created by one or more developers. It can be a server-side JS code, HTML, or a configuration file. Each script project can contain multiple files.
321 &quot;createTime&quot;: &quot;A String&quot;, # Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.
322 &quot;functionSet&quot;: { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any.
323 &quot;values&quot;: [ # A list of functions composing the set.
324 { # Represents a function in a script project.
325 &quot;name&quot;: &quot;A String&quot;, # The function name in the script project.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800326 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800327 ],
328 },
329 &quot;lastModifyUser&quot;: { # A simple user profile resource. # The user who modified the file most recently. This read-only field is only visible to users who have WRITER permission for the script project.
330 &quot;domain&quot;: &quot;A String&quot;, # The user&#x27;s domain.
331 &quot;email&quot;: &quot;A String&quot;, # The user&#x27;s identifying email address.
332 &quot;name&quot;: &quot;A String&quot;, # The user&#x27;s display name.
333 &quot;photoUrl&quot;: &quot;A String&quot;, # The user&#x27;s photo.
334 },
335 &quot;name&quot;: &quot;A String&quot;, # The name of the file. The file extension is not part of the file name, which can be identified from the type field.
336 &quot;source&quot;: &quot;A String&quot;, # The file content.
337 &quot;type&quot;: &quot;A String&quot;, # The type of the file.
338 &quot;updateTime&quot;: &quot;A String&quot;, # Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.
339 },
340 ],
341 &quot;scriptId&quot;: &quot;A String&quot;, # The script project&#x27;s Drive ID.
342}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700343</div>
344
345</body></html>