1<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"> 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 115Args: 116 body: object, The request body. 117 The object takes the form of: 118 119{ # Request to create a script project. 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 129Returns: 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 filed 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 157Args: 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 164Returns: 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 filed 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 192Args: 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 200Returns: 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. This read-only field is only visible to users who have WRITER permission for the script project. 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 }, 212 ], 213 }, 214 "lastModifyUser": { # 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 "domain": "A String", # The user's domain. 216 "email": "A String", # The user's identifying email address. 217 "name": "A String", # The user's display name. 218 "photoUrl": "A String", # The user's photo. 219 }, 220 "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. 221 "source": "A String", # The file content. 222 "type": "A String", # The type of the file. 223 "updateTime": "A String", # Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. 224 }, 225 ], 226 "scriptId": "A String", # The script project's Drive ID. 227}</pre> 228</div> 229 230<div class="method"> 231 <code class="details" id="getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, metricsGranularity=None, x__xgafv=None)</code> 232 <pre>Get metrics data for scripts, such as number of executions and active users. 233 234Args: 235 scriptId: string, Required field indicating the script to get metrics for. (required) 236 metricsFilter_deploymentId: string, Optional field indicating a specific deployment to retrieve metrics from. 237 metricsGranularity: string, Required field indicating what granularity of metrics are returned. 238 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. 242 x__xgafv: string, V1 error format. 243 Allowed values 244 1 - v1 error format 245 2 - v2 error format 246 247Returns: 248 An object of the form: 249 250 { # Resource containing usage stats for a given script, based on the supplied filter and mask present in the request. 251 "activeUsers": [ # Number of active users. 252 { # Metrics value that holds number of executions counted. 253 "endTime": "A String", # Required field indicating the end time of the interval. 254 "startTime": "A String", # Required field indicating the start time of the interval. 255 "value": "A String", # Indicates the number of executions counted. 256 }, 257 ], 258 "failedExecutions": [ # Number of failed executions. 259 { # Metrics value that holds number of executions counted. 260 "endTime": "A String", # Required field indicating the end time of the interval. 261 "startTime": "A String", # Required field indicating the start time of the interval. 262 "value": "A String", # Indicates the number of executions counted. 263 }, 264 ], 265 "totalExecutions": [ # Number of total executions. 266 { # Metrics value that holds number of executions counted. 267 "endTime": "A String", # Required field indicating the end time of the interval. 268 "startTime": "A String", # Required field indicating the start time of the interval. 269 "value": "A String", # Indicates the number of executions counted. 270 }, 271 ], 272}</pre> 273</div> 274 275<div class="method"> 276 <code class="details" id="updateContent">updateContent(scriptId, body=None, x__xgafv=None)</code> 277 <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. 278 279Args: 280 scriptId: string, The script project's Drive ID. (required) 281 body: object, The request body. 282 The object takes the form of: 283 284{ # The Content resource. 285 "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. 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 "createTime": "A String", # Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. 288 "functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. 289 "values": [ # A list of functions composing the set. 290 { # Represents a function in a script project. 291 "name": "A String", # The function name in the script project. 292 }, 293 ], 294 }, 295 "lastModifyUser": { # 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 "domain": "A String", # The user's domain. 297 "email": "A String", # The user's identifying email address. 298 "name": "A String", # The user's display name. 299 "photoUrl": "A String", # The user's photo. 300 }, 301 "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. 302 "source": "A String", # The file content. 303 "type": "A String", # The type of the file. 304 "updateTime": "A String", # Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. 305 }, 306 ], 307 "scriptId": "A String", # The script project's Drive ID. 308} 309 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. 319 "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. 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 "createTime": "A String", # Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. 322 "functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. 323 "values": [ # A list of functions composing the set. 324 { # Represents a function in a script project. 325 "name": "A String", # The function name in the script project. 326 }, 327 ], 328 }, 329 "lastModifyUser": { # 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 "domain": "A String", # The user's domain. 331 "email": "A String", # The user's identifying email address. 332 "name": "A String", # The user's display name. 333 "photoUrl": "A String", # The user's photo. 334 }, 335 "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. 336 "source": "A String", # The file content. 337 "type": "A String", # The type of the file. 338 "updateTime": "A String", # Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. 339 }, 340 ], 341 "scriptId": "A String", # The script project's Drive ID. 342}</pre> 343</div> 344 345</body></html>