import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../../types"; /** * Creates a new routine in the dataset. */ export declare class Routine extends pulumi.CustomResource { /** * Get an existing Routine resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, opts?: pulumi.CustomResourceOptions): Routine; /** * Returns true if the given object is an instance of Routine. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Routine; /** * Optional. */ readonly arguments: pulumi.Output; /** * The time when this routine was created, in milliseconds since the epoch. */ readonly creationTime: pulumi.Output; /** * 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. */ readonly definitionBody: pulumi.Output; /** * Optional. [Experimental] The description of the routine if defined. */ readonly description: pulumi.Output; /** * Optional. [Experimental] The determinism level of the JavaScript UDF if defined. */ readonly determinismLevel: pulumi.Output; /** * A hash of this resource. */ readonly etag: pulumi.Output; /** * Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. */ readonly importedLibraries: pulumi.Output; /** * Optional. Defaults to "SQL". */ readonly language: pulumi.Output; /** * The time when this routine was last modified, in milliseconds since the epoch. */ readonly lastModifiedTime: pulumi.Output; /** * Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION". */ readonly returnTableType: pulumi.Output; /** * Optional if language = "SQL"; required otherwise. 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. */ readonly returnType: pulumi.Output; /** * Required. Reference describing the ID of this routine. */ readonly routineReference: pulumi.Output; /** * Required. The type of routine. */ readonly routineType: pulumi.Output; /** * Create a Routine resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RoutineArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a Routine resource. */ export interface RoutineArgs { /** * Optional. */ readonly arguments?: pulumi.Input[]>; readonly datasetsId: pulumi.Input; /** * 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. */ readonly definitionBody?: pulumi.Input; /** * Optional. [Experimental] The description of the routine if defined. */ readonly description?: pulumi.Input; /** * Optional. [Experimental] The determinism level of the JavaScript UDF if defined. */ readonly determinismLevel?: pulumi.Input; /** * Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. */ readonly importedLibraries?: pulumi.Input[]>; /** * Optional. Defaults to "SQL". */ readonly language?: pulumi.Input; readonly projectsId: pulumi.Input; /** * Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION". */ readonly returnTableType?: pulumi.Input; /** * Optional if language = "SQL"; required otherwise. 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. */ readonly returnType?: pulumi.Input; /** * Required. Reference describing the ID of this routine. */ readonly routineReference?: pulumi.Input; /** * Required. The type of routine. */ readonly routineType?: pulumi.Input; readonly routinesId: pulumi.Input; }