RoutineArgs

data class RoutineArgs(val arguments: Output<List<ArgumentArgs>>? = null, val datasetId: Output<String>? = null, val definitionBody: Output<String>? = null, val description: Output<String>? = null, val determinismLevel: Output<RoutineDeterminismLevel>? = null, val importedLibraries: Output<List<String>>? = null, val language: Output<RoutineLanguage>? = null, val project: Output<String>? = null, val remoteFunctionOptions: Output<RemoteFunctionOptionsArgs>? = null, val returnTableType: Output<StandardSqlTableTypeArgs>? = null, val returnType: Output<StandardSqlDataTypeArgs>? = null, val routineReference: Output<RoutineReferenceArgs>? = null, val routineType: Output<RoutineRoutineType>? = null, val sparkOptions: Output<SparkOptionsArgs>? = null, val strictMode: Output<Boolean>? = null) : ConvertibleToJava<RoutineArgs>

Creates a new routine in the dataset. Auto-naming is currently not supported for this resource.

Constructors

Link copied to clipboard
fun RoutineArgs(arguments: Output<List<ArgumentArgs>>? = null, datasetId: Output<String>? = null, definitionBody: Output<String>? = null, description: Output<String>? = null, determinismLevel: Output<RoutineDeterminismLevel>? = null, importedLibraries: Output<List<String>>? = null, language: Output<RoutineLanguage>? = null, project: Output<String>? = null, remoteFunctionOptions: Output<RemoteFunctionOptionsArgs>? = null, returnTableType: Output<StandardSqlTableTypeArgs>? = null, returnType: Output<StandardSqlDataTypeArgs>? = null, routineReference: Output<RoutineReferenceArgs>? = null, routineType: Output<RoutineRoutineType>? = null, sparkOptions: Output<SparkOptionsArgs>? = null, strictMode: Output<Boolean>? = null)

Functions

Link copied to clipboard
open override fun toJava(): RoutineArgs

Properties

Link copied to clipboard
val arguments: Output<List<ArgumentArgs>>? = null

Optional.

Link copied to clipboard
val datasetId: Output<String>? = null
Link copied to clipboard
val definitionBody: Output<String>? = null

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.

Link copied to clipboard
val description: Output<String>? = null

Optional. The description of the routine, if defined.

Link copied to clipboard

Optional. The determinism level of the JavaScript UDF, if defined.

Link copied to clipboard
val importedLibraries: Output<List<String>>? = null

Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries.

Link copied to clipboard
val language: Output<RoutineLanguage>? = null

Optional. Defaults to "SQL" if remote_function_options field is absent, not set otherwise.

Link copied to clipboard
val project: Output<String>? = null
Link copied to clipboard

Optional. Remote function specific options.

Link copied to clipboard

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 specified in return table type, at query time.

Link copied to clipboard
val returnType: Output<StandardSqlDataTypeArgs>? = null

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.

Link copied to clipboard

Reference describing the ID of this routine.

Link copied to clipboard
val routineType: Output<RoutineRoutineType>? = null

The type of routine.

Link copied to clipboard
val sparkOptions: Output<SparkOptionsArgs>? = null

Optional. Spark specific options.

Link copied to clipboard
val strictMode: Output<Boolean>? = null

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.