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="bigquery_v2.html">BigQuery API</a> . <a href="bigquery_v2.routines.html">routines</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#delete">delete(projectId, datasetId, routineId)</a></code></p> 82<p class="firstline">Deletes the routine specified by routineId from the dataset.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(projectId, datasetId, routineId, readMask=None)</a></code></p> 85<p class="firstline">Gets the specified routine resource by routine ID.</p> 86<p class="toc_element"> 87 <code><a href="#insert">insert(projectId, datasetId, body=None)</a></code></p> 88<p class="firstline">Creates a new routine in the dataset.</p> 89<p class="toc_element"> 90 <code><a href="#list">list(projectId, datasetId, filter=None, maxResults=None, pageToken=None, readMask=None)</a></code></p> 91<p class="firstline">Lists all routines in the specified dataset. Requires the READER dataset role.</p> 92<p class="toc_element"> 93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 94<p class="firstline">Retrieves the next page of results.</p> 95<p class="toc_element"> 96 <code><a href="#update">update(projectId, datasetId, routineId, body=None)</a></code></p> 97<p class="firstline">Updates information in an existing routine. The update method replaces the entire Routine resource.</p> 98<h3>Method Details</h3> 99<div class="method"> 100 <code class="details" id="close">close()</code> 101 <pre>Close httplib2 connections.</pre> 102</div> 103 104<div class="method"> 105 <code class="details" id="delete">delete(projectId, datasetId, routineId)</code> 106 <pre>Deletes the routine specified by routineId from the dataset. 107 108Args: 109 projectId: string, Required. Project ID of the routine to delete (required) 110 datasetId: string, Required. Dataset ID of the routine to delete (required) 111 routineId: string, Required. Routine ID of the routine to delete (required) 112</pre> 113</div> 114 115<div class="method"> 116 <code class="details" id="get">get(projectId, datasetId, routineId, readMask=None)</code> 117 <pre>Gets the specified routine resource by routine ID. 118 119Args: 120 projectId: string, Required. Project ID of the requested routine (required) 121 datasetId: string, Required. Dataset ID of the requested routine (required) 122 routineId: string, Required. Routine ID of the requested routine (required) 123 readMask: string, If set, only the Routine fields in the field mask are returned in the response. If unset, all Routine fields are returned. 124 125Returns: 126 An object of the form: 127 128 { # A user-defined function or a stored procedure. 129 "arguments": [ # Optional. 130 { # Input/output argument of a function or a stored procedure. 131 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. 132 "dataType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Required unless argument_kind = ANY_TYPE. 133 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 134 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 135 "fields": [ 136 # Object with schema name: StandardSqlField 137 ], 138 }, 139 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 140 }, 141 "mode": "A String", # Optional. Specifies whether the argument is input or output. Can be set for procedures only. 142 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. 143 }, 144 ], 145 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since the epoch. 146 "definitionBody": "A String", # Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks. 147 "description": "A String", # Optional. The description of the routine, if defined. 148 "determinismLevel": "A String", # Optional. The determinism level of the JavaScript UDF, if defined. 149 "etag": "A String", # Output only. A hash of this resource. 150 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. 151 "A String", 152 ], 153 "language": "A String", # Optional. Defaults to "SQL". 154 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds since the epoch. 155 "returnTableType": { # A table type # Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time. 156 "columns": [ # The columns in this table type 157 { # A field or a column. 158 "name": "A String", # Optional. The name of this field. Can be absent for struct fields. 159 "type": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field). 160 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 161 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 162 "fields": [ 163 # Object with schema name: StandardSqlField 164 ], 165 }, 166 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 167 }, 168 }, 169 ], 170 }, 171 "returnType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64. 172 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 173 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 174 "fields": [ 175 # Object with schema name: StandardSqlField 176 ], 177 }, 178 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 179 }, 180 "routineReference": { # Required. Reference describing the ID of this routine. 181 "datasetId": "A String", # [Required] The ID of the dataset containing this routine. 182 "projectId": "A String", # [Required] The ID of the project containing this routine. 183 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. 184 }, 185 "routineType": "A String", # Required. The type of routine. 186 "strictMode": True or False, # Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. 187}</pre> 188</div> 189 190<div class="method"> 191 <code class="details" id="insert">insert(projectId, datasetId, body=None)</code> 192 <pre>Creates a new routine in the dataset. 193 194Args: 195 projectId: string, Required. Project ID of the new routine (required) 196 datasetId: string, Required. Dataset ID of the new routine (required) 197 body: object, The request body. 198 The object takes the form of: 199 200{ # A user-defined function or a stored procedure. 201 "arguments": [ # Optional. 202 { # Input/output argument of a function or a stored procedure. 203 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. 204 "dataType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Required unless argument_kind = ANY_TYPE. 205 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 206 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 207 "fields": [ 208 # Object with schema name: StandardSqlField 209 ], 210 }, 211 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 212 }, 213 "mode": "A String", # Optional. Specifies whether the argument is input or output. Can be set for procedures only. 214 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. 215 }, 216 ], 217 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since the epoch. 218 "definitionBody": "A String", # Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks. 219 "description": "A String", # Optional. The description of the routine, if defined. 220 "determinismLevel": "A String", # Optional. The determinism level of the JavaScript UDF, if defined. 221 "etag": "A String", # Output only. A hash of this resource. 222 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. 223 "A String", 224 ], 225 "language": "A String", # Optional. Defaults to "SQL". 226 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds since the epoch. 227 "returnTableType": { # A table type # Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time. 228 "columns": [ # The columns in this table type 229 { # A field or a column. 230 "name": "A String", # Optional. The name of this field. Can be absent for struct fields. 231 "type": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field). 232 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 233 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 234 "fields": [ 235 # Object with schema name: StandardSqlField 236 ], 237 }, 238 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 239 }, 240 }, 241 ], 242 }, 243 "returnType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64. 244 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 245 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 246 "fields": [ 247 # Object with schema name: StandardSqlField 248 ], 249 }, 250 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 251 }, 252 "routineReference": { # Required. Reference describing the ID of this routine. 253 "datasetId": "A String", # [Required] The ID of the dataset containing this routine. 254 "projectId": "A String", # [Required] The ID of the project containing this routine. 255 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. 256 }, 257 "routineType": "A String", # Required. The type of routine. 258 "strictMode": True or False, # Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. 259} 260 261 262Returns: 263 An object of the form: 264 265 { # A user-defined function or a stored procedure. 266 "arguments": [ # Optional. 267 { # Input/output argument of a function or a stored procedure. 268 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. 269 "dataType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Required unless argument_kind = ANY_TYPE. 270 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 271 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 272 "fields": [ 273 # Object with schema name: StandardSqlField 274 ], 275 }, 276 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 277 }, 278 "mode": "A String", # Optional. Specifies whether the argument is input or output. Can be set for procedures only. 279 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. 280 }, 281 ], 282 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since the epoch. 283 "definitionBody": "A String", # Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks. 284 "description": "A String", # Optional. The description of the routine, if defined. 285 "determinismLevel": "A String", # Optional. The determinism level of the JavaScript UDF, if defined. 286 "etag": "A String", # Output only. A hash of this resource. 287 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. 288 "A String", 289 ], 290 "language": "A String", # Optional. Defaults to "SQL". 291 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds since the epoch. 292 "returnTableType": { # A table type # Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time. 293 "columns": [ # The columns in this table type 294 { # A field or a column. 295 "name": "A String", # Optional. The name of this field. Can be absent for struct fields. 296 "type": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field). 297 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 298 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 299 "fields": [ 300 # Object with schema name: StandardSqlField 301 ], 302 }, 303 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 304 }, 305 }, 306 ], 307 }, 308 "returnType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64. 309 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 310 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 311 "fields": [ 312 # Object with schema name: StandardSqlField 313 ], 314 }, 315 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 316 }, 317 "routineReference": { # Required. Reference describing the ID of this routine. 318 "datasetId": "A String", # [Required] The ID of the dataset containing this routine. 319 "projectId": "A String", # [Required] The ID of the project containing this routine. 320 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. 321 }, 322 "routineType": "A String", # Required. The type of routine. 323 "strictMode": True or False, # Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. 324}</pre> 325</div> 326 327<div class="method"> 328 <code class="details" id="list">list(projectId, datasetId, filter=None, maxResults=None, pageToken=None, readMask=None)</code> 329 <pre>Lists all routines in the specified dataset. Requires the READER dataset role. 330 331Args: 332 projectId: string, Required. Project ID of the routines to list (required) 333 datasetId: string, Required. Dataset ID of the routines to list (required) 334 filter: string, If set, then only the Routines matching this filter are returned. The current supported form is either "routine_type:" or "routineType:", where is a RoutineType enum. Example: "routineType:SCALAR_FUNCTION". 335 maxResults: integer, The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection. 336 pageToken: string, Page token, returned by a previous call, to request the next page of results 337 readMask: string, If set, then only the Routine fields in the field mask, as well as project_id, dataset_id and routine_id, are returned in the response. If unset, then the following Routine fields are returned: etag, project_id, dataset_id, routine_id, routine_type, creation_time, last_modified_time, and language. 338 339Returns: 340 An object of the form: 341 342 { 343 "nextPageToken": "A String", # A token to request the next page of results. 344 "routines": [ # Routines in the requested dataset. Unless read_mask is set in the request, only the following fields are populated: etag, project_id, dataset_id, routine_id, routine_type, creation_time, last_modified_time, and language. 345 { # A user-defined function or a stored procedure. 346 "arguments": [ # Optional. 347 { # Input/output argument of a function or a stored procedure. 348 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. 349 "dataType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Required unless argument_kind = ANY_TYPE. 350 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 351 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 352 "fields": [ 353 # Object with schema name: StandardSqlField 354 ], 355 }, 356 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 357 }, 358 "mode": "A String", # Optional. Specifies whether the argument is input or output. Can be set for procedures only. 359 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. 360 }, 361 ], 362 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since the epoch. 363 "definitionBody": "A String", # Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks. 364 "description": "A String", # Optional. The description of the routine, if defined. 365 "determinismLevel": "A String", # Optional. The determinism level of the JavaScript UDF, if defined. 366 "etag": "A String", # Output only. A hash of this resource. 367 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. 368 "A String", 369 ], 370 "language": "A String", # Optional. Defaults to "SQL". 371 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds since the epoch. 372 "returnTableType": { # A table type # Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time. 373 "columns": [ # The columns in this table type 374 { # A field or a column. 375 "name": "A String", # Optional. The name of this field. Can be absent for struct fields. 376 "type": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field). 377 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 378 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 379 "fields": [ 380 # Object with schema name: StandardSqlField 381 ], 382 }, 383 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 384 }, 385 }, 386 ], 387 }, 388 "returnType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64. 389 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 390 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 391 "fields": [ 392 # Object with schema name: StandardSqlField 393 ], 394 }, 395 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 396 }, 397 "routineReference": { # Required. Reference describing the ID of this routine. 398 "datasetId": "A String", # [Required] The ID of the dataset containing this routine. 399 "projectId": "A String", # [Required] The ID of the project containing this routine. 400 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. 401 }, 402 "routineType": "A String", # Required. The type of routine. 403 "strictMode": True or False, # Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. 404 }, 405 ], 406}</pre> 407</div> 408 409<div class="method"> 410 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 411 <pre>Retrieves the next page of results. 412 413Args: 414 previous_request: The request for the previous page. (required) 415 previous_response: The response from the request for the previous page. (required) 416 417Returns: 418 A request object that you can call 'execute()' on to request the next 419 page. Returns None if there are no more items in the collection. 420 </pre> 421</div> 422 423<div class="method"> 424 <code class="details" id="update">update(projectId, datasetId, routineId, body=None)</code> 425 <pre>Updates information in an existing routine. The update method replaces the entire Routine resource. 426 427Args: 428 projectId: string, Required. Project ID of the routine to update (required) 429 datasetId: string, Required. Dataset ID of the routine to update (required) 430 routineId: string, Required. Routine ID of the routine to update (required) 431 body: object, The request body. 432 The object takes the form of: 433 434{ # A user-defined function or a stored procedure. 435 "arguments": [ # Optional. 436 { # Input/output argument of a function or a stored procedure. 437 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. 438 "dataType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Required unless argument_kind = ANY_TYPE. 439 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 440 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 441 "fields": [ 442 # Object with schema name: StandardSqlField 443 ], 444 }, 445 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 446 }, 447 "mode": "A String", # Optional. Specifies whether the argument is input or output. Can be set for procedures only. 448 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. 449 }, 450 ], 451 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since the epoch. 452 "definitionBody": "A String", # Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks. 453 "description": "A String", # Optional. The description of the routine, if defined. 454 "determinismLevel": "A String", # Optional. The determinism level of the JavaScript UDF, if defined. 455 "etag": "A String", # Output only. A hash of this resource. 456 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. 457 "A String", 458 ], 459 "language": "A String", # Optional. Defaults to "SQL". 460 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds since the epoch. 461 "returnTableType": { # A table type # Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time. 462 "columns": [ # The columns in this table type 463 { # A field or a column. 464 "name": "A String", # Optional. The name of this field. Can be absent for struct fields. 465 "type": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field). 466 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 467 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 468 "fields": [ 469 # Object with schema name: StandardSqlField 470 ], 471 }, 472 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 473 }, 474 }, 475 ], 476 }, 477 "returnType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64. 478 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 479 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 480 "fields": [ 481 # Object with schema name: StandardSqlField 482 ], 483 }, 484 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 485 }, 486 "routineReference": { # Required. Reference describing the ID of this routine. 487 "datasetId": "A String", # [Required] The ID of the dataset containing this routine. 488 "projectId": "A String", # [Required] The ID of the project containing this routine. 489 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. 490 }, 491 "routineType": "A String", # Required. The type of routine. 492 "strictMode": True or False, # Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. 493} 494 495 496Returns: 497 An object of the form: 498 499 { # A user-defined function or a stored procedure. 500 "arguments": [ # Optional. 501 { # Input/output argument of a function or a stored procedure. 502 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. 503 "dataType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Required unless argument_kind = ANY_TYPE. 504 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 505 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 506 "fields": [ 507 # Object with schema name: StandardSqlField 508 ], 509 }, 510 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 511 }, 512 "mode": "A String", # Optional. Specifies whether the argument is input or output. Can be set for procedures only. 513 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. 514 }, 515 ], 516 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since the epoch. 517 "definitionBody": "A String", # Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks. 518 "description": "A String", # Optional. The description of the routine, if defined. 519 "determinismLevel": "A String", # Optional. The determinism level of the JavaScript UDF, if defined. 520 "etag": "A String", # Output only. A hash of this resource. 521 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. 522 "A String", 523 ], 524 "language": "A String", # Optional. Defaults to "SQL". 525 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds since the epoch. 526 "returnTableType": { # A table type # Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time. 527 "columns": [ # The columns in this table type 528 { # A field or a column. 529 "name": "A String", # Optional. The name of this field. Can be absent for struct fields. 530 "type": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field). 531 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 532 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 533 "fields": [ 534 # Object with schema name: StandardSqlField 535 ], 536 }, 537 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 538 }, 539 }, 540 ], 541 }, 542 "returnType": { # The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}} # Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64. 543 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". 544 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". 545 "fields": [ 546 # Object with schema name: StandardSqlField 547 ], 548 }, 549 "typeKind": "A String", # Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 550 }, 551 "routineReference": { # Required. Reference describing the ID of this routine. 552 "datasetId": "A String", # [Required] The ID of the dataset containing this routine. 553 "projectId": "A String", # [Required] The ID of the project containing this routine. 554 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. 555 }, 556 "routineType": "A String", # Required. The type of routine. 557 "strictMode": True or False, # Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. 558}</pre> 559</div> 560 561</body></html>