#[non_exhaustive]pub struct ConfigVariableTemplate {
pub key: String,
pub value_type: ValueType,
pub display_name: String,
pub description: String,
pub validation_regex: String,
pub required: bool,
pub role_grant: Option<RoleGrant>,
pub enum_options: Vec<EnumOption>,
pub authorization_code_link: Option<AuthorizationCodeLink>,
pub state: State,
pub is_advanced: bool,
/* private fields */
}Expand description
ConfigVariableTemplate provides metadata about a ConfigVariable that is
used in a Connection.
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.key: StringKey of the config variable.
value_type: ValueTypeType of the parameter: string, int, bool etc. consider custom type for the benefit for the validation.
display_name: StringDisplay name of the parameter.
description: StringDescription.
validation_regex: StringRegular expression in RE2 syntax used for validating the value of a
ConfigVariable.
required: boolFlag represents that this ConfigVariable must be provided for a
connection.
role_grant: Option<RoleGrant>Role grant configuration for the config variable.
enum_options: Vec<EnumOption>Enum options. To be populated if ValueType is ENUM
Authorization code link options. To be populated if ValueType is
AUTHORIZATION_CODE
state: StateState of the config variable.
is_advanced: boolIndicates if current template is part of advanced settings
Implementations§
Source§impl ConfigVariableTemplate
impl ConfigVariableTemplate
pub fn new() -> Self
Sourcepub fn set_value_type<T: Into<ValueType>>(self, v: T) -> Self
pub fn set_value_type<T: Into<ValueType>>(self, v: T) -> Self
Sets the value of value_type.
§Example
use google_cloud_connectors_v1::model::config_variable_template::ValueType;
let x0 = ConfigVariableTemplate::new().set_value_type(ValueType::String);
let x1 = ConfigVariableTemplate::new().set_value_type(ValueType::Int);
let x2 = ConfigVariableTemplate::new().set_value_type(ValueType::Bool);Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sets the value of display_name.
§Example
let x = ConfigVariableTemplate::new().set_display_name("example");Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sets the value of description.
§Example
let x = ConfigVariableTemplate::new().set_description("example");Sourcepub fn set_validation_regex<T: Into<String>>(self, v: T) -> Self
pub fn set_validation_regex<T: Into<String>>(self, v: T) -> Self
Sets the value of validation_regex.
§Example
let x = ConfigVariableTemplate::new().set_validation_regex("example");Sourcepub fn set_required<T: Into<bool>>(self, v: T) -> Self
pub fn set_required<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_role_grant<T>(self, v: T) -> Self
pub fn set_role_grant<T>(self, v: T) -> Self
Sets the value of role_grant.
§Example
use google_cloud_connectors_v1::model::RoleGrant;
let x = ConfigVariableTemplate::new().set_role_grant(RoleGrant::default()/* use setters */);Sourcepub fn set_or_clear_role_grant<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_role_grant<T>(self, v: Option<T>) -> Self
Sets or clears the value of role_grant.
§Example
use google_cloud_connectors_v1::model::RoleGrant;
let x = ConfigVariableTemplate::new().set_or_clear_role_grant(Some(RoleGrant::default()/* use setters */));
let x = ConfigVariableTemplate::new().set_or_clear_role_grant(None::<RoleGrant>);Sourcepub fn set_enum_options<T, V>(self, v: T) -> Self
pub fn set_enum_options<T, V>(self, v: T) -> Self
Sets the value of enum_options.
§Example
use google_cloud_connectors_v1::model::EnumOption;
let x = ConfigVariableTemplate::new()
.set_enum_options([
EnumOption::default()/* use setters */,
EnumOption::default()/* use (different) setters */,
]);Sets the value of authorization_code_link.
§Example
use google_cloud_connectors_v1::model::AuthorizationCodeLink;
let x = ConfigVariableTemplate::new().set_authorization_code_link(AuthorizationCodeLink::default()/* use setters */);Sets or clears the value of authorization_code_link.
§Example
use google_cloud_connectors_v1::model::AuthorizationCodeLink;
let x = ConfigVariableTemplate::new().set_or_clear_authorization_code_link(Some(AuthorizationCodeLink::default()/* use setters */));
let x = ConfigVariableTemplate::new().set_or_clear_authorization_code_link(None::<AuthorizationCodeLink>);Sourcepub fn set_is_advanced<T: Into<bool>>(self, v: T) -> Self
pub fn set_is_advanced<T: Into<bool>>(self, v: T) -> Self
Sets the value of is_advanced.
§Example
let x = ConfigVariableTemplate::new().set_is_advanced(true);Trait Implementations§
Source§impl Clone for ConfigVariableTemplate
impl Clone for ConfigVariableTemplate
Source§fn clone(&self) -> ConfigVariableTemplate
fn clone(&self) -> ConfigVariableTemplate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more