| 1 |
<html><body> |
| 2 |
<style> |
| 3 |
|
| 4 |
body, 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 |
|
| 15 |
body { |
| 16 |
font-size: 13px; |
| 17 |
padding: 1em; |
| 18 |
} |
| 19 |
|
| 20 |
h1 { |
| 21 |
font-size: 26px; |
| 22 |
margin-bottom: 1em; |
| 23 |
} |
| 24 |
|
| 25 |
h2 { |
| 26 |
font-size: 24px; |
| 27 |
margin-bottom: 1em; |
| 28 |
} |
| 29 |
|
| 30 |
h3 { |
| 31 |
font-size: 20px; |
| 32 |
margin-bottom: 1em; |
| 33 |
margin-top: 1em; |
| 34 |
} |
| 35 |
|
| 36 |
pre, code { |
| 37 |
line-height: 1.5; |
| 38 |
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 |
} |
| 40 |
|
| 41 |
pre { |
| 42 |
margin-top: 0.5em; |
| 43 |
} |
| 44 |
|
| 45 |
h1, h2, h3, p { |
| 46 |
font-family: Arial, sans serif; |
| 47 |
} |
| 48 |
|
| 49 |
h1, 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"> |
| 88 |
<code><a href="#close">close()</a></code></p> |
| 89 |
<p class="firstline">Close httplib2 connections.</p> |
| 90 |
<p class="toc_element"> |
| 91 |
<code><a href="#create">create(body=None, x__xgafv=None)</a></code></p> |
| 92 |
<p class="firstline">Creates a new, empty script project with no script files and a base manifest file.</p> |
| 93 |
<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> |
| 98 |
<p class="firstline">Gets the content of the script project, including the code source and metadata for each script file.</p> |
| 99 |
<p class="toc_element"> |
| 100 |
<code><a href="#getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, metricsGranularity=None, x__xgafv=None)</a></code></p> |
| 101 |
<p class="firstline">Get metrics data for scripts, such as number of executions and active users.</p> |
| 102 |
<p class="toc_element"> |
| 103 |
<code><a href="#updateContent">updateContent(scriptId, body=None, x__xgafv=None)</a></code></p> |
| 104 |
<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> |
| 105 |
<h3>Method Details</h3> |
| 106 |
<div class="method"> |
| 107 |
<code class="details" id="close">close()</code> |
| 108 |
<pre>Close httplib2 connections.</pre> |
| 109 |
</div> |
| 110 |
|
| 111 |
<div class="method"> |
| 112 |
<code class="details" id="create">create(body=None, x__xgafv=None)</code> |
| 113 |
<pre>Creates a new, empty script project with no script files and a base manifest file. |
| 114 |
|
| 115 |
Args: |
| 116 |
body: object, The request body. |
| 117 |
The object takes the form of: |
| 118 |
|
| 119 |
{ # Request to create a script project. |
| 120 |
"parentId": "A String", # 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 |
"title": "A String", # The title for the project. |
| 122 |
} |
| 123 |
|
| 124 |
x__xgafv: string, V1 error format. |
| 125 |
Allowed values |
| 126 |
1 - v1 error format |
| 127 |
2 - v2 error format |
| 128 |
|
| 129 |
Returns: |
| 130 |
An object of the form: |
| 131 |
|
| 132 |
{ # The script project resource. |
| 133 |
"createTime": "A String", # When the script was created. |
| 134 |
"creator": { # A simple user profile resource. # User who originally created the script. |
| 135 |
"domain": "A String", # The user's domain. |
| 136 |
"email": "A String", # The user's identifying email address. |
| 137 |
"name": "A String", # The user's display name. |
| 138 |
"photoUrl": "A String", # The user's photo. |
| 139 |
}, |
| 140 |
"lastModifyUser": { # A simple user profile resource. # User who last modified the script. |
| 141 |
"domain": "A String", # The user's domain. |
| 142 |
"email": "A String", # The user's identifying email address. |
| 143 |
"name": "A String", # The user's display name. |
| 144 |
"photoUrl": "A String", # The user's photo. |
| 145 |
}, |
| 146 |
"parentId": "A String", # The parent's Drive ID that the script will be attached to. This is usually the ID of a Google Document or Google Sheet. This field is optional, and if not set, a stand-alone script will be created. |
| 147 |
"scriptId": "A String", # The script project's Drive ID. |
| 148 |
"title": "A String", # The title for the project. |
| 149 |
"updateTime": "A String", # When the script was last updated. |
| 150 |
}</pre> |
| 151 |
</div> |
| 152 |
|
| 153 |
<div class="method"> |
| 154 |
<code class="details" id="get">get(scriptId, x__xgafv=None)</code> |
| 155 |
<pre>Gets a script project's metadata. |
| 156 |
|
| 157 |
Args: |
| 158 |
scriptId: string, The script project's Drive ID. (required) |
| 159 |
x__xgafv: string, V1 error format. |
| 160 |
Allowed values |
| 161 |
1 - v1 error format |
| 162 |
2 - v2 error format |
| 163 |
|
| 164 |
Returns: |
| 165 |
An object of the form: |
| 166 |
|
| 167 |
{ # The script project resource. |
| 168 |
"createTime": "A String", # When the script was created. |
| 169 |
"creator": { # A simple user profile resource. # User who originally created the script. |
| 170 |
"domain": "A String", # The user's domain. |
| 171 |
"email": "A String", # The user's identifying email address. |
| 172 |
"name": "A String", # The user's display name. |
| 173 |
"photoUrl": "A String", # The user's photo. |
| 174 |
}, |
| 175 |
"lastModifyUser": { # A simple user profile resource. # User who last modified the script. |
| 176 |
"domain": "A String", # The user's domain. |
| 177 |
"email": "A String", # The user's identifying email address. |
| 178 |
"name": "A String", # The user's display name. |
| 179 |
"photoUrl": "A String", # The user's photo. |
| 180 |
}, |
| 181 |
"parentId": "A String", # The parent's Drive ID that the script will be attached to. This is usually the ID of a Google Document or Google Sheet. This field is optional, and if not set, a stand-alone script will be created. |
| 182 |
"scriptId": "A String", # The script project's Drive ID. |
| 183 |
"title": "A String", # The title for the project. |
| 184 |
"updateTime": "A String", # When the script was last updated. |
| 185 |
}</pre> |
| 186 |
</div> |
| 187 |
|
| 188 |
<div class="method"> |
| 189 |
<code class="details" id="getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</code> |
| 190 |
<pre>Gets the content of the script project, including the code source and metadata for each script file. |
| 191 |
|
| 192 |
Args: |
| 193 |
scriptId: string, The script project's Drive ID. (required) |
| 194 |
versionNumber: integer, The version number of the project to retrieve. If not provided, the project's HEAD version is returned. |
| 195 |
x__xgafv: string, V1 error format. |
| 196 |
Allowed values |
| 197 |
1 - v1 error format |
| 198 |
2 - v2 error format |
| 199 |
|
| 200 |
Returns: |
| 201 |
An object of the form: |
| 202 |
|
| 203 |
{ # The Content resource. |
| 204 |
"files": [ # The list of script project files. One of the files is a script manifest; it must be named "appsscript", 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 |
"createTime": "A String", # Creation date timestamp. |
| 207 |
"functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. |
| 208 |
"values": [ # A list of functions composing the set. |
| 209 |
{ # Represents a function in a script project. |
| 210 |
"name": "A String", # The function name in the script project. |
| 211 |
"parameters": [ # The ordered list of parameter names of the function in the script project. |
| 212 |
"A String", |
| 213 |
], |
| 214 |
}, |
| 215 |
], |
| 216 |
}, |
| 217 |
"lastModifyUser": { # A simple user profile resource. # The user who modified the file most recently. The details visible in this object are controlled by the profile visibility settings of the last modifying user. |
| 218 |
"domain": "A String", # The user's domain. |
| 219 |
"email": "A String", # The user's identifying email address. |
| 220 |
"name": "A String", # The user's display name. |
| 221 |
"photoUrl": "A String", # The user's photo. |
| 222 |
}, |
| 223 |
"name": "A String", # The name of the file. The file extension is not part of the file name, which can be identified from the type field. |
| 224 |
"source": "A String", # The file content. |
| 225 |
"type": "A String", # The type of the file. |
| 226 |
"updateTime": "A String", # Last modified date timestamp. |
| 227 |
}, |
| 228 |
], |
| 229 |
"scriptId": "A String", # The script project's Drive ID. |
| 230 |
}</pre> |
| 231 |
</div> |
| 232 |
|
| 233 |
<div class="method"> |
| 234 |
<code class="details" id="getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, metricsGranularity=None, x__xgafv=None)</code> |
| 235 |
<pre>Get metrics data for scripts, such as number of executions and active users. |
| 236 |
|
| 237 |
Args: |
| 238 |
scriptId: string, Required field indicating the script to get metrics for. (required) |
| 239 |
metricsFilter_deploymentId: string, Optional field indicating a specific deployment to retrieve metrics from. |
| 240 |
metricsGranularity: string, Required field indicating what granularity of metrics are returned. |
| 241 |
Allowed values |
| 242 |
UNSPECIFIED_GRANULARITY - Default metric granularity used to query no metrics. |
| 243 |
WEEKLY - Represents weekly metrics. |
| 244 |
DAILY - Represents daily metrics over a period of 7 days. |
| 245 |
x__xgafv: string, V1 error format. |
| 246 |
Allowed values |
| 247 |
1 - v1 error format |
| 248 |
2 - v2 error format |
| 249 |
|
| 250 |
Returns: |
| 251 |
An object of the form: |
| 252 |
|
| 253 |
{ # Resource containing usage stats for a given script, based on the supplied filter and mask present in the request. |
| 254 |
"activeUsers": [ # Number of active users. |
| 255 |
{ # Metrics value that holds number of executions counted. |
| 256 |
"endTime": "A String", # Required field indicating the end time of the interval. |
| 257 |
"startTime": "A String", # Required field indicating the start time of the interval. |
| 258 |
"value": "A String", # Indicates the number of executions counted. |
| 259 |
}, |
| 260 |
], |
| 261 |
"failedExecutions": [ # Number of failed executions. |
| 262 |
{ # Metrics value that holds number of executions counted. |
| 263 |
"endTime": "A String", # Required field indicating the end time of the interval. |
| 264 |
"startTime": "A String", # Required field indicating the start time of the interval. |
| 265 |
"value": "A String", # Indicates the number of executions counted. |
| 266 |
}, |
| 267 |
], |
| 268 |
"totalExecutions": [ # Number of total executions. |
| 269 |
{ # Metrics value that holds number of executions counted. |
| 270 |
"endTime": "A String", # Required field indicating the end time of the interval. |
| 271 |
"startTime": "A String", # Required field indicating the start time of the interval. |
| 272 |
"value": "A String", # Indicates the number of executions counted. |
| 273 |
}, |
| 274 |
], |
| 275 |
}</pre> |
| 276 |
</div> |
| 277 |
|
| 278 |
<div class="method"> |
| 279 |
<code class="details" id="updateContent">updateContent(scriptId, body=None, x__xgafv=None)</code> |
| 280 |
<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. |
| 281 |
|
| 282 |
Args: |
| 283 |
scriptId: string, The script project's Drive ID. (required) |
| 284 |
body: object, The request body. |
| 285 |
The object takes the form of: |
| 286 |
|
| 287 |
{ # The Content resource. |
| 288 |
"files": [ # The list of script project files. One of the files is a script manifest; it must be named "appsscript", must have type of JSON, and include the manifest configurations for the project. |
| 289 |
{ # 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. |
| 290 |
"createTime": "A String", # Creation date timestamp. |
| 291 |
"functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. |
| 292 |
"values": [ # A list of functions composing the set. |
| 293 |
{ # Represents a function in a script project. |
| 294 |
"name": "A String", # The function name in the script project. |
| 295 |
"parameters": [ # The ordered list of parameter names of the function in the script project. |
| 296 |
"A String", |
| 297 |
], |
| 298 |
}, |
| 299 |
], |
| 300 |
}, |
| 301 |
"lastModifyUser": { # A simple user profile resource. # The user who modified the file most recently. The details visible in this object are controlled by the profile visibility settings of the last modifying user. |
| 302 |
"domain": "A String", # The user's domain. |
| 303 |
"email": "A String", # The user's identifying email address. |
| 304 |
"name": "A String", # The user's display name. |
| 305 |
"photoUrl": "A String", # The user's photo. |
| 306 |
}, |
| 307 |
"name": "A String", # The name of the file. The file extension is not part of the file name, which can be identified from the type field. |
| 308 |
"source": "A String", # The file content. |
| 309 |
"type": "A String", # The type of the file. |
| 310 |
"updateTime": "A String", # Last modified date timestamp. |
| 311 |
}, |
| 312 |
], |
| 313 |
"scriptId": "A String", # The script project's Drive ID. |
| 314 |
} |
| 315 |
|
| 316 |
x__xgafv: string, V1 error format. |
| 317 |
Allowed values |
| 318 |
1 - v1 error format |
| 319 |
2 - v2 error format |
| 320 |
|
| 321 |
Returns: |
| 322 |
An object of the form: |
| 323 |
|
| 324 |
{ # The Content resource. |
| 325 |
"files": [ # The list of script project files. One of the files is a script manifest; it must be named "appsscript", must have type of JSON, and include the manifest configurations for the project. |
| 326 |
{ # 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. |
| 327 |
"createTime": "A String", # Creation date timestamp. |
| 328 |
"functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. |
| 329 |
"values": [ # A list of functions composing the set. |
| 330 |
{ # Represents a function in a script project. |
| 331 |
"name": "A String", # The function name in the script project. |
| 332 |
"parameters": [ # The ordered list of parameter names of the function in the script project. |
| 333 |
"A String", |
| 334 |
], |
| 335 |
}, |
| 336 |
], |
| 337 |
}, |
| 338 |
"lastModifyUser": { # A simple user profile resource. # The user who modified the file most recently. The details visible in this object are controlled by the profile visibility settings of the last modifying user. |
| 339 |
"domain": "A String", # The user's domain. |
| 340 |
"email": "A String", # The user's identifying email address. |
| 341 |
"name": "A String", # The user's display name. |
| 342 |
"photoUrl": "A String", # The user's photo. |
| 343 |
}, |
| 344 |
"name": "A String", # The name of the file. The file extension is not part of the file name, which can be identified from the type field. |
| 345 |
"source": "A String", # The file content. |
| 346 |
"type": "A String", # The type of the file. |
| 347 |
"updateTime": "A String", # Last modified date timestamp. |
| 348 |
}, |
| 349 |
], |
| 350 |
"scriptId": "A String", # The script project's Drive ID. |
| 351 |
}</pre> |
| 352 |
</div> |
| 353 |
|
| 354 |
</body></html> |