#[non_exhaustive]pub struct Routine {Show 21 fields
pub etag: String,
pub routine_reference: Option<RoutineReference>,
pub routine_type: RoutineType,
pub creation_time: i64,
pub last_modified_time: i64,
pub language: Language,
pub arguments: Vec<Argument>,
pub return_type: Option<StandardSqlDataType>,
pub return_table_type: Option<StandardSqlTableType>,
pub imported_libraries: Vec<String>,
pub definition_body: String,
pub description: String,
pub determinism_level: DeterminismLevel,
pub security_mode: SecurityMode,
pub strict_mode: Option<BoolValue>,
pub remote_function_options: Option<RemoteFunctionOptions>,
pub spark_options: Option<SparkOptions>,
pub data_governance_type: DataGovernanceType,
pub python_options: Option<PythonOptions>,
pub external_runtime_options: Option<ExternalRuntimeOptions>,
pub build_status: Option<RoutineBuildStatus>,
/* private fields */
}Expand description
A user-defined function or a stored procedure.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.etag: StringOutput only. A hash of this resource.
routine_reference: Option<RoutineReference>Required. Reference describing the ID of this routine.
routine_type: RoutineTypeRequired. The type of routine.
creation_time: i64Output only. The time when this routine was created, in milliseconds since the epoch.
last_modified_time: i64Output only. The time when this routine was last modified, in milliseconds since the epoch.
language: LanguageOptional. Defaults to “SQL” if remote_function_options field is absent, not set otherwise.
arguments: Vec<Argument>Optional.
return_type: Option<StandardSqlDataType>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.
return_table_type: Option<StandardSqlTableType>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.
imported_libraries: Vec<String>Optional. If language = “JAVASCRIPT”, this field stores the path of the imported JAVASCRIPT libraries.
definition_body: StringRequired. 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.
If definition_body references another routine, then that routine must
be fully qualified with its project ID.
description: StringOptional. The description of the routine, if defined.
determinism_level: DeterminismLevelOptional. The determinism level of the JavaScript UDF, if defined.
security_mode: SecurityModeOptional. The security mode of the routine, if defined. If not defined, the security mode is automatically determined from the routine’s configuration.
strict_mode: Option<BoolValue>Optional. Use this option to catch many common errors. Error checking is
not exhaustive, and successfully creating a procedure doesn’t guarantee
that the procedure will successfully execute at runtime. If strictMode is
set to TRUE, the procedure body is further checked for errors such as
non-existent tables or columns. The CREATE PROCEDURE statement fails if
the body fails any of these checks.
If strictMode is set to FALSE, the procedure body is checked only for
syntax. For procedures that invoke themselves recursively, specify
strictMode=FALSE to avoid non-existent procedure errors during
validation.
Default value is TRUE.
remote_function_options: Option<RemoteFunctionOptions>Optional. Remote function specific options.
spark_options: Option<SparkOptions>Optional. Spark specific options.
data_governance_type: DataGovernanceTypeOptional. If set to DATA_MASKING, the function is validated and made
available as a masking function. For more information, see Create custom
masking
routines.
python_options: Option<PythonOptions>Optional. Options for the Python UDF. Preview
external_runtime_options: Option<ExternalRuntimeOptions>Optional. Options for the runtime of the external system executing the routine. This field is only applicable for Python UDFs. Preview
build_status: Option<RoutineBuildStatus>Output only. The build status of the routine. This field is only applicable to Python UDFs. Preview
Implementations§
Source§impl Routine
impl Routine
Sourcepub fn set_routine_reference<T>(self, v: T) -> Selfwhere
T: Into<RoutineReference>,
pub fn set_routine_reference<T>(self, v: T) -> Selfwhere
T: Into<RoutineReference>,
Sets the value of routine_reference.
§Example
use google_cloud_bigquery_v2::model::RoutineReference;
let x = Routine::new().set_routine_reference(RoutineReference::default()/* use setters */);Sourcepub fn set_or_clear_routine_reference<T>(self, v: Option<T>) -> Selfwhere
T: Into<RoutineReference>,
pub fn set_or_clear_routine_reference<T>(self, v: Option<T>) -> Selfwhere
T: Into<RoutineReference>,
Sets or clears the value of routine_reference.
§Example
use google_cloud_bigquery_v2::model::RoutineReference;
let x = Routine::new().set_or_clear_routine_reference(Some(RoutineReference::default()/* use setters */));
let x = Routine::new().set_or_clear_routine_reference(None::<RoutineReference>);Sourcepub fn set_routine_type<T: Into<RoutineType>>(self, v: T) -> Self
pub fn set_routine_type<T: Into<RoutineType>>(self, v: T) -> Self
Sets the value of routine_type.
§Example
use google_cloud_bigquery_v2::model::routine::RoutineType;
let x0 = Routine::new().set_routine_type(RoutineType::ScalarFunction);
let x1 = Routine::new().set_routine_type(RoutineType::Procedure);
let x2 = Routine::new().set_routine_type(RoutineType::TableValuedFunction);Sourcepub fn set_creation_time<T: Into<i64>>(self, v: T) -> Self
pub fn set_creation_time<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_last_modified_time<T: Into<i64>>(self, v: T) -> Self
pub fn set_last_modified_time<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_language<T: Into<Language>>(self, v: T) -> Self
pub fn set_language<T: Into<Language>>(self, v: T) -> Self
Sourcepub fn set_arguments<T, V>(self, v: T) -> Self
pub fn set_arguments<T, V>(self, v: T) -> Self
Sourcepub fn set_return_type<T>(self, v: T) -> Selfwhere
T: Into<StandardSqlDataType>,
pub fn set_return_type<T>(self, v: T) -> Selfwhere
T: Into<StandardSqlDataType>,
Sets the value of return_type.
§Example
use google_cloud_bigquery_v2::model::StandardSqlDataType;
let x = Routine::new().set_return_type(StandardSqlDataType::default()/* use setters */);Sourcepub fn set_or_clear_return_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<StandardSqlDataType>,
pub fn set_or_clear_return_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<StandardSqlDataType>,
Sets or clears the value of return_type.
§Example
use google_cloud_bigquery_v2::model::StandardSqlDataType;
let x = Routine::new().set_or_clear_return_type(Some(StandardSqlDataType::default()/* use setters */));
let x = Routine::new().set_or_clear_return_type(None::<StandardSqlDataType>);Sourcepub fn set_return_table_type<T>(self, v: T) -> Selfwhere
T: Into<StandardSqlTableType>,
pub fn set_return_table_type<T>(self, v: T) -> Selfwhere
T: Into<StandardSqlTableType>,
Sets the value of return_table_type.
§Example
use google_cloud_bigquery_v2::model::StandardSqlTableType;
let x = Routine::new().set_return_table_type(StandardSqlTableType::default()/* use setters */);Sourcepub fn set_or_clear_return_table_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<StandardSqlTableType>,
pub fn set_or_clear_return_table_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<StandardSqlTableType>,
Sets or clears the value of return_table_type.
§Example
use google_cloud_bigquery_v2::model::StandardSqlTableType;
let x = Routine::new().set_or_clear_return_table_type(Some(StandardSqlTableType::default()/* use setters */));
let x = Routine::new().set_or_clear_return_table_type(None::<StandardSqlTableType>);Sourcepub fn set_imported_libraries<T, V>(self, v: T) -> Self
pub fn set_imported_libraries<T, V>(self, v: T) -> Self
Sets the value of imported_libraries.
§Example
let x = Routine::new().set_imported_libraries(["a", "b", "c"]);Sourcepub fn set_definition_body<T: Into<String>>(self, v: T) -> Self
pub fn set_definition_body<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_determinism_level<T: Into<DeterminismLevel>>(self, v: T) -> Self
pub fn set_determinism_level<T: Into<DeterminismLevel>>(self, v: T) -> Self
Sets the value of determinism_level.
§Example
use google_cloud_bigquery_v2::model::routine::DeterminismLevel;
let x0 = Routine::new().set_determinism_level(DeterminismLevel::Deterministic);
let x1 = Routine::new().set_determinism_level(DeterminismLevel::NotDeterministic);Sourcepub fn set_security_mode<T: Into<SecurityMode>>(self, v: T) -> Self
pub fn set_security_mode<T: Into<SecurityMode>>(self, v: T) -> Self
Sets the value of security_mode.
§Example
use google_cloud_bigquery_v2::model::routine::SecurityMode;
let x0 = Routine::new().set_security_mode(SecurityMode::Definer);
let x1 = Routine::new().set_security_mode(SecurityMode::Invoker);Sourcepub fn set_strict_mode<T>(self, v: T) -> Self
pub fn set_strict_mode<T>(self, v: T) -> Self
Sets the value of strict_mode.
§Example
use wkt::BoolValue;
let x = Routine::new().set_strict_mode(BoolValue::default()/* use setters */);Sourcepub fn set_or_clear_strict_mode<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_strict_mode<T>(self, v: Option<T>) -> Self
Sets or clears the value of strict_mode.
§Example
use wkt::BoolValue;
let x = Routine::new().set_or_clear_strict_mode(Some(BoolValue::default()/* use setters */));
let x = Routine::new().set_or_clear_strict_mode(None::<BoolValue>);Sourcepub fn set_remote_function_options<T>(self, v: T) -> Selfwhere
T: Into<RemoteFunctionOptions>,
pub fn set_remote_function_options<T>(self, v: T) -> Selfwhere
T: Into<RemoteFunctionOptions>,
Sets the value of remote_function_options.
§Example
use google_cloud_bigquery_v2::model::routine::RemoteFunctionOptions;
let x = Routine::new().set_remote_function_options(RemoteFunctionOptions::default()/* use setters */);Sourcepub fn set_or_clear_remote_function_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<RemoteFunctionOptions>,
pub fn set_or_clear_remote_function_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<RemoteFunctionOptions>,
Sets or clears the value of remote_function_options.
§Example
use google_cloud_bigquery_v2::model::routine::RemoteFunctionOptions;
let x = Routine::new().set_or_clear_remote_function_options(Some(RemoteFunctionOptions::default()/* use setters */));
let x = Routine::new().set_or_clear_remote_function_options(None::<RemoteFunctionOptions>);Sourcepub fn set_spark_options<T>(self, v: T) -> Selfwhere
T: Into<SparkOptions>,
pub fn set_spark_options<T>(self, v: T) -> Selfwhere
T: Into<SparkOptions>,
Sets the value of spark_options.
§Example
use google_cloud_bigquery_v2::model::SparkOptions;
let x = Routine::new().set_spark_options(SparkOptions::default()/* use setters */);Sourcepub fn set_or_clear_spark_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SparkOptions>,
pub fn set_or_clear_spark_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SparkOptions>,
Sets or clears the value of spark_options.
§Example
use google_cloud_bigquery_v2::model::SparkOptions;
let x = Routine::new().set_or_clear_spark_options(Some(SparkOptions::default()/* use setters */));
let x = Routine::new().set_or_clear_spark_options(None::<SparkOptions>);Sourcepub fn set_data_governance_type<T: Into<DataGovernanceType>>(self, v: T) -> Self
pub fn set_data_governance_type<T: Into<DataGovernanceType>>(self, v: T) -> Self
Sets the value of data_governance_type.
§Example
use google_cloud_bigquery_v2::model::routine::DataGovernanceType;
let x0 = Routine::new().set_data_governance_type(DataGovernanceType::DataMasking);Sourcepub fn set_python_options<T>(self, v: T) -> Selfwhere
T: Into<PythonOptions>,
pub fn set_python_options<T>(self, v: T) -> Selfwhere
T: Into<PythonOptions>,
Sets the value of python_options.
§Example
use google_cloud_bigquery_v2::model::PythonOptions;
let x = Routine::new().set_python_options(PythonOptions::default()/* use setters */);Sourcepub fn set_or_clear_python_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<PythonOptions>,
pub fn set_or_clear_python_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<PythonOptions>,
Sets or clears the value of python_options.
§Example
use google_cloud_bigquery_v2::model::PythonOptions;
let x = Routine::new().set_or_clear_python_options(Some(PythonOptions::default()/* use setters */));
let x = Routine::new().set_or_clear_python_options(None::<PythonOptions>);Sourcepub fn set_external_runtime_options<T>(self, v: T) -> Selfwhere
T: Into<ExternalRuntimeOptions>,
pub fn set_external_runtime_options<T>(self, v: T) -> Selfwhere
T: Into<ExternalRuntimeOptions>,
Sets the value of external_runtime_options.
§Example
use google_cloud_bigquery_v2::model::ExternalRuntimeOptions;
let x = Routine::new().set_external_runtime_options(ExternalRuntimeOptions::default()/* use setters */);Sourcepub fn set_or_clear_external_runtime_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<ExternalRuntimeOptions>,
pub fn set_or_clear_external_runtime_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<ExternalRuntimeOptions>,
Sets or clears the value of external_runtime_options.
§Example
use google_cloud_bigquery_v2::model::ExternalRuntimeOptions;
let x = Routine::new().set_or_clear_external_runtime_options(Some(ExternalRuntimeOptions::default()/* use setters */));
let x = Routine::new().set_or_clear_external_runtime_options(None::<ExternalRuntimeOptions>);Sourcepub fn set_build_status<T>(self, v: T) -> Selfwhere
T: Into<RoutineBuildStatus>,
pub fn set_build_status<T>(self, v: T) -> Selfwhere
T: Into<RoutineBuildStatus>,
Sets the value of build_status.
§Example
use google_cloud_bigquery_v2::model::RoutineBuildStatus;
let x = Routine::new().set_build_status(RoutineBuildStatus::default()/* use setters */);Sourcepub fn set_or_clear_build_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<RoutineBuildStatus>,
pub fn set_or_clear_build_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<RoutineBuildStatus>,
Sets or clears the value of build_status.
§Example
use google_cloud_bigquery_v2::model::RoutineBuildStatus;
let x = Routine::new().set_or_clear_build_status(Some(RoutineBuildStatus::default()/* use setters */));
let x = Routine::new().set_or_clear_build_status(None::<RoutineBuildStatus>);Trait Implementations§
impl StructuralPartialEq for Routine
Auto Trait Implementations§
impl Freeze for Routine
impl RefUnwindSafe for Routine
impl Send for Routine
impl Sync for Routine
impl Unpin for Routine
impl UnsafeUnpin for Routine
impl UnwindSafe for Routine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request