gcp_bigquery_client/model/
argument.rs

1//! Input/output argument of a function or a stored procedure.
2use crate::model::standard_sql_data_type::StandardSqlDataType;
3
4#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct Argument {
7    /// Optional. Specifies whether the argument is input or output. Can be set for procedures only.
8    pub mode: Option<Mode>,
9    /// Optional. The name of this argument. Can be absent for function return argument.
10    pub name: Option<String>,
11    /// Required unless argument_kind = ANY_TYPE.
12    pub data_type: Option<StandardSqlDataType>,
13    /// Optional. Defaults to FIXED_TYPE.
14    pub argument_kind: Option<ArgumentKind>,
15}
16
17/// Optional. Specifies whether the argument is input or output. Can be set for procedures only.
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
20pub enum Mode {
21    /// Unspecified mode
22    ModeUnspecified,
23    /// The argument is input-only.
24    In,
25    /// The argument is output-only.
26    Out,
27    /// The argument is both an input and an output.
28    Inout,
29}
30
31/// Optional. Defaults to FIXED_TYPE.
32#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
34pub enum ArgumentKind {
35    /// Unspecified argument kind
36    ArgumentKindUnspecified,
37    /// The argument is a variable with fully specified type, which can be a struct or an array, but not a table.
38    FixedType,
39    /// The argument is any type, including struct or array, but not a table. To be added: FIXED_TABLE, ANY_TABLE
40    AnyType,
41}