// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
/// Environment represents a user-visible compute infrastructure for analytics
/// within a lake.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Environment {
/// Output only. The relative resource name of the environment, of the form:
/// projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
pub name: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Output only. System generated globally unique ID for the environment. This
/// ID will be different if the environment is deleted and re-created with the
/// same name.
pub uid: std::string::String,
/// Output only. Environment creation time.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the environment was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User defined labels for the environment.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Description of the environment.
pub description: std::string::String,
/// Output only. Current state of the environment.
pub state: crate::model::State,
/// Required. Infrastructure specification for the Environment.
pub infrastructure_spec: std::option::Option<crate::model::environment::InfrastructureSpec>,
/// Optional. Configuration for sessions created for this environment.
pub session_spec: std::option::Option<crate::model::environment::SessionSpec>,
/// Output only. Status of sessions created for this environment.
pub session_status: std::option::Option<crate::model::environment::SessionStatus>,
/// Output only. URI Endpoints to access sessions associated with the
/// Environment.
pub endpoints: std::option::Option<crate::model::environment::Endpoints>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Environment {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Environment::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let environment_id = "environment_id";
/// let x = Environment::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [display_name][crate::model::Environment::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// let x = Environment::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [uid][crate::model::Environment::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// let x = Environment::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::Environment::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use wkt::Timestamp;
/// let x = Environment::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Environment::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use wkt::Timestamp;
/// let x = Environment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Environment::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Environment::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use wkt::Timestamp;
/// let x = Environment::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Environment::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use wkt::Timestamp;
/// let x = Environment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Environment::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::Environment::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// let x = Environment::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [description][crate::model::Environment::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// let x = Environment::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [state][crate::model::Environment::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = Environment::new().set_state(State::Active);
/// let x1 = Environment::new().set_state(State::Creating);
/// let x2 = Environment::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [infrastructure_spec][crate::model::Environment::infrastructure_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::InfrastructureSpec;
/// let x = Environment::new().set_infrastructure_spec(InfrastructureSpec::default()/* use setters */);
/// ```
pub fn set_infrastructure_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::environment::InfrastructureSpec>,
{
self.infrastructure_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [infrastructure_spec][crate::model::Environment::infrastructure_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::InfrastructureSpec;
/// let x = Environment::new().set_or_clear_infrastructure_spec(Some(InfrastructureSpec::default()/* use setters */));
/// let x = Environment::new().set_or_clear_infrastructure_spec(None::<InfrastructureSpec>);
/// ```
pub fn set_or_clear_infrastructure_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::environment::InfrastructureSpec>,
{
self.infrastructure_spec = v.map(|x| x.into());
self
}
/// Sets the value of [session_spec][crate::model::Environment::session_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::SessionSpec;
/// let x = Environment::new().set_session_spec(SessionSpec::default()/* use setters */);
/// ```
pub fn set_session_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::environment::SessionSpec>,
{
self.session_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [session_spec][crate::model::Environment::session_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::SessionSpec;
/// let x = Environment::new().set_or_clear_session_spec(Some(SessionSpec::default()/* use setters */));
/// let x = Environment::new().set_or_clear_session_spec(None::<SessionSpec>);
/// ```
pub fn set_or_clear_session_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::environment::SessionSpec>,
{
self.session_spec = v.map(|x| x.into());
self
}
/// Sets the value of [session_status][crate::model::Environment::session_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::SessionStatus;
/// let x = Environment::new().set_session_status(SessionStatus::default()/* use setters */);
/// ```
pub fn set_session_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::environment::SessionStatus>,
{
self.session_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [session_status][crate::model::Environment::session_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::SessionStatus;
/// let x = Environment::new().set_or_clear_session_status(Some(SessionStatus::default()/* use setters */));
/// let x = Environment::new().set_or_clear_session_status(None::<SessionStatus>);
/// ```
pub fn set_or_clear_session_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::environment::SessionStatus>,
{
self.session_status = v.map(|x| x.into());
self
}
/// Sets the value of [endpoints][crate::model::Environment::endpoints].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::Endpoints;
/// let x = Environment::new().set_endpoints(Endpoints::default()/* use setters */);
/// ```
pub fn set_endpoints<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::environment::Endpoints>,
{
self.endpoints = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [endpoints][crate::model::Environment::endpoints].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Environment;
/// use google_cloud_dataplex_v1::model::environment::Endpoints;
/// let x = Environment::new().set_or_clear_endpoints(Some(Endpoints::default()/* use setters */));
/// let x = Environment::new().set_or_clear_endpoints(None::<Endpoints>);
/// ```
pub fn set_or_clear_endpoints<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::environment::Endpoints>,
{
self.endpoints = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Environment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment"
}
}
/// Defines additional types related to [Environment].
pub mod environment {
#[allow(unused_imports)]
use super::*;
/// Configuration for the underlying infrastructure used to run workloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InfrastructureSpec {
/// Hardware config
pub resources:
std::option::Option<crate::model::environment::infrastructure_spec::Resources>,
/// Software config
pub runtime: std::option::Option<crate::model::environment::infrastructure_spec::Runtime>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InfrastructureSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [resources][crate::model::environment::InfrastructureSpec::resources].
///
/// Note that all the setters affecting `resources` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::environment::infrastructure_spec::ComputeResources;
/// let x = InfrastructureSpec::new().set_resources(Some(
/// google_cloud_dataplex_v1::model::environment::infrastructure_spec::Resources::Compute(ComputeResources::default().into())));
/// ```
pub fn set_resources<
T: std::convert::Into<
std::option::Option<crate::model::environment::infrastructure_spec::Resources>,
>,
>(
mut self,
v: T,
) -> Self {
self.resources = v.into();
self
}
/// The value of [resources][crate::model::environment::InfrastructureSpec::resources]
/// if it holds a `Compute`, `None` if the field is not set or
/// holds a different branch.
pub fn compute(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::environment::infrastructure_spec::ComputeResources>,
> {
#[allow(unreachable_patterns)]
self.resources.as_ref().and_then(|v| match v {
crate::model::environment::infrastructure_spec::Resources::Compute(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [resources][crate::model::environment::InfrastructureSpec::resources]
/// to hold a `Compute`.
///
/// Note that all the setters affecting `resources` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::environment::infrastructure_spec::ComputeResources;
/// let x = InfrastructureSpec::new().set_compute(ComputeResources::default()/* use setters */);
/// assert!(x.compute().is_some());
/// ```
pub fn set_compute<
T: std::convert::Into<
std::boxed::Box<
crate::model::environment::infrastructure_spec::ComputeResources,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.resources = std::option::Option::Some(
crate::model::environment::infrastructure_spec::Resources::Compute(v.into()),
);
self
}
/// Sets the value of [runtime][crate::model::environment::InfrastructureSpec::runtime].
///
/// Note that all the setters affecting `runtime` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::environment::infrastructure_spec::OsImageRuntime;
/// let x = InfrastructureSpec::new().set_runtime(Some(
/// google_cloud_dataplex_v1::model::environment::infrastructure_spec::Runtime::OsImage(OsImageRuntime::default().into())));
/// ```
pub fn set_runtime<
T: std::convert::Into<
std::option::Option<crate::model::environment::infrastructure_spec::Runtime>,
>,
>(
mut self,
v: T,
) -> Self {
self.runtime = v.into();
self
}
/// The value of [runtime][crate::model::environment::InfrastructureSpec::runtime]
/// if it holds a `OsImage`, `None` if the field is not set or
/// holds a different branch.
pub fn os_image(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::environment::infrastructure_spec::OsImageRuntime>,
> {
#[allow(unreachable_patterns)]
self.runtime.as_ref().and_then(|v| match v {
crate::model::environment::infrastructure_spec::Runtime::OsImage(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [runtime][crate::model::environment::InfrastructureSpec::runtime]
/// to hold a `OsImage`.
///
/// Note that all the setters affecting `runtime` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::environment::infrastructure_spec::OsImageRuntime;
/// let x = InfrastructureSpec::new().set_os_image(OsImageRuntime::default()/* use setters */);
/// assert!(x.os_image().is_some());
/// ```
pub fn set_os_image<
T: std::convert::Into<
std::boxed::Box<crate::model::environment::infrastructure_spec::OsImageRuntime>,
>,
>(
mut self,
v: T,
) -> Self {
self.runtime = std::option::Option::Some(
crate::model::environment::infrastructure_spec::Runtime::OsImage(v.into()),
);
self
}
}
impl wkt::message::Message for InfrastructureSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment.InfrastructureSpec"
}
}
/// Defines additional types related to [InfrastructureSpec].
pub mod infrastructure_spec {
#[allow(unused_imports)]
use super::*;
/// Compute resources associated with the analyze interactive workloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeResources {
/// Optional. Size in GB of the disk. Default is 100 GB.
pub disk_size_gb: i32,
/// Optional. Total number of nodes in the sessions created for this
/// environment.
pub node_count: i32,
/// Optional. Max configurable nodes.
/// If max_node_count > node_count, then auto-scaling is enabled.
pub max_node_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeResources {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [disk_size_gb][crate::model::environment::infrastructure_spec::ComputeResources::disk_size_gb].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::ComputeResources;
/// let x = ComputeResources::new().set_disk_size_gb(42);
/// ```
pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_size_gb = v.into();
self
}
/// Sets the value of [node_count][crate::model::environment::infrastructure_spec::ComputeResources::node_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::ComputeResources;
/// let x = ComputeResources::new().set_node_count(42);
/// ```
pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.node_count = v.into();
self
}
/// Sets the value of [max_node_count][crate::model::environment::infrastructure_spec::ComputeResources::max_node_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::ComputeResources;
/// let x = ComputeResources::new().set_max_node_count(42);
/// ```
pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_node_count = v.into();
self
}
}
impl wkt::message::Message for ComputeResources {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources"
}
}
/// Software Runtime Configuration to run Analyze.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OsImageRuntime {
/// Required. Dataplex Universal Catalog Image version.
pub image_version: std::string::String,
/// Optional. List of Java jars to be included in the runtime environment.
/// Valid input includes Cloud Storage URIs to Jar binaries.
/// For example, gs://bucket-name/my/path/to/file.jar
pub java_libraries: std::vec::Vec<std::string::String>,
/// Optional. A list of python packages to be installed.
/// Valid formats include Cloud Storage URI to a PIP installable library.
/// For example, gs://bucket-name/my/path/to/lib.tar.gz
pub python_packages: std::vec::Vec<std::string::String>,
/// Optional. Spark properties to provide configuration for use in sessions
/// created for this environment. The properties to set on daemon config
/// files. Property keys are specified in `prefix:property` format. The
/// prefix must be "spark".
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OsImageRuntime {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [image_version][crate::model::environment::infrastructure_spec::OsImageRuntime::image_version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::OsImageRuntime;
/// let x = OsImageRuntime::new().set_image_version("example");
/// ```
pub fn set_image_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.image_version = v.into();
self
}
/// Sets the value of [java_libraries][crate::model::environment::infrastructure_spec::OsImageRuntime::java_libraries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::OsImageRuntime;
/// let x = OsImageRuntime::new().set_java_libraries(["a", "b", "c"]);
/// ```
pub fn set_java_libraries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.java_libraries = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [python_packages][crate::model::environment::infrastructure_spec::OsImageRuntime::python_packages].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::OsImageRuntime;
/// let x = OsImageRuntime::new().set_python_packages(["a", "b", "c"]);
/// ```
pub fn set_python_packages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.python_packages = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [properties][crate::model::environment::infrastructure_spec::OsImageRuntime::properties].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::infrastructure_spec::OsImageRuntime;
/// let x = OsImageRuntime::new().set_properties([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for OsImageRuntime {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime"
}
}
/// Hardware config
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Resources {
/// Optional. Compute resources needed for analyze interactive workloads.
Compute(
std::boxed::Box<crate::model::environment::infrastructure_spec::ComputeResources>,
),
}
/// Software config
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Runtime {
/// Required. Software Runtime Configuration for analyze interactive
/// workloads.
OsImage(
std::boxed::Box<crate::model::environment::infrastructure_spec::OsImageRuntime>,
),
}
}
/// Configuration for sessions created for this environment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionSpec {
/// Optional. The idle time configuration of the session. The session will be
/// auto-terminated at the end of this period.
pub max_idle_duration: std::option::Option<wkt::Duration>,
/// Optional. If True, this causes sessions to be pre-created and available
/// for faster startup to enable interactive exploration use-cases. This
/// defaults to False to avoid additional billed charges. These can only be
/// set to True for the environment with name set to "default", and with
/// default configuration.
pub enable_fast_startup: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [max_idle_duration][crate::model::environment::SessionSpec::max_idle_duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::SessionSpec;
/// use wkt::Duration;
/// let x = SessionSpec::new().set_max_idle_duration(Duration::default()/* use setters */);
/// ```
pub fn set_max_idle_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_idle_duration = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_idle_duration][crate::model::environment::SessionSpec::max_idle_duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::SessionSpec;
/// use wkt::Duration;
/// let x = SessionSpec::new().set_or_clear_max_idle_duration(Some(Duration::default()/* use setters */));
/// let x = SessionSpec::new().set_or_clear_max_idle_duration(None::<Duration>);
/// ```
pub fn set_or_clear_max_idle_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_idle_duration = v.map(|x| x.into());
self
}
/// Sets the value of [enable_fast_startup][crate::model::environment::SessionSpec::enable_fast_startup].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::SessionSpec;
/// let x = SessionSpec::new().set_enable_fast_startup(true);
/// ```
pub fn set_enable_fast_startup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_fast_startup = v.into();
self
}
}
impl wkt::message::Message for SessionSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment.SessionSpec"
}
}
/// Status of sessions created for this environment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionStatus {
/// Output only. Queries over sessions to mark whether the environment is
/// currently active or not
pub active: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [active][crate::model::environment::SessionStatus::active].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::SessionStatus;
/// let x = SessionStatus::new().set_active(true);
/// ```
pub fn set_active<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.active = v.into();
self
}
}
impl wkt::message::Message for SessionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment.SessionStatus"
}
}
/// URI Endpoints to access sessions associated with the Environment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Endpoints {
/// Output only. URI to serve notebook APIs
pub notebooks: std::string::String,
/// Output only. URI to serve SQL APIs
pub sql: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Endpoints {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [notebooks][crate::model::environment::Endpoints::notebooks].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::Endpoints;
/// let x = Endpoints::new().set_notebooks("example");
/// ```
pub fn set_notebooks<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.notebooks = v.into();
self
}
/// Sets the value of [sql][crate::model::environment::Endpoints::sql].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::environment::Endpoints;
/// let x = Endpoints::new().set_sql("example");
/// ```
pub fn set_sql<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql = v.into();
self
}
}
impl wkt::message::Message for Endpoints {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Environment.Endpoints"
}
}
}
/// Content represents a user-visible notebook or a sql script
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Content {
/// Output only. The relative resource name of the content, of the form:
/// projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
pub name: std::string::String,
/// Output only. System generated globally unique ID for the content. This ID
/// will be different if the content is deleted and re-created with the same
/// name.
pub uid: std::string::String,
/// Required. The path for the Content file, represented as directory
/// structure. Unique within a lake. Limited to alphanumerics, hyphens,
/// underscores, dots and slashes.
pub path: std::string::String,
/// Output only. Content creation time.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the content was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User defined labels for the content.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Description of the content.
pub description: std::string::String,
/// Only returned in `GetContent` requests and not in `ListContent` request.
pub data: std::option::Option<crate::model::content::Data>,
/// Types of content
pub content: std::option::Option<crate::model::content::Content>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Content {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Content::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let content_id = "content_id";
/// let x = Content::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::Content::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// let x = Content::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [path][crate::model::Content::path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// let x = Content::new().set_path("example");
/// ```
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
/// Sets the value of [create_time][crate::model::Content::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use wkt::Timestamp;
/// let x = Content::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Content::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use wkt::Timestamp;
/// let x = Content::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Content::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Content::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use wkt::Timestamp;
/// let x = Content::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Content::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use wkt::Timestamp;
/// let x = Content::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Content::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::Content::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// let x = Content::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [description][crate::model::Content::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// let x = Content::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [data][crate::model::Content::data].
///
/// Note that all the setters affecting `data` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use google_cloud_dataplex_v1::model::content::Data;
/// let x = Content::new().set_data(Some(Data::DataText("example".to_string())));
/// ```
pub fn set_data<T: std::convert::Into<std::option::Option<crate::model::content::Data>>>(
mut self,
v: T,
) -> Self {
self.data = v.into();
self
}
/// The value of [data][crate::model::Content::data]
/// if it holds a `DataText`, `None` if the field is not set or
/// holds a different branch.
pub fn data_text(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::content::Data::DataText(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [data][crate::model::Content::data]
/// to hold a `DataText`.
///
/// Note that all the setters affecting `data` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// let x = Content::new().set_data_text("example");
/// assert!(x.data_text().is_some());
/// ```
pub fn set_data_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data = std::option::Option::Some(crate::model::content::Data::DataText(v.into()));
self
}
/// Sets the value of [content][crate::model::Content::content].
///
/// Note that all the setters affecting `content` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use google_cloud_dataplex_v1::model::content::SqlScript;
/// let x = Content::new().set_content(Some(
/// google_cloud_dataplex_v1::model::content::Content::SqlScript(SqlScript::default().into())));
/// ```
pub fn set_content<
T: std::convert::Into<std::option::Option<crate::model::content::Content>>,
>(
mut self,
v: T,
) -> Self {
self.content = v.into();
self
}
/// The value of [content][crate::model::Content::content]
/// if it holds a `SqlScript`, `None` if the field is not set or
/// holds a different branch.
pub fn sql_script(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::content::SqlScript>> {
#[allow(unreachable_patterns)]
self.content.as_ref().and_then(|v| match v {
crate::model::content::Content::SqlScript(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [content][crate::model::Content::content]
/// to hold a `SqlScript`.
///
/// Note that all the setters affecting `content` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use google_cloud_dataplex_v1::model::content::SqlScript;
/// let x = Content::new().set_sql_script(SqlScript::default()/* use setters */);
/// assert!(x.sql_script().is_some());
/// assert!(x.notebook().is_none());
/// ```
pub fn set_sql_script<
T: std::convert::Into<std::boxed::Box<crate::model::content::SqlScript>>,
>(
mut self,
v: T,
) -> Self {
self.content =
std::option::Option::Some(crate::model::content::Content::SqlScript(v.into()));
self
}
/// The value of [content][crate::model::Content::content]
/// if it holds a `Notebook`, `None` if the field is not set or
/// holds a different branch.
pub fn notebook(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::content::Notebook>> {
#[allow(unreachable_patterns)]
self.content.as_ref().and_then(|v| match v {
crate::model::content::Content::Notebook(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [content][crate::model::Content::content]
/// to hold a `Notebook`.
///
/// Note that all the setters affecting `content` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Content;
/// use google_cloud_dataplex_v1::model::content::Notebook;
/// let x = Content::new().set_notebook(Notebook::default()/* use setters */);
/// assert!(x.notebook().is_some());
/// assert!(x.sql_script().is_none());
/// ```
pub fn set_notebook<T: std::convert::Into<std::boxed::Box<crate::model::content::Notebook>>>(
mut self,
v: T,
) -> Self {
self.content =
std::option::Option::Some(crate::model::content::Content::Notebook(v.into()));
self
}
}
impl wkt::message::Message for Content {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Content"
}
}
/// Defines additional types related to [Content].
pub mod content {
#[allow(unused_imports)]
use super::*;
/// Configuration for the Sql Script content.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlScript {
/// Required. Query Engine to be used for the Sql Query.
pub engine: crate::model::content::sql_script::QueryEngine,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlScript {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [engine][crate::model::content::SqlScript::engine].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::content::SqlScript;
/// use google_cloud_dataplex_v1::model::content::sql_script::QueryEngine;
/// let x0 = SqlScript::new().set_engine(QueryEngine::Spark);
/// ```
pub fn set_engine<T: std::convert::Into<crate::model::content::sql_script::QueryEngine>>(
mut self,
v: T,
) -> Self {
self.engine = v.into();
self
}
}
impl wkt::message::Message for SqlScript {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Content.SqlScript"
}
}
/// Defines additional types related to [SqlScript].
pub mod sql_script {
#[allow(unused_imports)]
use super::*;
/// Query Engine Type of the SQL Script.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum QueryEngine {
/// Value was unspecified.
Unspecified,
/// Spark SQL Query.
Spark,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [QueryEngine::value] or
/// [QueryEngine::name].
UnknownValue(query_engine::UnknownValue),
}
#[doc(hidden)]
pub mod query_engine {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl QueryEngine {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Spark => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("QUERY_ENGINE_UNSPECIFIED"),
Self::Spark => std::option::Option::Some("SPARK"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for QueryEngine {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for QueryEngine {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for QueryEngine {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Spark,
_ => Self::UnknownValue(query_engine::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for QueryEngine {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"QUERY_ENGINE_UNSPECIFIED" => Self::Unspecified,
"SPARK" => Self::Spark,
_ => Self::UnknownValue(query_engine::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for QueryEngine {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Spark => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for QueryEngine {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryEngine>::new(
".google.cloud.dataplex.v1.Content.SqlScript.QueryEngine",
))
}
}
}
/// Configuration for Notebook content.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Notebook {
/// Required. Kernel Type of the notebook.
pub kernel_type: crate::model::content::notebook::KernelType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Notebook {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kernel_type][crate::model::content::Notebook::kernel_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::content::Notebook;
/// use google_cloud_dataplex_v1::model::content::notebook::KernelType;
/// let x0 = Notebook::new().set_kernel_type(KernelType::Python3);
/// ```
pub fn set_kernel_type<
T: std::convert::Into<crate::model::content::notebook::KernelType>,
>(
mut self,
v: T,
) -> Self {
self.kernel_type = v.into();
self
}
}
impl wkt::message::Message for Notebook {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Content.Notebook"
}
}
/// Defines additional types related to [Notebook].
pub mod notebook {
#[allow(unused_imports)]
use super::*;
/// Kernel Type of the Jupyter notebook.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KernelType {
/// Kernel Type unspecified.
Unspecified,
/// Python 3 Kernel.
Python3,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [KernelType::value] or
/// [KernelType::name].
UnknownValue(kernel_type::UnknownValue),
}
#[doc(hidden)]
pub mod kernel_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KernelType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Python3 => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("KERNEL_TYPE_UNSPECIFIED"),
Self::Python3 => std::option::Option::Some("PYTHON3"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KernelType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KernelType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for KernelType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Python3,
_ => Self::UnknownValue(kernel_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KernelType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KERNEL_TYPE_UNSPECIFIED" => Self::Unspecified,
"PYTHON3" => Self::Python3,
_ => Self::UnknownValue(kernel_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KernelType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Python3 => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KernelType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<KernelType>::new(
".google.cloud.dataplex.v1.Content.Notebook.KernelType",
))
}
}
}
/// Only returned in `GetContent` requests and not in `ListContent` request.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Data {
/// Required. Content data in string format.
DataText(std::string::String),
}
/// Types of content
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Content {
/// Sql Script related configurations.
SqlScript(std::boxed::Box<crate::model::content::SqlScript>),
/// Notebook related configurations.
Notebook(std::boxed::Box<crate::model::content::Notebook>),
}
}
/// Represents an active analyze session running for a user.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Session {
/// Output only. The relative resource name of the content, of the form:
/// projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}/sessions/{session_id}
pub name: std::string::String,
/// Output only. Email of user running the session.
pub user_id: std::string::String,
/// Output only. Session start time.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. State of Session
pub state: crate::model::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Session {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Session::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Session;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let environment_id = "environment_id";
/// # let session_id = "session_id";
/// let x = Session::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}/sessions/{session_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [user_id][crate::model::Session::user_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Session;
/// let x = Session::new().set_user_id("example");
/// ```
pub fn set_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user_id = v.into();
self
}
/// Sets the value of [create_time][crate::model::Session::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Session;
/// use wkt::Timestamp;
/// let x = Session::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Session::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Session;
/// use wkt::Timestamp;
/// let x = Session::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Session::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [state][crate::model::Session::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Session;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = Session::new().set_state(State::Active);
/// let x1 = Session::new().set_state(State::Creating);
/// let x2 = Session::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for Session {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Session"
}
}
/// Represents a proposed change to a metadata resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChangeRequest {
/// Identifier. The relative resource name of the ChangeRequest, of the form:
/// projects/{project_number}/locations/{location_id}/changeRequests/{change_request_id}
pub name: std::string::String,
/// Output only. System generated globally unique ID for the ChangeRequest.
pub uid: std::string::String,
/// Output only. The time when the ChangeRequest was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the ChangeRequest was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Justification of the ChangeRequest. This should explain
/// *why* the change is needed or why it should be approved.
pub justification: std::string::String,
/// Optional. User-defined labels for the ChangeRequest.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Output only. The email address of the user who created the ChangeRequest.
pub author: std::string::String,
/// Output only. The current state of the ChangeRequest.
pub state: crate::model::change_request::State,
/// Output only. The full resource name of the target resource to be modified.
/// Example:
/// //dataplex.googleapis.com/projects/my-project/locations/us-central1/entryGroups/my-group/entries/my-entry
pub resource: std::string::String,
/// Output only. The type of change represented by the change_payload.
/// This field is derived from the populated field in the change_payload oneof.
pub change_type: crate::model::change_request::ChangeType,
/// Output only. The reason provided for rejecting the ChangeRequest.
pub rejection_comment: std::string::String,
/// Output only. The email address of the user who approved/rejected the
/// ChangeRequest.
pub approver: std::string::String,
/// Optional. This checksum is computed by the service. It can be sent on
/// update and delete requests to ensure the client has an up-to-date value
/// before proceeding.
pub etag: std::string::String,
/// Detailed specification of the change, embedding the original request.
pub change_payload: std::option::Option<crate::model::change_request::ChangePayload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChangeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::ChangeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let change_request_id = "change_request_id";
/// let x = ChangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/changeRequests/{change_request_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::ChangeRequest::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::ChangeRequest::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use wkt::Timestamp;
/// let x = ChangeRequest::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::ChangeRequest::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use wkt::Timestamp;
/// let x = ChangeRequest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = ChangeRequest::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::ChangeRequest::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use wkt::Timestamp;
/// let x = ChangeRequest::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::ChangeRequest::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use wkt::Timestamp;
/// let x = ChangeRequest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = ChangeRequest::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [justification][crate::model::ChangeRequest::justification].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_justification("example");
/// ```
pub fn set_justification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.justification = v.into();
self
}
/// Sets the value of [labels][crate::model::ChangeRequest::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [author][crate::model::ChangeRequest::author].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_author("example");
/// ```
pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.author = v.into();
self
}
/// Sets the value of [state][crate::model::ChangeRequest::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::change_request::State;
/// let x0 = ChangeRequest::new().set_state(State::New);
/// let x1 = ChangeRequest::new().set_state(State::Approved);
/// let x2 = ChangeRequest::new().set_state(State::Rejected);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::change_request::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [resource][crate::model::ChangeRequest::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
/// Sets the value of [change_type][crate::model::ChangeRequest::change_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::change_request::ChangeType;
/// let x0 = ChangeRequest::new().set_change_type(ChangeType::CreateEntry);
/// let x1 = ChangeRequest::new().set_change_type(ChangeType::UpdateEntry);
/// let x2 = ChangeRequest::new().set_change_type(ChangeType::DeleteEntry);
/// ```
pub fn set_change_type<T: std::convert::Into<crate::model::change_request::ChangeType>>(
mut self,
v: T,
) -> Self {
self.change_type = v.into();
self
}
/// Sets the value of [rejection_comment][crate::model::ChangeRequest::rejection_comment].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_rejection_comment("example");
/// ```
pub fn set_rejection_comment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rejection_comment = v.into();
self
}
/// Sets the value of [approver][crate::model::ChangeRequest::approver].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_approver("example");
/// ```
pub fn set_approver<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.approver = v.into();
self
}
/// Sets the value of [etag][crate::model::ChangeRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = ChangeRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload].
///
/// Note that all the setters affecting `change_payload` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::CreateEntryRequest;
/// let x = ChangeRequest::new().set_change_payload(Some(
/// google_cloud_dataplex_v1::model::change_request::ChangePayload::CreateEntry(CreateEntryRequest::default().into())));
/// ```
pub fn set_change_payload<
T: std::convert::Into<std::option::Option<crate::model::change_request::ChangePayload>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = v.into();
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `CreateEntry`, `None` if the field is not set or
/// holds a different branch.
pub fn create_entry(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateEntryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::CreateEntry(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `CreateEntry`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::CreateEntryRequest;
/// let x = ChangeRequest::new().set_create_entry(CreateEntryRequest::default()/* use setters */);
/// assert!(x.create_entry().is_some());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_create_entry<
T: std::convert::Into<std::boxed::Box<crate::model::CreateEntryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::CreateEntry(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `UpdateEntry`, `None` if the field is not set or
/// holds a different branch.
pub fn update_entry(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateEntryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::UpdateEntry(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `UpdateEntry`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// let x = ChangeRequest::new().set_update_entry(UpdateEntryRequest::default()/* use setters */);
/// assert!(x.update_entry().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_update_entry<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateEntryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::UpdateEntry(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `DeleteEntry`, `None` if the field is not set or
/// holds a different branch.
pub fn delete_entry(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteEntryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::DeleteEntry(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `DeleteEntry`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::DeleteEntryRequest;
/// let x = ChangeRequest::new().set_delete_entry(DeleteEntryRequest::default()/* use setters */);
/// assert!(x.delete_entry().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_delete_entry<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteEntryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::DeleteEntry(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `CreateEntryLink`, `None` if the field is not set or
/// holds a different branch.
pub fn create_entry_link(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateEntryLinkRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::CreateEntryLink(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `CreateEntryLink`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::CreateEntryLinkRequest;
/// let x = ChangeRequest::new().set_create_entry_link(CreateEntryLinkRequest::default()/* use setters */);
/// assert!(x.create_entry_link().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_create_entry_link<
T: std::convert::Into<std::boxed::Box<crate::model::CreateEntryLinkRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::CreateEntryLink(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `DeleteEntryLink`, `None` if the field is not set or
/// holds a different branch.
pub fn delete_entry_link(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteEntryLinkRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::DeleteEntryLink(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `DeleteEntryLink`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::DeleteEntryLinkRequest;
/// let x = ChangeRequest::new().set_delete_entry_link(DeleteEntryLinkRequest::default()/* use setters */);
/// assert!(x.delete_entry_link().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_delete_entry_link<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteEntryLinkRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::DeleteEntryLink(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `CreateGlossary`, `None` if the field is not set or
/// holds a different branch.
pub fn create_glossary(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateGlossaryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::CreateGlossary(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `CreateGlossary`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::CreateGlossaryRequest;
/// let x = ChangeRequest::new().set_create_glossary(CreateGlossaryRequest::default()/* use setters */);
/// assert!(x.create_glossary().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_create_glossary<
T: std::convert::Into<std::boxed::Box<crate::model::CreateGlossaryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::CreateGlossary(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `UpdateGlossary`, `None` if the field is not set or
/// holds a different branch.
pub fn update_glossary(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateGlossaryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::UpdateGlossary(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `UpdateGlossary`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::UpdateGlossaryRequest;
/// let x = ChangeRequest::new().set_update_glossary(UpdateGlossaryRequest::default()/* use setters */);
/// assert!(x.update_glossary().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_update_glossary<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateGlossaryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::UpdateGlossary(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `DeleteGlossary`, `None` if the field is not set or
/// holds a different branch.
pub fn delete_glossary(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteGlossaryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::DeleteGlossary(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `DeleteGlossary`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::DeleteGlossaryRequest;
/// let x = ChangeRequest::new().set_delete_glossary(DeleteGlossaryRequest::default()/* use setters */);
/// assert!(x.delete_glossary().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_delete_glossary<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteGlossaryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::DeleteGlossary(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `CreateGlossaryCategory`, `None` if the field is not set or
/// holds a different branch.
pub fn create_glossary_category(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateGlossaryCategoryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::CreateGlossaryCategory(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `CreateGlossaryCategory`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::CreateGlossaryCategoryRequest;
/// let x = ChangeRequest::new().set_create_glossary_category(CreateGlossaryCategoryRequest::default()/* use setters */);
/// assert!(x.create_glossary_category().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_create_glossary_category<
T: std::convert::Into<std::boxed::Box<crate::model::CreateGlossaryCategoryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::CreateGlossaryCategory(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `UpdateGlossaryCategory`, `None` if the field is not set or
/// holds a different branch.
pub fn update_glossary_category(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateGlossaryCategoryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::UpdateGlossaryCategory(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `UpdateGlossaryCategory`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::UpdateGlossaryCategoryRequest;
/// let x = ChangeRequest::new().set_update_glossary_category(UpdateGlossaryCategoryRequest::default()/* use setters */);
/// assert!(x.update_glossary_category().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_update_glossary_category<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateGlossaryCategoryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::UpdateGlossaryCategory(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `DeleteGlossaryCategory`, `None` if the field is not set or
/// holds a different branch.
pub fn delete_glossary_category(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteGlossaryCategoryRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::DeleteGlossaryCategory(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `DeleteGlossaryCategory`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::DeleteGlossaryCategoryRequest;
/// let x = ChangeRequest::new().set_delete_glossary_category(DeleteGlossaryCategoryRequest::default()/* use setters */);
/// assert!(x.delete_glossary_category().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_delete_glossary_category<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteGlossaryCategoryRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::DeleteGlossaryCategory(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `CreateGlossaryTerm`, `None` if the field is not set or
/// holds a different branch.
pub fn create_glossary_term(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateGlossaryTermRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::CreateGlossaryTerm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `CreateGlossaryTerm`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::CreateGlossaryTermRequest;
/// let x = ChangeRequest::new().set_create_glossary_term(CreateGlossaryTermRequest::default()/* use setters */);
/// assert!(x.create_glossary_term().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_create_glossary_term<
T: std::convert::Into<std::boxed::Box<crate::model::CreateGlossaryTermRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::CreateGlossaryTerm(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `UpdateGlossaryTerm`, `None` if the field is not set or
/// holds a different branch.
pub fn update_glossary_term(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateGlossaryTermRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::UpdateGlossaryTerm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `UpdateGlossaryTerm`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::UpdateGlossaryTermRequest;
/// let x = ChangeRequest::new().set_update_glossary_term(UpdateGlossaryTermRequest::default()/* use setters */);
/// assert!(x.update_glossary_term().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_update_glossary_term<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateGlossaryTermRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::UpdateGlossaryTerm(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `DeleteGlossaryTerm`, `None` if the field is not set or
/// holds a different branch.
pub fn delete_glossary_term(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteGlossaryTermRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::DeleteGlossaryTerm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `DeleteGlossaryTerm`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::DeleteGlossaryTermRequest;
/// let x = ChangeRequest::new().set_delete_glossary_term(DeleteGlossaryTermRequest::default()/* use setters */);
/// assert!(x.delete_glossary_term().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.data_product_access_request().is_none());
/// ```
pub fn set_delete_glossary_term<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteGlossaryTermRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::DeleteGlossaryTerm(v.into()),
);
self
}
/// The value of [change_payload][crate::model::ChangeRequest::change_payload]
/// if it holds a `DataProductAccessRequest`, `None` if the field is not set or
/// holds a different branch.
pub fn data_product_access_request(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataProductAccessRequest>> {
#[allow(unreachable_patterns)]
self.change_payload.as_ref().and_then(|v| match v {
crate::model::change_request::ChangePayload::DataProductAccessRequest(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [change_payload][crate::model::ChangeRequest::change_payload]
/// to hold a `DataProductAccessRequest`.
///
/// Note that all the setters affecting `change_payload` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ChangeRequest;
/// use google_cloud_dataplex_v1::model::DataProductAccessRequest;
/// let x = ChangeRequest::new().set_data_product_access_request(DataProductAccessRequest::default()/* use setters */);
/// assert!(x.data_product_access_request().is_some());
/// assert!(x.create_entry().is_none());
/// assert!(x.update_entry().is_none());
/// assert!(x.delete_entry().is_none());
/// assert!(x.create_entry_link().is_none());
/// assert!(x.delete_entry_link().is_none());
/// assert!(x.create_glossary().is_none());
/// assert!(x.update_glossary().is_none());
/// assert!(x.delete_glossary().is_none());
/// assert!(x.create_glossary_category().is_none());
/// assert!(x.update_glossary_category().is_none());
/// assert!(x.delete_glossary_category().is_none());
/// assert!(x.create_glossary_term().is_none());
/// assert!(x.update_glossary_term().is_none());
/// assert!(x.delete_glossary_term().is_none());
/// ```
pub fn set_data_product_access_request<
T: std::convert::Into<std::boxed::Box<crate::model::DataProductAccessRequest>>,
>(
mut self,
v: T,
) -> Self {
self.change_payload = std::option::Option::Some(
crate::model::change_request::ChangePayload::DataProductAccessRequest(v.into()),
);
self
}
}
impl wkt::message::Message for ChangeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ChangeRequest"
}
}
/// Defines additional types related to [ChangeRequest].
pub mod change_request {
#[allow(unused_imports)]
use super::*;
/// Possible states of a ChangeRequest.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// State unspecified.
Unspecified,
/// The change is proposed and new.
New,
/// The change has been approved.
Approved,
/// The change has been rejected.
Rejected,
/// The change request has expired.
Expired,
/// The approved change has been revoked.
Revoked,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::New => std::option::Option::Some(1),
Self::Approved => std::option::Option::Some(2),
Self::Rejected => std::option::Option::Some(3),
Self::Expired => std::option::Option::Some(4),
Self::Revoked => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::New => std::option::Option::Some("NEW"),
Self::Approved => std::option::Option::Some("APPROVED"),
Self::Rejected => std::option::Option::Some("REJECTED"),
Self::Expired => std::option::Option::Some("EXPIRED"),
Self::Revoked => std::option::Option::Some("REVOKED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::New,
2 => Self::Approved,
3 => Self::Rejected,
4 => Self::Expired,
5 => Self::Revoked,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"NEW" => Self::New,
"APPROVED" => Self::Approved,
"REJECTED" => Self::Rejected,
"EXPIRED" => Self::Expired,
"REVOKED" => Self::Revoked,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::New => serializer.serialize_i32(1),
Self::Approved => serializer.serialize_i32(2),
Self::Rejected => serializer.serialize_i32(3),
Self::Expired => serializer.serialize_i32(4),
Self::Revoked => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.ChangeRequest.State",
))
}
}
/// Enum representing the type of change in the payload.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChangeType {
/// State unspecified.
Unspecified,
/// Request to create an Entry.
CreateEntry,
/// Request to update an Entry.
UpdateEntry,
/// Request to delete an Entry.
DeleteEntry,
/// Request to create an EntryLink.
CreateEntryLink,
/// Request to delete an EntryLink.
DeleteEntryLink,
/// Request to create a Glossary.
CreateGlossary,
/// Request to update a Glossary.
UpdateGlossary,
/// Request to delete a Glossary.
DeleteGlossary,
/// Request to create a GlossaryCategory.
CreateGlossaryCategory,
/// Request to update a GlossaryCategory.
UpdateGlossaryCategory,
/// Request to delete a GlossaryCategory.
DeleteGlossaryCategory,
/// Request to create a GlossaryTerm.
CreateGlossaryTerm,
/// Request to update a GlossaryTerm.
UpdateGlossaryTerm,
/// Request to delete a GlossaryTerm.
DeleteGlossaryTerm,
/// Request to request Data Product access.
RequestDataProductAccess,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ChangeType::value] or
/// [ChangeType::name].
UnknownValue(change_type::UnknownValue),
}
#[doc(hidden)]
pub mod change_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChangeType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CreateEntry => std::option::Option::Some(1),
Self::UpdateEntry => std::option::Option::Some(2),
Self::DeleteEntry => std::option::Option::Some(3),
Self::CreateEntryLink => std::option::Option::Some(4),
Self::DeleteEntryLink => std::option::Option::Some(5),
Self::CreateGlossary => std::option::Option::Some(7),
Self::UpdateGlossary => std::option::Option::Some(8),
Self::DeleteGlossary => std::option::Option::Some(9),
Self::CreateGlossaryCategory => std::option::Option::Some(10),
Self::UpdateGlossaryCategory => std::option::Option::Some(11),
Self::DeleteGlossaryCategory => std::option::Option::Some(13),
Self::CreateGlossaryTerm => std::option::Option::Some(14),
Self::UpdateGlossaryTerm => std::option::Option::Some(15),
Self::DeleteGlossaryTerm => std::option::Option::Some(17),
Self::RequestDataProductAccess => std::option::Option::Some(33),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
Self::CreateEntry => std::option::Option::Some("CREATE_ENTRY"),
Self::UpdateEntry => std::option::Option::Some("UPDATE_ENTRY"),
Self::DeleteEntry => std::option::Option::Some("DELETE_ENTRY"),
Self::CreateEntryLink => std::option::Option::Some("CREATE_ENTRY_LINK"),
Self::DeleteEntryLink => std::option::Option::Some("DELETE_ENTRY_LINK"),
Self::CreateGlossary => std::option::Option::Some("CREATE_GLOSSARY"),
Self::UpdateGlossary => std::option::Option::Some("UPDATE_GLOSSARY"),
Self::DeleteGlossary => std::option::Option::Some("DELETE_GLOSSARY"),
Self::CreateGlossaryCategory => {
std::option::Option::Some("CREATE_GLOSSARY_CATEGORY")
}
Self::UpdateGlossaryCategory => {
std::option::Option::Some("UPDATE_GLOSSARY_CATEGORY")
}
Self::DeleteGlossaryCategory => {
std::option::Option::Some("DELETE_GLOSSARY_CATEGORY")
}
Self::CreateGlossaryTerm => std::option::Option::Some("CREATE_GLOSSARY_TERM"),
Self::UpdateGlossaryTerm => std::option::Option::Some("UPDATE_GLOSSARY_TERM"),
Self::DeleteGlossaryTerm => std::option::Option::Some("DELETE_GLOSSARY_TERM"),
Self::RequestDataProductAccess => {
std::option::Option::Some("REQUEST_DATA_PRODUCT_ACCESS")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChangeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChangeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ChangeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CreateEntry,
2 => Self::UpdateEntry,
3 => Self::DeleteEntry,
4 => Self::CreateEntryLink,
5 => Self::DeleteEntryLink,
7 => Self::CreateGlossary,
8 => Self::UpdateGlossary,
9 => Self::DeleteGlossary,
10 => Self::CreateGlossaryCategory,
11 => Self::UpdateGlossaryCategory,
13 => Self::DeleteGlossaryCategory,
14 => Self::CreateGlossaryTerm,
15 => Self::UpdateGlossaryTerm,
17 => Self::DeleteGlossaryTerm,
33 => Self::RequestDataProductAccess,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChangeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"CREATE_ENTRY" => Self::CreateEntry,
"UPDATE_ENTRY" => Self::UpdateEntry,
"DELETE_ENTRY" => Self::DeleteEntry,
"CREATE_ENTRY_LINK" => Self::CreateEntryLink,
"DELETE_ENTRY_LINK" => Self::DeleteEntryLink,
"CREATE_GLOSSARY" => Self::CreateGlossary,
"UPDATE_GLOSSARY" => Self::UpdateGlossary,
"DELETE_GLOSSARY" => Self::DeleteGlossary,
"CREATE_GLOSSARY_CATEGORY" => Self::CreateGlossaryCategory,
"UPDATE_GLOSSARY_CATEGORY" => Self::UpdateGlossaryCategory,
"DELETE_GLOSSARY_CATEGORY" => Self::DeleteGlossaryCategory,
"CREATE_GLOSSARY_TERM" => Self::CreateGlossaryTerm,
"UPDATE_GLOSSARY_TERM" => Self::UpdateGlossaryTerm,
"DELETE_GLOSSARY_TERM" => Self::DeleteGlossaryTerm,
"REQUEST_DATA_PRODUCT_ACCESS" => Self::RequestDataProductAccess,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChangeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CreateEntry => serializer.serialize_i32(1),
Self::UpdateEntry => serializer.serialize_i32(2),
Self::DeleteEntry => serializer.serialize_i32(3),
Self::CreateEntryLink => serializer.serialize_i32(4),
Self::DeleteEntryLink => serializer.serialize_i32(5),
Self::CreateGlossary => serializer.serialize_i32(7),
Self::UpdateGlossary => serializer.serialize_i32(8),
Self::DeleteGlossary => serializer.serialize_i32(9),
Self::CreateGlossaryCategory => serializer.serialize_i32(10),
Self::UpdateGlossaryCategory => serializer.serialize_i32(11),
Self::DeleteGlossaryCategory => serializer.serialize_i32(13),
Self::CreateGlossaryTerm => serializer.serialize_i32(14),
Self::UpdateGlossaryTerm => serializer.serialize_i32(15),
Self::DeleteGlossaryTerm => serializer.serialize_i32(17),
Self::RequestDataProductAccess => serializer.serialize_i32(33),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChangeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
".google.cloud.dataplex.v1.ChangeRequest.ChangeType",
))
}
}
/// Detailed specification of the change, embedding the original request.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChangePayload {
/// Payload for creating an Entry.
CreateEntry(std::boxed::Box<crate::model::CreateEntryRequest>),
/// Payload for updating an Entry.
UpdateEntry(std::boxed::Box<crate::model::UpdateEntryRequest>),
/// Payload for deleting an Entry.
DeleteEntry(std::boxed::Box<crate::model::DeleteEntryRequest>),
/// Payload for creating an EntryLink.
CreateEntryLink(std::boxed::Box<crate::model::CreateEntryLinkRequest>),
/// Payload for deleting an EntryLink.
DeleteEntryLink(std::boxed::Box<crate::model::DeleteEntryLinkRequest>),
/// Payload for creating a Glossary.
CreateGlossary(std::boxed::Box<crate::model::CreateGlossaryRequest>),
/// Payload for updating a Glossary.
UpdateGlossary(std::boxed::Box<crate::model::UpdateGlossaryRequest>),
/// Payload for deleting a Glossary.
DeleteGlossary(std::boxed::Box<crate::model::DeleteGlossaryRequest>),
/// Payload for creating a GlossaryCategory.
CreateGlossaryCategory(std::boxed::Box<crate::model::CreateGlossaryCategoryRequest>),
/// Payload for updating a GlossaryCategory.
UpdateGlossaryCategory(std::boxed::Box<crate::model::UpdateGlossaryCategoryRequest>),
/// Payload for deleting a GlossaryCategory.
DeleteGlossaryCategory(std::boxed::Box<crate::model::DeleteGlossaryCategoryRequest>),
/// Payload for creating a GlossaryTerm.
CreateGlossaryTerm(std::boxed::Box<crate::model::CreateGlossaryTermRequest>),
/// Payload for updating a GlossaryTerm.
UpdateGlossaryTerm(std::boxed::Box<crate::model::UpdateGlossaryTermRequest>),
/// Payload for deleting a GlossaryTerm.
DeleteGlossaryTerm(std::boxed::Box<crate::model::DeleteGlossaryTermRequest>),
/// Payload for Data Product access request.
DataProductAccessRequest(std::boxed::Box<crate::model::DataProductAccessRequest>),
}
}
/// Message for requesting access to a Data Product. This will be used to
/// create a ChangeRequest of type REQUEST_DATA_PRODUCT_ACCESS.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataProductAccessRequest {
/// Required. The resource name of the data product.
/// Format:
/// projects/{project_number}/locations/{location_id}/dataProducts/{data_product_id}
pub parent: std::string::String,
/// Required. The ID of the access group for which access is being requested.
/// This corresponds to the unique identifier of the AccessGroup defined in the
/// Data Product.
pub access_group_id: std::string::String,
/// Output only. The display name of the access group defined in the Data
/// Product for which access is being requested.
pub access_group_display_name: std::string::String,
/// Optional. The principal for which access is being requested in IAM format.
/// If not specified, the requestor's principal will be used.
/// Example: `serviceAccount:my-sa@my-project.iam.gserviceaccount.com`.
/// Only service account principals are currently supported.
/// <https://cloud.google.com/iam/docs/principal-identifiers>
pub requested_principal: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataProductAccessRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::DataProductAccessRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProductAccessRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = DataProductAccessRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [access_group_id][crate::model::DataProductAccessRequest::access_group_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProductAccessRequest;
/// let x = DataProductAccessRequest::new().set_access_group_id("example");
/// ```
pub fn set_access_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.access_group_id = v.into();
self
}
/// Sets the value of [access_group_display_name][crate::model::DataProductAccessRequest::access_group_display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProductAccessRequest;
/// let x = DataProductAccessRequest::new().set_access_group_display_name("example");
/// ```
pub fn set_access_group_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.access_group_display_name = v.into();
self
}
/// Sets the value of [requested_principal][crate::model::DataProductAccessRequest::requested_principal].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProductAccessRequest;
/// let x = DataProductAccessRequest::new().set_requested_principal("example");
/// ```
pub fn set_requested_principal<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.requested_principal = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [requested_principal][crate::model::DataProductAccessRequest::requested_principal].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProductAccessRequest;
/// let x = DataProductAccessRequest::new().set_or_clear_requested_principal(Some("example"));
/// let x = DataProductAccessRequest::new().set_or_clear_requested_principal(None::<String>);
/// ```
pub fn set_or_clear_requested_principal<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.requested_principal = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataProductAccessRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProductAccessRequest"
}
}
/// A Glossary represents a collection of GlossaryCategories and GlossaryTerms
/// defined by the user. Glossary is a top level resource and is the Google Cloud
/// parent resource of all the GlossaryCategories and GlossaryTerms within it.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Glossary {
/// Output only. Identifier. The resource name of the Glossary.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
pub name: std::string::String,
/// Output only. System generated unique id for the Glossary. This ID will be
/// different if the Glossary is deleted and re-created with the
/// same name.
pub uid: std::string::String,
/// Optional. User friendly display name of the Glossary. This is user-mutable.
/// This will be same as the GlossaryId, if not specified.
pub display_name: std::string::String,
/// Optional. The user-mutable description of the Glossary.
pub description: std::string::String,
/// Output only. The time at which the Glossary was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time at which the Glossary was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User-defined labels for the Glossary.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Output only. The number of GlossaryTerms in the Glossary.
pub term_count: i32,
/// Output only. The number of GlossaryCategories in the Glossary.
pub category_count: i32,
/// Optional. Needed for resource freshness validation.
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the
/// client has an up-to-date value before proceeding.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Glossary {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Glossary::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = Glossary::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::Glossary::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [display_name][crate::model::Glossary::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::Glossary::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [create_time][crate::model::Glossary::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// use wkt::Timestamp;
/// let x = Glossary::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Glossary::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// use wkt::Timestamp;
/// let x = Glossary::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Glossary::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Glossary::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// use wkt::Timestamp;
/// let x = Glossary::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Glossary::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// use wkt::Timestamp;
/// let x = Glossary::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Glossary::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::Glossary::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [term_count][crate::model::Glossary::term_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_term_count(42);
/// ```
pub fn set_term_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.term_count = v.into();
self
}
/// Sets the value of [category_count][crate::model::Glossary::category_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_category_count(42);
/// ```
pub fn set_category_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.category_count = v.into();
self
}
/// Sets the value of [etag][crate::model::Glossary::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Glossary;
/// let x = Glossary::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for Glossary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Glossary"
}
}
/// A GlossaryCategory represents a collection of GlossaryCategories and
/// GlossaryTerms within a Glossary that are related to each other.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GlossaryCategory {
/// Output only. Identifier. The resource name of the GlossaryCategory.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}
pub name: std::string::String,
/// Output only. System generated unique id for the GlossaryCategory. This ID
/// will be different if the GlossaryCategory is deleted and re-created with
/// the same name.
pub uid: std::string::String,
/// Optional. User friendly display name of the GlossaryCategory. This is
/// user-mutable. This will be same as the GlossaryCategoryId, if not
/// specified.
pub display_name: std::string::String,
/// Optional. The user-mutable description of the GlossaryCategory.
pub description: std::string::String,
/// Output only. The time at which the GlossaryCategory was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time at which the GlossaryCategory was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User-defined labels for the GlossaryCategory.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Required. The immediate parent of the GlossaryCategory in the
/// resource-hierarchy. It can either be a Glossary or a GlossaryCategory.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
/// OR
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}
pub parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GlossaryCategory {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GlossaryCategory::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// # let glossary_category_id = "glossary_category_id";
/// let x = GlossaryCategory::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}/categories/{glossary_category_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::GlossaryCategory::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = GlossaryCategory::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [display_name][crate::model::GlossaryCategory::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = GlossaryCategory::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::GlossaryCategory::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = GlossaryCategory::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [create_time][crate::model::GlossaryCategory::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// use wkt::Timestamp;
/// let x = GlossaryCategory::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::GlossaryCategory::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// use wkt::Timestamp;
/// let x = GlossaryCategory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = GlossaryCategory::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::GlossaryCategory::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// use wkt::Timestamp;
/// let x = GlossaryCategory::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::GlossaryCategory::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// use wkt::Timestamp;
/// let x = GlossaryCategory::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = GlossaryCategory::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::GlossaryCategory::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = GlossaryCategory::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [parent][crate::model::GlossaryCategory::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = GlossaryCategory::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
}
impl wkt::message::Message for GlossaryCategory {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GlossaryCategory"
}
}
/// GlossaryTerms are the core of Glossary.
/// A GlossaryTerm holds a rich text description that can be attached to Entries
/// or specific columns to enrich them.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GlossaryTerm {
/// Output only. Identifier. The resource name of the GlossaryTerm.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id}
pub name: std::string::String,
/// Output only. System generated unique id for the GlossaryTerm. This ID will
/// be different if the GlossaryTerm is deleted and re-created with the same
/// name.
pub uid: std::string::String,
/// Optional. User friendly display name of the GlossaryTerm. This is
/// user-mutable. This will be same as the GlossaryTermId, if not specified.
pub display_name: std::string::String,
/// Optional. The user-mutable description of the GlossaryTerm.
pub description: std::string::String,
/// Output only. The time at which the GlossaryTerm was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time at which the GlossaryTerm was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User-defined labels for the GlossaryTerm.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Required. The immediate parent of the GlossaryTerm in the
/// resource-hierarchy. It can either be a Glossary or a GlossaryCategory.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
/// OR
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}
pub parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GlossaryTerm {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GlossaryTerm::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// # let glossary_term_id = "glossary_term_id";
/// let x = GlossaryTerm::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}/terms/{glossary_term_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::GlossaryTerm::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = GlossaryTerm::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [display_name][crate::model::GlossaryTerm::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = GlossaryTerm::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::GlossaryTerm::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = GlossaryTerm::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [create_time][crate::model::GlossaryTerm::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// use wkt::Timestamp;
/// let x = GlossaryTerm::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::GlossaryTerm::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// use wkt::Timestamp;
/// let x = GlossaryTerm::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = GlossaryTerm::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::GlossaryTerm::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// use wkt::Timestamp;
/// let x = GlossaryTerm::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::GlossaryTerm::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// use wkt::Timestamp;
/// let x = GlossaryTerm::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = GlossaryTerm::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::GlossaryTerm::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = GlossaryTerm::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [parent][crate::model::GlossaryTerm::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GlossaryTerm;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = GlossaryTerm::new().set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
}
impl wkt::message::Message for GlossaryTerm {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GlossaryTerm"
}
}
/// Create Glossary Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateGlossaryRequest {
/// Required. The parent resource where this Glossary will be created.
/// Format: projects/{project_id_or_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. Glossary ID: Glossary identifier.
pub glossary_id: std::string::String,
/// Required. The Glossary to create.
pub glossary: std::option::Option<crate::model::Glossary>,
/// Optional. Validates the request without actually creating the Glossary.
/// Default: false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateGlossaryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateGlossaryRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryRequest;
/// let x = CreateGlossaryRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [glossary_id][crate::model::CreateGlossaryRequest::glossary_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryRequest;
/// let x = CreateGlossaryRequest::new().set_glossary_id("example");
/// ```
pub fn set_glossary_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.glossary_id = v.into();
self
}
/// Sets the value of [glossary][crate::model::CreateGlossaryRequest::glossary].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryRequest;
/// use google_cloud_dataplex_v1::model::Glossary;
/// let x = CreateGlossaryRequest::new().set_glossary(Glossary::default()/* use setters */);
/// ```
pub fn set_glossary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Glossary>,
{
self.glossary = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [glossary][crate::model::CreateGlossaryRequest::glossary].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryRequest;
/// use google_cloud_dataplex_v1::model::Glossary;
/// let x = CreateGlossaryRequest::new().set_or_clear_glossary(Some(Glossary::default()/* use setters */));
/// let x = CreateGlossaryRequest::new().set_or_clear_glossary(None::<Glossary>);
/// ```
pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Glossary>,
{
self.glossary = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateGlossaryRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryRequest;
/// let x = CreateGlossaryRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateGlossaryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateGlossaryRequest"
}
}
/// Update Glossary Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGlossaryRequest {
/// Required. The Glossary to update.
/// The Glossary's `name` field is used to identify the Glossary to update.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
pub glossary: std::option::Option<crate::model::Glossary>,
/// Required. The list of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. Validates the request without actually updating the Glossary.
/// Default: false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateGlossaryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [glossary][crate::model::UpdateGlossaryRequest::glossary].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryRequest;
/// use google_cloud_dataplex_v1::model::Glossary;
/// let x = UpdateGlossaryRequest::new().set_glossary(Glossary::default()/* use setters */);
/// ```
pub fn set_glossary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Glossary>,
{
self.glossary = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [glossary][crate::model::UpdateGlossaryRequest::glossary].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryRequest;
/// use google_cloud_dataplex_v1::model::Glossary;
/// let x = UpdateGlossaryRequest::new().set_or_clear_glossary(Some(Glossary::default()/* use setters */));
/// let x = UpdateGlossaryRequest::new().set_or_clear_glossary(None::<Glossary>);
/// ```
pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Glossary>,
{
self.glossary = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateGlossaryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryRequest;
/// use wkt::FieldMask;
/// let x = UpdateGlossaryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateGlossaryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryRequest;
/// use wkt::FieldMask;
/// let x = UpdateGlossaryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateGlossaryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateGlossaryRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryRequest;
/// let x = UpdateGlossaryRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateGlossaryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateGlossaryRequest"
}
}
/// Delete Glossary Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteGlossaryRequest {
/// Required. The name of the Glossary to delete.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
pub name: std::string::String,
/// Optional. The etag of the Glossary.
/// If this is provided, it must match the server's etag.
/// If the etag is provided and does not match the server-computed etag,
/// the request must fail with a ABORTED error code.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteGlossaryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteGlossaryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteGlossaryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = DeleteGlossaryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteGlossaryRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteGlossaryRequest;
/// let x = DeleteGlossaryRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteGlossaryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteGlossaryRequest"
}
}
/// Get Glossary Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGlossaryRequest {
/// Required. The name of the Glossary to retrieve.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGlossaryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetGlossaryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetGlossaryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = GetGlossaryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetGlossaryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetGlossaryRequest"
}
}
/// List Glossaries Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGlossariesRequest {
/// Required. The parent, which has this collection of Glossaries.
/// Format: projects/{project_id_or_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. The maximum number of Glossaries to return. The service may
/// return fewer than this value. If unspecified, at most 50 Glossaries will be
/// returned. The maximum value is 1000; values above 1000 will be coerced to
/// 1000.
pub page_size: i32,
/// Optional. A page token, received from a previous `ListGlossaries` call.
/// Provide this to retrieve the subsequent page.
/// When paginating, all other parameters provided to `ListGlossaries` must
/// match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter expression that filters Glossaries listed in the response.
/// Filters on proto fields of Glossary are supported.
/// Examples of using a filter are:
///
/// - `display_name="my-glossary"`
/// - `categoryCount=1`
/// - `termCount=0`
pub filter: std::string::String,
/// Optional. Order by expression that orders Glossaries listed in the
/// response. Order by fields are: `name` or `create_time` for the result. If
/// not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGlossariesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListGlossariesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesRequest;
/// let x = ListGlossariesRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListGlossariesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesRequest;
/// let x = ListGlossariesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListGlossariesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesRequest;
/// let x = ListGlossariesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListGlossariesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesRequest;
/// let x = ListGlossariesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListGlossariesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesRequest;
/// let x = ListGlossariesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListGlossariesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListGlossariesRequest"
}
}
/// List Glossaries Response
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGlossariesResponse {
/// Lists the Glossaries in the specified parent.
pub glossaries: std::vec::Vec<crate::model::Glossary>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is omitted, there are no subsequent pages.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGlossariesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [glossaries][crate::model::ListGlossariesResponse::glossaries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesResponse;
/// use google_cloud_dataplex_v1::model::Glossary;
/// let x = ListGlossariesResponse::new()
/// .set_glossaries([
/// Glossary::default()/* use setters */,
/// Glossary::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_glossaries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Glossary>,
{
use std::iter::Iterator;
self.glossaries = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListGlossariesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesResponse;
/// let x = ListGlossariesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListGlossariesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossariesResponse;
/// let x = ListGlossariesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListGlossariesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListGlossariesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListGlossariesResponse {
type PageItem = crate::model::Glossary;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.glossaries
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Creates a new GlossaryCategory under the specified Glossary.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateGlossaryCategoryRequest {
/// Required. The parent resource where this GlossaryCategory will be created.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
/// where `locationId` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. GlossaryCategory identifier.
pub category_id: std::string::String,
/// Required. The GlossaryCategory to create.
pub category: std::option::Option<crate::model::GlossaryCategory>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateGlossaryCategoryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateGlossaryCategoryRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryCategoryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = CreateGlossaryCategoryRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [category_id][crate::model::CreateGlossaryCategoryRequest::category_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryCategoryRequest;
/// let x = CreateGlossaryCategoryRequest::new().set_category_id("example");
/// ```
pub fn set_category_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.category_id = v.into();
self
}
/// Sets the value of [category][crate::model::CreateGlossaryCategoryRequest::category].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryCategoryRequest;
/// use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = CreateGlossaryCategoryRequest::new().set_category(GlossaryCategory::default()/* use setters */);
/// ```
pub fn set_category<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GlossaryCategory>,
{
self.category = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [category][crate::model::CreateGlossaryCategoryRequest::category].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryCategoryRequest;
/// use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = CreateGlossaryCategoryRequest::new().set_or_clear_category(Some(GlossaryCategory::default()/* use setters */));
/// let x = CreateGlossaryCategoryRequest::new().set_or_clear_category(None::<GlossaryCategory>);
/// ```
pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GlossaryCategory>,
{
self.category = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateGlossaryCategoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateGlossaryCategoryRequest"
}
}
/// Update GlossaryCategory Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGlossaryCategoryRequest {
/// Required. The GlossaryCategory to update.
/// The GlossaryCategory's `name` field is used to identify the
/// GlossaryCategory to update. Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}
pub category: std::option::Option<crate::model::GlossaryCategory>,
/// Required. The list of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateGlossaryCategoryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [category][crate::model::UpdateGlossaryCategoryRequest::category].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryCategoryRequest;
/// use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = UpdateGlossaryCategoryRequest::new().set_category(GlossaryCategory::default()/* use setters */);
/// ```
pub fn set_category<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GlossaryCategory>,
{
self.category = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [category][crate::model::UpdateGlossaryCategoryRequest::category].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryCategoryRequest;
/// use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = UpdateGlossaryCategoryRequest::new().set_or_clear_category(Some(GlossaryCategory::default()/* use setters */));
/// let x = UpdateGlossaryCategoryRequest::new().set_or_clear_category(None::<GlossaryCategory>);
/// ```
pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GlossaryCategory>,
{
self.category = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateGlossaryCategoryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryCategoryRequest;
/// use wkt::FieldMask;
/// let x = UpdateGlossaryCategoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateGlossaryCategoryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryCategoryRequest;
/// use wkt::FieldMask;
/// let x = UpdateGlossaryCategoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateGlossaryCategoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateGlossaryCategoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateGlossaryCategoryRequest"
}
}
/// Delete GlossaryCategory Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteGlossaryCategoryRequest {
/// Required. The name of the GlossaryCategory to delete.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteGlossaryCategoryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteGlossaryCategoryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteGlossaryCategoryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// # let glossary_category_id = "glossary_category_id";
/// let x = DeleteGlossaryCategoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}/categories/{glossary_category_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteGlossaryCategoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteGlossaryCategoryRequest"
}
}
/// Get GlossaryCategory Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGlossaryCategoryRequest {
/// Required. The name of the GlossaryCategory to retrieve.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGlossaryCategoryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetGlossaryCategoryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetGlossaryCategoryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// # let glossary_category_id = "glossary_category_id";
/// let x = GetGlossaryCategoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}/categories/{glossary_category_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetGlossaryCategoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetGlossaryCategoryRequest"
}
}
/// List GlossaryCategories Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGlossaryCategoriesRequest {
/// Required. The parent, which has this collection of GlossaryCategories.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
/// Location is the Google Cloud region.
pub parent: std::string::String,
/// Optional. The maximum number of GlossaryCategories to return. The service
/// may return fewer than this value. If unspecified, at most 50
/// GlossaryCategories will be returned. The maximum value is 1000; values
/// above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. A page token, received from a previous `ListGlossaryCategories`
/// call. Provide this to retrieve the subsequent page. When paginating, all
/// other parameters provided to `ListGlossaryCategories` must match the call
/// that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter expression that filters GlossaryCategories listed in the
/// response. Filters are supported on the following fields:
///
/// - immediate_parent
///
/// Examples of using a filter are:
///
/// - `immediate_parent="projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}"`
/// - `immediate_parent="projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}"`
///
/// This will only return the GlossaryCategories that are directly nested
/// under the specified parent.
pub filter: std::string::String,
/// Optional. Order by expression that orders GlossaryCategories listed in the
/// response. Order by fields are: `name` or `create_time` for the result. If
/// not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGlossaryCategoriesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListGlossaryCategoriesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = ListGlossaryCategoriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListGlossaryCategoriesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesRequest;
/// let x = ListGlossaryCategoriesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListGlossaryCategoriesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesRequest;
/// let x = ListGlossaryCategoriesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListGlossaryCategoriesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesRequest;
/// let x = ListGlossaryCategoriesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListGlossaryCategoriesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesRequest;
/// let x = ListGlossaryCategoriesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListGlossaryCategoriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListGlossaryCategoriesRequest"
}
}
/// List GlossaryCategories Response
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGlossaryCategoriesResponse {
/// Lists the GlossaryCategories in the specified parent.
pub categories: std::vec::Vec<crate::model::GlossaryCategory>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is omitted, there are no subsequent pages.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGlossaryCategoriesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [categories][crate::model::ListGlossaryCategoriesResponse::categories].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesResponse;
/// use google_cloud_dataplex_v1::model::GlossaryCategory;
/// let x = ListGlossaryCategoriesResponse::new()
/// .set_categories([
/// GlossaryCategory::default()/* use setters */,
/// GlossaryCategory::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_categories<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GlossaryCategory>,
{
use std::iter::Iterator;
self.categories = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListGlossaryCategoriesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesResponse;
/// let x = ListGlossaryCategoriesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListGlossaryCategoriesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryCategoriesResponse;
/// let x = ListGlossaryCategoriesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListGlossaryCategoriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListGlossaryCategoriesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListGlossaryCategoriesResponse {
type PageItem = crate::model::GlossaryCategory;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.categories
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Creates a new GlossaryTerm under the specified Glossary.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateGlossaryTermRequest {
/// Required. The parent resource where the GlossaryTerm will be created.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. GlossaryTerm identifier.
pub term_id: std::string::String,
/// Required. The GlossaryTerm to create.
pub term: std::option::Option<crate::model::GlossaryTerm>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateGlossaryTermRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateGlossaryTermRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryTermRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = CreateGlossaryTermRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [term_id][crate::model::CreateGlossaryTermRequest::term_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryTermRequest;
/// let x = CreateGlossaryTermRequest::new().set_term_id("example");
/// ```
pub fn set_term_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.term_id = v.into();
self
}
/// Sets the value of [term][crate::model::CreateGlossaryTermRequest::term].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryTermRequest;
/// use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = CreateGlossaryTermRequest::new().set_term(GlossaryTerm::default()/* use setters */);
/// ```
pub fn set_term<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GlossaryTerm>,
{
self.term = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [term][crate::model::CreateGlossaryTermRequest::term].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateGlossaryTermRequest;
/// use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = CreateGlossaryTermRequest::new().set_or_clear_term(Some(GlossaryTerm::default()/* use setters */));
/// let x = CreateGlossaryTermRequest::new().set_or_clear_term(None::<GlossaryTerm>);
/// ```
pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GlossaryTerm>,
{
self.term = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateGlossaryTermRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateGlossaryTermRequest"
}
}
/// Update GlossaryTerm Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGlossaryTermRequest {
/// Required. The GlossaryTerm to update.
/// The GlossaryTerm's `name` field is used to identify the GlossaryTerm to
/// update. Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id}
pub term: std::option::Option<crate::model::GlossaryTerm>,
/// Required. The list of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateGlossaryTermRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [term][crate::model::UpdateGlossaryTermRequest::term].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryTermRequest;
/// use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = UpdateGlossaryTermRequest::new().set_term(GlossaryTerm::default()/* use setters */);
/// ```
pub fn set_term<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GlossaryTerm>,
{
self.term = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [term][crate::model::UpdateGlossaryTermRequest::term].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryTermRequest;
/// use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = UpdateGlossaryTermRequest::new().set_or_clear_term(Some(GlossaryTerm::default()/* use setters */));
/// let x = UpdateGlossaryTermRequest::new().set_or_clear_term(None::<GlossaryTerm>);
/// ```
pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GlossaryTerm>,
{
self.term = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateGlossaryTermRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryTermRequest;
/// use wkt::FieldMask;
/// let x = UpdateGlossaryTermRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateGlossaryTermRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateGlossaryTermRequest;
/// use wkt::FieldMask;
/// let x = UpdateGlossaryTermRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateGlossaryTermRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateGlossaryTermRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateGlossaryTermRequest"
}
}
/// Delete GlossaryTerm Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteGlossaryTermRequest {
/// Required. The name of the GlossaryTerm to delete.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteGlossaryTermRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteGlossaryTermRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteGlossaryTermRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// # let glossary_term_id = "glossary_term_id";
/// let x = DeleteGlossaryTermRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}/terms/{glossary_term_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteGlossaryTermRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteGlossaryTermRequest"
}
}
/// Get GlossaryTerm Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGlossaryTermRequest {
/// Required. The name of the GlossaryTerm to retrieve.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGlossaryTermRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetGlossaryTermRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetGlossaryTermRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// # let glossary_term_id = "glossary_term_id";
/// let x = GetGlossaryTermRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}/terms/{glossary_term_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetGlossaryTermRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetGlossaryTermRequest"
}
}
/// List GlossaryTerms Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGlossaryTermsRequest {
/// Required. The parent, which has this collection of GlossaryTerms.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. The maximum number of GlossaryTerms to return. The service may
/// return fewer than this value. If unspecified, at most 50 GlossaryTerms will
/// be returned. The maximum value is 1000; values above 1000 will be coerced
/// to 1000.
pub page_size: i32,
/// Optional. A page token, received from a previous `ListGlossaryTerms` call.
/// Provide this to retrieve the subsequent page.
/// When paginating, all other parameters provided to `ListGlossaryTerms` must
/// match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter expression that filters GlossaryTerms listed in the
/// response. Filters are supported on the following fields:
///
/// - immediate_parent
///
/// Examples of using a filter are:
///
/// - `immediate_parent="projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}"`
/// - `immediate_parent="projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id}"`
///
/// This will only return the GlossaryTerms that are directly nested under the
/// specified parent.
pub filter: std::string::String,
/// Optional. Order by expression that orders GlossaryTerms listed in the
/// response. Order by fields are: `name` or `create_time` for the result. If
/// not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGlossaryTermsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListGlossaryTermsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let glossary_id = "glossary_id";
/// let x = ListGlossaryTermsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListGlossaryTermsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsRequest;
/// let x = ListGlossaryTermsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListGlossaryTermsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsRequest;
/// let x = ListGlossaryTermsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListGlossaryTermsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsRequest;
/// let x = ListGlossaryTermsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListGlossaryTermsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsRequest;
/// let x = ListGlossaryTermsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListGlossaryTermsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListGlossaryTermsRequest"
}
}
/// List GlossaryTerms Response
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGlossaryTermsResponse {
/// Lists the GlossaryTerms in the specified parent.
pub terms: std::vec::Vec<crate::model::GlossaryTerm>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is omitted, there are no subsequent pages.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGlossaryTermsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [terms][crate::model::ListGlossaryTermsResponse::terms].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsResponse;
/// use google_cloud_dataplex_v1::model::GlossaryTerm;
/// let x = ListGlossaryTermsResponse::new()
/// .set_terms([
/// GlossaryTerm::default()/* use setters */,
/// GlossaryTerm::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_terms<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GlossaryTerm>,
{
use std::iter::Iterator;
self.terms = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListGlossaryTermsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsResponse;
/// let x = ListGlossaryTermsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListGlossaryTermsResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListGlossaryTermsResponse;
/// let x = ListGlossaryTermsResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListGlossaryTermsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListGlossaryTermsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListGlossaryTermsResponse {
type PageItem = crate::model::GlossaryTerm;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.terms
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// AspectType is a template for creating Aspects, and represents the
/// JSON-schema for a given Entry, for example, BigQuery Table Schema.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AspectType {
/// Output only. The relative resource name of the AspectType, of the form:
/// projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the AspectType.
/// If you delete and recreate the AspectType with the same name, then this ID
/// will be different.
pub uid: std::string::String,
/// Output only. The time when the AspectType was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the AspectType was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the AspectType.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Optional. User-defined labels for the AspectType.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// The service computes this checksum. The client may send it on update and
/// delete requests to ensure it has an up-to-date value before proceeding.
pub etag: std::string::String,
/// Optional. Immutable. Stores data classification of the aspect.
pub data_classification: crate::model::aspect_type::DataClassification,
/// Immutable. Defines the Authorization for this type.
pub authorization: std::option::Option<crate::model::aspect_type::Authorization>,
/// Required. MetadataTemplate of the aspect.
pub metadata_template: std::option::Option<crate::model::aspect_type::MetadataTemplate>,
/// Output only. Denotes the transfer status of the Aspect Type. It is
/// unspecified for Aspect Types created from Dataplex API.
pub transfer_status: crate::model::TransferStatus,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AspectType {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::AspectType::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let aspect_type_id = "aspect_type_id";
/// let x = AspectType::new().set_name(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::AspectType::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// let x = AspectType::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::AspectType::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use wkt::Timestamp;
/// let x = AspectType::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::AspectType::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use wkt::Timestamp;
/// let x = AspectType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = AspectType::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::AspectType::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use wkt::Timestamp;
/// let x = AspectType::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::AspectType::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use wkt::Timestamp;
/// let x = AspectType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = AspectType::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::AspectType::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// let x = AspectType::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::AspectType::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// let x = AspectType::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::AspectType::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// let x = AspectType::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [etag][crate::model::AspectType::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// let x = AspectType::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [data_classification][crate::model::AspectType::data_classification].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use google_cloud_dataplex_v1::model::aspect_type::DataClassification;
/// let x0 = AspectType::new().set_data_classification(DataClassification::MetadataAndData);
/// ```
pub fn set_data_classification<
T: std::convert::Into<crate::model::aspect_type::DataClassification>,
>(
mut self,
v: T,
) -> Self {
self.data_classification = v.into();
self
}
/// Sets the value of [authorization][crate::model::AspectType::authorization].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use google_cloud_dataplex_v1::model::aspect_type::Authorization;
/// let x = AspectType::new().set_authorization(Authorization::default()/* use setters */);
/// ```
pub fn set_authorization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aspect_type::Authorization>,
{
self.authorization = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [authorization][crate::model::AspectType::authorization].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use google_cloud_dataplex_v1::model::aspect_type::Authorization;
/// let x = AspectType::new().set_or_clear_authorization(Some(Authorization::default()/* use setters */));
/// let x = AspectType::new().set_or_clear_authorization(None::<Authorization>);
/// ```
pub fn set_or_clear_authorization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aspect_type::Authorization>,
{
self.authorization = v.map(|x| x.into());
self
}
/// Sets the value of [metadata_template][crate::model::AspectType::metadata_template].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = AspectType::new().set_metadata_template(MetadataTemplate::default()/* use setters */);
/// ```
pub fn set_metadata_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
self.metadata_template = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [metadata_template][crate::model::AspectType::metadata_template].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = AspectType::new().set_or_clear_metadata_template(Some(MetadataTemplate::default()/* use setters */));
/// let x = AspectType::new().set_or_clear_metadata_template(None::<MetadataTemplate>);
/// ```
pub fn set_or_clear_metadata_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
self.metadata_template = v.map(|x| x.into());
self
}
/// Sets the value of [transfer_status][crate::model::AspectType::transfer_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectType;
/// use google_cloud_dataplex_v1::model::TransferStatus;
/// let x0 = AspectType::new().set_transfer_status(TransferStatus::Migrated);
/// let x1 = AspectType::new().set_transfer_status(TransferStatus::Transferred);
/// ```
pub fn set_transfer_status<T: std::convert::Into<crate::model::TransferStatus>>(
mut self,
v: T,
) -> Self {
self.transfer_status = v.into();
self
}
}
impl wkt::message::Message for AspectType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectType"
}
}
/// Defines additional types related to [AspectType].
pub mod aspect_type {
#[allow(unused_imports)]
use super::*;
/// Authorization for an AspectType.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Authorization {
/// Immutable. The IAM permission grantable on the EntryGroup to allow access
/// to instantiate Aspects of Dataplex Universal Catalog owned AspectTypes,
/// only settable for Dataplex Universal Catalog owned Types.
pub alternate_use_permission: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Authorization {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [alternate_use_permission][crate::model::aspect_type::Authorization::alternate_use_permission].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::Authorization;
/// let x = Authorization::new().set_alternate_use_permission("example");
/// ```
pub fn set_alternate_use_permission<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.alternate_use_permission = v.into();
self
}
}
impl wkt::message::Message for Authorization {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectType.Authorization"
}
}
/// MetadataTemplate definition for an AspectType.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetadataTemplate {
/// Optional. Index is used to encode Template messages. The value of index
/// can range between 1 and 2,147,483,647. Index must be unique within all
/// fields in a Template. (Nested Templates can reuse indexes). Once a
/// Template is defined, the index cannot be changed, because it identifies
/// the field in the actual storage format. Index is a mandatory field, but
/// it is optional for top level fields, and map/array "values" definitions.
pub index: i32,
/// Required. The name of the field.
pub name: std::string::String,
/// Required. The datatype of this field. The following values are supported:
///
/// Primitive types:
///
/// * string
/// * int
/// * bool
/// * double
/// * datetime. Must be of the format RFC3339 UTC "Zulu" (Examples:
/// "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z").
///
/// Complex types:
///
/// * enum
/// * array
/// * map
/// * record
pub r#type: std::string::String,
/// Optional. Field definition. You must specify it if the type is record. It
/// defines the nested fields.
pub record_fields: std::vec::Vec<crate::model::aspect_type::MetadataTemplate>,
/// Optional. The list of values for an enum type. You must define it if the
/// type is enum.
pub enum_values: std::vec::Vec<crate::model::aspect_type::metadata_template::EnumValue>,
/// Optional. If the type is map, set map_items. map_items can refer to a
/// primitive field or a complex (record only) field. To specify a primitive
/// field, you only need to set name and type in the nested
/// MetadataTemplate. The recommended value for the name field is item, as
/// this isn't used in the actual payload.
pub map_items:
std::option::Option<std::boxed::Box<crate::model::aspect_type::MetadataTemplate>>,
/// Optional. If the type is array, set array_items. array_items can refer
/// to a primitive field or a complex (record only) field. To specify a
/// primitive field, you only need to set name and type in the nested
/// MetadataTemplate. The recommended value for the name field is item, as
/// this isn't used in the actual payload.
pub array_items:
std::option::Option<std::boxed::Box<crate::model::aspect_type::MetadataTemplate>>,
/// Optional. You can use type id if this definition of the field needs to be
/// reused later. The type id must be unique across the entire template. You
/// can only specify it if the field type is record.
pub type_id: std::string::String,
/// Optional. A reference to another field definition (not an inline
/// definition). The value must be equal to the value of an id field defined
/// elsewhere in the MetadataTemplate. Only fields with record type can
/// refer to other fields.
pub type_ref: std::string::String,
/// Optional. Specifies the constraints on this field.
pub constraints:
std::option::Option<crate::model::aspect_type::metadata_template::Constraints>,
/// Optional. Specifies annotations on this field.
pub annotations:
std::option::Option<crate::model::aspect_type::metadata_template::Annotations>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetadataTemplate {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [index][crate::model::aspect_type::MetadataTemplate::index].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_index(42);
/// ```
pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.index = v.into();
self
}
/// Sets the value of [name][crate::model::aspect_type::MetadataTemplate::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [r#type][crate::model::aspect_type::MetadataTemplate::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [record_fields][crate::model::aspect_type::MetadataTemplate::record_fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new()
/// .set_record_fields([
/// MetadataTemplate::default()/* use setters */,
/// MetadataTemplate::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_record_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
use std::iter::Iterator;
self.record_fields = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [enum_values][crate::model::aspect_type::MetadataTemplate::enum_values].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// use google_cloud_dataplex_v1::model::aspect_type::metadata_template::EnumValue;
/// let x = MetadataTemplate::new()
/// .set_enum_values([
/// EnumValue::default()/* use setters */,
/// EnumValue::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_enum_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::aspect_type::metadata_template::EnumValue>,
{
use std::iter::Iterator;
self.enum_values = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [map_items][crate::model::aspect_type::MetadataTemplate::map_items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_map_items(MetadataTemplate::default()/* use setters */);
/// ```
pub fn set_map_items<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
self.map_items = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
/// Sets or clears the value of [map_items][crate::model::aspect_type::MetadataTemplate::map_items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_or_clear_map_items(Some(MetadataTemplate::default()/* use setters */));
/// let x = MetadataTemplate::new().set_or_clear_map_items(None::<MetadataTemplate>);
/// ```
pub fn set_or_clear_map_items<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
self.map_items = v.map(|x| std::boxed::Box::new(x.into()));
self
}
/// Sets the value of [array_items][crate::model::aspect_type::MetadataTemplate::array_items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_array_items(MetadataTemplate::default()/* use setters */);
/// ```
pub fn set_array_items<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
self.array_items = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
/// Sets or clears the value of [array_items][crate::model::aspect_type::MetadataTemplate::array_items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_or_clear_array_items(Some(MetadataTemplate::default()/* use setters */));
/// let x = MetadataTemplate::new().set_or_clear_array_items(None::<MetadataTemplate>);
/// ```
pub fn set_or_clear_array_items<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aspect_type::MetadataTemplate>,
{
self.array_items = v.map(|x| std::boxed::Box::new(x.into()));
self
}
/// Sets the value of [type_id][crate::model::aspect_type::MetadataTemplate::type_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_type_id("example");
/// ```
pub fn set_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.type_id = v.into();
self
}
/// Sets the value of [type_ref][crate::model::aspect_type::MetadataTemplate::type_ref].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// let x = MetadataTemplate::new().set_type_ref("example");
/// ```
pub fn set_type_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.type_ref = v.into();
self
}
/// Sets the value of [constraints][crate::model::aspect_type::MetadataTemplate::constraints].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Constraints;
/// let x = MetadataTemplate::new().set_constraints(Constraints::default()/* use setters */);
/// ```
pub fn set_constraints<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aspect_type::metadata_template::Constraints>,
{
self.constraints = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [constraints][crate::model::aspect_type::MetadataTemplate::constraints].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Constraints;
/// let x = MetadataTemplate::new().set_or_clear_constraints(Some(Constraints::default()/* use setters */));
/// let x = MetadataTemplate::new().set_or_clear_constraints(None::<Constraints>);
/// ```
pub fn set_or_clear_constraints<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aspect_type::metadata_template::Constraints>,
{
self.constraints = v.map(|x| x.into());
self
}
/// Sets the value of [annotations][crate::model::aspect_type::MetadataTemplate::annotations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = MetadataTemplate::new().set_annotations(Annotations::default()/* use setters */);
/// ```
pub fn set_annotations<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aspect_type::metadata_template::Annotations>,
{
self.annotations = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [annotations][crate::model::aspect_type::MetadataTemplate::annotations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::MetadataTemplate;
/// use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = MetadataTemplate::new().set_or_clear_annotations(Some(Annotations::default()/* use setters */));
/// let x = MetadataTemplate::new().set_or_clear_annotations(None::<Annotations>);
/// ```
pub fn set_or_clear_annotations<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aspect_type::metadata_template::Annotations>,
{
self.annotations = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MetadataTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectType.MetadataTemplate"
}
}
/// Defines additional types related to [MetadataTemplate].
pub mod metadata_template {
#[allow(unused_imports)]
use super::*;
/// Definition of Enumvalue, to be used for enum fields.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnumValue {
/// Required. Index for the enum value. It can't be modified.
pub index: i32,
/// Required. Name of the enumvalue. This is the actual value that the
/// aspect can contain.
pub name: std::string::String,
/// Optional. You can set this message if you need to deprecate an enum
/// value.
pub deprecated: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnumValue {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [index][crate::model::aspect_type::metadata_template::EnumValue::index].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::EnumValue;
/// let x = EnumValue::new().set_index(42);
/// ```
pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.index = v.into();
self
}
/// Sets the value of [name][crate::model::aspect_type::metadata_template::EnumValue::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::EnumValue;
/// let x = EnumValue::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [deprecated][crate::model::aspect_type::metadata_template::EnumValue::deprecated].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::EnumValue;
/// let x = EnumValue::new().set_deprecated("example");
/// ```
pub fn set_deprecated<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deprecated = v.into();
self
}
}
impl wkt::message::Message for EnumValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectType.MetadataTemplate.EnumValue"
}
}
/// Definition of the constraints of a field.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Constraints {
/// Optional. Marks this field as optional or required.
pub required: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Constraints {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [required][crate::model::aspect_type::metadata_template::Constraints::required].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Constraints;
/// let x = Constraints::new().set_required(true);
/// ```
pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.required = v.into();
self
}
}
impl wkt::message::Message for Constraints {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectType.MetadataTemplate.Constraints"
}
}
/// Definition of the annotations of a field.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Annotations {
/// Optional. Marks a field as deprecated. You can include a deprecation
/// message.
pub deprecated: std::string::String,
/// Optional. Display name for a field.
pub display_name: std::string::String,
/// Optional. Description for a field.
pub description: std::string::String,
/// Optional. Display order for a field. You can use this to reorder where
/// a field is rendered.
pub display_order: i32,
/// Optional. You can use String Type annotations to specify special
/// meaning to string fields. The following values are supported:
///
/// * richText: The field must be interpreted as a rich text field.
/// * url: A fully qualified URL link.
/// * resource: A service qualified resource reference.
pub string_type: std::string::String,
/// Optional. Suggested hints for string fields. You can use them to
/// suggest values to users through console.
pub string_values: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Annotations {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [deprecated][crate::model::aspect_type::metadata_template::Annotations::deprecated].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = Annotations::new().set_deprecated("example");
/// ```
pub fn set_deprecated<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deprecated = v.into();
self
}
/// Sets the value of [display_name][crate::model::aspect_type::metadata_template::Annotations::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = Annotations::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::aspect_type::metadata_template::Annotations::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = Annotations::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_order][crate::model::aspect_type::metadata_template::Annotations::display_order].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = Annotations::new().set_display_order(42);
/// ```
pub fn set_display_order<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.display_order = v.into();
self
}
/// Sets the value of [string_type][crate::model::aspect_type::metadata_template::Annotations::string_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = Annotations::new().set_string_type("example");
/// ```
pub fn set_string_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.string_type = v.into();
self
}
/// Sets the value of [string_values][crate::model::aspect_type::metadata_template::Annotations::string_values].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::aspect_type::metadata_template::Annotations;
/// let x = Annotations::new().set_string_values(["a", "b", "c"]);
/// ```
pub fn set_string_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.string_values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Annotations {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectType.MetadataTemplate.Annotations"
}
}
}
/// Classifies the data stored by the aspect.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataClassification {
/// Denotes that the aspect contains only metadata.
Unspecified,
/// Metadata and data classification.
MetadataAndData,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [DataClassification::value] or
/// [DataClassification::name].
UnknownValue(data_classification::UnknownValue),
}
#[doc(hidden)]
pub mod data_classification {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataClassification {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::MetadataAndData => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_CLASSIFICATION_UNSPECIFIED"),
Self::MetadataAndData => std::option::Option::Some("METADATA_AND_DATA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataClassification {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataClassification {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DataClassification {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::MetadataAndData,
_ => Self::UnknownValue(data_classification::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataClassification {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_CLASSIFICATION_UNSPECIFIED" => Self::Unspecified,
"METADATA_AND_DATA" => Self::MetadataAndData,
_ => Self::UnknownValue(data_classification::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataClassification {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::MetadataAndData => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataClassification {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataClassification>::new(
".google.cloud.dataplex.v1.AspectType.DataClassification",
))
}
}
}
/// An Entry Group represents a logical grouping of one or more Entries.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntryGroup {
/// Output only. The relative resource name of the EntryGroup, in the format
/// projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the EntryGroup. If you
/// delete and recreate the EntryGroup with the same name, this ID will be
/// different.
pub uid: std::string::String,
/// Output only. The time when the EntryGroup was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the EntryGroup was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the EntryGroup.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Optional. User-defined labels for the EntryGroup.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// This checksum is computed by the service, and might be sent on update and
/// delete requests to ensure the client has an up-to-date value before
/// proceeding.
pub etag: std::string::String,
/// Output only. Denotes the transfer status of the Entry Group. It is
/// unspecified for Entry Group created from Dataplex API.
pub transfer_status: crate::model::TransferStatus,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntryGroup {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::EntryGroup::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// let x = EntryGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::EntryGroup::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = EntryGroup::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::EntryGroup::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// use wkt::Timestamp;
/// let x = EntryGroup::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::EntryGroup::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// use wkt::Timestamp;
/// let x = EntryGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = EntryGroup::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::EntryGroup::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// use wkt::Timestamp;
/// let x = EntryGroup::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::EntryGroup::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// use wkt::Timestamp;
/// let x = EntryGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = EntryGroup::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::EntryGroup::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = EntryGroup::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::EntryGroup::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = EntryGroup::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::EntryGroup::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = EntryGroup::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [etag][crate::model::EntryGroup::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = EntryGroup::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [transfer_status][crate::model::EntryGroup::transfer_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryGroup;
/// use google_cloud_dataplex_v1::model::TransferStatus;
/// let x0 = EntryGroup::new().set_transfer_status(TransferStatus::Migrated);
/// let x1 = EntryGroup::new().set_transfer_status(TransferStatus::Transferred);
/// ```
pub fn set_transfer_status<T: std::convert::Into<crate::model::TransferStatus>>(
mut self,
v: T,
) -> Self {
self.transfer_status = v.into();
self
}
}
impl wkt::message::Message for EntryGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryGroup"
}
}
/// Entry Type is a template for creating Entries.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntryType {
/// Output only. The relative resource name of the EntryType, of the form:
/// projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the EntryType. This ID
/// will be different if the EntryType is deleted and re-created with the same
/// name.
pub uid: std::string::String,
/// Output only. The time when the EntryType was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the EntryType was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the EntryType.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Optional. User-defined labels for the EntryType.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. This checksum is computed by the service, and might be sent on
/// update and delete requests to ensure the client has an up-to-date value
/// before proceeding.
pub etag: std::string::String,
/// Optional. Indicates the classes this Entry Type belongs to, for example,
/// TABLE, DATABASE, MODEL.
pub type_aliases: std::vec::Vec<std::string::String>,
/// Optional. The platform that Entries of this type belongs to.
pub platform: std::string::String,
/// Optional. The system that Entries of this type belongs to. Examples include
/// CloudSQL, MariaDB etc
pub system: std::string::String,
/// AspectInfo for the entry type.
pub required_aspects: std::vec::Vec<crate::model::entry_type::AspectInfo>,
/// Immutable. Authorization defined for this type.
pub authorization: std::option::Option<crate::model::entry_type::Authorization>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntryType {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::EntryType::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_type_id = "entry_type_id";
/// let x = EntryType::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryTypes/{entry_type_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::EntryType::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::EntryType::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use wkt::Timestamp;
/// let x = EntryType::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::EntryType::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use wkt::Timestamp;
/// let x = EntryType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = EntryType::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::EntryType::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use wkt::Timestamp;
/// let x = EntryType::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::EntryType::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use wkt::Timestamp;
/// let x = EntryType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = EntryType::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::EntryType::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::EntryType::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::EntryType::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [etag][crate::model::EntryType::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [type_aliases][crate::model::EntryType::type_aliases].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_type_aliases(["a", "b", "c"]);
/// ```
pub fn set_type_aliases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.type_aliases = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [platform][crate::model::EntryType::platform].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_platform("example");
/// ```
pub fn set_platform<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.platform = v.into();
self
}
/// Sets the value of [system][crate::model::EntryType::system].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// let x = EntryType::new().set_system("example");
/// ```
pub fn set_system<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.system = v.into();
self
}
/// Sets the value of [required_aspects][crate::model::EntryType::required_aspects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use google_cloud_dataplex_v1::model::entry_type::AspectInfo;
/// let x = EntryType::new()
/// .set_required_aspects([
/// AspectInfo::default()/* use setters */,
/// AspectInfo::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_required_aspects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::entry_type::AspectInfo>,
{
use std::iter::Iterator;
self.required_aspects = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [authorization][crate::model::EntryType::authorization].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use google_cloud_dataplex_v1::model::entry_type::Authorization;
/// let x = EntryType::new().set_authorization(Authorization::default()/* use setters */);
/// ```
pub fn set_authorization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::entry_type::Authorization>,
{
self.authorization = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [authorization][crate::model::EntryType::authorization].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryType;
/// use google_cloud_dataplex_v1::model::entry_type::Authorization;
/// let x = EntryType::new().set_or_clear_authorization(Some(Authorization::default()/* use setters */));
/// let x = EntryType::new().set_or_clear_authorization(None::<Authorization>);
/// ```
pub fn set_or_clear_authorization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::entry_type::Authorization>,
{
self.authorization = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EntryType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryType"
}
}
/// Defines additional types related to [EntryType].
pub mod entry_type {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AspectInfo {
/// Required aspect type for the entry type.
pub r#type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AspectInfo {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [r#type][crate::model::entry_type::AspectInfo::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_type::AspectInfo;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let aspect_type_id = "aspect_type_id";
/// let x = AspectInfo::new().set_type(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"));
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for AspectInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryType.AspectInfo"
}
}
/// Authorization for an Entry Type.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Authorization {
/// Immutable. The IAM permission grantable on the Entry Group to allow
/// access to instantiate Entries of Dataplex Universal Catalog owned Entry
/// Types, only settable for Dataplex Universal Catalog owned Types.
pub alternate_use_permission: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Authorization {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [alternate_use_permission][crate::model::entry_type::Authorization::alternate_use_permission].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_type::Authorization;
/// let x = Authorization::new().set_alternate_use_permission("example");
/// ```
pub fn set_alternate_use_permission<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.alternate_use_permission = v.into();
self
}
}
impl wkt::message::Message for Authorization {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryType.Authorization"
}
}
}
/// Represents a single piece of metadata describing an entry or entry link.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Aspect {
/// Output only. The resource name of the type used to create this Aspect.
pub aspect_type: std::string::String,
/// Output only. The path in the entry under which the aspect is attached.
pub path: std::string::String,
/// Output only. The time when the Aspect was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the Aspect was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Required. The content of the aspect, according to its aspect type schema.
/// The maximum size of the field is 120KB (encoded as UTF-8).
pub data: std::option::Option<wkt::Struct>,
/// Optional. Information related to the source system of the aspect.
pub aspect_source: std::option::Option<crate::model::AspectSource>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Aspect {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [aspect_type][crate::model::Aspect::aspect_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// let x = Aspect::new().set_aspect_type("example");
/// ```
pub fn set_aspect_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.aspect_type = v.into();
self
}
/// Sets the value of [path][crate::model::Aspect::path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// let x = Aspect::new().set_path("example");
/// ```
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
/// Sets the value of [create_time][crate::model::Aspect::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use wkt::Timestamp;
/// let x = Aspect::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Aspect::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use wkt::Timestamp;
/// let x = Aspect::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Aspect::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Aspect::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use wkt::Timestamp;
/// let x = Aspect::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Aspect::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use wkt::Timestamp;
/// let x = Aspect::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Aspect::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [data][crate::model::Aspect::data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use wkt::Struct;
/// let x = Aspect::new().set_data(Struct::default()/* use setters */);
/// ```
pub fn set_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.data = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data][crate::model::Aspect::data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use wkt::Struct;
/// let x = Aspect::new().set_or_clear_data(Some(Struct::default()/* use setters */));
/// let x = Aspect::new().set_or_clear_data(None::<Struct>);
/// ```
pub fn set_or_clear_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.data = v.map(|x| x.into());
self
}
/// Sets the value of [aspect_source][crate::model::Aspect::aspect_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use google_cloud_dataplex_v1::model::AspectSource;
/// let x = Aspect::new().set_aspect_source(AspectSource::default()/* use setters */);
/// ```
pub fn set_aspect_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AspectSource>,
{
self.aspect_source = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [aspect_source][crate::model::Aspect::aspect_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Aspect;
/// use google_cloud_dataplex_v1::model::AspectSource;
/// let x = Aspect::new().set_or_clear_aspect_source(Some(AspectSource::default()/* use setters */));
/// let x = Aspect::new().set_or_clear_aspect_source(None::<AspectSource>);
/// ```
pub fn set_or_clear_aspect_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AspectSource>,
{
self.aspect_source = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Aspect {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Aspect"
}
}
/// Information related to the source system of the aspect.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AspectSource {
/// The time the aspect was created in the source system.
pub create_time: std::option::Option<wkt::Timestamp>,
/// The time the aspect was last updated in the source system.
pub update_time: std::option::Option<wkt::Timestamp>,
/// The version of the data format used to produce this data. This field is
/// used to indicated when the underlying data format changes (e.g., schema
/// modifications, changes to the source URL format definition, etc).
pub data_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AspectSource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [create_time][crate::model::AspectSource::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectSource;
/// use wkt::Timestamp;
/// let x = AspectSource::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::AspectSource::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectSource;
/// use wkt::Timestamp;
/// let x = AspectSource::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = AspectSource::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::AspectSource::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectSource;
/// use wkt::Timestamp;
/// let x = AspectSource::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::AspectSource::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectSource;
/// use wkt::Timestamp;
/// let x = AspectSource::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = AspectSource::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [data_version][crate::model::AspectSource::data_version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AspectSource;
/// let x = AspectSource::new().set_data_version("example");
/// ```
pub fn set_data_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_version = v.into();
self
}
}
impl wkt::message::Message for AspectSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AspectSource"
}
}
/// An entry is a representation of a data resource that can be described by
/// various metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Entry {
/// Identifier. The relative resource name of the entry, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`.
pub name: std::string::String,
/// Required. Immutable. The relative resource name of the entry type that was
/// used to create this entry, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry_type_id}`.
pub entry_type: std::string::String,
/// Output only. The time when the entry was created in Dataplex Universal
/// Catalog.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the entry was last updated in Dataplex Universal
/// Catalog.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. The aspects that are attached to the entry. Depending on how the
/// aspect is attached to the entry, the format of the aspect key can be one of
/// the following:
///
/// * If the aspect is attached directly to the entry:
/// `{project_id_or_number}.{location_id}.{aspect_type_id}`
/// * If the aspect is attached to an entry's path:
/// `{project_id_or_number}.{location_id}.{aspect_type_id}@{path}`
pub aspects: std::collections::HashMap<std::string::String, crate::model::Aspect>,
/// Optional. Immutable. The resource name of the parent entry, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`.
pub parent_entry: std::string::String,
/// Optional. A name for the entry that can be referenced by an external
/// system. For more information, see [Fully qualified
/// names](https://cloud.google.com/data-catalog/docs/fully-qualified-names).
/// The maximum size of the field is 4000 characters.
pub fully_qualified_name: std::string::String,
/// Optional. Information related to the source system of the data resource
/// that is represented by the entry.
pub entry_source: std::option::Option<crate::model::EntrySource>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Entry {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Entry::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_id = "entry_id";
/// let x = Entry::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [entry_type][crate::model::Entry::entry_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// let x = Entry::new().set_entry_type("example");
/// ```
pub fn set_entry_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_type = v.into();
self
}
/// Sets the value of [create_time][crate::model::Entry::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use wkt::Timestamp;
/// let x = Entry::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Entry::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use wkt::Timestamp;
/// let x = Entry::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Entry::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Entry::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use wkt::Timestamp;
/// let x = Entry::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Entry::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use wkt::Timestamp;
/// let x = Entry::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Entry::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [aspects][crate::model::Entry::aspects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use google_cloud_dataplex_v1::model::Aspect;
/// let x = Entry::new().set_aspects([
/// ("key0", Aspect::default()/* use setters */),
/// ("key1", Aspect::default()/* use (different) setters */),
/// ]);
/// ```
pub fn set_aspects<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::Aspect>,
{
use std::iter::Iterator;
self.aspects = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [parent_entry][crate::model::Entry::parent_entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// let x = Entry::new().set_parent_entry("example");
/// ```
pub fn set_parent_entry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent_entry = v.into();
self
}
/// Sets the value of [fully_qualified_name][crate::model::Entry::fully_qualified_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// let x = Entry::new().set_fully_qualified_name("example");
/// ```
pub fn set_fully_qualified_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.fully_qualified_name = v.into();
self
}
/// Sets the value of [entry_source][crate::model::Entry::entry_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use google_cloud_dataplex_v1::model::EntrySource;
/// let x = Entry::new().set_entry_source(EntrySource::default()/* use setters */);
/// ```
pub fn set_entry_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntrySource>,
{
self.entry_source = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_source][crate::model::Entry::entry_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entry;
/// use google_cloud_dataplex_v1::model::EntrySource;
/// let x = Entry::new().set_or_clear_entry_source(Some(EntrySource::default()/* use setters */));
/// let x = Entry::new().set_or_clear_entry_source(None::<EntrySource>);
/// ```
pub fn set_or_clear_entry_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntrySource>,
{
self.entry_source = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Entry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Entry"
}
}
/// Information related to the source system of the data resource that is
/// represented by the entry.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntrySource {
/// The name of the resource in the source system.
/// Maximum length is 4,000 characters.
pub resource: std::string::String,
/// The name of the source system.
/// Maximum length is 64 characters.
pub system: std::string::String,
/// The platform containing the source system.
/// Maximum length is 64 characters.
pub platform: std::string::String,
/// A user-friendly display name.
/// Maximum length is 500 characters.
pub display_name: std::string::String,
/// A description of the data resource.
/// Maximum length is 2,000 characters.
pub description: std::string::String,
/// User-defined labels.
/// The maximum size of keys and values is 128 characters each.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Immutable. The entries representing the ancestors of the data resource in
/// the source system.
pub ancestors: std::vec::Vec<crate::model::entry_source::Ancestor>,
/// The time when the resource was created in the source system.
pub create_time: std::option::Option<wkt::Timestamp>,
/// The time when the resource was last updated in the source system. If the
/// entry exists in the system and its `EntrySource` has `update_time`
/// populated, further updates to the `EntrySource` of the entry must provide
/// incremental updates to its `update_time`.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Output only. Location of the resource in the source system. You can search
/// the entry by this location. By default, this should match the location of
/// the entry group containing this entry. A different value allows capturing
/// the source location for data external to Google Cloud.
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntrySource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [resource][crate::model::EntrySource::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
/// Sets the value of [system][crate::model::EntrySource::system].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_system("example");
/// ```
pub fn set_system<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.system = v.into();
self
}
/// Sets the value of [platform][crate::model::EntrySource::platform].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_platform("example");
/// ```
pub fn set_platform<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.platform = v.into();
self
}
/// Sets the value of [display_name][crate::model::EntrySource::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::EntrySource::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [labels][crate::model::EntrySource::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [ancestors][crate::model::EntrySource::ancestors].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// use google_cloud_dataplex_v1::model::entry_source::Ancestor;
/// let x = EntrySource::new()
/// .set_ancestors([
/// Ancestor::default()/* use setters */,
/// Ancestor::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_ancestors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::entry_source::Ancestor>,
{
use std::iter::Iterator;
self.ancestors = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [create_time][crate::model::EntrySource::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// use wkt::Timestamp;
/// let x = EntrySource::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::EntrySource::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// use wkt::Timestamp;
/// let x = EntrySource::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = EntrySource::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::EntrySource::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// use wkt::Timestamp;
/// let x = EntrySource::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::EntrySource::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// use wkt::Timestamp;
/// let x = EntrySource::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = EntrySource::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [location][crate::model::EntrySource::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntrySource;
/// let x = EntrySource::new().set_location("example");
/// ```
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for EntrySource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntrySource"
}
}
/// Defines additional types related to [EntrySource].
pub mod entry_source {
#[allow(unused_imports)]
use super::*;
/// Information about individual items in the hierarchy that is associated with
/// the data resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Ancestor {
/// Optional. The name of the ancestor resource.
pub name: std::string::String,
/// Optional. The type of the ancestor resource.
pub r#type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Ancestor {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::entry_source::Ancestor::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_source::Ancestor;
/// let x = Ancestor::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [r#type][crate::model::entry_source::Ancestor::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_source::Ancestor;
/// let x = Ancestor::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for Ancestor {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntrySource.Ancestor"
}
}
}
/// Create EntryGroup Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEntryGroupRequest {
/// Required. The resource name of the entryGroup, of the form:
/// projects/{project_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. EntryGroup identifier.
pub entry_group_id: std::string::String,
/// Required. EntryGroup Resource.
pub entry_group: std::option::Option<crate::model::EntryGroup>,
/// Optional. The service validates the request without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEntryGroupRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateEntryGroupRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryGroupRequest;
/// let x = CreateEntryGroupRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [entry_group_id][crate::model::CreateEntryGroupRequest::entry_group_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryGroupRequest;
/// let x = CreateEntryGroupRequest::new().set_entry_group_id("example");
/// ```
pub fn set_entry_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_group_id = v.into();
self
}
/// Sets the value of [entry_group][crate::model::CreateEntryGroupRequest::entry_group].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryGroupRequest;
/// use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = CreateEntryGroupRequest::new().set_entry_group(EntryGroup::default()/* use setters */);
/// ```
pub fn set_entry_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryGroup>,
{
self.entry_group = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_group][crate::model::CreateEntryGroupRequest::entry_group].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryGroupRequest;
/// use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = CreateEntryGroupRequest::new().set_or_clear_entry_group(Some(EntryGroup::default()/* use setters */));
/// let x = CreateEntryGroupRequest::new().set_or_clear_entry_group(None::<EntryGroup>);
/// ```
pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryGroup>,
{
self.entry_group = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateEntryGroupRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryGroupRequest;
/// let x = CreateEntryGroupRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateEntryGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateEntryGroupRequest"
}
}
/// Update EntryGroup Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEntryGroupRequest {
/// Required. EntryGroup Resource.
pub entry_group: std::option::Option<crate::model::EntryGroup>,
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. The service validates the request, without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEntryGroupRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_group][crate::model::UpdateEntryGroupRequest::entry_group].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryGroupRequest;
/// use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = UpdateEntryGroupRequest::new().set_entry_group(EntryGroup::default()/* use setters */);
/// ```
pub fn set_entry_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryGroup>,
{
self.entry_group = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_group][crate::model::UpdateEntryGroupRequest::entry_group].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryGroupRequest;
/// use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = UpdateEntryGroupRequest::new().set_or_clear_entry_group(Some(EntryGroup::default()/* use setters */));
/// let x = UpdateEntryGroupRequest::new().set_or_clear_entry_group(None::<EntryGroup>);
/// ```
pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryGroup>,
{
self.entry_group = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateEntryGroupRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryGroupRequest;
/// use wkt::FieldMask;
/// let x = UpdateEntryGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateEntryGroupRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryGroupRequest;
/// use wkt::FieldMask;
/// let x = UpdateEntryGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateEntryGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateEntryGroupRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryGroupRequest;
/// let x = UpdateEntryGroupRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateEntryGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateEntryGroupRequest"
}
}
/// Delete EntryGroup Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEntryGroupRequest {
/// Required. The resource name of the EntryGroup:
/// `projects/{project_number}/locations/{location_id}/entryGroups/{entry_group_id}`.
pub name: std::string::String,
/// Optional. If the client provided etag value does not match the current etag
/// value, the DeleteEntryGroupRequest method returns an ABORTED error
/// response.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEntryGroupRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteEntryGroupRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntryGroupRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// let x = DeleteEntryGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteEntryGroupRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntryGroupRequest;
/// let x = DeleteEntryGroupRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteEntryGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteEntryGroupRequest"
}
}
/// List entryGroups request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntryGroupsRequest {
/// Required. The resource name of the entryGroup location, of the form:
/// `projects/{project_number}/locations/{location_id}`
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of EntryGroups to return. The service may return
/// fewer than this value. If unspecified, the service returns at most 10
/// EntryGroups. The maximum value is 1000; values above 1000 will be coerced
/// to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListEntryGroups` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters you provide to `ListEntryGroups` must match the call that
/// provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntryGroupsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListEntryGroupsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsRequest;
/// let x = ListEntryGroupsRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListEntryGroupsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsRequest;
/// let x = ListEntryGroupsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListEntryGroupsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsRequest;
/// let x = ListEntryGroupsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListEntryGroupsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsRequest;
/// let x = ListEntryGroupsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListEntryGroupsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsRequest;
/// let x = ListEntryGroupsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListEntryGroupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntryGroupsRequest"
}
}
/// List entry groups response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntryGroupsResponse {
/// Entry groups under the given parent location.
pub entry_groups: std::vec::Vec<crate::model::EntryGroup>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntryGroupsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_groups][crate::model::ListEntryGroupsResponse::entry_groups].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsResponse;
/// use google_cloud_dataplex_v1::model::EntryGroup;
/// let x = ListEntryGroupsResponse::new()
/// .set_entry_groups([
/// EntryGroup::default()/* use setters */,
/// EntryGroup::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_entry_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntryGroup>,
{
use std::iter::Iterator;
self.entry_groups = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListEntryGroupsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsResponse;
/// let x = ListEntryGroupsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListEntryGroupsResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryGroupsResponse;
/// let x = ListEntryGroupsResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListEntryGroupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntryGroupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEntryGroupsResponse {
type PageItem = crate::model::EntryGroup;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.entry_groups
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get EntryGroup request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEntryGroupRequest {
/// Required. The resource name of the EntryGroup:
/// `projects/{project_number}/locations/{location_id}/entryGroups/{entry_group_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEntryGroupRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetEntryGroupRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryGroupRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// let x = GetEntryGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetEntryGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetEntryGroupRequest"
}
}
/// Create EntryType Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEntryTypeRequest {
/// Required. The resource name of the EntryType, of the form:
/// projects/{project_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. EntryType identifier.
pub entry_type_id: std::string::String,
/// Required. EntryType Resource.
pub entry_type: std::option::Option<crate::model::EntryType>,
/// Optional. The service validates the request without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEntryTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateEntryTypeRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryTypeRequest;
/// let x = CreateEntryTypeRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [entry_type_id][crate::model::CreateEntryTypeRequest::entry_type_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryTypeRequest;
/// let x = CreateEntryTypeRequest::new().set_entry_type_id("example");
/// ```
pub fn set_entry_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_type_id = v.into();
self
}
/// Sets the value of [entry_type][crate::model::CreateEntryTypeRequest::entry_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryTypeRequest;
/// use google_cloud_dataplex_v1::model::EntryType;
/// let x = CreateEntryTypeRequest::new().set_entry_type(EntryType::default()/* use setters */);
/// ```
pub fn set_entry_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryType>,
{
self.entry_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_type][crate::model::CreateEntryTypeRequest::entry_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryTypeRequest;
/// use google_cloud_dataplex_v1::model::EntryType;
/// let x = CreateEntryTypeRequest::new().set_or_clear_entry_type(Some(EntryType::default()/* use setters */));
/// let x = CreateEntryTypeRequest::new().set_or_clear_entry_type(None::<EntryType>);
/// ```
pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryType>,
{
self.entry_type = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateEntryTypeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryTypeRequest;
/// let x = CreateEntryTypeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateEntryTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateEntryTypeRequest"
}
}
/// Update EntryType Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEntryTypeRequest {
/// Required. EntryType Resource.
pub entry_type: std::option::Option<crate::model::EntryType>,
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. The service validates the request without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEntryTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_type][crate::model::UpdateEntryTypeRequest::entry_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryTypeRequest;
/// use google_cloud_dataplex_v1::model::EntryType;
/// let x = UpdateEntryTypeRequest::new().set_entry_type(EntryType::default()/* use setters */);
/// ```
pub fn set_entry_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryType>,
{
self.entry_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_type][crate::model::UpdateEntryTypeRequest::entry_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryTypeRequest;
/// use google_cloud_dataplex_v1::model::EntryType;
/// let x = UpdateEntryTypeRequest::new().set_or_clear_entry_type(Some(EntryType::default()/* use setters */));
/// let x = UpdateEntryTypeRequest::new().set_or_clear_entry_type(None::<EntryType>);
/// ```
pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryType>,
{
self.entry_type = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateEntryTypeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryTypeRequest;
/// use wkt::FieldMask;
/// let x = UpdateEntryTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateEntryTypeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryTypeRequest;
/// use wkt::FieldMask;
/// let x = UpdateEntryTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateEntryTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateEntryTypeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryTypeRequest;
/// let x = UpdateEntryTypeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateEntryTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateEntryTypeRequest"
}
}
/// Delete EntryType Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEntryTypeRequest {
/// Required. The resource name of the EntryType:
/// `projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}`.
pub name: std::string::String,
/// Optional. If the client provided etag value does not match the current etag
/// value, the DeleteEntryTypeRequest method returns an ABORTED error response.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEntryTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteEntryTypeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntryTypeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_type_id = "entry_type_id";
/// let x = DeleteEntryTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryTypes/{entry_type_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteEntryTypeRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntryTypeRequest;
/// let x = DeleteEntryTypeRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteEntryTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteEntryTypeRequest"
}
}
/// List EntryTypes request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntryTypesRequest {
/// Required. The resource name of the EntryType location, of the form:
/// `projects/{project_number}/locations/{location_id}`
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of EntryTypes to return. The service may return
/// fewer than this value. If unspecified, the service returns at most 10
/// EntryTypes. The maximum value is 1000; values above 1000 will be coerced to
/// 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListEntryTypes` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters you provided to `ListEntryTypes` must match the call that
/// provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request. Filters are case-sensitive.
/// The service supports the following formats:
///
/// * labels.key1 = "value1"
/// * labels:key1
/// * name = "value"
///
/// These restrictions can be conjoined with AND, OR, and NOT conjunctions.
pub filter: std::string::String,
/// Optional. Orders the result by `name` or `create_time` fields.
/// If not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntryTypesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListEntryTypesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesRequest;
/// let x = ListEntryTypesRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListEntryTypesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesRequest;
/// let x = ListEntryTypesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListEntryTypesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesRequest;
/// let x = ListEntryTypesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListEntryTypesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesRequest;
/// let x = ListEntryTypesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListEntryTypesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesRequest;
/// let x = ListEntryTypesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListEntryTypesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntryTypesRequest"
}
}
/// List EntryTypes response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntryTypesResponse {
/// EntryTypes under the given parent location.
pub entry_types: std::vec::Vec<crate::model::EntryType>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntryTypesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_types][crate::model::ListEntryTypesResponse::entry_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesResponse;
/// use google_cloud_dataplex_v1::model::EntryType;
/// let x = ListEntryTypesResponse::new()
/// .set_entry_types([
/// EntryType::default()/* use setters */,
/// EntryType::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_entry_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntryType>,
{
use std::iter::Iterator;
self.entry_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListEntryTypesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesResponse;
/// let x = ListEntryTypesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListEntryTypesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntryTypesResponse;
/// let x = ListEntryTypesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListEntryTypesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntryTypesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEntryTypesResponse {
type PageItem = crate::model::EntryType;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.entry_types
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get EntryType request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEntryTypeRequest {
/// Required. The resource name of the EntryType:
/// `projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEntryTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetEntryTypeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryTypeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_type_id = "entry_type_id";
/// let x = GetEntryTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryTypes/{entry_type_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetEntryTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetEntryTypeRequest"
}
}
/// Create AspectType Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAspectTypeRequest {
/// Required. The resource name of the AspectType, of the form:
/// projects/{project_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. AspectType identifier.
pub aspect_type_id: std::string::String,
/// Required. AspectType Resource.
pub aspect_type: std::option::Option<crate::model::AspectType>,
/// Optional. The service validates the request without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAspectTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateAspectTypeRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAspectTypeRequest;
/// let x = CreateAspectTypeRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [aspect_type_id][crate::model::CreateAspectTypeRequest::aspect_type_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAspectTypeRequest;
/// let x = CreateAspectTypeRequest::new().set_aspect_type_id("example");
/// ```
pub fn set_aspect_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.aspect_type_id = v.into();
self
}
/// Sets the value of [aspect_type][crate::model::CreateAspectTypeRequest::aspect_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAspectTypeRequest;
/// use google_cloud_dataplex_v1::model::AspectType;
/// let x = CreateAspectTypeRequest::new().set_aspect_type(AspectType::default()/* use setters */);
/// ```
pub fn set_aspect_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AspectType>,
{
self.aspect_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [aspect_type][crate::model::CreateAspectTypeRequest::aspect_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAspectTypeRequest;
/// use google_cloud_dataplex_v1::model::AspectType;
/// let x = CreateAspectTypeRequest::new().set_or_clear_aspect_type(Some(AspectType::default()/* use setters */));
/// let x = CreateAspectTypeRequest::new().set_or_clear_aspect_type(None::<AspectType>);
/// ```
pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AspectType>,
{
self.aspect_type = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateAspectTypeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAspectTypeRequest;
/// let x = CreateAspectTypeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateAspectTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateAspectTypeRequest"
}
}
/// Update AspectType Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAspectTypeRequest {
/// Required. AspectType Resource
pub aspect_type: std::option::Option<crate::model::AspectType>,
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAspectTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [aspect_type][crate::model::UpdateAspectTypeRequest::aspect_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAspectTypeRequest;
/// use google_cloud_dataplex_v1::model::AspectType;
/// let x = UpdateAspectTypeRequest::new().set_aspect_type(AspectType::default()/* use setters */);
/// ```
pub fn set_aspect_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AspectType>,
{
self.aspect_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [aspect_type][crate::model::UpdateAspectTypeRequest::aspect_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAspectTypeRequest;
/// use google_cloud_dataplex_v1::model::AspectType;
/// let x = UpdateAspectTypeRequest::new().set_or_clear_aspect_type(Some(AspectType::default()/* use setters */));
/// let x = UpdateAspectTypeRequest::new().set_or_clear_aspect_type(None::<AspectType>);
/// ```
pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AspectType>,
{
self.aspect_type = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateAspectTypeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAspectTypeRequest;
/// use wkt::FieldMask;
/// let x = UpdateAspectTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateAspectTypeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAspectTypeRequest;
/// use wkt::FieldMask;
/// let x = UpdateAspectTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateAspectTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateAspectTypeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAspectTypeRequest;
/// let x = UpdateAspectTypeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateAspectTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateAspectTypeRequest"
}
}
/// Delete AspectType Request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAspectTypeRequest {
/// Required. The resource name of the AspectType:
/// `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`.
pub name: std::string::String,
/// Optional. If the client provided etag value does not match the current etag
/// value, the DeleteAspectTypeRequest method returns an ABORTED error
/// response.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAspectTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteAspectTypeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteAspectTypeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let aspect_type_id = "aspect_type_id";
/// let x = DeleteAspectTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteAspectTypeRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteAspectTypeRequest;
/// let x = DeleteAspectTypeRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteAspectTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteAspectTypeRequest"
}
}
/// List AspectTypes request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAspectTypesRequest {
/// Required. The resource name of the AspectType location, of the form:
/// `projects/{project_number}/locations/{location_id}`
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of AspectTypes to return. The service may return
/// fewer than this value. If unspecified, the service returns at most 10
/// AspectTypes. The maximum value is 1000; values above 1000 will be coerced
/// to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListAspectTypes` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters you provide to `ListAspectTypes` must match the call that
/// provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request. Filters are case-sensitive.
/// The service supports the following formats:
///
/// * labels.key1 = "value1"
/// * labels:key1
/// * name = "value"
///
/// These restrictions can be conjoined with AND, OR, and NOT conjunctions.
pub filter: std::string::String,
/// Optional. Orders the result by `name` or `create_time` fields.
/// If not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAspectTypesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListAspectTypesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesRequest;
/// let x = ListAspectTypesRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListAspectTypesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesRequest;
/// let x = ListAspectTypesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListAspectTypesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesRequest;
/// let x = ListAspectTypesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListAspectTypesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesRequest;
/// let x = ListAspectTypesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListAspectTypesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesRequest;
/// let x = ListAspectTypesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAspectTypesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListAspectTypesRequest"
}
}
/// List AspectTypes response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAspectTypesResponse {
/// AspectTypes under the given parent location.
pub aspect_types: std::vec::Vec<crate::model::AspectType>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAspectTypesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [aspect_types][crate::model::ListAspectTypesResponse::aspect_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesResponse;
/// use google_cloud_dataplex_v1::model::AspectType;
/// let x = ListAspectTypesResponse::new()
/// .set_aspect_types([
/// AspectType::default()/* use setters */,
/// AspectType::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AspectType>,
{
use std::iter::Iterator;
self.aspect_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListAspectTypesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesResponse;
/// let x = ListAspectTypesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListAspectTypesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAspectTypesResponse;
/// let x = ListAspectTypesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListAspectTypesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListAspectTypesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAspectTypesResponse {
type PageItem = crate::model::AspectType;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.aspect_types
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get AspectType request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAspectTypeRequest {
/// Required. The resource name of the AspectType:
/// `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAspectTypeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetAspectTypeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetAspectTypeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let aspect_type_id = "aspect_type_id";
/// let x = GetAspectTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAspectTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetAspectTypeRequest"
}
}
/// Create Entry request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEntryRequest {
/// Required. The resource name of the parent Entry Group:
/// `projects/{project}/locations/{location}/entryGroups/{entry_group}`.
pub parent: std::string::String,
/// Required. Entry identifier. It has to be unique within an Entry Group.
///
/// Entries corresponding to Google Cloud resources use an Entry ID format
/// based on [full resource
/// names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
/// The format is a full resource name of the resource without the
/// prefix double slashes in the API service name part of the full resource
/// name. This allows retrieval of entries using their associated resource
/// name.
///
/// For example, if the full resource name of a resource is
/// `//library.googleapis.com/shelves/shelf1/books/book2`,
/// then the suggested entry_id is
/// `library.googleapis.com/shelves/shelf1/books/book2`.
///
/// It is also suggested to follow the same convention for entries
/// corresponding to resources from providers or systems other than Google
/// Cloud.
///
/// The maximum size of the field is 4000 characters.
pub entry_id: std::string::String,
/// Required. Entry resource.
pub entry: std::option::Option<crate::model::Entry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEntryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateEntryRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// let x = CreateEntryRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [entry_id][crate::model::CreateEntryRequest::entry_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryRequest;
/// let x = CreateEntryRequest::new().set_entry_id("example");
/// ```
pub fn set_entry_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_id = v.into();
self
}
/// Sets the value of [entry][crate::model::CreateEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryRequest;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = CreateEntryRequest::new().set_entry(Entry::default()/* use setters */);
/// ```
pub fn set_entry<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry][crate::model::CreateEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryRequest;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = CreateEntryRequest::new().set_or_clear_entry(Some(Entry::default()/* use setters */));
/// let x = CreateEntryRequest::new().set_or_clear_entry(None::<Entry>);
/// ```
pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateEntryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateEntryRequest"
}
}
/// Update Entry request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEntryRequest {
/// Required. Entry resource.
pub entry: std::option::Option<crate::model::Entry>,
/// Optional. Mask of fields to update. To update Aspects, the update_mask must
/// contain the value "aspects".
///
/// If the update_mask is empty, the service will update all modifiable fields
/// present in the request.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. If set to true and the entry doesn't exist, the service will
/// create it.
pub allow_missing: bool,
/// Optional. If set to true and the aspect_keys specify aspect ranges, the
/// service deletes any existing aspects from that range that weren't provided
/// in the request.
pub delete_missing_aspects: bool,
/// Optional. The map keys of the Aspects which the service should modify. It
/// supports the following syntaxes:
///
/// * `<aspect_type_reference>` - matches an aspect of the given type and empty
/// path.
/// * `<aspect_type_reference>@path` - matches an aspect of the given type and
/// specified path. For example, to attach an aspect to a field that is
/// specified by the `schema` aspect, the path should have the format
/// `Schema.<field_name>`.
/// * `<aspect_type_reference>@*` - matches aspects of the given type for all
/// paths.
/// * `*@path` - matches aspects of all types on the given path.
///
/// The service will not remove existing aspects matching the syntax unless
/// `delete_missing_aspects` is set to true.
///
/// If this field is left empty, the service treats it as specifying
/// exactly those Aspects present in the request.
pub aspect_keys: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEntryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry][crate::model::UpdateEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = UpdateEntryRequest::new().set_entry(Entry::default()/* use setters */);
/// ```
pub fn set_entry<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry][crate::model::UpdateEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = UpdateEntryRequest::new().set_or_clear_entry(Some(Entry::default()/* use setters */));
/// let x = UpdateEntryRequest::new().set_or_clear_entry(None::<Entry>);
/// ```
pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateEntryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// use wkt::FieldMask;
/// let x = UpdateEntryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateEntryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// use wkt::FieldMask;
/// let x = UpdateEntryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateEntryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [allow_missing][crate::model::UpdateEntryRequest::allow_missing].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// let x = UpdateEntryRequest::new().set_allow_missing(true);
/// ```
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
/// Sets the value of [delete_missing_aspects][crate::model::UpdateEntryRequest::delete_missing_aspects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// let x = UpdateEntryRequest::new().set_delete_missing_aspects(true);
/// ```
pub fn set_delete_missing_aspects<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.delete_missing_aspects = v.into();
self
}
/// Sets the value of [aspect_keys][crate::model::UpdateEntryRequest::aspect_keys].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryRequest;
/// let x = UpdateEntryRequest::new().set_aspect_keys(["a", "b", "c"]);
/// ```
pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_keys = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UpdateEntryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateEntryRequest"
}
}
/// Delete Entry request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEntryRequest {
/// Required. The resource name of the Entry:
/// `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEntryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteEntryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_id = "entry_id";
/// let x = DeleteEntryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteEntryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteEntryRequest"
}
}
/// List Entries request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntriesRequest {
/// Required. The resource name of the parent Entry Group:
/// `projects/{project}/locations/{location}/entryGroups/{entry_group}`.
pub parent: std::string::String,
/// Optional. Number of items to return per page. If there are remaining
/// results, the service returns a next_page_token. If unspecified, the service
/// returns at most 10 Entries. The maximum value is 100; values above 100 will
/// be coerced to 100.
pub page_size: i32,
/// Optional. Page token received from a previous `ListEntries` call. Provide
/// this to retrieve the subsequent page.
pub page_token: std::string::String,
/// Optional. A filter on the entries to return. Filters are case-sensitive.
/// You can filter the request by the following fields:
///
/// * entry_type
/// * entry_source.display_name
/// * parent_entry
///
/// The comparison operators are =, !=, <, >, <=, >=. The service compares
/// strings according to lexical order.
///
/// You can use the logical operators AND, OR, NOT in the filter.
///
/// You can use Wildcard "*", but for entry_type and parent_entry you need to
/// provide the full project id or number.
///
/// You cannot use parent_entry in conjunction with other fields.
///
/// Example filter expressions:
///
/// * "entry_source.display_name=AnExampleDisplayName"
/// * "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type"
/// * "entry_type=projects/example-project/locations/us/entryTypes/a* OR
/// entry_type=projects/another-project/locations/*"
/// * "NOT entry_source.display_name=AnotherExampleDisplayName"
/// * "parent_entry=projects/example-project/locations/us/entryGroups/example-entry-group/entries/example-entry"
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntriesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListEntriesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntriesRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// let x = ListEntriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListEntriesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntriesRequest;
/// let x = ListEntriesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListEntriesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntriesRequest;
/// let x = ListEntriesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListEntriesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntriesRequest;
/// let x = ListEntriesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListEntriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntriesRequest"
}
}
/// List Entries response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntriesResponse {
/// The list of entries under the given parent location.
pub entries: std::vec::Vec<crate::model::Entry>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntriesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entries][crate::model::ListEntriesResponse::entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntriesResponse;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = ListEntriesResponse::new()
/// .set_entries([
/// Entry::default()/* use setters */,
/// Entry::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Entry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListEntriesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntriesResponse;
/// let x = ListEntriesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListEntriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntriesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEntriesResponse {
type PageItem = crate::model::Entry;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.entries
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get Entry request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEntryRequest {
/// Required. The resource name of the Entry:
/// `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`.
pub name: std::string::String,
/// Optional. View to control which parts of an entry the service should
/// return.
/// **Please check the limitations on returned aspects in the Entry view
/// documentation. Amount of returned aspects depends on the selected Entry
/// View.**
pub view: crate::model::EntryView,
/// Optional. Limits the aspects returned to the provided aspect types.
/// It only works for CUSTOM view.
pub aspect_types: std::vec::Vec<std::string::String>,
/// Optional. Limits the aspects returned to those associated with the provided
/// paths within the Entry. It only works for CUSTOM view.
pub paths: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEntryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetEntryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_id = "entry_id";
/// let x = GetEntryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [view][crate::model::GetEntryRequest::view].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryRequest;
/// use google_cloud_dataplex_v1::model::EntryView;
/// let x0 = GetEntryRequest::new().set_view(EntryView::Basic);
/// let x1 = GetEntryRequest::new().set_view(EntryView::Full);
/// let x2 = GetEntryRequest::new().set_view(EntryView::Custom);
/// ```
pub fn set_view<T: std::convert::Into<crate::model::EntryView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
/// Sets the value of [aspect_types][crate::model::GetEntryRequest::aspect_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryRequest;
/// let x = GetEntryRequest::new().set_aspect_types(["a", "b", "c"]);
/// ```
pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [paths][crate::model::GetEntryRequest::paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryRequest;
/// let x = GetEntryRequest::new().set_paths(["a", "b", "c"]);
/// ```
pub fn set_paths<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.paths = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GetEntryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetEntryRequest"
}
}
/// Lookup Entry request using permissions in the source system.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupEntryRequest {
/// Required. The project to which the request should be attributed in the
/// following form: `projects/{project}/locations/{location}`.
pub name: std::string::String,
/// Optional. View to control which parts of an entry the service should
/// return.
/// **Please check the limitations on returned aspects in the Entry view
/// documentation. Amount of returned aspects depends on the selected Entry
/// View.**
pub view: crate::model::EntryView,
/// Optional. Limits the aspects returned to the provided aspect types.
/// It only works for CUSTOM view.
pub aspect_types: std::vec::Vec<std::string::String>,
/// Optional. Limits the aspects returned to those associated with the provided
/// paths within the Entry. It only works for CUSTOM view.
pub paths: std::vec::Vec<std::string::String>,
/// Required. The resource name of the Entry:
/// `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`.
pub entry: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LookupEntryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::LookupEntryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryRequest;
/// let x = LookupEntryRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [view][crate::model::LookupEntryRequest::view].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryRequest;
/// use google_cloud_dataplex_v1::model::EntryView;
/// let x0 = LookupEntryRequest::new().set_view(EntryView::Basic);
/// let x1 = LookupEntryRequest::new().set_view(EntryView::Full);
/// let x2 = LookupEntryRequest::new().set_view(EntryView::Custom);
/// ```
pub fn set_view<T: std::convert::Into<crate::model::EntryView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
/// Sets the value of [aspect_types][crate::model::LookupEntryRequest::aspect_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryRequest;
/// let x = LookupEntryRequest::new().set_aspect_types(["a", "b", "c"]);
/// ```
pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [paths][crate::model::LookupEntryRequest::paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryRequest;
/// let x = LookupEntryRequest::new().set_paths(["a", "b", "c"]);
/// ```
pub fn set_paths<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.paths = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [entry][crate::model::LookupEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_id = "entry_id";
/// let x = LookupEntryRequest::new().set_entry(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"));
/// ```
pub fn set_entry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry = v.into();
self
}
}
impl wkt::message::Message for LookupEntryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.LookupEntryRequest"
}
}
/// Lookup Context using permissions in the source system.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupContextRequest {
/// Required. The project to which the request should be attributed in the
/// following form: `projects/{project}/locations/{location}`.
pub name: std::string::String,
/// Required. The entry names to look up the context for. The maximum number of
/// resources for a request is limited to 10.
///
/// ## Examples:
///
/// `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`
pub resources: std::vec::Vec<std::string::String>,
/// Optional. The text representing contextual information for which metadata
/// context is being requested.
pub context: std::string::String,
/// Optional. Allows to configure the context.
///
/// Supported options:
///
/// - `format` - The format of the context (one of `yaml`,
/// `xml`, `json`, default is `yaml`).
/// - `context_budget` - If provided, the output will be intelligently
/// truncated on a best-effort basis to contain approximately the desired
/// amount of characters. There is no guarantee to achieve the specific amount.
pub options: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LookupContextRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::LookupContextRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupContextRequest;
/// let x = LookupContextRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [resources][crate::model::LookupContextRequest::resources].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupContextRequest;
/// let x = LookupContextRequest::new().set_resources(["a", "b", "c"]);
/// ```
pub fn set_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.resources = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [context][crate::model::LookupContextRequest::context].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupContextRequest;
/// let x = LookupContextRequest::new().set_context("example");
/// ```
pub fn set_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.context = v.into();
self
}
/// Sets the value of [options][crate::model::LookupContextRequest::options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupContextRequest;
/// let x = LookupContextRequest::new().set_options([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_options<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for LookupContextRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.LookupContextRequest"
}
}
/// Modify Entry request using permissions in the source system.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ModifyEntryRequest {
/// Required. The project to which the request should be attributed in the
/// following form: `projects/{project}/locations/{location}`.
pub name: std::string::String,
/// Required. The entry to modify.
pub entry: std::option::Option<crate::model::Entry>,
/// Optional. Mask of fields to update. To update Aspects, the update_mask must
/// contain the value "aspects".
///
/// If the update_mask is empty, the service will update all modifiable fields
/// present in the request.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. If set to true, any aspects not specified in the request will be
/// deleted. The default is false.
pub delete_missing_aspects: bool,
/// Optional. The aspect keys which the service should modify. It supports
/// the following syntaxes:
///
/// * `<aspect_type_reference>` - matches an aspect of the given type and empty
/// path.
/// * `<aspect_type_reference>@path` - matches an aspect of the given type and
/// specified path. For example, to attach an aspect to a field that is
/// specified by the `schema` aspect, the path should have the format
/// `Schema.<field_name>`.
/// * `<aspect_type_reference>@*` - matches aspects of the given type for all
/// paths.
/// * `*@path` - matches aspects of all types on the given path.
///
/// The service will not remove existing aspects matching the syntax unless
/// `delete_missing_aspects` is set to true.
///
/// If this field is left empty, the service treats it as specifying
/// exactly those Aspects present in the request.
pub aspect_keys: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ModifyEntryRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::ModifyEntryRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// let x = ModifyEntryRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [entry][crate::model::ModifyEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = ModifyEntryRequest::new().set_entry(Entry::default()/* use setters */);
/// ```
pub fn set_entry<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry][crate::model::ModifyEntryRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = ModifyEntryRequest::new().set_or_clear_entry(Some(Entry::default()/* use setters */));
/// let x = ModifyEntryRequest::new().set_or_clear_entry(None::<Entry>);
/// ```
pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::ModifyEntryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// use wkt::FieldMask;
/// let x = ModifyEntryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::ModifyEntryRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// use wkt::FieldMask;
/// let x = ModifyEntryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = ModifyEntryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [delete_missing_aspects][crate::model::ModifyEntryRequest::delete_missing_aspects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// let x = ModifyEntryRequest::new().set_delete_missing_aspects(true);
/// ```
pub fn set_delete_missing_aspects<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.delete_missing_aspects = v.into();
self
}
/// Sets the value of [aspect_keys][crate::model::ModifyEntryRequest::aspect_keys].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ModifyEntryRequest;
/// let x = ModifyEntryRequest::new().set_aspect_keys(["a", "b", "c"]);
/// ```
pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_keys = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ModifyEntryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ModifyEntryRequest"
}
}
/// Lookup Context response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupContextResponse {
/// Pre-formatted block of text containing the context for the requested
/// resources.
pub context: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LookupContextResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [context][crate::model::LookupContextResponse::context].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupContextResponse;
/// let x = LookupContextResponse::new().set_context("example");
/// ```
pub fn set_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.context = v.into();
self
}
}
impl wkt::message::Message for LookupContextResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.LookupContextResponse"
}
}
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchEntriesRequest {
/// Required. The project to which the request should be attributed in the
/// following form: `projects/{project}/locations/global`.
pub name: std::string::String,
/// Required. The query against which entries in scope should be matched.
/// The query syntax is defined in [Search syntax for Dataplex Universal
/// Catalog](https://cloud.google.com/dataplex/docs/search-syntax).
pub query: std::string::String,
/// Optional. Number of results in the search page. If <=0, then defaults
/// to 10. Max limit for page_size is 1000. Throws an invalid argument for
/// page_size > 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `SearchEntries` call. Provide
/// this to retrieve the subsequent page.
pub page_token: std::string::String,
/// Optional. Specifies the ordering of results.
/// Supported values are:
///
/// * `relevance`
/// * `last_modified_timestamp`
/// * `last_modified_timestamp asc`
pub order_by: std::string::String,
/// Optional. The scope under which the search should be operating. It must
/// either be `organizations/<org_id>` or `projects/<project_ref>`. If it is
/// unspecified, it defaults to the organization where the project provided in
/// `name` is located.
pub scope: std::string::String,
/// Optional. Specifies whether the search should understand the meaning and
/// intent behind the query, rather than just matching keywords.
pub semantic_search: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchEntriesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::SearchEntriesRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [query][crate::model::SearchEntriesRequest::query].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_query("example");
/// ```
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
/// Sets the value of [page_size][crate::model::SearchEntriesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::SearchEntriesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [order_by][crate::model::SearchEntriesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
/// Sets the value of [scope][crate::model::SearchEntriesRequest::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_scope("example");
/// ```
pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.scope = v.into();
self
}
/// Sets the value of [semantic_search][crate::model::SearchEntriesRequest::semantic_search].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesRequest;
/// let x = SearchEntriesRequest::new().set_semantic_search(true);
/// ```
pub fn set_semantic_search<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.semantic_search = v.into();
self
}
}
impl wkt::message::Message for SearchEntriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.SearchEntriesRequest"
}
}
/// A single result of a SearchEntries request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchEntriesResult {
/// Linked resource name.
#[deprecated]
pub linked_resource: std::string::String,
#[allow(missing_docs)]
pub dataplex_entry: std::option::Option<crate::model::Entry>,
/// Snippets.
#[deprecated]
pub snippets: std::option::Option<crate::model::search_entries_result::Snippets>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchEntriesResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [linked_resource][crate::model::SearchEntriesResult::linked_resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResult;
/// let x = SearchEntriesResult::new().set_linked_resource("example");
/// ```
#[deprecated]
pub fn set_linked_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.linked_resource = v.into();
self
}
/// Sets the value of [dataplex_entry][crate::model::SearchEntriesResult::dataplex_entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResult;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = SearchEntriesResult::new().set_dataplex_entry(Entry::default()/* use setters */);
/// ```
pub fn set_dataplex_entry<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.dataplex_entry = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dataplex_entry][crate::model::SearchEntriesResult::dataplex_entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResult;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = SearchEntriesResult::new().set_or_clear_dataplex_entry(Some(Entry::default()/* use setters */));
/// let x = SearchEntriesResult::new().set_or_clear_dataplex_entry(None::<Entry>);
/// ```
pub fn set_or_clear_dataplex_entry<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.dataplex_entry = v.map(|x| x.into());
self
}
/// Sets the value of [snippets][crate::model::SearchEntriesResult::snippets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResult;
/// use google_cloud_dataplex_v1::model::search_entries_result::Snippets;
/// let x = SearchEntriesResult::new().set_snippets(Snippets::default()/* use setters */);
/// ```
#[deprecated]
pub fn set_snippets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::search_entries_result::Snippets>,
{
self.snippets = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [snippets][crate::model::SearchEntriesResult::snippets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResult;
/// use google_cloud_dataplex_v1::model::search_entries_result::Snippets;
/// let x = SearchEntriesResult::new().set_or_clear_snippets(Some(Snippets::default()/* use setters */));
/// let x = SearchEntriesResult::new().set_or_clear_snippets(None::<Snippets>);
/// ```
#[deprecated]
pub fn set_or_clear_snippets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::search_entries_result::Snippets>,
{
self.snippets = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SearchEntriesResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.SearchEntriesResult"
}
}
/// Defines additional types related to [SearchEntriesResult].
pub mod search_entries_result {
#[allow(unused_imports)]
use super::*;
/// Snippets for the entry, contains HTML-style highlighting for
/// matched tokens, will be used in UI.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct Snippets {
/// Entry
#[deprecated]
pub dataplex_entry: std::option::Option<crate::model::Entry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Snippets {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dataplex_entry][crate::model::search_entries_result::Snippets::dataplex_entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::search_entries_result::Snippets;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = Snippets::new().set_dataplex_entry(Entry::default()/* use setters */);
/// ```
#[deprecated]
pub fn set_dataplex_entry<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.dataplex_entry = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dataplex_entry][crate::model::search_entries_result::Snippets::dataplex_entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::search_entries_result::Snippets;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = Snippets::new().set_or_clear_dataplex_entry(Some(Entry::default()/* use setters */));
/// let x = Snippets::new().set_or_clear_dataplex_entry(None::<Entry>);
/// ```
#[deprecated]
pub fn set_or_clear_dataplex_entry<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.dataplex_entry = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Snippets {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.SearchEntriesResult.Snippets"
}
}
}
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchEntriesResponse {
/// The results matching the search query.
pub results: std::vec::Vec<crate::model::SearchEntriesResult>,
/// The estimated total number of matching entries. This number isn't
/// guaranteed to be accurate.
pub total_size: i32,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach. Search results don't include
/// data from these locations.
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchEntriesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [results][crate::model::SearchEntriesResponse::results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResponse;
/// use google_cloud_dataplex_v1::model::SearchEntriesResult;
/// let x = SearchEntriesResponse::new()
/// .set_results([
/// SearchEntriesResult::default()/* use setters */,
/// SearchEntriesResult::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SearchEntriesResult>,
{
use std::iter::Iterator;
self.results = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [total_size][crate::model::SearchEntriesResponse::total_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResponse;
/// let x = SearchEntriesResponse::new().set_total_size(42);
/// ```
pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
/// Sets the value of [next_page_token][crate::model::SearchEntriesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResponse;
/// let x = SearchEntriesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable][crate::model::SearchEntriesResponse::unreachable].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SearchEntriesResponse;
/// let x = SearchEntriesResponse::new().set_unreachable(["a", "b", "c"]);
/// ```
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SearchEntriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.SearchEntriesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchEntriesResponse {
type PageItem = crate::model::SearchEntriesResult;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.results
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// An object that describes the values that you want to set for an entry and its
/// attached aspects when you import metadata. Used when you run a metadata
/// import job. See
/// [CreateMetadataJob][google.cloud.dataplex.v1.CatalogService.CreateMetadataJob].
///
/// You provide a collection of import items in a metadata import file. For more
/// information about how to create a metadata import file, see [Metadata import
/// file](https://cloud.google.com/dataplex/docs/import-metadata#metadata-import-file).
///
/// [google.cloud.dataplex.v1.CatalogService.CreateMetadataJob]: crate::client::CatalogService::create_metadata_job
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportItem {
/// Information about an entry and its attached aspects.
pub entry: std::option::Option<crate::model::Entry>,
/// Information about the entry link. User should provide either one of the
/// entry or entry_link. While providing entry_link, user should not
/// provide update_mask and aspect_keys.
pub entry_link: std::option::Option<crate::model::EntryLink>,
/// The fields to update, in paths that are relative to the `Entry` resource.
/// Separate each field with a comma.
///
/// In `FULL` entry sync mode, Dataplex Universal Catalog includes the paths of
/// all of the fields for an entry that can be modified, including aspects.
/// This means that Dataplex Universal Catalog replaces the existing entry with
/// the entry in the metadata import file. All modifiable fields are updated,
/// regardless of the fields that are listed in the update mask, and regardless
/// of whether a field is present in the `entry` object.
///
/// The `update_mask` field is ignored when an entry is created or re-created.
///
/// In an aspect-only metadata job (when entry sync mode is `NONE`), set this
/// value to `aspects`.
///
/// Dataplex Universal Catalog also determines which entries and aspects to
/// modify by comparing the values and timestamps that you provide in the
/// metadata import file with the values and timestamps that exist in your
/// project. For more information, see [Comparison
/// logic](https://cloud.google.com/dataplex/docs/import-metadata#data-modification-logic).
pub update_mask: std::option::Option<wkt::FieldMask>,
/// The aspects to modify. Supports the following syntaxes:
///
/// * `{aspect_type_reference}`: matches aspects that belong to the specified
/// aspect type and are attached directly to the entry.
/// * `{aspect_type_reference}@{path}`: matches aspects that belong to the
/// specified aspect type and path.
/// * `{aspect_type_reference}@*` : matches aspects of the given type for all
/// paths.
/// * `*@path` : matches aspects of all types on the given path.
///
/// Replace `{aspect_type_reference}` with a reference to the aspect type, in
/// the format
/// `{project_id_or_number}.{location_id}.{aspect_type_id}`.
///
/// In `FULL` entry sync mode, if you leave this field empty, it is treated as
/// specifying exactly those aspects that are present within the specified
/// entry. Dataplex Universal Catalog implicitly adds the keys for all of the
/// required aspects of an entry.
pub aspect_keys: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportItem {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry][crate::model::ImportItem::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = ImportItem::new().set_entry(Entry::default()/* use setters */);
/// ```
pub fn set_entry<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry][crate::model::ImportItem::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// use google_cloud_dataplex_v1::model::Entry;
/// let x = ImportItem::new().set_or_clear_entry(Some(Entry::default()/* use setters */));
/// let x = ImportItem::new().set_or_clear_entry(None::<Entry>);
/// ```
pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entry>,
{
self.entry = v.map(|x| x.into());
self
}
/// Sets the value of [entry_link][crate::model::ImportItem::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = ImportItem::new().set_entry_link(EntryLink::default()/* use setters */);
/// ```
pub fn set_entry_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryLink>,
{
self.entry_link = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_link][crate::model::ImportItem::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = ImportItem::new().set_or_clear_entry_link(Some(EntryLink::default()/* use setters */));
/// let x = ImportItem::new().set_or_clear_entry_link(None::<EntryLink>);
/// ```
pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryLink>,
{
self.entry_link = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::ImportItem::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// use wkt::FieldMask;
/// let x = ImportItem::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::ImportItem::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// use wkt::FieldMask;
/// let x = ImportItem::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = ImportItem::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [aspect_keys][crate::model::ImportItem::aspect_keys].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ImportItem;
/// let x = ImportItem::new().set_aspect_keys(["a", "b", "c"]);
/// ```
pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_keys = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImportItem {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ImportItem"
}
}
/// Create metadata job request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMetadataJobRequest {
/// Required. The resource name of the parent location, in the format
/// `projects/{project_id_or_number}/locations/{location_id}`
pub parent: std::string::String,
/// Required. The metadata job resource.
pub metadata_job: std::option::Option<crate::model::MetadataJob>,
/// Optional. The metadata job ID. If not provided, a unique ID is generated
/// with the prefix `metadata-job-`.
pub metadata_job_id: std::string::String,
/// Optional. The service validates the request without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMetadataJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateMetadataJobRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataJobRequest;
/// let x = CreateMetadataJobRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [metadata_job][crate::model::CreateMetadataJobRequest::metadata_job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataJobRequest;
/// use google_cloud_dataplex_v1::model::MetadataJob;
/// let x = CreateMetadataJobRequest::new().set_metadata_job(MetadataJob::default()/* use setters */);
/// ```
pub fn set_metadata_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MetadataJob>,
{
self.metadata_job = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [metadata_job][crate::model::CreateMetadataJobRequest::metadata_job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataJobRequest;
/// use google_cloud_dataplex_v1::model::MetadataJob;
/// let x = CreateMetadataJobRequest::new().set_or_clear_metadata_job(Some(MetadataJob::default()/* use setters */));
/// let x = CreateMetadataJobRequest::new().set_or_clear_metadata_job(None::<MetadataJob>);
/// ```
pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MetadataJob>,
{
self.metadata_job = v.map(|x| x.into());
self
}
/// Sets the value of [metadata_job_id][crate::model::CreateMetadataJobRequest::metadata_job_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataJobRequest;
/// let x = CreateMetadataJobRequest::new().set_metadata_job_id("example");
/// ```
pub fn set_metadata_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.metadata_job_id = v.into();
self
}
/// Sets the value of [validate_only][crate::model::CreateMetadataJobRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataJobRequest;
/// let x = CreateMetadataJobRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateMetadataJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateMetadataJobRequest"
}
}
/// Get metadata job request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMetadataJobRequest {
/// Required. The resource name of the metadata job, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/metadataJobs/{metadata_job_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMetadataJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetMetadataJobRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetMetadataJobRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let metadata_job_id = "metadata_job_id";
/// let x = GetMetadataJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataJobs/{metadata_job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMetadataJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetMetadataJobRequest"
}
}
/// List metadata jobs request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMetadataJobsRequest {
/// Required. The resource name of the parent location, in the format
/// `projects/{project_id_or_number}/locations/{location_id}`
pub parent: std::string::String,
/// Optional. The maximum number of metadata jobs to return. The service might
/// return fewer jobs than this value. If unspecified, at most 10 jobs are
/// returned. The maximum value is 1,000.
pub page_size: i32,
/// Optional. The page token received from a previous `ListMetadataJobs` call.
/// Provide this token to retrieve the subsequent page of results. When
/// paginating, all other parameters that are provided to the
/// `ListMetadataJobs` request must match the call that provided the page
/// token.
pub page_token: std::string::String,
/// Optional. Filter request. Filters are case-sensitive.
/// The service supports the following formats:
///
/// * `labels.key1 = "value1"`
/// * `labels:key1`
/// * `name = "value"`
///
/// You can combine filters with `AND`, `OR`, and `NOT` operators.
pub filter: std::string::String,
/// Optional. The field to sort the results by, either `name` or `create_time`.
/// If not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMetadataJobsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListMetadataJobsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsRequest;
/// let x = ListMetadataJobsRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListMetadataJobsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsRequest;
/// let x = ListMetadataJobsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListMetadataJobsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsRequest;
/// let x = ListMetadataJobsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListMetadataJobsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsRequest;
/// let x = ListMetadataJobsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListMetadataJobsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsRequest;
/// let x = ListMetadataJobsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListMetadataJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListMetadataJobsRequest"
}
}
/// List metadata jobs response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMetadataJobsResponse {
/// Metadata jobs under the specified parent location.
pub metadata_jobs: std::vec::Vec<crate::model::MetadataJob>,
/// A token to retrieve the next page of results. If there are no more results
/// in the list, the value is empty.
pub next_page_token: std::string::String,
/// Locations that the service couldn't reach.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMetadataJobsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [metadata_jobs][crate::model::ListMetadataJobsResponse::metadata_jobs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsResponse;
/// use google_cloud_dataplex_v1::model::MetadataJob;
/// let x = ListMetadataJobsResponse::new()
/// .set_metadata_jobs([
/// MetadataJob::default()/* use setters */,
/// MetadataJob::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_metadata_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MetadataJob>,
{
use std::iter::Iterator;
self.metadata_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListMetadataJobsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsResponse;
/// let x = ListMetadataJobsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListMetadataJobsResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataJobsResponse;
/// let x = ListMetadataJobsResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListMetadataJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListMetadataJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMetadataJobsResponse {
type PageItem = crate::model::MetadataJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.metadata_jobs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Cancel metadata job request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelMetadataJobRequest {
/// Required. The resource name of the job, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/metadataJobs/{metadata_job_id}`
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelMetadataJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::CancelMetadataJobRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CancelMetadataJobRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let metadata_job_id = "metadata_job_id";
/// let x = CancelMetadataJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataJobs/{metadata_job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for CancelMetadataJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CancelMetadataJobRequest"
}
}
/// A metadata job resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetadataJob {
/// Output only. Identifier. The name of the resource that the configuration is
/// applied to, in the format
/// `projects/{project_number}/locations/{location_id}/metadataJobs/{metadata_job_id}`.
pub name: std::string::String,
/// Output only. A system-generated, globally unique ID for the metadata job.
/// If the metadata job is deleted and then re-created with the same name, this
/// ID is different.
pub uid: std::string::String,
/// Output only. The time when the metadata job was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the metadata job was updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User-defined labels.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Required. Metadata job type.
pub r#type: crate::model::metadata_job::Type,
/// Output only. Metadata job status.
pub status: std::option::Option<crate::model::metadata_job::Status>,
#[allow(missing_docs)]
pub spec: std::option::Option<crate::model::metadata_job::Spec>,
#[allow(missing_docs)]
pub result: std::option::Option<crate::model::metadata_job::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetadataJob {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::MetadataJob::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let metadata_job_id = "metadata_job_id";
/// let x = MetadataJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataJobs/{metadata_job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::MetadataJob::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// let x = MetadataJob::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::MetadataJob::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use wkt::Timestamp;
/// let x = MetadataJob::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::MetadataJob::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use wkt::Timestamp;
/// let x = MetadataJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = MetadataJob::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::MetadataJob::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use wkt::Timestamp;
/// let x = MetadataJob::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::MetadataJob::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use wkt::Timestamp;
/// let x = MetadataJob::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = MetadataJob::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::MetadataJob::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// let x = MetadataJob::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [r#type][crate::model::MetadataJob::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::Type;
/// let x0 = MetadataJob::new().set_type(Type::Import);
/// let x1 = MetadataJob::new().set_type(Type::Export);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::metadata_job::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [status][crate::model::MetadataJob::status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::Status;
/// let x = MetadataJob::new().set_status(Status::default()/* use setters */);
/// ```
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::metadata_job::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [status][crate::model::MetadataJob::status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::Status;
/// let x = MetadataJob::new().set_or_clear_status(Some(Status::default()/* use setters */));
/// let x = MetadataJob::new().set_or_clear_status(None::<Status>);
/// ```
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::metadata_job::Status>,
{
self.status = v.map(|x| x.into());
self
}
/// Sets the value of [spec][crate::model::MetadataJob::spec].
///
/// Note that all the setters affecting `spec` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// let x = MetadataJob::new().set_spec(Some(
/// google_cloud_dataplex_v1::model::metadata_job::Spec::ImportSpec(ImportJobSpec::default().into())));
/// ```
pub fn set_spec<
T: std::convert::Into<std::option::Option<crate::model::metadata_job::Spec>>,
>(
mut self,
v: T,
) -> Self {
self.spec = v.into();
self
}
/// The value of [spec][crate::model::MetadataJob::spec]
/// if it holds a `ImportSpec`, `None` if the field is not set or
/// holds a different branch.
pub fn import_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::metadata_job::ImportJobSpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::metadata_job::Spec::ImportSpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::MetadataJob::spec]
/// to hold a `ImportSpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// let x = MetadataJob::new().set_import_spec(ImportJobSpec::default()/* use setters */);
/// assert!(x.import_spec().is_some());
/// assert!(x.export_spec().is_none());
/// ```
pub fn set_import_spec<
T: std::convert::Into<std::boxed::Box<crate::model::metadata_job::ImportJobSpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::metadata_job::Spec::ImportSpec(v.into()));
self
}
/// The value of [spec][crate::model::MetadataJob::spec]
/// if it holds a `ExportSpec`, `None` if the field is not set or
/// holds a different branch.
pub fn export_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::metadata_job::ExportJobSpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::metadata_job::Spec::ExportSpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::MetadataJob::spec]
/// to hold a `ExportSpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::ExportJobSpec;
/// let x = MetadataJob::new().set_export_spec(ExportJobSpec::default()/* use setters */);
/// assert!(x.export_spec().is_some());
/// assert!(x.import_spec().is_none());
/// ```
pub fn set_export_spec<
T: std::convert::Into<std::boxed::Box<crate::model::metadata_job::ExportJobSpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::metadata_job::Spec::ExportSpec(v.into()));
self
}
/// Sets the value of [result][crate::model::MetadataJob::result].
///
/// Note that all the setters affecting `result` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = MetadataJob::new().set_result(Some(
/// google_cloud_dataplex_v1::model::metadata_job::Result::ImportResult(ImportJobResult::default().into())));
/// ```
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::metadata_job::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
/// The value of [result][crate::model::MetadataJob::result]
/// if it holds a `ImportResult`, `None` if the field is not set or
/// holds a different branch.
pub fn import_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::metadata_job::ImportJobResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::metadata_job::Result::ImportResult(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::MetadataJob::result]
/// to hold a `ImportResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = MetadataJob::new().set_import_result(ImportJobResult::default()/* use setters */);
/// assert!(x.import_result().is_some());
/// assert!(x.export_result().is_none());
/// ```
pub fn set_import_result<
T: std::convert::Into<std::boxed::Box<crate::model::metadata_job::ImportJobResult>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::metadata_job::Result::ImportResult(v.into()));
self
}
/// The value of [result][crate::model::MetadataJob::result]
/// if it holds a `ExportResult`, `None` if the field is not set or
/// holds a different branch.
pub fn export_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::metadata_job::ExportJobResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::metadata_job::Result::ExportResult(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::MetadataJob::result]
/// to hold a `ExportResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataJob;
/// use google_cloud_dataplex_v1::model::metadata_job::ExportJobResult;
/// let x = MetadataJob::new().set_export_result(ExportJobResult::default()/* use setters */);
/// assert!(x.export_result().is_some());
/// assert!(x.import_result().is_none());
/// ```
pub fn set_export_result<
T: std::convert::Into<std::boxed::Box<crate::model::metadata_job::ExportJobResult>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::metadata_job::Result::ExportResult(v.into()));
self
}
}
impl wkt::message::Message for MetadataJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob"
}
}
/// Defines additional types related to [MetadataJob].
pub mod metadata_job {
#[allow(unused_imports)]
use super::*;
/// Results from a metadata import job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportJobResult {
/// Output only. The total number of entries that were deleted.
pub deleted_entries: i64,
/// Output only. The total number of entries that were updated.
pub updated_entries: i64,
/// Output only. The total number of entries that were created.
pub created_entries: i64,
/// Output only. The total number of entries that were unchanged.
pub unchanged_entries: i64,
/// Output only. The total number of entries that were recreated.
pub recreated_entries: i64,
/// Output only. The time when the status was updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Output only. The total number of entry links that were successfully
/// deleted.
pub deleted_entry_links: i64,
/// Output only. The total number of entry links that were successfully
/// created.
pub created_entry_links: i64,
/// Output only. The total number of entry links that were left unchanged.
pub unchanged_entry_links: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportJobResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [deleted_entries][crate::model::metadata_job::ImportJobResult::deleted_entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_deleted_entries(42);
/// ```
pub fn set_deleted_entries<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.deleted_entries = v.into();
self
}
/// Sets the value of [updated_entries][crate::model::metadata_job::ImportJobResult::updated_entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_updated_entries(42);
/// ```
pub fn set_updated_entries<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.updated_entries = v.into();
self
}
/// Sets the value of [created_entries][crate::model::metadata_job::ImportJobResult::created_entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_created_entries(42);
/// ```
pub fn set_created_entries<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.created_entries = v.into();
self
}
/// Sets the value of [unchanged_entries][crate::model::metadata_job::ImportJobResult::unchanged_entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_unchanged_entries(42);
/// ```
pub fn set_unchanged_entries<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.unchanged_entries = v.into();
self
}
/// Sets the value of [recreated_entries][crate::model::metadata_job::ImportJobResult::recreated_entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_recreated_entries(42);
/// ```
pub fn set_recreated_entries<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.recreated_entries = v.into();
self
}
/// Sets the value of [update_time][crate::model::metadata_job::ImportJobResult::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// use wkt::Timestamp;
/// let x = ImportJobResult::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::metadata_job::ImportJobResult::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// use wkt::Timestamp;
/// let x = ImportJobResult::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = ImportJobResult::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [deleted_entry_links][crate::model::metadata_job::ImportJobResult::deleted_entry_links].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_deleted_entry_links(42);
/// ```
pub fn set_deleted_entry_links<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.deleted_entry_links = v.into();
self
}
/// Sets the value of [created_entry_links][crate::model::metadata_job::ImportJobResult::created_entry_links].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_created_entry_links(42);
/// ```
pub fn set_created_entry_links<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.created_entry_links = v.into();
self
}
/// Sets the value of [unchanged_entry_links][crate::model::metadata_job::ImportJobResult::unchanged_entry_links].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobResult;
/// let x = ImportJobResult::new().set_unchanged_entry_links(42);
/// ```
pub fn set_unchanged_entry_links<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.unchanged_entry_links = v.into();
self
}
}
impl wkt::message::Message for ImportJobResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.ImportJobResult"
}
}
/// Summary results from a metadata export job. The results are a snapshot of
/// the metadata at the time when the job was created. The exported entries are
/// saved to a Cloud Storage bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportJobResult {
/// Output only. The number of entries that were exported.
pub exported_entries: i64,
/// Output only. The error message if the metadata export job failed.
pub error_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportJobResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [exported_entries][crate::model::metadata_job::ExportJobResult::exported_entries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ExportJobResult;
/// let x = ExportJobResult::new().set_exported_entries(42);
/// ```
pub fn set_exported_entries<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.exported_entries = v.into();
self
}
/// Sets the value of [error_message][crate::model::metadata_job::ExportJobResult::error_message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ExportJobResult;
/// let x = ExportJobResult::new().set_error_message("example");
/// ```
pub fn set_error_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.error_message = v.into();
self
}
}
impl wkt::message::Message for ExportJobResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.ExportJobResult"
}
}
/// Job specification for a metadata import job.
///
/// You can run the following kinds of metadata import jobs:
///
/// * Full sync of entries with incremental import of their aspects.
/// Supported for custom entries.
/// * Incremental import of aspects only. Supported for aspects that belong
/// to custom entries and system entries. For custom entries, you can modify
/// both optional aspects and required aspects. For system entries, you can
/// modify optional aspects.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportJobSpec {
/// Optional. The URI of a Cloud Storage bucket or folder (beginning with
/// `gs://` and ending with `/`) that contains the metadata import files for
/// this job.
///
/// A metadata import file defines the values to set for each of the entries
/// and aspects in a metadata import job. For more information about how to
/// create a metadata import file and the file requirements, see [Metadata
/// import
/// file](https://cloud.google.com/dataplex/docs/import-metadata#metadata-import-file).
///
/// You can provide multiple metadata import files in the same metadata job.
/// The bucket or folder must contain at least one metadata import file, in
/// JSON Lines format (either `.json` or `.jsonl` file extension).
///
/// In `FULL` entry sync mode, don't save the metadata import file in a
/// folder named `SOURCE_STORAGE_URI/deletions/`.
///
/// **Caution**: If the metadata import file contains no data, all entries
/// and aspects that belong to the job's scope are deleted.
pub source_storage_uri: std::string::String,
/// Optional. The time when the process that created the metadata import
/// files began.
pub source_create_time: std::option::Option<wkt::Timestamp>,
/// Required. A boundary on the scope of impact that the metadata import job
/// can have.
pub scope: std::option::Option<crate::model::metadata_job::import_job_spec::ImportJobScope>,
/// Required. The sync mode for entries.
pub entry_sync_mode: crate::model::metadata_job::import_job_spec::SyncMode,
/// Required. The sync mode for aspects.
pub aspect_sync_mode: crate::model::metadata_job::import_job_spec::SyncMode,
/// Optional. The level of logs to write to Cloud Logging for this job.
///
/// Debug-level logs provide highly-detailed information for
/// troubleshooting, but their increased verbosity could incur [additional
/// costs](https://cloud.google.com/stackdriver/pricing) that might not be
/// merited for all jobs.
///
/// If unspecified, defaults to `INFO`.
pub log_level: crate::model::metadata_job::import_job_spec::LogLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportJobSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [source_storage_uri][crate::model::metadata_job::ImportJobSpec::source_storage_uri].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// let x = ImportJobSpec::new().set_source_storage_uri("example");
/// ```
pub fn set_source_storage_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_storage_uri = v.into();
self
}
/// Sets the value of [source_create_time][crate::model::metadata_job::ImportJobSpec::source_create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use wkt::Timestamp;
/// let x = ImportJobSpec::new().set_source_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_source_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.source_create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [source_create_time][crate::model::metadata_job::ImportJobSpec::source_create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use wkt::Timestamp;
/// let x = ImportJobSpec::new().set_or_clear_source_create_time(Some(Timestamp::default()/* use setters */));
/// let x = ImportJobSpec::new().set_or_clear_source_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_source_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.source_create_time = v.map(|x| x.into());
self
}
/// Sets the value of [scope][crate::model::metadata_job::ImportJobSpec::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobSpec::new().set_scope(ImportJobScope::default()/* use setters */);
/// ```
pub fn set_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::metadata_job::import_job_spec::ImportJobScope>,
{
self.scope = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scope][crate::model::metadata_job::ImportJobSpec::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobSpec::new().set_or_clear_scope(Some(ImportJobScope::default()/* use setters */));
/// let x = ImportJobSpec::new().set_or_clear_scope(None::<ImportJobScope>);
/// ```
pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::metadata_job::import_job_spec::ImportJobScope>,
{
self.scope = v.map(|x| x.into());
self
}
/// Sets the value of [entry_sync_mode][crate::model::metadata_job::ImportJobSpec::entry_sync_mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::SyncMode;
/// let x0 = ImportJobSpec::new().set_entry_sync_mode(SyncMode::Full);
/// let x1 = ImportJobSpec::new().set_entry_sync_mode(SyncMode::Incremental);
/// let x2 = ImportJobSpec::new().set_entry_sync_mode(SyncMode::None);
/// ```
pub fn set_entry_sync_mode<
T: std::convert::Into<crate::model::metadata_job::import_job_spec::SyncMode>,
>(
mut self,
v: T,
) -> Self {
self.entry_sync_mode = v.into();
self
}
/// Sets the value of [aspect_sync_mode][crate::model::metadata_job::ImportJobSpec::aspect_sync_mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::SyncMode;
/// let x0 = ImportJobSpec::new().set_aspect_sync_mode(SyncMode::Full);
/// let x1 = ImportJobSpec::new().set_aspect_sync_mode(SyncMode::Incremental);
/// let x2 = ImportJobSpec::new().set_aspect_sync_mode(SyncMode::None);
/// ```
pub fn set_aspect_sync_mode<
T: std::convert::Into<crate::model::metadata_job::import_job_spec::SyncMode>,
>(
mut self,
v: T,
) -> Self {
self.aspect_sync_mode = v.into();
self
}
/// Sets the value of [log_level][crate::model::metadata_job::ImportJobSpec::log_level].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ImportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::LogLevel;
/// let x0 = ImportJobSpec::new().set_log_level(LogLevel::Debug);
/// let x1 = ImportJobSpec::new().set_log_level(LogLevel::Info);
/// ```
pub fn set_log_level<
T: std::convert::Into<crate::model::metadata_job::import_job_spec::LogLevel>,
>(
mut self,
v: T,
) -> Self {
self.log_level = v.into();
self
}
}
impl wkt::message::Message for ImportJobSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.ImportJobSpec"
}
}
/// Defines additional types related to [ImportJobSpec].
pub mod import_job_spec {
#[allow(unused_imports)]
use super::*;
/// A boundary on the scope of impact that the metadata import job can have.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportJobScope {
/// Required. The entry groups that are in scope for the import job,
/// specified as relative resource names in the format
/// `projects/{project_number_or_id}/locations/{location_id}/entryGroups/{entry_group_id}`.
/// Only entries and aspects that belong to the specified entry groups are
/// affected by the job.
///
/// The entry groups and the job must be in the same location.
pub entry_groups: std::vec::Vec<std::string::String>,
/// Required. The entry types that are in scope for the import job,
/// specified as relative resource names in the format
/// `projects/{project_number_or_id}/locations/{location_id}/entryTypes/{entry_type_id}`.
/// The job modifies only the entries and aspects that belong to these
/// entry types.
///
/// If the metadata import file attempts to modify an entry whose type
/// isn't included in this list, the import job is halted before modifying
/// any entries or aspects.
///
/// The location of an entry type must either match the location of the
/// job, or the entry type must be global.
pub entry_types: std::vec::Vec<std::string::String>,
/// Optional. The aspect types that are in scope for the import job,
/// specified as relative resource names in the format
/// `projects/{project_number_or_id}/locations/{location_id}/aspectTypes/{aspect_type_id}`.
/// The job modifies only the aspects that belong to these aspect types.
///
/// This field is required when creating an aspect-only import job.
///
/// If the metadata import file attempts to modify an aspect whose type
/// isn't included in this list, the import job is halted before modifying
/// any entries or aspects.
///
/// The location of an aspect type must either match the location of the
/// job, or the aspect type must be global.
pub aspect_types: std::vec::Vec<std::string::String>,
/// Optional. The glossaries that are in scope for the import job,
/// specified as relative resource names in the format
/// `projects/{project_number_or_id}/locations/{location_id}/glossaries/{glossary_id}`.
///
/// While importing Business Glossary entries, the user must
/// provide glossaries. While importing entries, the user does not have to
/// provide glossaries. If the metadata import file attempts to modify
/// Business Glossary entries whose glossary isn't included in this list,
/// the import job will skip those entries.
///
/// The location of a glossary must either match the location of the
/// job, or the glossary must be global.
pub glossaries: std::vec::Vec<std::string::String>,
/// Optional. The entry link types that are in scope for the import job,
/// specified as relative resource names in the format
/// `projects/{project_number_or_id}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`.
/// The job modifies only the entryLinks that belong to these entry link
/// types.
///
/// If the metadata import file attempts to create or delete an entry link
/// whose entry link type isn't included in this list, the import job will
/// skip those entry links.
pub entry_link_types: std::vec::Vec<std::string::String>,
/// Optional. Defines the scope of entries that can be referenced in the
/// entry links.
///
/// Currently, projects are supported as valid scopes.
/// Format: `projects/{project_number_or_id}`
///
/// If the metadata import file attempts to create an entry link
/// which references an entry that is not in the scope, the import job will
/// skip that entry link.
pub referenced_entry_scopes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportJobScope {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_groups][crate::model::metadata_job::import_job_spec::ImportJobScope::entry_groups].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobScope::new().set_entry_groups(["a", "b", "c"]);
/// ```
pub fn set_entry_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_groups = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [entry_types][crate::model::metadata_job::import_job_spec::ImportJobScope::entry_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobScope::new().set_entry_types(["a", "b", "c"]);
/// ```
pub fn set_entry_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [aspect_types][crate::model::metadata_job::import_job_spec::ImportJobScope::aspect_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobScope::new().set_aspect_types(["a", "b", "c"]);
/// ```
pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [glossaries][crate::model::metadata_job::import_job_spec::ImportJobScope::glossaries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobScope::new().set_glossaries(["a", "b", "c"]);
/// ```
pub fn set_glossaries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.glossaries = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [entry_link_types][crate::model::metadata_job::import_job_spec::ImportJobScope::entry_link_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobScope::new().set_entry_link_types(["a", "b", "c"]);
/// ```
pub fn set_entry_link_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_link_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [referenced_entry_scopes][crate::model::metadata_job::import_job_spec::ImportJobScope::referenced_entry_scopes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::import_job_spec::ImportJobScope;
/// let x = ImportJobScope::new().set_referenced_entry_scopes(["a", "b", "c"]);
/// ```
pub fn set_referenced_entry_scopes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.referenced_entry_scopes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImportJobScope {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.ImportJobSpec.ImportJobScope"
}
}
/// Specifies how the entries and aspects in a metadata import job are
/// updated. For more information, see [Sync
/// mode](https://cloud.google.com/dataplex/docs/import-metadata#sync-mode).
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SyncMode {
/// Sync mode unspecified.
Unspecified,
/// All resources in the job's scope are modified. If a resource exists in
/// Dataplex Universal Catalog but isn't included in the metadata import
/// file, the resource is deleted when you run the metadata job. Use this
/// mode to perform a full sync of the set of entries in the job scope.
///
/// This sync mode is supported for entries.
Full,
/// Only the resources that are explicitly included in the
/// metadata import file are modified. Use this mode to modify a subset of
/// resources while leaving unreferenced resources unchanged.
///
/// This sync mode is supported for aspects.
Incremental,
/// If entry sync mode is `NONE`, then aspects are modified according
/// to the aspect sync mode. Other metadata that belongs to entries in the
/// job's scope isn't modified.
///
/// This sync mode is supported for entries.
None,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [SyncMode::value] or
/// [SyncMode::name].
UnknownValue(sync_mode::UnknownValue),
}
#[doc(hidden)]
pub mod sync_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SyncMode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Full => std::option::Option::Some(1),
Self::Incremental => std::option::Option::Some(2),
Self::None => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SYNC_MODE_UNSPECIFIED"),
Self::Full => std::option::Option::Some("FULL"),
Self::Incremental => std::option::Option::Some("INCREMENTAL"),
Self::None => std::option::Option::Some("NONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SyncMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SyncMode {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SyncMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Full,
2 => Self::Incremental,
3 => Self::None,
_ => Self::UnknownValue(sync_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SyncMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
"FULL" => Self::Full,
"INCREMENTAL" => Self::Incremental,
"NONE" => Self::None,
_ => Self::UnknownValue(sync_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SyncMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Full => serializer.serialize_i32(1),
Self::Incremental => serializer.serialize_i32(2),
Self::None => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SyncMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SyncMode>::new(
".google.cloud.dataplex.v1.MetadataJob.ImportJobSpec.SyncMode",
))
}
}
/// The level of logs to write to Cloud Logging for this job.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LogLevel {
/// Log level unspecified.
Unspecified,
/// Debug-level logging. Captures detailed logs for each import item. Use
/// debug-level logging to troubleshoot issues with specific import items.
/// For example, use debug-level logging to identify resources that are
/// missing from the job scope, entries or aspects that don't conform to
/// the associated entry type or aspect type, or other misconfigurations
/// with the metadata import file.
///
/// Depending on the size of your metadata job and the number of logs that
/// are generated, debug-level logging might incur
/// [additional costs](https://cloud.google.com/stackdriver/pricing).
Debug,
/// Info-level logging. Captures logs at the overall job level. Includes
/// aggregate logs about import items, but doesn't specify which import
/// item has an error.
Info,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [LogLevel::value] or
/// [LogLevel::name].
UnknownValue(log_level::UnknownValue),
}
#[doc(hidden)]
pub mod log_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LogLevel {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Debug => std::option::Option::Some(1),
Self::Info => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LOG_LEVEL_UNSPECIFIED"),
Self::Debug => std::option::Option::Some("DEBUG"),
Self::Info => std::option::Option::Some("INFO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LogLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LogLevel {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LogLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Debug,
2 => Self::Info,
_ => Self::UnknownValue(log_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LogLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LOG_LEVEL_UNSPECIFIED" => Self::Unspecified,
"DEBUG" => Self::Debug,
"INFO" => Self::Info,
_ => Self::UnknownValue(log_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LogLevel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Debug => serializer.serialize_i32(1),
Self::Info => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LogLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogLevel>::new(
".google.cloud.dataplex.v1.MetadataJob.ImportJobSpec.LogLevel",
))
}
}
}
/// Job specification for a metadata export job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportJobSpec {
/// Required. The scope of the export job.
pub scope: std::option::Option<crate::model::metadata_job::export_job_spec::ExportJobScope>,
/// Required. The root path of the Cloud Storage bucket to export the
/// metadata to, in the format `gs://{bucket}/`. You can optionally specify a
/// custom prefix after the bucket name, in the format
/// `gs://{bucket}/{prefix}/`. The maximum length of the custom prefix is 128
/// characters. Dataplex Universal Catalog constructs the object path for the
/// exported files by using the bucket name and prefix that you provide,
/// followed by a system-generated path.
///
/// The bucket must be in the same VPC Service Controls perimeter as the job.
pub output_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportJobSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [scope][crate::model::metadata_job::ExportJobSpec::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ExportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobSpec::new().set_scope(ExportJobScope::default()/* use setters */);
/// ```
pub fn set_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::metadata_job::export_job_spec::ExportJobScope>,
{
self.scope = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scope][crate::model::metadata_job::ExportJobSpec::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ExportJobSpec;
/// use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobSpec::new().set_or_clear_scope(Some(ExportJobScope::default()/* use setters */));
/// let x = ExportJobSpec::new().set_or_clear_scope(None::<ExportJobScope>);
/// ```
pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::metadata_job::export_job_spec::ExportJobScope>,
{
self.scope = v.map(|x| x.into());
self
}
/// Sets the value of [output_path][crate::model::metadata_job::ExportJobSpec::output_path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::ExportJobSpec;
/// let x = ExportJobSpec::new().set_output_path("example");
/// ```
pub fn set_output_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_path = v.into();
self
}
}
impl wkt::message::Message for ExportJobSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.ExportJobSpec"
}
}
/// Defines additional types related to [ExportJobSpec].
pub mod export_job_spec {
#[allow(unused_imports)]
use super::*;
/// The scope of the export job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportJobScope {
/// Whether the metadata export job is an organization-level export job.
///
/// - If `true`, the job exports the entries from the same organization and
/// VPC Service Controls perimeter as the job. The project that the job
/// belongs to determines the VPC Service Controls perimeter. If you set
/// the job scope to be at the organization level, then don't provide a
/// list of projects or entry groups.
/// - If `false`, you must specify a list of projects or a list of entry
/// groups whose entries you want to export.
///
/// The default is `false`.
pub organization_level: bool,
/// The projects whose metadata you want to export, in the format
/// `projects/{project_id_or_number}`. Only the entries from
/// the specified projects are exported.
///
/// The projects must be in the same organization and VPC Service Controls
/// perimeter as the job.
///
/// If you set the job scope to be a list of projects, then set the
/// organization-level export flag to false and don't provide a list of
/// entry groups.
pub projects: std::vec::Vec<std::string::String>,
/// The entry groups whose metadata you want to export, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}`.
/// Only the entries in the specified entry groups are exported.
///
/// The entry groups must be in the same location and the same VPC Service
/// Controls perimeter as the job.
///
/// If you set the job scope to be a list of entry groups, then set the
/// organization-level export flag to false and don't provide a list of
/// projects.
pub entry_groups: std::vec::Vec<std::string::String>,
/// The entry types that are in scope for the export job, specified as
/// relative resource names in the format
/// `projects/{project_id_or_number}/locations/{location}/entryTypes/{entry_type_id}`.
/// Only entries that belong to the specified entry types are affected by
/// the job.
pub entry_types: std::vec::Vec<std::string::String>,
/// The aspect types that are in scope for the export job, specified as
/// relative resource names in the format
/// `projects/{project_id_or_number}/locations/{location}/aspectTypes/{aspect_type_id}`.
/// Only aspects that belong to the specified aspect types are affected by
/// the job.
pub aspect_types: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportJobScope {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [organization_level][crate::model::metadata_job::export_job_spec::ExportJobScope::organization_level].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobScope::new().set_organization_level(true);
/// ```
pub fn set_organization_level<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.organization_level = v.into();
self
}
/// Sets the value of [projects][crate::model::metadata_job::export_job_spec::ExportJobScope::projects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobScope::new().set_projects(["a", "b", "c"]);
/// ```
pub fn set_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.projects = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [entry_groups][crate::model::metadata_job::export_job_spec::ExportJobScope::entry_groups].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobScope::new().set_entry_groups(["a", "b", "c"]);
/// ```
pub fn set_entry_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_groups = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [entry_types][crate::model::metadata_job::export_job_spec::ExportJobScope::entry_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobScope::new().set_entry_types(["a", "b", "c"]);
/// ```
pub fn set_entry_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [aspect_types][crate::model::metadata_job::export_job_spec::ExportJobScope::aspect_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::export_job_spec::ExportJobScope;
/// let x = ExportJobScope::new().set_aspect_types(["a", "b", "c"]);
/// ```
pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ExportJobScope {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.ExportJobSpec.ExportJobScope"
}
}
}
/// Metadata job status.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Status {
/// Output only. State of the metadata job.
pub state: crate::model::metadata_job::status::State,
/// Output only. Message relating to the progression of a metadata job.
pub message: std::string::String,
/// Output only. Progress tracking.
pub completion_percent: i32,
/// Output only. The time when the status was updated.
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Status {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::metadata_job::Status::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::Status;
/// use google_cloud_dataplex_v1::model::metadata_job::status::State;
/// let x0 = Status::new().set_state(State::Queued);
/// let x1 = Status::new().set_state(State::Running);
/// let x2 = Status::new().set_state(State::Canceling);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::metadata_job::status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::metadata_job::Status::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::Status;
/// let x = Status::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [completion_percent][crate::model::metadata_job::Status::completion_percent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::Status;
/// let x = Status::new().set_completion_percent(42);
/// ```
pub fn set_completion_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.completion_percent = v.into();
self
}
/// Sets the value of [update_time][crate::model::metadata_job::Status::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::Status;
/// use wkt::Timestamp;
/// let x = Status::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::metadata_job::Status::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_job::Status;
/// use wkt::Timestamp;
/// let x = Status::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Status::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Status {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataJob.Status"
}
}
/// Defines additional types related to [Status].
pub mod status {
#[allow(unused_imports)]
use super::*;
/// State of a metadata job.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// State unspecified.
Unspecified,
/// The job is queued.
Queued,
/// The job is running.
Running,
/// The job is being canceled.
Canceling,
/// The job is canceled.
Canceled,
/// The job succeeded.
Succeeded,
/// The job failed.
Failed,
/// The job completed with some errors.
SucceededWithErrors,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Queued => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Canceling => std::option::Option::Some(3),
Self::Canceled => std::option::Option::Some(4),
Self::Succeeded => std::option::Option::Some(5),
Self::Failed => std::option::Option::Some(6),
Self::SucceededWithErrors => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Queued => std::option::Option::Some("QUEUED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Canceling => std::option::Option::Some("CANCELING"),
Self::Canceled => std::option::Option::Some("CANCELED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::SucceededWithErrors => std::option::Option::Some("SUCCEEDED_WITH_ERRORS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Queued,
2 => Self::Running,
3 => Self::Canceling,
4 => Self::Canceled,
5 => Self::Succeeded,
6 => Self::Failed,
7 => Self::SucceededWithErrors,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"QUEUED" => Self::Queued,
"RUNNING" => Self::Running,
"CANCELING" => Self::Canceling,
"CANCELED" => Self::Canceled,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"SUCCEEDED_WITH_ERRORS" => Self::SucceededWithErrors,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Queued => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Canceling => serializer.serialize_i32(3),
Self::Canceled => serializer.serialize_i32(4),
Self::Succeeded => serializer.serialize_i32(5),
Self::Failed => serializer.serialize_i32(6),
Self::SucceededWithErrors => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.MetadataJob.Status.State",
))
}
}
}
/// Metadata job type.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Unspecified.
Unspecified,
/// Import job.
Import,
/// Export job.
Export,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Import => std::option::Option::Some(1),
Self::Export => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Import => std::option::Option::Some("IMPORT"),
Self::Export => std::option::Option::Some("EXPORT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Import,
2 => Self::Export,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"IMPORT" => Self::Import,
"EXPORT" => Self::Export,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Import => serializer.serialize_i32(1),
Self::Export => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.MetadataJob.Type",
))
}
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Spec {
/// Import job specification.
ImportSpec(std::boxed::Box<crate::model::metadata_job::ImportJobSpec>),
/// Export job specification.
ExportSpec(std::boxed::Box<crate::model::metadata_job::ExportJobSpec>),
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
/// Output only. Import job result.
ImportResult(std::boxed::Box<crate::model::metadata_job::ImportJobResult>),
/// Output only. Export job result.
ExportResult(std::boxed::Box<crate::model::metadata_job::ExportJobResult>),
}
}
/// EntryLink represents a link between two Entries.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntryLink {
/// Output only. Immutable. Identifier. The relative resource name of the Entry
/// Link, of the form:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
pub name: std::string::String,
/// Required. Immutable. Relative resource name of the Entry Link Type used to
/// create this Entry Link. For example:
///
/// - Entry link between synonym terms in a glossary:
/// `projects/dataplex-types/locations/global/entryLinkTypes/synonym`
/// - Entry link between related terms in a glossary:
/// `projects/dataplex-types/locations/global/entryLinkTypes/related`
/// - Entry link between glossary terms and data assets:
/// `projects/dataplex-types/locations/global/entryLinkTypes/definition`
pub entry_link_type: std::string::String,
/// Output only. The time when the Entry Link was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the Entry Link was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. The aspects that are attached to the entry link.
/// The format of the aspect key has to be the following:
/// `{project_id_or_number}.{location_id}.{aspect_type_id}`
/// Currently, only a single aspect of a Dataplex-owned Aspect Type is allowed.
pub aspects: std::collections::HashMap<std::string::String, crate::model::Aspect>,
/// Required. Immutable. Specifies the Entries referenced in the Entry Link.
/// There should be exactly two entry references.
pub entry_references: std::vec::Vec<crate::model::entry_link::EntryReference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntryLink {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::EntryLink::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_link_id = "entry_link_id";
/// let x = EntryLink::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [entry_link_type][crate::model::EntryLink::entry_link_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// let x = EntryLink::new().set_entry_link_type("example");
/// ```
pub fn set_entry_link_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_link_type = v.into();
self
}
/// Sets the value of [create_time][crate::model::EntryLink::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// use wkt::Timestamp;
/// let x = EntryLink::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::EntryLink::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// use wkt::Timestamp;
/// let x = EntryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = EntryLink::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::EntryLink::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// use wkt::Timestamp;
/// let x = EntryLink::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::EntryLink::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// use wkt::Timestamp;
/// let x = EntryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = EntryLink::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [aspects][crate::model::EntryLink::aspects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// use google_cloud_dataplex_v1::model::Aspect;
/// let x = EntryLink::new().set_aspects([
/// ("key0", Aspect::default()/* use setters */),
/// ("key1", Aspect::default()/* use (different) setters */),
/// ]);
/// ```
pub fn set_aspects<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::Aspect>,
{
use std::iter::Iterator;
self.aspects = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [entry_references][crate::model::EntryLink::entry_references].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLink;
/// use google_cloud_dataplex_v1::model::entry_link::EntryReference;
/// let x = EntryLink::new()
/// .set_entry_references([
/// EntryReference::default()/* use setters */,
/// EntryReference::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_entry_references<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::entry_link::EntryReference>,
{
use std::iter::Iterator;
self.entry_references = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for EntryLink {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryLink"
}
}
/// Defines additional types related to [EntryLink].
pub mod entry_link {
#[allow(unused_imports)]
use super::*;
/// Reference to the Entry that is linked through the Entry Link.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntryReference {
/// Required. Immutable. The relative resource name of the referenced Entry,
/// of the form:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
pub name: std::string::String,
/// Immutable. The path in the Entry that is referenced in the Entry Link.
/// Empty path denotes that the Entry itself is referenced in the Entry
/// Link.
pub path: std::string::String,
/// Required. Immutable. The reference type of the Entry.
pub r#type: crate::model::entry_link::entry_reference::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntryReference {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::entry_link::EntryReference::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_link::EntryReference;
/// let x = EntryReference::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [path][crate::model::entry_link::EntryReference::path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_link::EntryReference;
/// let x = EntryReference::new().set_path("example");
/// ```
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
/// Sets the value of [r#type][crate::model::entry_link::EntryReference::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entry_link::EntryReference;
/// use google_cloud_dataplex_v1::model::entry_link::entry_reference::Type;
/// let x0 = EntryReference::new().set_type(Type::Source);
/// let x1 = EntryReference::new().set_type(Type::Target);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::entry_link::entry_reference::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for EntryReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryLink.EntryReference"
}
}
/// Defines additional types related to [EntryReference].
pub mod entry_reference {
#[allow(unused_imports)]
use super::*;
/// Reference type of the Entry.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Unspecified reference type. Implies that the Entry is referenced
/// in a non-directional Entry Link.
Unspecified,
/// The Entry is referenced as the source of the directional Entry Link.
Source,
/// The Entry is referenced as the target of the directional Entry Link.
Target,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Source => std::option::Option::Some(2),
Self::Target => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
Self::Source => std::option::Option::Some("SOURCE"),
Self::Target => std::option::Option::Some("TARGET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Source,
3 => Self::Target,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNSPECIFIED" => Self::Unspecified,
"SOURCE" => Self::Source,
"TARGET" => Self::Target,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Source => serializer.serialize_i32(2),
Self::Target => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.EntryLink.EntryReference.Type",
))
}
}
}
}
/// Request message for CreateEntryLink.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEntryLinkRequest {
/// Required. The resource name of the parent Entry Group:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}`.
pub parent: std::string::String,
/// Required. Entry Link identifier
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must be between 1-63 characters.
/// * Must end with a number or a letter.
/// * Must be unique within the EntryGroup.
pub entry_link_id: std::string::String,
/// Required. Entry Link resource.
pub entry_link: std::option::Option<crate::model::EntryLink>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEntryLinkRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateEntryLinkRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryLinkRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// let x = CreateEntryLinkRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [entry_link_id][crate::model::CreateEntryLinkRequest::entry_link_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryLinkRequest;
/// let x = CreateEntryLinkRequest::new().set_entry_link_id("example");
/// ```
pub fn set_entry_link_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_link_id = v.into();
self
}
/// Sets the value of [entry_link][crate::model::CreateEntryLinkRequest::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryLinkRequest;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = CreateEntryLinkRequest::new().set_entry_link(EntryLink::default()/* use setters */);
/// ```
pub fn set_entry_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryLink>,
{
self.entry_link = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_link][crate::model::CreateEntryLinkRequest::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntryLinkRequest;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = CreateEntryLinkRequest::new().set_or_clear_entry_link(Some(EntryLink::default()/* use setters */));
/// let x = CreateEntryLinkRequest::new().set_or_clear_entry_link(None::<EntryLink>);
/// ```
pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryLink>,
{
self.entry_link = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateEntryLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateEntryLinkRequest"
}
}
/// Request message for UpdateEntryLink method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEntryLinkRequest {
/// Required. Entry Link resource.
pub entry_link: std::option::Option<crate::model::EntryLink>,
/// Optional. If set to true and the entry link doesn't exist, the service will
/// create it.
pub allow_missing: bool,
/// Optional. The map keys of the Aspects which the service should modify.
/// It should be the aspect type reference in the format
/// `{project_id_or_number}.{location_id}.{aspect_type_id}`.
///
/// If this field is left empty, the service treats it as specifying
/// exactly those Aspects present in the request.
pub aspect_keys: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEntryLinkRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_link][crate::model::UpdateEntryLinkRequest::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryLinkRequest;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = UpdateEntryLinkRequest::new().set_entry_link(EntryLink::default()/* use setters */);
/// ```
pub fn set_entry_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EntryLink>,
{
self.entry_link = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entry_link][crate::model::UpdateEntryLinkRequest::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryLinkRequest;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = UpdateEntryLinkRequest::new().set_or_clear_entry_link(Some(EntryLink::default()/* use setters */));
/// let x = UpdateEntryLinkRequest::new().set_or_clear_entry_link(None::<EntryLink>);
/// ```
pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EntryLink>,
{
self.entry_link = v.map(|x| x.into());
self
}
/// Sets the value of [allow_missing][crate::model::UpdateEntryLinkRequest::allow_missing].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryLinkRequest;
/// let x = UpdateEntryLinkRequest::new().set_allow_missing(true);
/// ```
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
/// Sets the value of [aspect_keys][crate::model::UpdateEntryLinkRequest::aspect_keys].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntryLinkRequest;
/// let x = UpdateEntryLinkRequest::new().set_aspect_keys(["a", "b", "c"]);
/// ```
pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_keys = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UpdateEntryLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateEntryLinkRequest"
}
}
/// Request message for DeleteEntryLink.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEntryLinkRequest {
/// Required. The resource name of the Entry Link:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEntryLinkRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteEntryLinkRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntryLinkRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_link_id = "entry_link_id";
/// let x = DeleteEntryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteEntryLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteEntryLinkRequest"
}
}
/// Request message for LookupEntryLinks.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupEntryLinksRequest {
/// Required. The project to which the request should be attributed to
/// Format: `projects/{project_id_or_number}/locations/{location_id}`.
pub name: std::string::String,
/// Required. The resource name of the referred Entry.
/// Format:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`.
/// Entry Links which references this entry will be returned in the response.
pub entry: std::string::String,
/// Mode of entry reference.
pub entry_mode: crate::model::lookup_entry_links_request::EntryMode,
/// Entry link types to filter the response by. If empty, all entry link types
/// will be returned. At most 10 entry link types can be specified.
pub entry_link_types: std::vec::Vec<std::string::String>,
/// Maximum number of EntryLinks to return. The service may return fewer
/// than this value. If unspecified, at most 10 EntryLinks will be returned.
/// The maximum value is 10; values above 10 will be coerced to 10.
pub page_size: i32,
/// Page token received from a previous `LookupEntryLinks` call. Provide this
/// to retrieve the subsequent page. When paginating, all other parameters that
/// are provided to the `LookupEntryLinks` request must match the call that
/// provided the page token.
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LookupEntryLinksRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::LookupEntryLinksRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksRequest;
/// let x = LookupEntryLinksRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [entry][crate::model::LookupEntryLinksRequest::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_id = "entry_id";
/// let x = LookupEntryLinksRequest::new().set_entry(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"));
/// ```
pub fn set_entry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry = v.into();
self
}
/// Sets the value of [entry_mode][crate::model::LookupEntryLinksRequest::entry_mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksRequest;
/// use google_cloud_dataplex_v1::model::lookup_entry_links_request::EntryMode;
/// let x0 = LookupEntryLinksRequest::new().set_entry_mode(EntryMode::Source);
/// let x1 = LookupEntryLinksRequest::new().set_entry_mode(EntryMode::Target);
/// ```
pub fn set_entry_mode<
T: std::convert::Into<crate::model::lookup_entry_links_request::EntryMode>,
>(
mut self,
v: T,
) -> Self {
self.entry_mode = v.into();
self
}
/// Sets the value of [entry_link_types][crate::model::LookupEntryLinksRequest::entry_link_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksRequest;
/// let x = LookupEntryLinksRequest::new().set_entry_link_types(["a", "b", "c"]);
/// ```
pub fn set_entry_link_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_link_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [page_size][crate::model::LookupEntryLinksRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksRequest;
/// let x = LookupEntryLinksRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::LookupEntryLinksRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksRequest;
/// let x = LookupEntryLinksRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for LookupEntryLinksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.LookupEntryLinksRequest"
}
}
/// Defines additional types related to [LookupEntryLinksRequest].
pub mod lookup_entry_links_request {
#[allow(unused_imports)]
use super::*;
/// Mode of entry reference.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntryMode {
/// Unspecified entry mode. Returns both directional and non-directional
/// entry links which references the entry.
Unspecified,
/// Returns all directed entry links which references the entry as source.
Source,
/// Return all directed entry links which references the entry as target.
Target,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EntryMode::value] or
/// [EntryMode::name].
UnknownValue(entry_mode::UnknownValue),
}
#[doc(hidden)]
pub mod entry_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntryMode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Source => std::option::Option::Some(1),
Self::Target => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENTRY_MODE_UNSPECIFIED"),
Self::Source => std::option::Option::Some("SOURCE"),
Self::Target => std::option::Option::Some("TARGET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntryMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntryMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EntryMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Source,
2 => Self::Target,
_ => Self::UnknownValue(entry_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntryMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTRY_MODE_UNSPECIFIED" => Self::Unspecified,
"SOURCE" => Self::Source,
"TARGET" => Self::Target,
_ => Self::UnknownValue(entry_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntryMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Source => serializer.serialize_i32(1),
Self::Target => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntryMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntryMode>::new(
".google.cloud.dataplex.v1.LookupEntryLinksRequest.EntryMode",
))
}
}
}
/// Response message for LookupEntryLinks.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupEntryLinksResponse {
/// List of entry links that reference the specified entry.
pub entry_links: std::vec::Vec<crate::model::EntryLink>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LookupEntryLinksResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_links][crate::model::LookupEntryLinksResponse::entry_links].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksResponse;
/// use google_cloud_dataplex_v1::model::EntryLink;
/// let x = LookupEntryLinksResponse::new()
/// .set_entry_links([
/// EntryLink::default()/* use setters */,
/// EntryLink::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_entry_links<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntryLink>,
{
use std::iter::Iterator;
self.entry_links = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::LookupEntryLinksResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::LookupEntryLinksResponse;
/// let x = LookupEntryLinksResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for LookupEntryLinksResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.LookupEntryLinksResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for LookupEntryLinksResponse {
type PageItem = crate::model::EntryLink;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.entry_links
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Request message for GetEntryLink.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEntryLinkRequest {
/// Required. The resource name of the Entry Link:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEntryLinkRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetEntryLinkRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntryLinkRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_link_id = "entry_link_id";
/// let x = GetEntryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetEntryLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetEntryLinkRequest"
}
}
/// MetadataFeed contains information related to the metadata feed.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetadataFeed {
/// Identifier. The resource name of the metadata feed, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/metadataFeeds/{metadata_feed_id}`.
pub name: std::string::String,
/// Output only. A system-generated, globally unique ID for the metadata job.
/// If the metadata job is deleted and then re-created with the same name, this
/// ID is different.
pub uid: std::string::String,
/// Required. The scope of the metadata feed.
/// Only the in scope changes are published.
pub scope: std::option::Option<crate::model::metadata_feed::Scope>,
/// Optional. The filters of the metadata feed.
/// Only the changes that match the filters are published.
pub filters: std::option::Option<crate::model::metadata_feed::Filters>,
/// Output only. The time when the feed was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the feed was updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User-defined labels.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// The endpoint defines the where the metadata feed messages are
/// published.
pub endpoint: std::option::Option<crate::model::metadata_feed::Endpoint>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetadataFeed {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::MetadataFeed::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let metadata_feed_id = "metadata_feed_id";
/// let x = MetadataFeed::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataFeeds/{metadata_feed_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::MetadataFeed::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = MetadataFeed::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [scope][crate::model::MetadataFeed::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use google_cloud_dataplex_v1::model::metadata_feed::Scope;
/// let x = MetadataFeed::new().set_scope(Scope::default()/* use setters */);
/// ```
pub fn set_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::metadata_feed::Scope>,
{
self.scope = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scope][crate::model::MetadataFeed::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use google_cloud_dataplex_v1::model::metadata_feed::Scope;
/// let x = MetadataFeed::new().set_or_clear_scope(Some(Scope::default()/* use setters */));
/// let x = MetadataFeed::new().set_or_clear_scope(None::<Scope>);
/// ```
pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::metadata_feed::Scope>,
{
self.scope = v.map(|x| x.into());
self
}
/// Sets the value of [filters][crate::model::MetadataFeed::filters].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use google_cloud_dataplex_v1::model::metadata_feed::Filters;
/// let x = MetadataFeed::new().set_filters(Filters::default()/* use setters */);
/// ```
pub fn set_filters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::metadata_feed::Filters>,
{
self.filters = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [filters][crate::model::MetadataFeed::filters].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use google_cloud_dataplex_v1::model::metadata_feed::Filters;
/// let x = MetadataFeed::new().set_or_clear_filters(Some(Filters::default()/* use setters */));
/// let x = MetadataFeed::new().set_or_clear_filters(None::<Filters>);
/// ```
pub fn set_or_clear_filters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::metadata_feed::Filters>,
{
self.filters = v.map(|x| x.into());
self
}
/// Sets the value of [create_time][crate::model::MetadataFeed::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use wkt::Timestamp;
/// let x = MetadataFeed::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::MetadataFeed::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use wkt::Timestamp;
/// let x = MetadataFeed::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = MetadataFeed::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::MetadataFeed::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use wkt::Timestamp;
/// let x = MetadataFeed::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::MetadataFeed::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use wkt::Timestamp;
/// let x = MetadataFeed::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = MetadataFeed::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::MetadataFeed::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = MetadataFeed::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [endpoint][crate::model::MetadataFeed::endpoint].
///
/// Note that all the setters affecting `endpoint` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// use google_cloud_dataplex_v1::model::metadata_feed::Endpoint;
/// let x = MetadataFeed::new().set_endpoint(Some(Endpoint::PubsubTopic("example".to_string())));
/// ```
pub fn set_endpoint<
T: std::convert::Into<std::option::Option<crate::model::metadata_feed::Endpoint>>,
>(
mut self,
v: T,
) -> Self {
self.endpoint = v.into();
self
}
/// The value of [endpoint][crate::model::MetadataFeed::endpoint]
/// if it holds a `PubsubTopic`, `None` if the field is not set or
/// holds a different branch.
pub fn pubsub_topic(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.endpoint.as_ref().and_then(|v| match v {
crate::model::metadata_feed::Endpoint::PubsubTopic(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [endpoint][crate::model::MetadataFeed::endpoint]
/// to hold a `PubsubTopic`.
///
/// Note that all the setters affecting `endpoint` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = MetadataFeed::new().set_pubsub_topic("example");
/// assert!(x.pubsub_topic().is_some());
/// ```
pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.endpoint =
std::option::Option::Some(crate::model::metadata_feed::Endpoint::PubsubTopic(v.into()));
self
}
}
impl wkt::message::Message for MetadataFeed {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataFeed"
}
}
/// Defines additional types related to [MetadataFeed].
pub mod metadata_feed {
#[allow(unused_imports)]
use super::*;
/// Scope defines the scope of the metadata feed.
/// Scopes are exclusive. Only one of the scopes can be specified.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Scope {
/// Optional. Whether the metadata feed is at the organization-level.
///
/// - If `true`, all changes happened to the entries in the same
/// organization as the feed are published.
/// - If `false`, you must specify a list of projects or a list of entry
/// groups whose entries you want to listen to.
///
/// The default is `false`.
pub organization_level: bool,
/// Optional. The projects whose entries you want to listen to.
/// Must be in the same organization as the feed.
/// Must be in the format: `projects/{project_id_or_number}`.
pub projects: std::vec::Vec<std::string::String>,
/// Optional. The entry groups whose entries you want to listen to.
/// Must be in the format:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}`.
pub entry_groups: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Scope {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [organization_level][crate::model::metadata_feed::Scope::organization_level].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_feed::Scope;
/// let x = Scope::new().set_organization_level(true);
/// ```
pub fn set_organization_level<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.organization_level = v.into();
self
}
/// Sets the value of [projects][crate::model::metadata_feed::Scope::projects].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_feed::Scope;
/// let x = Scope::new().set_projects(["a", "b", "c"]);
/// ```
pub fn set_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.projects = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [entry_groups][crate::model::metadata_feed::Scope::entry_groups].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_feed::Scope;
/// let x = Scope::new().set_entry_groups(["a", "b", "c"]);
/// ```
pub fn set_entry_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_groups = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Scope {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataFeed.Scope"
}
}
/// Filters defines the type of changes that you want to listen to.
/// You can have multiple entry type filters and multiple aspect type filters.
/// All of the entry type filters are OR'ed together.
/// All of the aspect type filters are OR'ed together.
/// All of the entry type filters and aspect type filters are AND'ed together.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Filters {
/// Optional. The entry types that you want to listen to, specified as
/// relative resource names in the format
/// `projects/{project_id_or_number}/locations/{location}/entryTypes/{entry_type_id}`.
/// Only entries that belong to the specified entry types are published.
pub entry_types: std::vec::Vec<std::string::String>,
/// Optional. The aspect types that you want to listen to. Depending on how
/// the aspect is attached to the entry, in the format:
/// `projects/{project_id_or_number}/locations/{location}/aspectTypes/{aspect_type_id}`.
pub aspect_types: std::vec::Vec<std::string::String>,
/// Optional. The type of change that you want to listen to.
/// If not specified, all changes are published.
pub change_types: std::vec::Vec<crate::model::metadata_feed::filters::ChangeType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Filters {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_types][crate::model::metadata_feed::Filters::entry_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_feed::Filters;
/// let x = Filters::new().set_entry_types(["a", "b", "c"]);
/// ```
pub fn set_entry_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.entry_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [aspect_types][crate::model::metadata_feed::Filters::aspect_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_feed::Filters;
/// let x = Filters::new().set_aspect_types(["a", "b", "c"]);
/// ```
pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aspect_types = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [change_types][crate::model::metadata_feed::Filters::change_types].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::metadata_feed::Filters;
/// use google_cloud_dataplex_v1::model::metadata_feed::filters::ChangeType;
/// let x = Filters::new().set_change_types([
/// ChangeType::Create,
/// ChangeType::Update,
/// ChangeType::Delete,
/// ]);
/// ```
pub fn set_change_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::metadata_feed::filters::ChangeType>,
{
use std::iter::Iterator;
self.change_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Filters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.MetadataFeed.Filters"
}
}
/// Defines additional types related to [Filters].
pub mod filters {
#[allow(unused_imports)]
use super::*;
/// The type of change that you want to listen to.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChangeType {
/// Unspecified change type. Defaults to UNSPECIFIED.
Unspecified,
/// The change is a create event.
Create,
/// The change is an update event.
Update,
/// The change is a delete event.
Delete,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ChangeType::value] or
/// [ChangeType::name].
UnknownValue(change_type::UnknownValue),
}
#[doc(hidden)]
pub mod change_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChangeType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Create => std::option::Option::Some(1),
Self::Update => std::option::Option::Some(2),
Self::Delete => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
Self::Create => std::option::Option::Some("CREATE"),
Self::Update => std::option::Option::Some("UPDATE"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChangeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChangeType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ChangeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Create,
2 => Self::Update,
3 => Self::Delete,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChangeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"CREATE" => Self::Create,
"UPDATE" => Self::Update,
"DELETE" => Self::Delete,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChangeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Create => serializer.serialize_i32(1),
Self::Update => serializer.serialize_i32(2),
Self::Delete => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChangeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
".google.cloud.dataplex.v1.MetadataFeed.Filters.ChangeType",
))
}
}
}
/// The endpoint defines the where the metadata feed messages are
/// published.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Endpoint {
/// Optional. The pubsub topic that you want the metadata feed messages to
/// publish to. Please grant Dataplex service account the permission to
/// publish messages to the topic. The service account is:
/// service-{PROJECT_NUMBER}@gcp-sa-dataplex.iam.gserviceaccount.com.
PubsubTopic(std::string::String),
}
}
/// Request message for CreateMetadataFeed.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMetadataFeedRequest {
/// Required. The resource name of the parent location, in the format
/// `projects/{project_id_or_number}/locations/{location_id}`
pub parent: std::string::String,
/// Required. The metadata job resource.
pub metadata_feed: std::option::Option<crate::model::MetadataFeed>,
/// Optional. The metadata job ID. If not provided, a unique ID is generated
/// with the prefix `metadata-job-`.
pub metadata_feed_id: std::string::String,
/// Optional. The service validates the request without performing any
/// mutations. The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMetadataFeedRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateMetadataFeedRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataFeedRequest;
/// let x = CreateMetadataFeedRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [metadata_feed][crate::model::CreateMetadataFeedRequest::metadata_feed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataFeedRequest;
/// use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = CreateMetadataFeedRequest::new().set_metadata_feed(MetadataFeed::default()/* use setters */);
/// ```
pub fn set_metadata_feed<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MetadataFeed>,
{
self.metadata_feed = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [metadata_feed][crate::model::CreateMetadataFeedRequest::metadata_feed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataFeedRequest;
/// use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = CreateMetadataFeedRequest::new().set_or_clear_metadata_feed(Some(MetadataFeed::default()/* use setters */));
/// let x = CreateMetadataFeedRequest::new().set_or_clear_metadata_feed(None::<MetadataFeed>);
/// ```
pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MetadataFeed>,
{
self.metadata_feed = v.map(|x| x.into());
self
}
/// Sets the value of [metadata_feed_id][crate::model::CreateMetadataFeedRequest::metadata_feed_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataFeedRequest;
/// let x = CreateMetadataFeedRequest::new().set_metadata_feed_id("example");
/// ```
pub fn set_metadata_feed_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.metadata_feed_id = v.into();
self
}
/// Sets the value of [validate_only][crate::model::CreateMetadataFeedRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateMetadataFeedRequest;
/// let x = CreateMetadataFeedRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateMetadataFeedRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateMetadataFeedRequest"
}
}
/// Request message for GetMetadataFeed.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMetadataFeedRequest {
/// Required. The resource name of the metadata feed, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/MetadataFeeds/{metadata_feed_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMetadataFeedRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetMetadataFeedRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetMetadataFeedRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let metadata_feed_id = "metadata_feed_id";
/// let x = GetMetadataFeedRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataFeeds/{metadata_feed_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMetadataFeedRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetMetadataFeedRequest"
}
}
/// Request message for ListMetadataFeedsRequest.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMetadataFeedsRequest {
/// Required. The resource name of the parent location, in the format
/// `projects/{project_id_or_number}/locations/{location_id}`
pub parent: std::string::String,
/// Optional. The maximum number of metadata feeds to return. The service
/// might return fewer feeds than this value. If unspecified, at most 10 feeds
/// are returned. The maximum value is 1,000.
pub page_size: i32,
/// Optional. The page token received from a previous `ListMetadataFeeds` call.
/// Provide this token to retrieve the subsequent page of results. When
/// paginating, all other parameters that are provided to the
/// `ListMetadataFeeds` request must match the call that provided the
/// page token.
pub page_token: std::string::String,
/// Optional. Filter request. Filters are case-sensitive.
/// The service supports the following formats:
///
/// * `labels.key1 = "value1"`
/// * `labels:key1`
/// * `name = "value"`
///
/// You can combine filters with `AND`, `OR`, and `NOT` operators.
pub filter: std::string::String,
/// Optional. The field to sort the results by, either `name` or `create_time`.
/// If not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMetadataFeedsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListMetadataFeedsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsRequest;
/// let x = ListMetadataFeedsRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListMetadataFeedsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsRequest;
/// let x = ListMetadataFeedsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListMetadataFeedsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsRequest;
/// let x = ListMetadataFeedsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListMetadataFeedsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsRequest;
/// let x = ListMetadataFeedsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListMetadataFeedsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsRequest;
/// let x = ListMetadataFeedsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListMetadataFeedsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListMetadataFeedsRequest"
}
}
/// Response message for ListMetadataFeeds.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMetadataFeedsResponse {
/// List of metadata feeds under the specified parent location.
pub metadata_feeds: std::vec::Vec<crate::model::MetadataFeed>,
/// A token to retrieve the next page of results. If there are no more results
/// in the list, the value is empty.
pub next_page_token: std::string::String,
/// Unordered list. Locations that the service couldn't reach.
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMetadataFeedsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [metadata_feeds][crate::model::ListMetadataFeedsResponse::metadata_feeds].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsResponse;
/// use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = ListMetadataFeedsResponse::new()
/// .set_metadata_feeds([
/// MetadataFeed::default()/* use setters */,
/// MetadataFeed::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_metadata_feeds<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MetadataFeed>,
{
use std::iter::Iterator;
self.metadata_feeds = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListMetadataFeedsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsResponse;
/// let x = ListMetadataFeedsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable][crate::model::ListMetadataFeedsResponse::unreachable].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListMetadataFeedsResponse;
/// let x = ListMetadataFeedsResponse::new().set_unreachable(["a", "b", "c"]);
/// ```
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListMetadataFeedsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListMetadataFeedsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMetadataFeedsResponse {
type PageItem = crate::model::MetadataFeed;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.metadata_feeds
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Request message for DeleteMetadataFeed.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMetadataFeedRequest {
/// Required. The resource name of the metadata feed, in the format
/// `projects/{project_id_or_number}/locations/{location_id}/MetadataFeeds/{metadata_feed_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMetadataFeedRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteMetadataFeedRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteMetadataFeedRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let metadata_feed_id = "metadata_feed_id";
/// let x = DeleteMetadataFeedRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataFeeds/{metadata_feed_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteMetadataFeedRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteMetadataFeedRequest"
}
}
/// Request message for UpdateMetadataFeed.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMetadataFeedRequest {
/// Required. Update description.
/// Only fields specified in `update_mask` are updated.
pub metadata_feed: std::option::Option<crate::model::MetadataFeed>,
/// Optional. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMetadataFeedRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [metadata_feed][crate::model::UpdateMetadataFeedRequest::metadata_feed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateMetadataFeedRequest;
/// use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = UpdateMetadataFeedRequest::new().set_metadata_feed(MetadataFeed::default()/* use setters */);
/// ```
pub fn set_metadata_feed<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MetadataFeed>,
{
self.metadata_feed = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [metadata_feed][crate::model::UpdateMetadataFeedRequest::metadata_feed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateMetadataFeedRequest;
/// use google_cloud_dataplex_v1::model::MetadataFeed;
/// let x = UpdateMetadataFeedRequest::new().set_or_clear_metadata_feed(Some(MetadataFeed::default()/* use setters */));
/// let x = UpdateMetadataFeedRequest::new().set_or_clear_metadata_feed(None::<MetadataFeed>);
/// ```
pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MetadataFeed>,
{
self.metadata_feed = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateMetadataFeedRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateMetadataFeedRequest;
/// use wkt::FieldMask;
/// let x = UpdateMetadataFeedRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateMetadataFeedRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateMetadataFeedRequest;
/// use wkt::FieldMask;
/// let x = UpdateMetadataFeedRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateMetadataFeedRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateMetadataFeedRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateMetadataFeedRequest;
/// let x = UpdateMetadataFeedRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateMetadataFeedRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateMetadataFeedRequest"
}
}
/// A Resource designed to manage encryption configurations for customers to
/// support Customer Managed Encryption Keys (CMEK).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
/// Identifier. The resource name of the EncryptionConfig.
/// Format:
/// organizations/{organization}/locations/{location}/encryptionConfigs/{encryption_config}
/// Global location is not supported.
pub name: std::string::String,
/// Optional. If a key is chosen, it means that the customer is using CMEK.
/// If a key is not chosen, it means that the customer is using Google managed
/// encryption.
pub key: std::string::String,
/// Output only. The time when the Encryption configuration was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the Encryption configuration was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Output only. The state of encryption of the databases.
pub encryption_state: crate::model::encryption_config::EncryptionState,
/// Etag of the EncryptionConfig. This is a strong etag.
pub etag: std::string::String,
/// Output only. Details of the failure if anything related to Cmek db fails.
pub failure_details: std::option::Option<crate::model::encryption_config::FailureDetails>,
/// Optional. Represent the state of CMEK opt-in for metastore.
pub enable_metastore_encryption: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::EncryptionConfig::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// # let organization_id = "organization_id";
/// # let location_id = "location_id";
/// # let encryption_config_id = "encryption_config_id";
/// let x = EncryptionConfig::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/encryptionConfigs/{encryption_config_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [key][crate::model::EncryptionConfig::key].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = EncryptionConfig::new().set_key("example");
/// ```
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
/// Sets the value of [create_time][crate::model::EncryptionConfig::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use wkt::Timestamp;
/// let x = EncryptionConfig::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::EncryptionConfig::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use wkt::Timestamp;
/// let x = EncryptionConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = EncryptionConfig::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::EncryptionConfig::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use wkt::Timestamp;
/// let x = EncryptionConfig::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::EncryptionConfig::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use wkt::Timestamp;
/// let x = EncryptionConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = EncryptionConfig::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [encryption_state][crate::model::EncryptionConfig::encryption_state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use google_cloud_dataplex_v1::model::encryption_config::EncryptionState;
/// let x0 = EncryptionConfig::new().set_encryption_state(EncryptionState::Encrypting);
/// let x1 = EncryptionConfig::new().set_encryption_state(EncryptionState::Completed);
/// let x2 = EncryptionConfig::new().set_encryption_state(EncryptionState::Failed);
/// ```
pub fn set_encryption_state<
T: std::convert::Into<crate::model::encryption_config::EncryptionState>,
>(
mut self,
v: T,
) -> Self {
self.encryption_state = v.into();
self
}
/// Sets the value of [etag][crate::model::EncryptionConfig::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = EncryptionConfig::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [failure_details][crate::model::EncryptionConfig::failure_details].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use google_cloud_dataplex_v1::model::encryption_config::FailureDetails;
/// let x = EncryptionConfig::new().set_failure_details(FailureDetails::default()/* use setters */);
/// ```
pub fn set_failure_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::encryption_config::FailureDetails>,
{
self.failure_details = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [failure_details][crate::model::EncryptionConfig::failure_details].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// use google_cloud_dataplex_v1::model::encryption_config::FailureDetails;
/// let x = EncryptionConfig::new().set_or_clear_failure_details(Some(FailureDetails::default()/* use setters */));
/// let x = EncryptionConfig::new().set_or_clear_failure_details(None::<FailureDetails>);
/// ```
pub fn set_or_clear_failure_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::encryption_config::FailureDetails>,
{
self.failure_details = v.map(|x| x.into());
self
}
/// Sets the value of [enable_metastore_encryption][crate::model::EncryptionConfig::enable_metastore_encryption].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = EncryptionConfig::new().set_enable_metastore_encryption(true);
/// ```
pub fn set_enable_metastore_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_metastore_encryption = v.into();
self
}
}
impl wkt::message::Message for EncryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EncryptionConfig"
}
}
/// Defines additional types related to [EncryptionConfig].
pub mod encryption_config {
#[allow(unused_imports)]
use super::*;
/// Details of the failure if anything related to Cmek db fails.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FailureDetails {
/// Output only. The error code for the failure.
pub error_code: crate::model::encryption_config::failure_details::ErrorCode,
/// Output only. The error message will be shown to the user. Set only if the
/// error code is REQUIRE_USER_ACTION.
pub error_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FailureDetails {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [error_code][crate::model::encryption_config::FailureDetails::error_code].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::encryption_config::FailureDetails;
/// use google_cloud_dataplex_v1::model::encryption_config::failure_details::ErrorCode;
/// let x0 = FailureDetails::new().set_error_code(ErrorCode::InternalError);
/// let x1 = FailureDetails::new().set_error_code(ErrorCode::RequireUserAction);
/// ```
pub fn set_error_code<
T: std::convert::Into<crate::model::encryption_config::failure_details::ErrorCode>,
>(
mut self,
v: T,
) -> Self {
self.error_code = v.into();
self
}
/// Sets the value of [error_message][crate::model::encryption_config::FailureDetails::error_message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::encryption_config::FailureDetails;
/// let x = FailureDetails::new().set_error_message("example");
/// ```
pub fn set_error_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.error_message = v.into();
self
}
}
impl wkt::message::Message for FailureDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EncryptionConfig.FailureDetails"
}
}
/// Defines additional types related to [FailureDetails].
pub mod failure_details {
#[allow(unused_imports)]
use super::*;
/// Error code for the failure if anything related to Cmek db fails.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ErrorCode {
/// The error code is not specified
Unknown,
/// Error because of internal server error, will be retried automatically.
InternalError,
/// User action is required to resolve the error.
RequireUserAction,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ErrorCode::value] or
/// [ErrorCode::name].
UnknownValue(error_code::UnknownValue),
}
#[doc(hidden)]
pub mod error_code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ErrorCode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::InternalError => std::option::Option::Some(1),
Self::RequireUserAction => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
Self::RequireUserAction => std::option::Option::Some("REQUIRE_USER_ACTION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ErrorCode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ErrorCode {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ErrorCode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
1 => Self::InternalError,
2 => Self::RequireUserAction,
_ => Self::UnknownValue(error_code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ErrorCode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNKNOWN" => Self::Unknown,
"INTERNAL_ERROR" => Self::InternalError,
"REQUIRE_USER_ACTION" => Self::RequireUserAction,
_ => Self::UnknownValue(error_code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ErrorCode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::InternalError => serializer.serialize_i32(1),
Self::RequireUserAction => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ErrorCode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
".google.cloud.dataplex.v1.EncryptionConfig.FailureDetails.ErrorCode",
))
}
}
}
/// State of encryption of the databases when EncryptionConfig is created or
/// updated.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncryptionState {
/// State is not specified.
Unspecified,
/// The encryption state of the database when the EncryptionConfig is created
/// or updated. If the encryption fails, it is retried indefinitely and the
/// state is shown as ENCRYPTING.
Encrypting,
/// The encryption of data has completed successfully.
Completed,
/// The encryption of data has failed.
/// The state is set to FAILED when the encryption fails due to reasons like
/// permission issues, invalid key etc.
Failed,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EncryptionState::value] or
/// [EncryptionState::name].
UnknownValue(encryption_state::UnknownValue),
}
#[doc(hidden)]
pub mod encryption_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EncryptionState {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Encrypting => std::option::Option::Some(1),
Self::Completed => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
Self::Encrypting => std::option::Option::Some("ENCRYPTING"),
Self::Completed => std::option::Option::Some("COMPLETED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EncryptionState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EncryptionState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EncryptionState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Encrypting,
2 => Self::Completed,
3 => Self::Failed,
_ => Self::UnknownValue(encryption_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EncryptionState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
"ENCRYPTING" => Self::Encrypting,
"COMPLETED" => Self::Completed,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(encryption_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EncryptionState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Encrypting => serializer.serialize_i32(1),
Self::Completed => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EncryptionState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
".google.cloud.dataplex.v1.EncryptionConfig.EncryptionState",
))
}
}
}
/// Create EncryptionConfig Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEncryptionConfigRequest {
/// Required. The location at which the EncryptionConfig is to be created.
pub parent: std::string::String,
/// Required. The ID of the
/// [EncryptionConfig][google.cloud.dataplex.v1.EncryptionConfig] to create.
/// Currently, only a value of "default" is supported.
///
/// [google.cloud.dataplex.v1.EncryptionConfig]: crate::model::EncryptionConfig
pub encryption_config_id: std::string::String,
/// Required. The EncryptionConfig to create.
pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEncryptionConfigRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateEncryptionConfigRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEncryptionConfigRequest;
/// let x = CreateEncryptionConfigRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [encryption_config_id][crate::model::CreateEncryptionConfigRequest::encryption_config_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEncryptionConfigRequest;
/// let x = CreateEncryptionConfigRequest::new().set_encryption_config_id("example");
/// ```
pub fn set_encryption_config_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encryption_config_id = v.into();
self
}
/// Sets the value of [encryption_config][crate::model::CreateEncryptionConfigRequest::encryption_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEncryptionConfigRequest;
/// use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = CreateEncryptionConfigRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
/// ```
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfig>,
{
self.encryption_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [encryption_config][crate::model::CreateEncryptionConfigRequest::encryption_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEncryptionConfigRequest;
/// use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = CreateEncryptionConfigRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
/// let x = CreateEncryptionConfigRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
/// ```
pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfig>,
{
self.encryption_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateEncryptionConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateEncryptionConfigRequest"
}
}
/// Get EncryptionConfig Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEncryptionConfigRequest {
/// Required. The name of the EncryptionConfig to fetch.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEncryptionConfigRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetEncryptionConfigRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEncryptionConfigRequest;
/// # let organization_id = "organization_id";
/// # let location_id = "location_id";
/// # let encryption_config_id = "encryption_config_id";
/// let x = GetEncryptionConfigRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/encryptionConfigs/{encryption_config_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetEncryptionConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetEncryptionConfigRequest"
}
}
/// Update EncryptionConfig Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEncryptionConfigRequest {
/// Required. The EncryptionConfig to update.
pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
/// Optional. Mask of fields to update.
/// The service treats an omitted field mask as an implied field mask
/// equivalent to all fields that are populated (have a non-empty value).
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEncryptionConfigRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encryption_config][crate::model::UpdateEncryptionConfigRequest::encryption_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEncryptionConfigRequest;
/// use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = UpdateEncryptionConfigRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
/// ```
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfig>,
{
self.encryption_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [encryption_config][crate::model::UpdateEncryptionConfigRequest::encryption_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEncryptionConfigRequest;
/// use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = UpdateEncryptionConfigRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
/// let x = UpdateEncryptionConfigRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
/// ```
pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfig>,
{
self.encryption_config = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateEncryptionConfigRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEncryptionConfigRequest;
/// use wkt::FieldMask;
/// let x = UpdateEncryptionConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateEncryptionConfigRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEncryptionConfigRequest;
/// use wkt::FieldMask;
/// let x = UpdateEncryptionConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateEncryptionConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateEncryptionConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateEncryptionConfigRequest"
}
}
/// Delete EncryptionConfig Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEncryptionConfigRequest {
/// Required. The name of the EncryptionConfig to delete.
pub name: std::string::String,
/// Optional. Etag of the EncryptionConfig. This is a strong etag.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEncryptionConfigRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteEncryptionConfigRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEncryptionConfigRequest;
/// # let organization_id = "organization_id";
/// # let location_id = "location_id";
/// # let encryption_config_id = "encryption_config_id";
/// let x = DeleteEncryptionConfigRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/encryptionConfigs/{encryption_config_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteEncryptionConfigRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEncryptionConfigRequest;
/// let x = DeleteEncryptionConfigRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteEncryptionConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteEncryptionConfigRequest"
}
}
/// List EncryptionConfigs Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEncryptionConfigsRequest {
/// Required. The location for which the EncryptionConfig is to be listed.
pub parent: std::string::String,
/// Optional. Maximum number of EncryptionConfigs to return. The service may
/// return fewer than this value. If unspecified, at most 10 EncryptionConfigs
/// will be returned. The maximum value is 1000; values above 1000 will be
/// coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListEncryptionConfigs` call.
/// Provide this to retrieve the subsequent page. When paginating, the
/// parameters - filter and order_by provided to `ListEncryptionConfigs` must
/// match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter the EncryptionConfigs to be returned.
/// Using bare literals: (These values will be matched anywhere it may appear
/// in the object's field values)
///
/// * filter=some_value
/// Using fields: (These values will be matched only in the specified field)
/// * filter=some_field=some_value
/// Supported fields:
/// * name, key, create_time, update_time, encryption_state
/// Example:
/// * filter=name=organizations/123/locations/us-central1/encryptionConfigs/test-config
/// conjunctions: (AND, OR, NOT)
/// * filter=name=organizations/123/locations/us-central1/encryptionConfigs/test-config
/// AND mode=CMEK
/// logical operators: (>, <, >=, <=, !=, =, :),
/// * filter=create_time>2024-05-01T00:00:00.000Z
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEncryptionConfigsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListEncryptionConfigsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsRequest;
/// # let organization_id = "organization_id";
/// # let location_id = "location_id";
/// let x = ListEncryptionConfigsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListEncryptionConfigsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsRequest;
/// let x = ListEncryptionConfigsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListEncryptionConfigsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsRequest;
/// let x = ListEncryptionConfigsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListEncryptionConfigsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsRequest;
/// let x = ListEncryptionConfigsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListEncryptionConfigsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsRequest;
/// let x = ListEncryptionConfigsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListEncryptionConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEncryptionConfigsRequest"
}
}
/// List EncryptionConfigs Response
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEncryptionConfigsResponse {
/// The list of EncryptionConfigs under the given parent location.
pub encryption_configs: std::vec::Vec<crate::model::EncryptionConfig>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEncryptionConfigsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encryption_configs][crate::model::ListEncryptionConfigsResponse::encryption_configs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsResponse;
/// use google_cloud_dataplex_v1::model::EncryptionConfig;
/// let x = ListEncryptionConfigsResponse::new()
/// .set_encryption_configs([
/// EncryptionConfig::default()/* use setters */,
/// EncryptionConfig::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_encryption_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EncryptionConfig>,
{
use std::iter::Iterator;
self.encryption_configs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListEncryptionConfigsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsResponse;
/// let x = ListEncryptionConfigsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListEncryptionConfigsResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEncryptionConfigsResponse;
/// let x = ListEncryptionConfigsResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListEncryptionConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEncryptionConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEncryptionConfigsResponse {
type PageItem = crate::model::EncryptionConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.encryption_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Spec for a data discovery scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataDiscoverySpec {
/// Optional. Configuration for metadata publishing.
pub bigquery_publishing_config:
std::option::Option<crate::model::data_discovery_spec::BigQueryPublishingConfig>,
/// The configurations of the data discovery scan resource.
pub resource_config: std::option::Option<crate::model::data_discovery_spec::ResourceConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataDiscoverySpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_publishing_config][crate::model::DataDiscoverySpec::bigquery_publishing_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoverySpec;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::BigQueryPublishingConfig;
/// let x = DataDiscoverySpec::new().set_bigquery_publishing_config(BigQueryPublishingConfig::default()/* use setters */);
/// ```
pub fn set_bigquery_publishing_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_discovery_spec::BigQueryPublishingConfig>,
{
self.bigquery_publishing_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_publishing_config][crate::model::DataDiscoverySpec::bigquery_publishing_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoverySpec;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::BigQueryPublishingConfig;
/// let x = DataDiscoverySpec::new().set_or_clear_bigquery_publishing_config(Some(BigQueryPublishingConfig::default()/* use setters */));
/// let x = DataDiscoverySpec::new().set_or_clear_bigquery_publishing_config(None::<BigQueryPublishingConfig>);
/// ```
pub fn set_or_clear_bigquery_publishing_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_discovery_spec::BigQueryPublishingConfig>,
{
self.bigquery_publishing_config = v.map(|x| x.into());
self
}
/// Sets the value of [resource_config][crate::model::DataDiscoverySpec::resource_config].
///
/// Note that all the setters affecting `resource_config` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoverySpec;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// let x = DataDiscoverySpec::new().set_resource_config(Some(
/// google_cloud_dataplex_v1::model::data_discovery_spec::ResourceConfig::StorageConfig(StorageConfig::default().into())));
/// ```
pub fn set_resource_config<
T: std::convert::Into<std::option::Option<crate::model::data_discovery_spec::ResourceConfig>>,
>(
mut self,
v: T,
) -> Self {
self.resource_config = v.into();
self
}
/// The value of [resource_config][crate::model::DataDiscoverySpec::resource_config]
/// if it holds a `StorageConfig`, `None` if the field is not set or
/// holds a different branch.
pub fn storage_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_discovery_spec::StorageConfig>>
{
#[allow(unreachable_patterns)]
self.resource_config.as_ref().and_then(|v| match v {
crate::model::data_discovery_spec::ResourceConfig::StorageConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [resource_config][crate::model::DataDiscoverySpec::resource_config]
/// to hold a `StorageConfig`.
///
/// Note that all the setters affecting `resource_config` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoverySpec;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// let x = DataDiscoverySpec::new().set_storage_config(StorageConfig::default()/* use setters */);
/// assert!(x.storage_config().is_some());
/// ```
pub fn set_storage_config<
T: std::convert::Into<std::boxed::Box<crate::model::data_discovery_spec::StorageConfig>>,
>(
mut self,
v: T,
) -> Self {
self.resource_config = std::option::Option::Some(
crate::model::data_discovery_spec::ResourceConfig::StorageConfig(v.into()),
);
self
}
}
impl wkt::message::Message for DataDiscoverySpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoverySpec"
}
}
/// Defines additional types related to [DataDiscoverySpec].
pub mod data_discovery_spec {
#[allow(unused_imports)]
use super::*;
/// Describes BigQuery publishing configurations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryPublishingConfig {
/// Optional. Determines whether to publish discovered tables as BigLake
/// external tables or non-BigLake external tables.
pub table_type: crate::model::data_discovery_spec::big_query_publishing_config::TableType,
/// Optional. The BigQuery connection used to create BigLake tables.
/// Must be in the form
/// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
pub connection: std::string::String,
/// Optional. The location of the BigQuery dataset to publish BigLake
/// external or non-BigLake external tables to.
///
/// 1. If the Cloud Storage bucket is located in a multi-region bucket, then
/// BigQuery dataset can be in the same multi-region bucket or any single
/// region that is included in the same multi-region bucket. The datascan can
/// be created in any single region that is included in the same multi-region
/// bucket
/// 1. If the Cloud Storage bucket is located in a dual-region bucket, then
/// BigQuery dataset can be located in regions that are included in the
/// dual-region bucket, or in a multi-region that includes the dual-region.
/// The datascan can be created in any single region that is included in the
/// same dual-region bucket.
/// 1. If the Cloud Storage bucket is located in a single region, then
/// BigQuery dataset can be in the same single region or any multi-region
/// bucket that includes the same single region. The datascan will be created
/// in the same single region as the bucket.
/// 1. If the BigQuery dataset is in single region, it must be in the same
/// single region as the datascan.
///
/// For supported values, refer to
/// <https://cloud.google.com/bigquery/docs/locations#supported_locations>.
pub location: std::string::String,
/// Optional. The project of the BigQuery dataset to publish BigLake external
/// or non-BigLake external tables to. If not specified, the project of the
/// Cloud Storage bucket will be used. The format is
/// "projects/{project_id_or_number}".
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryPublishingConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [table_type][crate::model::data_discovery_spec::BigQueryPublishingConfig::table_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::BigQueryPublishingConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::big_query_publishing_config::TableType;
/// let x0 = BigQueryPublishingConfig::new().set_table_type(TableType::External);
/// let x1 = BigQueryPublishingConfig::new().set_table_type(TableType::Biglake);
/// ```
pub fn set_table_type<
T: std::convert::Into<
crate::model::data_discovery_spec::big_query_publishing_config::TableType,
>,
>(
mut self,
v: T,
) -> Self {
self.table_type = v.into();
self
}
/// Sets the value of [connection][crate::model::data_discovery_spec::BigQueryPublishingConfig::connection].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::BigQueryPublishingConfig;
/// let x = BigQueryPublishingConfig::new().set_connection("example");
/// ```
pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connection = v.into();
self
}
/// Sets the value of [location][crate::model::data_discovery_spec::BigQueryPublishingConfig::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::BigQueryPublishingConfig;
/// let x = BigQueryPublishingConfig::new().set_location("example");
/// ```
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
/// Sets the value of [project][crate::model::data_discovery_spec::BigQueryPublishingConfig::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::BigQueryPublishingConfig;
/// let x = BigQueryPublishingConfig::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for BigQueryPublishingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoverySpec.BigQueryPublishingConfig"
}
}
/// Defines additional types related to [BigQueryPublishingConfig].
pub mod big_query_publishing_config {
#[allow(unused_imports)]
use super::*;
/// Determines how discovered tables are published.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TableType {
/// Table type unspecified.
Unspecified,
/// Default. Discovered tables are published as BigQuery external tables
/// whose data is accessed using the credentials of the user querying the
/// table.
External,
/// Discovered tables are published as BigLake external tables whose data
/// is accessed using the credentials of the associated BigQuery
/// connection.
Biglake,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [TableType::value] or
/// [TableType::name].
UnknownValue(table_type::UnknownValue),
}
#[doc(hidden)]
pub mod table_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TableType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::External => std::option::Option::Some(1),
Self::Biglake => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TABLE_TYPE_UNSPECIFIED"),
Self::External => std::option::Option::Some("EXTERNAL"),
Self::Biglake => std::option::Option::Some("BIGLAKE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TableType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TableType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TableType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::External,
2 => Self::Biglake,
_ => Self::UnknownValue(table_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TableType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TABLE_TYPE_UNSPECIFIED" => Self::Unspecified,
"EXTERNAL" => Self::External,
"BIGLAKE" => Self::Biglake,
_ => Self::UnknownValue(table_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TableType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::External => serializer.serialize_i32(1),
Self::Biglake => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TableType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableType>::new(
".google.cloud.dataplex.v1.DataDiscoverySpec.BigQueryPublishingConfig.TableType"))
}
}
}
/// Configurations related to Cloud Storage as the data source.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageConfig {
/// Optional. Defines the data to include during discovery when only a subset
/// of the data should be considered. Provide a list of patterns that
/// identify the data to include. For Cloud Storage bucket assets, these
/// patterns are interpreted as glob patterns used to match object names. For
/// BigQuery dataset assets, these patterns are interpreted as patterns to
/// match table names.
pub include_patterns: std::vec::Vec<std::string::String>,
/// Optional. Defines the data to exclude during discovery. Provide a list of
/// patterns that identify the data to exclude. For Cloud Storage bucket
/// assets, these patterns are interpreted as glob patterns used to match
/// object names. For BigQuery dataset assets, these patterns are interpreted
/// as patterns to match table names.
pub exclude_patterns: std::vec::Vec<std::string::String>,
/// Optional. Configuration for CSV data.
pub csv_options:
std::option::Option<crate::model::data_discovery_spec::storage_config::CsvOptions>,
/// Optional. Configuration for JSON data.
pub json_options:
std::option::Option<crate::model::data_discovery_spec::storage_config::JsonOptions>,
/// Optional. Specifies configuration for unstructured data discovery.
pub unstructured_data_options: std::option::Option<
crate::model::data_discovery_spec::storage_config::UnstructuredDataOptions,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [include_patterns][crate::model::data_discovery_spec::StorageConfig::include_patterns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// let x = StorageConfig::new().set_include_patterns(["a", "b", "c"]);
/// ```
pub fn set_include_patterns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_patterns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [exclude_patterns][crate::model::data_discovery_spec::StorageConfig::exclude_patterns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// let x = StorageConfig::new().set_exclude_patterns(["a", "b", "c"]);
/// ```
pub fn set_exclude_patterns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_patterns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [csv_options][crate::model::data_discovery_spec::StorageConfig::csv_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = StorageConfig::new().set_csv_options(CsvOptions::default()/* use setters */);
/// ```
pub fn set_csv_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_discovery_spec::storage_config::CsvOptions>,
{
self.csv_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [csv_options][crate::model::data_discovery_spec::StorageConfig::csv_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = StorageConfig::new().set_or_clear_csv_options(Some(CsvOptions::default()/* use setters */));
/// let x = StorageConfig::new().set_or_clear_csv_options(None::<CsvOptions>);
/// ```
pub fn set_or_clear_csv_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_discovery_spec::storage_config::CsvOptions>,
{
self.csv_options = v.map(|x| x.into());
self
}
/// Sets the value of [json_options][crate::model::data_discovery_spec::StorageConfig::json_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::JsonOptions;
/// let x = StorageConfig::new().set_json_options(JsonOptions::default()/* use setters */);
/// ```
pub fn set_json_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_discovery_spec::storage_config::JsonOptions>,
{
self.json_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [json_options][crate::model::data_discovery_spec::StorageConfig::json_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::JsonOptions;
/// let x = StorageConfig::new().set_or_clear_json_options(Some(JsonOptions::default()/* use setters */));
/// let x = StorageConfig::new().set_or_clear_json_options(None::<JsonOptions>);
/// ```
pub fn set_or_clear_json_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_discovery_spec::storage_config::JsonOptions>,
{
self.json_options = v.map(|x| x.into());
self
}
/// Sets the value of [unstructured_data_options][crate::model::data_discovery_spec::StorageConfig::unstructured_data_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::UnstructuredDataOptions;
/// let x = StorageConfig::new().set_unstructured_data_options(UnstructuredDataOptions::default()/* use setters */);
/// ```
pub fn set_unstructured_data_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_discovery_spec::storage_config::UnstructuredDataOptions,
>,
{
self.unstructured_data_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [unstructured_data_options][crate::model::data_discovery_spec::StorageConfig::unstructured_data_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::StorageConfig;
/// use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::UnstructuredDataOptions;
/// let x = StorageConfig::new().set_or_clear_unstructured_data_options(Some(UnstructuredDataOptions::default()/* use setters */));
/// let x = StorageConfig::new().set_or_clear_unstructured_data_options(None::<UnstructuredDataOptions>);
/// ```
pub fn set_or_clear_unstructured_data_options<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<
crate::model::data_discovery_spec::storage_config::UnstructuredDataOptions,
>,
{
self.unstructured_data_options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StorageConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoverySpec.StorageConfig"
}
}
/// Defines additional types related to [StorageConfig].
pub mod storage_config {
#[allow(unused_imports)]
use super::*;
/// Describes CSV and similar semi-structured data formats.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CsvOptions {
/// Optional. The number of rows to interpret as header rows that should be
/// skipped when reading data rows.
pub header_rows: i32,
/// Optional. The delimiter that is used to separate values. The default is
/// `,` (comma).
pub delimiter: std::string::String,
/// Optional. The character encoding of the data. The default is UTF-8.
pub encoding: std::string::String,
/// Optional. Whether to disable the inference of data types for CSV data.
/// If true, all columns are registered as strings.
pub type_inference_disabled: bool,
/// Optional. The character used to quote column values. Accepts `"`
/// (double quotation mark) or `'` (single quotation mark). If unspecified,
/// defaults to `"` (double quotation mark).
pub quote: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CsvOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [header_rows][crate::model::data_discovery_spec::storage_config::CsvOptions::header_rows].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = CsvOptions::new().set_header_rows(42);
/// ```
pub fn set_header_rows<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.header_rows = v.into();
self
}
/// Sets the value of [delimiter][crate::model::data_discovery_spec::storage_config::CsvOptions::delimiter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = CsvOptions::new().set_delimiter("example");
/// ```
pub fn set_delimiter<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.delimiter = v.into();
self
}
/// Sets the value of [encoding][crate::model::data_discovery_spec::storage_config::CsvOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = CsvOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [type_inference_disabled][crate::model::data_discovery_spec::storage_config::CsvOptions::type_inference_disabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = CsvOptions::new().set_type_inference_disabled(true);
/// ```
pub fn set_type_inference_disabled<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.type_inference_disabled = v.into();
self
}
/// Sets the value of [quote][crate::model::data_discovery_spec::storage_config::CsvOptions::quote].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::CsvOptions;
/// let x = CsvOptions::new().set_quote("example");
/// ```
pub fn set_quote<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.quote = v.into();
self
}
}
impl wkt::message::Message for CsvOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoverySpec.StorageConfig.CsvOptions"
}
}
/// Describes JSON data format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JsonOptions {
/// Optional. The character encoding of the data. The default is UTF-8.
pub encoding: std::string::String,
/// Optional. Whether to disable the inference of data types for JSON data.
/// If true, all columns are registered as their primitive types
/// (strings, number, or boolean).
pub type_inference_disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JsonOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encoding][crate::model::data_discovery_spec::storage_config::JsonOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::JsonOptions;
/// let x = JsonOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [type_inference_disabled][crate::model::data_discovery_spec::storage_config::JsonOptions::type_inference_disabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::JsonOptions;
/// let x = JsonOptions::new().set_type_inference_disabled(true);
/// ```
pub fn set_type_inference_disabled<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.type_inference_disabled = v.into();
self
}
}
impl wkt::message::Message for JsonOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoverySpec.StorageConfig.JsonOptions"
}
}
/// Describes options for unstructured data discovery.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UnstructuredDataOptions {
/// Optional. Specifies whether deeper semantic inference over the objects'
/// contents using GenAI is enabled.
pub semantic_inference_enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UnstructuredDataOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [semantic_inference_enabled][crate::model::data_discovery_spec::storage_config::UnstructuredDataOptions::semantic_inference_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_spec::storage_config::UnstructuredDataOptions;
/// let x = UnstructuredDataOptions::new().set_semantic_inference_enabled(true);
/// ```
pub fn set_semantic_inference_enabled<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.semantic_inference_enabled = v.into();
self
}
}
impl wkt::message::Message for UnstructuredDataOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoverySpec.StorageConfig.UnstructuredDataOptions"
}
}
}
/// The configurations of the data discovery scan resource.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceConfig {
/// Cloud Storage related configurations.
StorageConfig(std::boxed::Box<crate::model::data_discovery_spec::StorageConfig>),
}
}
/// The output of a data discovery scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataDiscoveryResult {
/// Output only. Configuration for metadata publishing.
pub bigquery_publishing:
std::option::Option<crate::model::data_discovery_result::BigQueryPublishing>,
/// Output only. Describes result statistics of a data scan discovery job.
pub scan_statistics: std::option::Option<crate::model::data_discovery_result::ScanStatistics>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataDiscoveryResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_publishing][crate::model::DataDiscoveryResult::bigquery_publishing].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoveryResult;
/// use google_cloud_dataplex_v1::model::data_discovery_result::BigQueryPublishing;
/// let x = DataDiscoveryResult::new().set_bigquery_publishing(BigQueryPublishing::default()/* use setters */);
/// ```
pub fn set_bigquery_publishing<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_discovery_result::BigQueryPublishing>,
{
self.bigquery_publishing = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_publishing][crate::model::DataDiscoveryResult::bigquery_publishing].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoveryResult;
/// use google_cloud_dataplex_v1::model::data_discovery_result::BigQueryPublishing;
/// let x = DataDiscoveryResult::new().set_or_clear_bigquery_publishing(Some(BigQueryPublishing::default()/* use setters */));
/// let x = DataDiscoveryResult::new().set_or_clear_bigquery_publishing(None::<BigQueryPublishing>);
/// ```
pub fn set_or_clear_bigquery_publishing<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_discovery_result::BigQueryPublishing>,
{
self.bigquery_publishing = v.map(|x| x.into());
self
}
/// Sets the value of [scan_statistics][crate::model::DataDiscoveryResult::scan_statistics].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoveryResult;
/// use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = DataDiscoveryResult::new().set_scan_statistics(ScanStatistics::default()/* use setters */);
/// ```
pub fn set_scan_statistics<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_discovery_result::ScanStatistics>,
{
self.scan_statistics = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scan_statistics][crate::model::DataDiscoveryResult::scan_statistics].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDiscoveryResult;
/// use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = DataDiscoveryResult::new().set_or_clear_scan_statistics(Some(ScanStatistics::default()/* use setters */));
/// let x = DataDiscoveryResult::new().set_or_clear_scan_statistics(None::<ScanStatistics>);
/// ```
pub fn set_or_clear_scan_statistics<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_discovery_result::ScanStatistics>,
{
self.scan_statistics = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataDiscoveryResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoveryResult"
}
}
/// Defines additional types related to [DataDiscoveryResult].
pub mod data_discovery_result {
#[allow(unused_imports)]
use super::*;
/// Describes BigQuery publishing configurations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryPublishing {
/// Output only. The BigQuery dataset the discovered tables are published to.
pub dataset: std::string::String,
/// Output only. The location of the BigQuery publishing dataset.
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryPublishing {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dataset][crate::model::data_discovery_result::BigQueryPublishing::dataset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::BigQueryPublishing;
/// let x = BigQueryPublishing::new().set_dataset("example");
/// ```
pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dataset = v.into();
self
}
/// Sets the value of [location][crate::model::data_discovery_result::BigQueryPublishing::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::BigQueryPublishing;
/// let x = BigQueryPublishing::new().set_location("example");
/// ```
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for BigQueryPublishing {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoveryResult.BigQueryPublishing"
}
}
/// Describes result statistics of a data scan discovery job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScanStatistics {
/// The number of files scanned.
pub scanned_file_count: i32,
/// The data processed in bytes.
pub data_processed_bytes: i64,
/// The number of files excluded.
pub files_excluded: i32,
/// The number of tables created.
pub tables_created: i32,
/// The number of tables deleted.
pub tables_deleted: i32,
/// The number of tables updated.
pub tables_updated: i32,
/// The number of filesets created.
pub filesets_created: i32,
/// The number of filesets deleted.
pub filesets_deleted: i32,
/// The number of filesets updated.
pub filesets_updated: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScanStatistics {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [scanned_file_count][crate::model::data_discovery_result::ScanStatistics::scanned_file_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_scanned_file_count(42);
/// ```
pub fn set_scanned_file_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.scanned_file_count = v.into();
self
}
/// Sets the value of [data_processed_bytes][crate::model::data_discovery_result::ScanStatistics::data_processed_bytes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_data_processed_bytes(42);
/// ```
pub fn set_data_processed_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.data_processed_bytes = v.into();
self
}
/// Sets the value of [files_excluded][crate::model::data_discovery_result::ScanStatistics::files_excluded].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_files_excluded(42);
/// ```
pub fn set_files_excluded<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.files_excluded = v.into();
self
}
/// Sets the value of [tables_created][crate::model::data_discovery_result::ScanStatistics::tables_created].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_tables_created(42);
/// ```
pub fn set_tables_created<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.tables_created = v.into();
self
}
/// Sets the value of [tables_deleted][crate::model::data_discovery_result::ScanStatistics::tables_deleted].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_tables_deleted(42);
/// ```
pub fn set_tables_deleted<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.tables_deleted = v.into();
self
}
/// Sets the value of [tables_updated][crate::model::data_discovery_result::ScanStatistics::tables_updated].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_tables_updated(42);
/// ```
pub fn set_tables_updated<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.tables_updated = v.into();
self
}
/// Sets the value of [filesets_created][crate::model::data_discovery_result::ScanStatistics::filesets_created].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_filesets_created(42);
/// ```
pub fn set_filesets_created<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.filesets_created = v.into();
self
}
/// Sets the value of [filesets_deleted][crate::model::data_discovery_result::ScanStatistics::filesets_deleted].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_filesets_deleted(42);
/// ```
pub fn set_filesets_deleted<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.filesets_deleted = v.into();
self
}
/// Sets the value of [filesets_updated][crate::model::data_discovery_result::ScanStatistics::filesets_updated].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_discovery_result::ScanStatistics;
/// let x = ScanStatistics::new().set_filesets_updated(42);
/// ```
pub fn set_filesets_updated<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.filesets_updated = v.into();
self
}
}
impl wkt::message::Message for ScanStatistics {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDiscoveryResult.ScanStatistics"
}
}
}
/// DataDocumentation scan related spec.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataDocumentationSpec {
/// Optional. Whether to publish result to Dataplex Catalog.
pub catalog_publishing_enabled: bool,
/// Optional. Specifies which components of the data documentation to generate.
/// Any component that is required to generate the specified components will
/// also be generated. If no generation scope is specified, all available
/// documentation components will be generated.
pub generation_scopes: std::vec::Vec<crate::model::data_documentation_spec::GenerationScope>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataDocumentationSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [catalog_publishing_enabled][crate::model::DataDocumentationSpec::catalog_publishing_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDocumentationSpec;
/// let x = DataDocumentationSpec::new().set_catalog_publishing_enabled(true);
/// ```
pub fn set_catalog_publishing_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.catalog_publishing_enabled = v.into();
self
}
/// Sets the value of [generation_scopes][crate::model::DataDocumentationSpec::generation_scopes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDocumentationSpec;
/// use google_cloud_dataplex_v1::model::data_documentation_spec::GenerationScope;
/// let x = DataDocumentationSpec::new().set_generation_scopes([
/// GenerationScope::All,
/// GenerationScope::TableAndColumnDescriptions,
/// GenerationScope::SqlQueries,
/// ]);
/// ```
pub fn set_generation_scopes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_documentation_spec::GenerationScope>,
{
use std::iter::Iterator;
self.generation_scopes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataDocumentationSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationSpec"
}
}
/// Defines additional types related to [DataDocumentationSpec].
pub mod data_documentation_spec {
#[allow(unused_imports)]
use super::*;
/// The data documentation generation scope. This field contains the possible
/// components of a data documentation scan which can be selectively generated.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum GenerationScope {
/// Unspecified generation scope. If no generation scope is specified, all
/// available documentation components will be generated.
Unspecified,
/// All the possible results will be generated.
All,
/// Table and column descriptions will be generated.
TableAndColumnDescriptions,
/// SQL queries will be generated.
SqlQueries,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [GenerationScope::value] or
/// [GenerationScope::name].
UnknownValue(generation_scope::UnknownValue),
}
#[doc(hidden)]
pub mod generation_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl GenerationScope {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::All => std::option::Option::Some(1),
Self::TableAndColumnDescriptions => std::option::Option::Some(2),
Self::SqlQueries => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("GENERATION_SCOPE_UNSPECIFIED"),
Self::All => std::option::Option::Some("ALL"),
Self::TableAndColumnDescriptions => {
std::option::Option::Some("TABLE_AND_COLUMN_DESCRIPTIONS")
}
Self::SqlQueries => std::option::Option::Some("SQL_QUERIES"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for GenerationScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for GenerationScope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for GenerationScope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::All,
2 => Self::TableAndColumnDescriptions,
3 => Self::SqlQueries,
_ => Self::UnknownValue(generation_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for GenerationScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"GENERATION_SCOPE_UNSPECIFIED" => Self::Unspecified,
"ALL" => Self::All,
"TABLE_AND_COLUMN_DESCRIPTIONS" => Self::TableAndColumnDescriptions,
"SQL_QUERIES" => Self::SqlQueries,
_ => Self::UnknownValue(generation_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for GenerationScope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::All => serializer.serialize_i32(1),
Self::TableAndColumnDescriptions => serializer.serialize_i32(2),
Self::SqlQueries => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for GenerationScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<GenerationScope>::new(
".google.cloud.dataplex.v1.DataDocumentationSpec.GenerationScope",
))
}
}
}
/// The output of a DataDocumentation scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataDocumentationResult {
/// The result of the data documentation scan.
pub result: std::option::Option<crate::model::data_documentation_result::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataDocumentationResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [result][crate::model::DataDocumentationResult::result].
///
/// Note that all the setters affecting `result` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDocumentationResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::DatasetResult;
/// let x = DataDocumentationResult::new().set_result(Some(
/// google_cloud_dataplex_v1::model::data_documentation_result::Result::DatasetResult(DatasetResult::default().into())));
/// ```
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::data_documentation_result::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
/// The value of [result][crate::model::DataDocumentationResult::result]
/// if it holds a `DatasetResult`, `None` if the field is not set or
/// holds a different branch.
pub fn dataset_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_documentation_result::DatasetResult>>
{
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_documentation_result::Result::DatasetResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataDocumentationResult::result]
/// to hold a `DatasetResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDocumentationResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::DatasetResult;
/// let x = DataDocumentationResult::new().set_dataset_result(DatasetResult::default()/* use setters */);
/// assert!(x.dataset_result().is_some());
/// assert!(x.table_result().is_none());
/// ```
pub fn set_dataset_result<
T: std::convert::Into<std::boxed::Box<crate::model::data_documentation_result::DatasetResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_documentation_result::Result::DatasetResult(v.into()),
);
self
}
/// The value of [result][crate::model::DataDocumentationResult::result]
/// if it holds a `TableResult`, `None` if the field is not set or
/// holds a different branch.
pub fn table_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_documentation_result::TableResult>>
{
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_documentation_result::Result::TableResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataDocumentationResult::result]
/// to hold a `TableResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataDocumentationResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::TableResult;
/// let x = DataDocumentationResult::new().set_table_result(TableResult::default()/* use setters */);
/// assert!(x.table_result().is_some());
/// assert!(x.dataset_result().is_none());
/// ```
pub fn set_table_result<
T: std::convert::Into<std::boxed::Box<crate::model::data_documentation_result::TableResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_documentation_result::Result::TableResult(v.into()),
);
self
}
}
impl wkt::message::Message for DataDocumentationResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult"
}
}
/// Defines additional types related to [DataDocumentationResult].
pub mod data_documentation_result {
#[allow(unused_imports)]
use super::*;
/// Insights for a dataset resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatasetResult {
/// Output only. Generated Dataset description.
pub overview: std::string::String,
/// Output only. Relationships suggesting how tables in the dataset are
/// related to each other, based on their schema.
pub schema_relationships:
std::vec::Vec<crate::model::data_documentation_result::SchemaRelationship>,
/// Output only. Sample SQL queries for the dataset.
pub queries: std::vec::Vec<crate::model::data_documentation_result::Query>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatasetResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [overview][crate::model::data_documentation_result::DatasetResult::overview].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::DatasetResult;
/// let x = DatasetResult::new().set_overview("example");
/// ```
pub fn set_overview<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.overview = v.into();
self
}
/// Sets the value of [schema_relationships][crate::model::data_documentation_result::DatasetResult::schema_relationships].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::DatasetResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// let x = DatasetResult::new()
/// .set_schema_relationships([
/// SchemaRelationship::default()/* use setters */,
/// SchemaRelationship::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_schema_relationships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_documentation_result::SchemaRelationship>,
{
use std::iter::Iterator;
self.schema_relationships = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [queries][crate::model::data_documentation_result::DatasetResult::queries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::DatasetResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::Query;
/// let x = DatasetResult::new()
/// .set_queries([
/// Query::default()/* use setters */,
/// Query::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_queries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_documentation_result::Query>,
{
use std::iter::Iterator;
self.queries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DatasetResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.DatasetResult"
}
}
/// Insights for a table resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TableResult {
/// Output only. The service-qualified full resource name of the cloud
/// resource. Ex:
/// //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
pub name: std::string::String,
/// Output only. Generated description of the table.
pub overview: std::string::String,
/// Output only. Schema of the table with generated metadata of the columns
/// in the schema.
pub schema: std::option::Option<crate::model::data_documentation_result::Schema>,
/// Output only. Sample SQL queries for the table.
pub queries: std::vec::Vec<crate::model::data_documentation_result::Query>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TableResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::data_documentation_result::TableResult::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::TableResult;
/// let x = TableResult::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [overview][crate::model::data_documentation_result::TableResult::overview].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::TableResult;
/// let x = TableResult::new().set_overview("example");
/// ```
pub fn set_overview<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.overview = v.into();
self
}
/// Sets the value of [schema][crate::model::data_documentation_result::TableResult::schema].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::TableResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::Schema;
/// let x = TableResult::new().set_schema(Schema::default()/* use setters */);
/// ```
pub fn set_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_documentation_result::Schema>,
{
self.schema = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [schema][crate::model::data_documentation_result::TableResult::schema].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::TableResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::Schema;
/// let x = TableResult::new().set_or_clear_schema(Some(Schema::default()/* use setters */));
/// let x = TableResult::new().set_or_clear_schema(None::<Schema>);
/// ```
pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_documentation_result::Schema>,
{
self.schema = v.map(|x| x.into());
self
}
/// Sets the value of [queries][crate::model::data_documentation_result::TableResult::queries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::TableResult;
/// use google_cloud_dataplex_v1::model::data_documentation_result::Query;
/// let x = TableResult::new()
/// .set_queries([
/// Query::default()/* use setters */,
/// Query::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_queries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_documentation_result::Query>,
{
use std::iter::Iterator;
self.queries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TableResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.TableResult"
}
}
/// Details of the relationship between the schema of two resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchemaRelationship {
/// Output only. An ordered list of fields for the join from the first table.
/// The size of this list must be the same as `right_schema_paths`.
/// Each field at index i in this list must correspond to a field at the same
/// index in the `right_schema_paths` list.
pub left_schema_paths: std::option::Option<
crate::model::data_documentation_result::schema_relationship::SchemaPaths,
>,
/// Output only. An ordered list of fields for the join from the second
/// table. The size of this list must be the same as `left_schema_paths`.
/// Each field at index i in this list must correspond to a field at the same
/// index in the `left_schema_paths` list.
pub right_schema_paths: std::option::Option<
crate::model::data_documentation_result::schema_relationship::SchemaPaths,
>,
/// Output only. Sources which generated the schema relation edge.
pub sources:
std::vec::Vec<crate::model::data_documentation_result::schema_relationship::Source>,
/// Output only. The type of relationship between the schema paths.
pub r#type: crate::model::data_documentation_result::schema_relationship::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchemaRelationship {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [left_schema_paths][crate::model::data_documentation_result::SchemaRelationship::left_schema_paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::SchemaPaths;
/// let x = SchemaRelationship::new().set_left_schema_paths(SchemaPaths::default()/* use setters */);
/// ```
pub fn set_left_schema_paths<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_documentation_result::schema_relationship::SchemaPaths,
>,
{
self.left_schema_paths = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [left_schema_paths][crate::model::data_documentation_result::SchemaRelationship::left_schema_paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::SchemaPaths;
/// let x = SchemaRelationship::new().set_or_clear_left_schema_paths(Some(SchemaPaths::default()/* use setters */));
/// let x = SchemaRelationship::new().set_or_clear_left_schema_paths(None::<SchemaPaths>);
/// ```
pub fn set_or_clear_left_schema_paths<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_documentation_result::schema_relationship::SchemaPaths,
>,
{
self.left_schema_paths = v.map(|x| x.into());
self
}
/// Sets the value of [right_schema_paths][crate::model::data_documentation_result::SchemaRelationship::right_schema_paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::SchemaPaths;
/// let x = SchemaRelationship::new().set_right_schema_paths(SchemaPaths::default()/* use setters */);
/// ```
pub fn set_right_schema_paths<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_documentation_result::schema_relationship::SchemaPaths,
>,
{
self.right_schema_paths = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [right_schema_paths][crate::model::data_documentation_result::SchemaRelationship::right_schema_paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::SchemaPaths;
/// let x = SchemaRelationship::new().set_or_clear_right_schema_paths(Some(SchemaPaths::default()/* use setters */));
/// let x = SchemaRelationship::new().set_or_clear_right_schema_paths(None::<SchemaPaths>);
/// ```
pub fn set_or_clear_right_schema_paths<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_documentation_result::schema_relationship::SchemaPaths,
>,
{
self.right_schema_paths = v.map(|x| x.into());
self
}
/// Sets the value of [sources][crate::model::data_documentation_result::SchemaRelationship::sources].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::Source;
/// let x = SchemaRelationship::new().set_sources([
/// Source::Agent,
/// Source::QueryHistory,
/// Source::TableConstraints,
/// ]);
/// ```
pub fn set_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<
crate::model::data_documentation_result::schema_relationship::Source,
>,
{
use std::iter::Iterator;
self.sources = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [r#type][crate::model::data_documentation_result::SchemaRelationship::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::SchemaRelationship;
/// use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::Type;
/// let x0 = SchemaRelationship::new().set_type(Type::SchemaJoin);
/// ```
pub fn set_type<
T: std::convert::Into<crate::model::data_documentation_result::schema_relationship::Type>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for SchemaRelationship {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.SchemaRelationship"
}
}
/// Defines additional types related to [SchemaRelationship].
pub mod schema_relationship {
#[allow(unused_imports)]
use super::*;
/// Represents an ordered set of paths within a table's schema.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchemaPaths {
/// Output only. The service-qualified full resource name of the table
/// Ex:
/// //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
pub table_fqn: std::string::String,
/// Output only. An ordered set of Paths to fields within the schema of the
/// table. For fields nested within a top level field of type record, use
/// '.' to separate field names. Examples: Top level field - `top_level`
/// Nested field - `top_level.child.sub_field`
pub paths: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchemaPaths {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [table_fqn][crate::model::data_documentation_result::schema_relationship::SchemaPaths::table_fqn].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::SchemaPaths;
/// let x = SchemaPaths::new().set_table_fqn("example");
/// ```
pub fn set_table_fqn<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.table_fqn = v.into();
self
}
/// Sets the value of [paths][crate::model::data_documentation_result::schema_relationship::SchemaPaths::paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::schema_relationship::SchemaPaths;
/// let x = SchemaPaths::new().set_paths(["a", "b", "c"]);
/// ```
pub fn set_paths<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.paths = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SchemaPaths {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.SchemaRelationship.SchemaPaths"
}
}
/// Source which generated the schema relation edge.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
/// The source of the schema relationship is unspecified.
Unspecified,
/// The source of the schema relationship is agent.
Agent,
/// The source of the schema relationship is query history from the source
/// system.
QueryHistory,
/// The source of the schema relationship is table constraints added in
/// the source system.
TableConstraints,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Source::value] or
/// [Source::name].
UnknownValue(source::UnknownValue),
}
#[doc(hidden)]
pub mod source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Source {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Agent => std::option::Option::Some(4),
Self::QueryHistory => std::option::Option::Some(5),
Self::TableConstraints => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SOURCE_UNSPECIFIED"),
Self::Agent => std::option::Option::Some("AGENT"),
Self::QueryHistory => std::option::Option::Some("QUERY_HISTORY"),
Self::TableConstraints => std::option::Option::Some("TABLE_CONSTRAINTS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Source {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Source {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Source {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
4 => Self::Agent,
5 => Self::QueryHistory,
6 => Self::TableConstraints,
_ => Self::UnknownValue(source::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Source {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SOURCE_UNSPECIFIED" => Self::Unspecified,
"AGENT" => Self::Agent,
"QUERY_HISTORY" => Self::QueryHistory,
"TABLE_CONSTRAINTS" => Self::TableConstraints,
_ => Self::UnknownValue(source::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Source {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Agent => serializer.serialize_i32(4),
Self::QueryHistory => serializer.serialize_i32(5),
Self::TableConstraints => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Source {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Source>::new(
".google.cloud.dataplex.v1.DataDocumentationResult.SchemaRelationship.Source",
))
}
}
/// The type of relationship.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// The type of the schema relationship is unspecified.
Unspecified,
/// Indicates a join relationship between the schema fields.
SchemaJoin,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SchemaJoin => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::SchemaJoin => std::option::Option::Some("SCHEMA_JOIN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SchemaJoin,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"SCHEMA_JOIN" => Self::SchemaJoin,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::SchemaJoin => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.DataDocumentationResult.SchemaRelationship.Type",
))
}
}
}
/// A sample SQL query in data documentation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Query {
/// Output only. The SQL query string which can be executed.
pub sql: std::string::String,
/// Output only. The description for the query.
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Query {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sql][crate::model::data_documentation_result::Query::sql].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::Query;
/// let x = Query::new().set_sql("example");
/// ```
pub fn set_sql<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql = v.into();
self
}
/// Sets the value of [description][crate::model::data_documentation_result::Query::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::Query;
/// let x = Query::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for Query {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.Query"
}
}
/// Schema of the table with generated metadata of columns.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Schema {
/// Output only. The list of columns.
pub fields: std::vec::Vec<crate::model::data_documentation_result::Field>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Schema {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [fields][crate::model::data_documentation_result::Schema::fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::Schema;
/// use google_cloud_dataplex_v1::model::data_documentation_result::Field;
/// let x = Schema::new()
/// .set_fields([
/// Field::default()/* use setters */,
/// Field::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_documentation_result::Field>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Schema {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.Schema"
}
}
/// Column of a table with generated metadata and nested fields.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Field {
/// Output only. The name of the column.
pub name: std::string::String,
/// Output only. Generated description for columns and fields.
pub description: std::string::String,
/// Output only. Nested fields.
pub fields: std::vec::Vec<crate::model::data_documentation_result::Field>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Field {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::data_documentation_result::Field::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::Field;
/// let x = Field::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [description][crate::model::data_documentation_result::Field::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::Field;
/// let x = Field::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [fields][crate::model::data_documentation_result::Field::fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_documentation_result::Field;
/// let x = Field::new()
/// .set_fields([
/// Field::default()/* use setters */,
/// Field::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_documentation_result::Field>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Field {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataDocumentationResult.Field"
}
}
/// The result of the data documentation scan.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
/// Output only. Insights for a Dataset resource.
DatasetResult(std::boxed::Box<crate::model::data_documentation_result::DatasetResult>),
/// Output only. Insights for a Table resource.
TableResult(std::boxed::Box<crate::model::data_documentation_result::TableResult>),
}
}
/// A data product is a curated collection of data assets, packaged to address
/// specific use cases. It's a way to manage and share data in a more organized,
/// product-like manner.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataProduct {
/// Identifier. Resource name of the data product.
/// Format:
/// `projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}`.
pub name: std::string::String,
/// Output only. System generated unique ID for the data product.
/// This ID will be different if the data product is deleted and re-created
/// with the same name.
pub uid: std::string::String,
/// Required. User-friendly display name of the data product.
pub display_name: std::string::String,
/// Output only. The time at which the data product was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time at which the data product was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. This checksum is computed by the server based on the value of
/// other fields, and may be sent on update and delete requests to ensure the
/// client has an up-to-date value before proceeding.
pub etag: std::string::String,
/// Optional. User-defined labels for the data product.
///
/// Example:
///
/// ```norust
/// {
/// "environment": "production",
/// "billing": "marketing-department"
/// }
/// ```
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Description of the data product.
pub description: std::string::String,
/// Optional. Base64 encoded image representing the data product. Max
/// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
/// only performs validation on size of the encoded data. Note: For byte
/// fields, the content of the fields are base64-encoded (which increases the
/// size of the data by 33-36%) when using JSON on the wire.
pub icon: ::bytes::Bytes,
/// Required. Emails of the data product owners.
pub owner_emails: std::vec::Vec<std::string::String>,
/// Output only. Number of data assets associated with this data product.
pub asset_count: i32,
/// Optional. Data product access groups by access group id as key.
/// If data product is used only for packaging data assets, then access groups
/// may be empty. However, if a data product is used for sharing data assets,
/// then at least one access group must be specified.
///
/// Example:
///
/// ```norust
/// {
/// "analyst": {
/// "id": "analyst",
/// "displayName": "Analyst",
/// "description": "Access group for analysts",
/// "principal": {
/// "googleGroup": "analysts@example.com"
/// }
/// }
/// }
/// ```
pub access_groups:
std::collections::HashMap<std::string::String, crate::model::data_product::AccessGroup>,
/// Optional. Configuration for access approval for the data product.
pub access_approval_config:
std::option::Option<crate::model::data_product::AccessApprovalConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataProduct {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataProduct::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = DataProduct::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataProduct::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [display_name][crate::model::DataProduct::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataProduct::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use wkt::Timestamp;
/// let x = DataProduct::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataProduct::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use wkt::Timestamp;
/// let x = DataProduct::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataProduct::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::DataProduct::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use wkt::Timestamp;
/// let x = DataProduct::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::DataProduct::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use wkt::Timestamp;
/// let x = DataProduct::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DataProduct::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [etag][crate::model::DataProduct::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [labels][crate::model::DataProduct::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [description][crate::model::DataProduct::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [icon][crate::model::DataProduct::icon].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_icon(bytes::Bytes::from_static(b"example"));
/// ```
pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.icon = v.into();
self
}
/// Sets the value of [owner_emails][crate::model::DataProduct::owner_emails].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_owner_emails(["a", "b", "c"]);
/// ```
pub fn set_owner_emails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.owner_emails = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [asset_count][crate::model::DataProduct::asset_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// let x = DataProduct::new().set_asset_count(42);
/// ```
pub fn set_asset_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.asset_count = v.into();
self
}
/// Sets the value of [access_groups][crate::model::DataProduct::access_groups].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use google_cloud_dataplex_v1::model::data_product::AccessGroup;
/// let x = DataProduct::new().set_access_groups([
/// ("key0", AccessGroup::default()/* use setters */),
/// ("key1", AccessGroup::default()/* use (different) setters */),
/// ]);
/// ```
pub fn set_access_groups<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::data_product::AccessGroup>,
{
use std::iter::Iterator;
self.access_groups = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [access_approval_config][crate::model::DataProduct::access_approval_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use google_cloud_dataplex_v1::model::data_product::AccessApprovalConfig;
/// let x = DataProduct::new().set_access_approval_config(AccessApprovalConfig::default()/* use setters */);
/// ```
pub fn set_access_approval_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_product::AccessApprovalConfig>,
{
self.access_approval_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [access_approval_config][crate::model::DataProduct::access_approval_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProduct;
/// use google_cloud_dataplex_v1::model::data_product::AccessApprovalConfig;
/// let x = DataProduct::new().set_or_clear_access_approval_config(Some(AccessApprovalConfig::default()/* use setters */));
/// let x = DataProduct::new().set_or_clear_access_approval_config(None::<AccessApprovalConfig>);
/// ```
pub fn set_or_clear_access_approval_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_product::AccessApprovalConfig>,
{
self.access_approval_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataProduct {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProduct"
}
}
/// Defines additional types related to [DataProduct].
pub mod data_product {
#[allow(unused_imports)]
use super::*;
/// Represents the principal entity associated with an access group, as per
/// <https://cloud.google.com/iam/docs/principals-overview>.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Principal {
/// Optional. Specifies the email of the producer service account, as per
/// <https://cloud.google.com/iam/docs/principals-overview#service-account>.
pub service_account: std::option::Option<std::string::String>,
/// The type of the principal entity.
pub r#type: std::option::Option<crate::model::data_product::principal::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Principal {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [service_account][crate::model::data_product::Principal::service_account].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::Principal;
/// let x = Principal::new().set_service_account("example");
/// ```
pub fn set_service_account<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.service_account = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [service_account][crate::model::data_product::Principal::service_account].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::Principal;
/// let x = Principal::new().set_or_clear_service_account(Some("example"));
/// let x = Principal::new().set_or_clear_service_account(None::<String>);
/// ```
pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.service_account = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::data_product::Principal::type].
///
/// Note that all the setters affecting `r#type` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::Principal;
/// use google_cloud_dataplex_v1::model::data_product::principal::Type;
/// let x = Principal::new().set_type(Some(Type::GoogleGroup("example".to_string())));
/// ```
pub fn set_type<
T: std::convert::Into<std::option::Option<crate::model::data_product::principal::Type>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// The value of [r#type][crate::model::data_product::Principal::r#type]
/// if it holds a `GoogleGroup`, `None` if the field is not set or
/// holds a different branch.
pub fn google_group(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::data_product::principal::Type::GoogleGroup(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [r#type][crate::model::data_product::Principal::r#type]
/// to hold a `GoogleGroup`.
///
/// Note that all the setters affecting `r#type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::Principal;
/// let x = Principal::new().set_google_group("example");
/// assert!(x.google_group().is_some());
/// ```
pub fn set_google_group<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::data_product::principal::Type::GoogleGroup(v.into()),
);
self
}
}
impl wkt::message::Message for Principal {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProduct.Principal"
}
}
/// Defines additional types related to [Principal].
pub mod principal {
#[allow(unused_imports)]
use super::*;
/// The type of the principal entity.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Optional. Email of the Google Group, as per
/// <https://cloud.google.com/iam/docs/principals-overview#google-group>.
GoogleGroup(std::string::String),
}
}
/// Custom user defined access groups at the data product level. These are used
/// for granting different levels of access (IAM roles) on the individual data
/// product's data assets.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessGroup {
/// Required. Unique identifier of the access group within the data product.
/// User defined. Eg. "analyst", "developer", etc.
pub id: std::string::String,
/// Required. User friendly display name of the access group.
/// Eg. "Analyst", "Developer", etc.
pub display_name: std::string::String,
/// Optional. Description of the access group.
pub description: std::string::String,
/// Required. The principal entity associated with this access group.
pub principal: std::option::Option<crate::model::data_product::Principal>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessGroup {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [id][crate::model::data_product::AccessGroup::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::AccessGroup;
/// let x = AccessGroup::new().set_id("example");
/// ```
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
/// Sets the value of [display_name][crate::model::data_product::AccessGroup::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::AccessGroup;
/// let x = AccessGroup::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::data_product::AccessGroup::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::AccessGroup;
/// let x = AccessGroup::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [principal][crate::model::data_product::AccessGroup::principal].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::AccessGroup;
/// use google_cloud_dataplex_v1::model::data_product::Principal;
/// let x = AccessGroup::new().set_principal(Principal::default()/* use setters */);
/// ```
pub fn set_principal<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_product::Principal>,
{
self.principal = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [principal][crate::model::data_product::AccessGroup::principal].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::AccessGroup;
/// use google_cloud_dataplex_v1::model::data_product::Principal;
/// let x = AccessGroup::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
/// let x = AccessGroup::new().set_or_clear_principal(None::<Principal>);
/// ```
pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_product::Principal>,
{
self.principal = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AccessGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProduct.AccessGroup"
}
}
/// Configuration for access approval for the data product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessApprovalConfig {
/// Optional. Specifies the email addresses of users who are potential
/// approvers and are notified when an access request is made for the data
/// product. The maximum number of emails allowed is 10.
pub approver_emails: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessApprovalConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [approver_emails][crate::model::data_product::AccessApprovalConfig::approver_emails].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_product::AccessApprovalConfig;
/// let x = AccessApprovalConfig::new().set_approver_emails(["a", "b", "c"]);
/// ```
pub fn set_approver_emails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.approver_emails = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AccessApprovalConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProduct.AccessApprovalConfig"
}
}
}
/// Represents a data asset resource that can be packaged and shared via a data
/// product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataAsset {
/// Identifier. Resource name of the data asset.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}
pub name: std::string::String,
/// Output only. System generated globally unique ID for the data asset.
/// This ID will be different if the data asset is deleted and re-created
/// with the same name.
pub uid: std::string::String,
/// Output only. The time at which the data asset was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time at which the data asset was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. This checksum is computed by the server based on the value of
/// other fields, and may be sent on update and delete requests to ensure the
/// client has an up-to-date value before proceeding.
pub etag: std::string::String,
/// Optional. User-defined labels for the data asset.
///
/// Example:
///
/// ```norust
/// {
/// "environment": "production",
/// "billing": "marketing-department"
/// }
/// ```
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Required. Immutable. Full resource name of the cloud resource represented
/// by the data asset. This must follow
/// <https://cloud.google.com/iam/docs/full-resource-names>. Example:
/// `//bigquery.googleapis.com/projects/my_project_123/datasets/dataset_456/tables/table_789`
/// Only BigQuery tables and datasets are currently supported.
/// Data asset creator must have getIamPolicy and setIamPolicy permissions on
/// the resource. Data asset creator must also have resource specific get
/// permission, for instance, bigquery.tables.get for BigQuery tables.
pub resource: std::string::String,
/// Optional. Access groups configurations for this data asset.
///
/// The key is `DataProduct.AccessGroup.id` and the value is
/// `AccessGroupConfig`.
///
/// Example:
///
/// ```norust
/// {
/// "analyst": {
/// "iamRoles": ["roles/bigquery.dataViewer"]
/// }
/// }
/// ```
///
/// Currently, at most one IAM role is allowed per access group. For providing
/// multiple predefined IAM roles, wrap them in a custom IAM role as per
/// <https://cloud.google.com/iam/docs/creating-custom-roles>.
pub access_group_configs:
std::collections::HashMap<std::string::String, crate::model::data_asset::AccessGroupConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAsset {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataAsset::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// # let data_asset_id = "data_asset_id";
/// let x = DataAsset::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataAsset::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// let x = DataAsset::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataAsset::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// use wkt::Timestamp;
/// let x = DataAsset::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataAsset::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// use wkt::Timestamp;
/// let x = DataAsset::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataAsset::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::DataAsset::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// use wkt::Timestamp;
/// let x = DataAsset::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::DataAsset::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// use wkt::Timestamp;
/// let x = DataAsset::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DataAsset::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [etag][crate::model::DataAsset::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// let x = DataAsset::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [labels][crate::model::DataAsset::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// let x = DataAsset::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [resource][crate::model::DataAsset::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// let x = DataAsset::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
/// Sets the value of [access_group_configs][crate::model::DataAsset::access_group_configs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAsset;
/// use google_cloud_dataplex_v1::model::data_asset::AccessGroupConfig;
/// let x = DataAsset::new().set_access_group_configs([
/// ("key0", AccessGroupConfig::default()/* use setters */),
/// ("key1", AccessGroupConfig::default()/* use (different) setters */),
/// ]);
/// ```
pub fn set_access_group_configs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::data_asset::AccessGroupConfig>,
{
use std::iter::Iterator;
self.access_group_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for DataAsset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataAsset"
}
}
/// Defines additional types related to [DataAsset].
pub mod data_asset {
#[allow(unused_imports)]
use super::*;
/// Configuration for access group inherited from the parent data product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessGroupConfig {
/// Optional. IAM roles granted on the resource to this access group. Role
/// name follows <https://cloud.google.com/iam/docs/reference/rest/v1/roles>.
///
/// Example: `[ "roles/bigquery.dataViewer" ]`
pub iam_roles: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessGroupConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [iam_roles][crate::model::data_asset::AccessGroupConfig::iam_roles].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_asset::AccessGroupConfig;
/// let x = AccessGroupConfig::new().set_iam_roles(["a", "b", "c"]);
/// ```
pub fn set_iam_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.iam_roles = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AccessGroupConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataAsset.AccessGroupConfig"
}
}
}
/// Request message for creating a data product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataProductRequest {
/// Required. The parent resource where this data product will be created.
/// Format: projects/{project_id_or_number}/locations/{location_id}
pub parent: std::string::String,
/// Optional. The ID of the data product to create.
///
/// The ID must conform to RFC-1034 and contain only lower-case letters (a-z),
/// numbers (0-9), or hyphens, with the first character a letter, the last a
/// letter or a number, and a 63 character maximum. Characters outside of
/// ASCII are not permitted.
/// Valid format regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`
/// If not provided, a system generated ID will be used.
pub data_product_id: std::string::String,
/// Required. The data product to create.
pub data_product: std::option::Option<crate::model::DataProduct>,
/// Optional. Validates the request without actually creating the data product.
/// Default: false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataProductRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateDataProductRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataProductRequest;
/// let x = CreateDataProductRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [data_product_id][crate::model::CreateDataProductRequest::data_product_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataProductRequest;
/// let x = CreateDataProductRequest::new().set_data_product_id("example");
/// ```
pub fn set_data_product_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_product_id = v.into();
self
}
/// Sets the value of [data_product][crate::model::CreateDataProductRequest::data_product].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataProductRequest;
/// use google_cloud_dataplex_v1::model::DataProduct;
/// let x = CreateDataProductRequest::new().set_data_product(DataProduct::default()/* use setters */);
/// ```
pub fn set_data_product<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataProduct>,
{
self.data_product = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_product][crate::model::CreateDataProductRequest::data_product].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataProductRequest;
/// use google_cloud_dataplex_v1::model::DataProduct;
/// let x = CreateDataProductRequest::new().set_or_clear_data_product(Some(DataProduct::default()/* use setters */));
/// let x = CreateDataProductRequest::new().set_or_clear_data_product(None::<DataProduct>);
/// ```
pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataProduct>,
{
self.data_product = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateDataProductRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataProductRequest;
/// let x = CreateDataProductRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDataProductRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateDataProductRequest"
}
}
/// Request message for deleting a data product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataProductRequest {
/// Required. The name of the data product to delete.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}
pub name: std::string::String,
/// Optional. The etag of the data product.
///
/// If an etag is provided and does not match the current etag of the data
/// product, then the deletion will be blocked and an ABORTED error will be
/// returned.
pub etag: std::string::String,
/// Optional. Validates the request without actually deleting the data product.
/// Default: false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataProductRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteDataProductRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataProductRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = DeleteDataProductRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteDataProductRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataProductRequest;
/// let x = DeleteDataProductRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [validate_only][crate::model::DeleteDataProductRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataProductRequest;
/// let x = DeleteDataProductRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for DeleteDataProductRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteDataProductRequest"
}
}
/// Request message for getting a data product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataProductRequest {
/// Required. The name of the data product to retrieve.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataProductRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataProductRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataProductRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = GetDataProductRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDataProductRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataProductRequest"
}
}
/// Request message for listing data products.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataProductsRequest {
/// Required. The parent, which has this collection of data products.
///
/// Format: `projects/{project_id_or_number}/locations/{location_id}`.
///
/// Supports listing across all locations with the wildcard `-` (hyphen)
/// character. Example: `projects/{project_id_or_number}/locations/-`
pub parent: std::string::String,
/// Optional. Filter expression that filters data products listed in the
/// response.
///
/// Example of using this filter is: `display_name="my-data-product"`
pub filter: std::string::String,
/// Optional. The maximum number of data products to return. The service may
/// return fewer than this value. If unspecified, at most 50 data products will
/// be returned. The maximum value is 1000; values above 1000 will be coerced
/// to 1000.
pub page_size: i32,
/// Optional. A page token, received from a previous `ListDataProducts` call.
/// Provide this to retrieve the subsequent page.
///
/// When paginating, all other parameters provided to `ListDataProducts` must
/// match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Order by expression that orders data products listed in the
/// response.
///
/// Supported Order by fields are: `name` or `create_time`.
///
/// If not specified, the ordering is undefined.
///
/// Ordering by `create_time` is not supported when listing resources across
/// locations (i.e. when request contains `/locations/-`).
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataProductsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataProductsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsRequest;
/// let x = ListDataProductsRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataProductsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsRequest;
/// let x = ListDataProductsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataProductsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsRequest;
/// let x = ListDataProductsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataProductsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsRequest;
/// let x = ListDataProductsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListDataProductsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsRequest;
/// let x = ListDataProductsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDataProductsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataProductsRequest"
}
}
/// Response message for listing data products.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataProductsResponse {
/// The data products for the requested filter criteria.
pub data_products: std::vec::Vec<crate::model::DataProduct>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is empty, then there are no subsequent pages.
pub next_page_token: std::string::String,
/// Unordered list. Locations that the service couldn't reach.
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataProductsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_products][crate::model::ListDataProductsResponse::data_products].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsResponse;
/// use google_cloud_dataplex_v1::model::DataProduct;
/// let x = ListDataProductsResponse::new()
/// .set_data_products([
/// DataProduct::default()/* use setters */,
/// DataProduct::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_products<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataProduct>,
{
use std::iter::Iterator;
self.data_products = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataProductsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsResponse;
/// let x = ListDataProductsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable][crate::model::ListDataProductsResponse::unreachable].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataProductsResponse;
/// let x = ListDataProductsResponse::new().set_unreachable(["a", "b", "c"]);
/// ```
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDataProductsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataProductsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataProductsResponse {
type PageItem = crate::model::DataProduct;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_products
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Request message for updating a data product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataProductRequest {
/// Required. The data product to update.
/// The data product's `name` field is used to identify the data product to
/// update.
pub data_product: std::option::Option<crate::model::DataProduct>,
/// Optional. The list of fields to update.
/// If this is empty or not set, then all the fields will be updated.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. Validates the request without actually updating the data product.
/// Default: false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataProductRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_product][crate::model::UpdateDataProductRequest::data_product].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataProductRequest;
/// use google_cloud_dataplex_v1::model::DataProduct;
/// let x = UpdateDataProductRequest::new().set_data_product(DataProduct::default()/* use setters */);
/// ```
pub fn set_data_product<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataProduct>,
{
self.data_product = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_product][crate::model::UpdateDataProductRequest::data_product].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataProductRequest;
/// use google_cloud_dataplex_v1::model::DataProduct;
/// let x = UpdateDataProductRequest::new().set_or_clear_data_product(Some(DataProduct::default()/* use setters */));
/// let x = UpdateDataProductRequest::new().set_or_clear_data_product(None::<DataProduct>);
/// ```
pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataProduct>,
{
self.data_product = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateDataProductRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataProductRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataProductRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateDataProductRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataProductRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataProductRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateDataProductRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateDataProductRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataProductRequest;
/// let x = UpdateDataProductRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDataProductRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateDataProductRequest"
}
}
/// Message for requesting access to a Data Product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RequestDataProductAccessRequest {
/// Required. The resource name of the data product.
/// Format:
/// projects/{project_number}/locations/{location_id}/dataProducts/{data_product_id}
pub parent: std::string::String,
/// Required. The change request for the data product access request.
pub change_request: std::option::Option<crate::model::ChangeRequest>,
/// Optional. Validates the request without actually creating the access change
/// request. Defaults to false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RequestDataProductAccessRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::RequestDataProductAccessRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RequestDataProductAccessRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = RequestDataProductAccessRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [change_request][crate::model::RequestDataProductAccessRequest::change_request].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RequestDataProductAccessRequest;
/// use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = RequestDataProductAccessRequest::new().set_change_request(ChangeRequest::default()/* use setters */);
/// ```
pub fn set_change_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ChangeRequest>,
{
self.change_request = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [change_request][crate::model::RequestDataProductAccessRequest::change_request].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RequestDataProductAccessRequest;
/// use google_cloud_dataplex_v1::model::ChangeRequest;
/// let x = RequestDataProductAccessRequest::new().set_or_clear_change_request(Some(ChangeRequest::default()/* use setters */));
/// let x = RequestDataProductAccessRequest::new().set_or_clear_change_request(None::<ChangeRequest>);
/// ```
pub fn set_or_clear_change_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ChangeRequest>,
{
self.change_request = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::RequestDataProductAccessRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RequestDataProductAccessRequest;
/// let x = RequestDataProductAccessRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for RequestDataProductAccessRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.RequestDataProductAccessRequest"
}
}
/// Response message for requesting access to a Data Product.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RequestDataProductAccessResponse {
/// The resource name of the created ChangeRequest.
/// Format:
/// projects/{project_number}/locations/{location_id}/changeRequests/{change_request_id}
pub change_request_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RequestDataProductAccessResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [change_request_name][crate::model::RequestDataProductAccessResponse::change_request_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RequestDataProductAccessResponse;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let change_request_id = "change_request_id";
/// let x = RequestDataProductAccessResponse::new().set_change_request_name(format!("projects/{project_id}/locations/{location_id}/changeRequests/{change_request_id}"));
/// ```
pub fn set_change_request_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.change_request_name = v.into();
self
}
}
impl wkt::message::Message for RequestDataProductAccessResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.RequestDataProductAccessResponse"
}
}
/// Request message for creating a data asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataAssetRequest {
/// Required. The parent resource where this data asset will be created.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}
pub parent: std::string::String,
/// Optional. The ID of the data asset to create.
///
/// The ID must conform to RFC-1034 and contain only lower-case letters (a-z),
/// numbers (0-9), or hyphens, with the first character a letter, the last a
/// letter or a number, and a 63 character maximum. Characters outside of
/// ASCII are not permitted.
/// Valid format regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`
/// If not provided, a system generated ID will be used.
pub data_asset_id: std::string::String,
/// Required. The data asset to create.
pub data_asset: std::option::Option<crate::model::DataAsset>,
/// Optional. Validates the request without actually creating the data asset.
/// Defaults to false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateDataAssetRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAssetRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = CreateDataAssetRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [data_asset_id][crate::model::CreateDataAssetRequest::data_asset_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAssetRequest;
/// let x = CreateDataAssetRequest::new().set_data_asset_id("example");
/// ```
pub fn set_data_asset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_asset_id = v.into();
self
}
/// Sets the value of [data_asset][crate::model::CreateDataAssetRequest::data_asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAssetRequest;
/// use google_cloud_dataplex_v1::model::DataAsset;
/// let x = CreateDataAssetRequest::new().set_data_asset(DataAsset::default()/* use setters */);
/// ```
pub fn set_data_asset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAsset>,
{
self.data_asset = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_asset][crate::model::CreateDataAssetRequest::data_asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAssetRequest;
/// use google_cloud_dataplex_v1::model::DataAsset;
/// let x = CreateDataAssetRequest::new().set_or_clear_data_asset(Some(DataAsset::default()/* use setters */));
/// let x = CreateDataAssetRequest::new().set_or_clear_data_asset(None::<DataAsset>);
/// ```
pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAsset>,
{
self.data_asset = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateDataAssetRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAssetRequest;
/// let x = CreateDataAssetRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDataAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateDataAssetRequest"
}
}
/// Request message for updating a data asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataAssetRequest {
/// Required. The data asset to update.
/// The data asset's `name` field is used to identify the data asset to update.
pub data_asset: std::option::Option<crate::model::DataAsset>,
/// Optional. The list of fields to update.
/// If this is empty or not set, then all the fields will be updated.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. Validates the request without actually updating the data asset.
/// Defaults to false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_asset][crate::model::UpdateDataAssetRequest::data_asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAssetRequest;
/// use google_cloud_dataplex_v1::model::DataAsset;
/// let x = UpdateDataAssetRequest::new().set_data_asset(DataAsset::default()/* use setters */);
/// ```
pub fn set_data_asset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAsset>,
{
self.data_asset = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_asset][crate::model::UpdateDataAssetRequest::data_asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAssetRequest;
/// use google_cloud_dataplex_v1::model::DataAsset;
/// let x = UpdateDataAssetRequest::new().set_or_clear_data_asset(Some(DataAsset::default()/* use setters */));
/// let x = UpdateDataAssetRequest::new().set_or_clear_data_asset(None::<DataAsset>);
/// ```
pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAsset>,
{
self.data_asset = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateDataAssetRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAssetRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataAssetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateDataAssetRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAssetRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataAssetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateDataAssetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateDataAssetRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAssetRequest;
/// let x = UpdateDataAssetRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDataAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateDataAssetRequest"
}
}
/// Request message for deleting a data asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataAssetRequest {
/// Required. The name of the data asset to delete.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}
pub name: std::string::String,
/// Optional. The etag of the data asset.
/// If this is provided, it must match the server's etag.
/// If the etag is provided and does not match the server-computed etag,
/// the request must fail with a ABORTED error code.
pub etag: std::string::String,
/// Optional. Validates the request without actually deleting the data asset.
/// Defaults to false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteDataAssetRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAssetRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// # let data_asset_id = "data_asset_id";
/// let x = DeleteDataAssetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteDataAssetRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAssetRequest;
/// let x = DeleteDataAssetRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [validate_only][crate::model::DeleteDataAssetRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAssetRequest;
/// let x = DeleteDataAssetRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for DeleteDataAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteDataAssetRequest"
}
}
/// Request message for getting a data asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataAssetRequest {
/// Required. The name of the data asset to retrieve.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataAssetRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataAssetRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// # let data_asset_id = "data_asset_id";
/// let x = GetDataAssetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDataAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataAssetRequest"
}
}
/// Request message for listing data assets.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAssetsRequest {
/// Required. The parent, which has this collection of data assets.
/// Format:
/// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}
pub parent: std::string::String,
/// Optional. Filter expression that filters data assets listed in the
/// response.
pub filter: std::string::String,
/// Optional. Order by expression that orders data assets listed in the
/// response.
///
/// Supported `order_by` fields are: `name` or `create_time`.
///
/// If not specified, the ordering is undefined.
pub order_by: std::string::String,
/// Optional. The maximum number of data assets to return. The service may
/// return fewer than this value. If unspecified, at most 50 data assets will
/// be returned. The maximum value is 1000; values above 1000 will be coerced
/// to 1000.
pub page_size: i32,
/// Optional. A page token, received from a previous `ListDataAssets` call.
/// Provide this to retrieve the subsequent page.
///
/// When paginating, all other parameters provided to `ListDataAssets` must
/// match the call that provided the page token.
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAssetsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataAssetsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_product_id = "data_product_id";
/// let x = ListDataAssetsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataAssetsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsRequest;
/// let x = ListDataAssetsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListDataAssetsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsRequest;
/// let x = ListDataAssetsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataAssetsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsRequest;
/// let x = ListDataAssetsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataAssetsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsRequest;
/// let x = ListDataAssetsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListDataAssetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataAssetsRequest"
}
}
/// Response message for listing data assets.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAssetsResponse {
/// The data assets for the requested filter criteria.
pub data_assets: std::vec::Vec<crate::model::DataAsset>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is empty, then there are no subsequent pages.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAssetsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_assets][crate::model::ListDataAssetsResponse::data_assets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsResponse;
/// use google_cloud_dataplex_v1::model::DataAsset;
/// let x = ListDataAssetsResponse::new()
/// .set_data_assets([
/// DataAsset::default()/* use setters */,
/// DataAsset::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_assets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAsset>,
{
use std::iter::Iterator;
self.data_assets = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataAssetsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAssetsResponse;
/// let x = ListDataAssetsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListDataAssetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataAssetsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAssetsResponse {
type PageItem = crate::model::DataAsset;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_assets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// DataProfileScan related setting.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataProfileSpec {
/// Optional. The percentage of the records to be selected from the dataset for
/// DataScan.
///
/// * Value can range between 0.0 and 100.0 with up to 3 significant decimal
/// digits.
/// * Sampling is not applied if `sampling_percent` is not specified, 0 or
///
pub sampling_percent: f32,
/// Optional. A filter applied to all rows in a single DataScan job.
/// The filter needs to be a valid SQL expression for a WHERE clause in
/// BigQuery standard SQL syntax.
/// Example: col1 >= 0 AND col2 < 10
pub row_filter: std::string::String,
/// Optional. Actions to take upon job completion..
pub post_scan_actions: std::option::Option<crate::model::data_profile_spec::PostScanActions>,
/// Optional. The fields to include in data profile.
///
/// If not specified, all fields at the time of profile scan job execution are
/// included, except for ones listed in `exclude_fields`.
pub include_fields: std::option::Option<crate::model::data_profile_spec::SelectedFields>,
/// Optional. The fields to exclude from data profile.
///
/// If specified, the fields will be excluded from data profile, regardless of
/// `include_fields` value.
pub exclude_fields: std::option::Option<crate::model::data_profile_spec::SelectedFields>,
/// Optional. If set, the latest DataScan job result will be published as
/// Dataplex Universal Catalog metadata.
pub catalog_publishing_enabled: bool,
/// Optional. The execution mode for the profile scan.
pub mode: crate::model::data_profile_spec::Mode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataProfileSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sampling_percent][crate::model::DataProfileSpec::sampling_percent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// let x = DataProfileSpec::new().set_sampling_percent(42.0);
/// ```
pub fn set_sampling_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.sampling_percent = v.into();
self
}
/// Sets the value of [row_filter][crate::model::DataProfileSpec::row_filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// let x = DataProfileSpec::new().set_row_filter("example");
/// ```
pub fn set_row_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.row_filter = v.into();
self
}
/// Sets the value of [post_scan_actions][crate::model::DataProfileSpec::post_scan_actions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::PostScanActions;
/// let x = DataProfileSpec::new().set_post_scan_actions(PostScanActions::default()/* use setters */);
/// ```
pub fn set_post_scan_actions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_profile_spec::PostScanActions>,
{
self.post_scan_actions = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [post_scan_actions][crate::model::DataProfileSpec::post_scan_actions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::PostScanActions;
/// let x = DataProfileSpec::new().set_or_clear_post_scan_actions(Some(PostScanActions::default()/* use setters */));
/// let x = DataProfileSpec::new().set_or_clear_post_scan_actions(None::<PostScanActions>);
/// ```
pub fn set_or_clear_post_scan_actions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_profile_spec::PostScanActions>,
{
self.post_scan_actions = v.map(|x| x.into());
self
}
/// Sets the value of [include_fields][crate::model::DataProfileSpec::include_fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::SelectedFields;
/// let x = DataProfileSpec::new().set_include_fields(SelectedFields::default()/* use setters */);
/// ```
pub fn set_include_fields<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_profile_spec::SelectedFields>,
{
self.include_fields = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [include_fields][crate::model::DataProfileSpec::include_fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::SelectedFields;
/// let x = DataProfileSpec::new().set_or_clear_include_fields(Some(SelectedFields::default()/* use setters */));
/// let x = DataProfileSpec::new().set_or_clear_include_fields(None::<SelectedFields>);
/// ```
pub fn set_or_clear_include_fields<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_profile_spec::SelectedFields>,
{
self.include_fields = v.map(|x| x.into());
self
}
/// Sets the value of [exclude_fields][crate::model::DataProfileSpec::exclude_fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::SelectedFields;
/// let x = DataProfileSpec::new().set_exclude_fields(SelectedFields::default()/* use setters */);
/// ```
pub fn set_exclude_fields<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_profile_spec::SelectedFields>,
{
self.exclude_fields = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [exclude_fields][crate::model::DataProfileSpec::exclude_fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::SelectedFields;
/// let x = DataProfileSpec::new().set_or_clear_exclude_fields(Some(SelectedFields::default()/* use setters */));
/// let x = DataProfileSpec::new().set_or_clear_exclude_fields(None::<SelectedFields>);
/// ```
pub fn set_or_clear_exclude_fields<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_profile_spec::SelectedFields>,
{
self.exclude_fields = v.map(|x| x.into());
self
}
/// Sets the value of [catalog_publishing_enabled][crate::model::DataProfileSpec::catalog_publishing_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// let x = DataProfileSpec::new().set_catalog_publishing_enabled(true);
/// ```
pub fn set_catalog_publishing_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.catalog_publishing_enabled = v.into();
self
}
/// Sets the value of [mode][crate::model::DataProfileSpec::mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileSpec;
/// use google_cloud_dataplex_v1::model::data_profile_spec::Mode;
/// let x0 = DataProfileSpec::new().set_mode(Mode::Standard);
/// let x1 = DataProfileSpec::new().set_mode(Mode::Lightweight);
/// ```
pub fn set_mode<T: std::convert::Into<crate::model::data_profile_spec::Mode>>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
}
impl wkt::message::Message for DataProfileSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileSpec"
}
}
/// Defines additional types related to [DataProfileSpec].
pub mod data_profile_spec {
#[allow(unused_imports)]
use super::*;
/// The configuration of post scan actions of DataProfileScan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostScanActions {
/// Optional. If set, results will be exported to the provided BigQuery
/// table.
pub bigquery_export:
std::option::Option<crate::model::data_profile_spec::post_scan_actions::BigQueryExport>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostScanActions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_export][crate::model::data_profile_spec::PostScanActions::bigquery_export].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_spec::PostScanActions;
/// use google_cloud_dataplex_v1::model::data_profile_spec::post_scan_actions::BigQueryExport;
/// let x = PostScanActions::new().set_bigquery_export(BigQueryExport::default()/* use setters */);
/// ```
pub fn set_bigquery_export<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_profile_spec::post_scan_actions::BigQueryExport,
>,
{
self.bigquery_export = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_export][crate::model::data_profile_spec::PostScanActions::bigquery_export].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_spec::PostScanActions;
/// use google_cloud_dataplex_v1::model::data_profile_spec::post_scan_actions::BigQueryExport;
/// let x = PostScanActions::new().set_or_clear_bigquery_export(Some(BigQueryExport::default()/* use setters */));
/// let x = PostScanActions::new().set_or_clear_bigquery_export(None::<BigQueryExport>);
/// ```
pub fn set_or_clear_bigquery_export<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_profile_spec::post_scan_actions::BigQueryExport,
>,
{
self.bigquery_export = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostScanActions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileSpec.PostScanActions"
}
}
/// Defines additional types related to [PostScanActions].
pub mod post_scan_actions {
#[allow(unused_imports)]
use super::*;
/// The configuration of BigQuery export post scan action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExport {
/// Optional. The BigQuery table to export DataProfileScan results to.
/// Format:
/// //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
pub results_table: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExport {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [results_table][crate::model::data_profile_spec::post_scan_actions::BigQueryExport::results_table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_spec::post_scan_actions::BigQueryExport;
/// let x = BigQueryExport::new().set_results_table("example");
/// ```
pub fn set_results_table<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.results_table = v.into();
self
}
}
impl wkt::message::Message for BigQueryExport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileSpec.PostScanActions.BigQueryExport"
}
}
}
/// The specification for fields to include or exclude in data profile scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SelectedFields {
/// Optional. Expected input is a list of fully qualified names of fields as
/// in the schema.
///
/// Only top-level field names for nested fields are supported.
/// For instance, if 'x' is of nested field type, listing 'x' is supported
/// but 'x.y.z' is not supported. Here 'y' and 'y.z' are nested fields of
/// 'x'.
pub field_names: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SelectedFields {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [field_names][crate::model::data_profile_spec::SelectedFields::field_names].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_spec::SelectedFields;
/// let x = SelectedFields::new().set_field_names(["a", "b", "c"]);
/// ```
pub fn set_field_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.field_names = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SelectedFields {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileSpec.SelectedFields"
}
}
/// Defines the execution mode for the profile scan.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
/// Default value. This value is unused.
Unspecified,
/// Performs standard profiling. The behavior is controlled by other fields
/// such as `sampling_percent`, `row_filter`, and column filters.
/// This mode allows for full scans or custom sampling.
Standard,
/// Specifies lightweight profiling mode. This mode is optimized for
/// low-latency, low-fidelity profiling.
///
/// When this mode is selected, the following fields must not be set:
/// `sampling_percent`, `row_filter`, `include_fields`, and `exclude_fields`.
Lightweight,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Mode::value] or
/// [Mode::name].
UnknownValue(mode::UnknownValue),
}
#[doc(hidden)]
pub mod mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Mode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::Lightweight => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::Lightweight => std::option::Option::Some("LIGHTWEIGHT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Mode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Mode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Mode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Lightweight,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Mode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MODE_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"LIGHTWEIGHT" => Self::Lightweight,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Mode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::Lightweight => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Mode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
".google.cloud.dataplex.v1.DataProfileSpec.Mode",
))
}
}
}
/// DataProfileResult defines the output of DataProfileScan. Each field of the
/// table will have field type specific profile result.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataProfileResult {
/// Output only. The count of rows scanned.
pub row_count: i64,
/// Output only. The profile information per field.
pub profile: std::option::Option<crate::model::data_profile_result::Profile>,
/// Output only. The data scanned for this result.
pub scanned_data: std::option::Option<crate::model::ScannedData>,
/// Output only. The result of post scan actions.
pub post_scan_actions_result:
std::option::Option<crate::model::data_profile_result::PostScanActionsResult>,
/// Output only. The status of publishing the data scan as Dataplex Universal
/// Catalog metadata.
pub catalog_publishing_status:
std::option::Option<crate::model::DataScanCatalogPublishingStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataProfileResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [row_count][crate::model::DataProfileResult::row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// let x = DataProfileResult::new().set_row_count(42);
/// ```
pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.row_count = v.into();
self
}
/// Sets the value of [profile][crate::model::DataProfileResult::profile].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::Profile;
/// let x = DataProfileResult::new().set_profile(Profile::default()/* use setters */);
/// ```
pub fn set_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_profile_result::Profile>,
{
self.profile = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [profile][crate::model::DataProfileResult::profile].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::Profile;
/// let x = DataProfileResult::new().set_or_clear_profile(Some(Profile::default()/* use setters */));
/// let x = DataProfileResult::new().set_or_clear_profile(None::<Profile>);
/// ```
pub fn set_or_clear_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_profile_result::Profile>,
{
self.profile = v.map(|x| x.into());
self
}
/// Sets the value of [scanned_data][crate::model::DataProfileResult::scanned_data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::ScannedData;
/// let x = DataProfileResult::new().set_scanned_data(ScannedData::default()/* use setters */);
/// ```
pub fn set_scanned_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ScannedData>,
{
self.scanned_data = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scanned_data][crate::model::DataProfileResult::scanned_data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::ScannedData;
/// let x = DataProfileResult::new().set_or_clear_scanned_data(Some(ScannedData::default()/* use setters */));
/// let x = DataProfileResult::new().set_or_clear_scanned_data(None::<ScannedData>);
/// ```
pub fn set_or_clear_scanned_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ScannedData>,
{
self.scanned_data = v.map(|x| x.into());
self
}
/// Sets the value of [post_scan_actions_result][crate::model::DataProfileResult::post_scan_actions_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::PostScanActionsResult;
/// let x = DataProfileResult::new().set_post_scan_actions_result(PostScanActionsResult::default()/* use setters */);
/// ```
pub fn set_post_scan_actions_result<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_profile_result::PostScanActionsResult>,
{
self.post_scan_actions_result = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [post_scan_actions_result][crate::model::DataProfileResult::post_scan_actions_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::PostScanActionsResult;
/// let x = DataProfileResult::new().set_or_clear_post_scan_actions_result(Some(PostScanActionsResult::default()/* use setters */));
/// let x = DataProfileResult::new().set_or_clear_post_scan_actions_result(None::<PostScanActionsResult>);
/// ```
pub fn set_or_clear_post_scan_actions_result<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_profile_result::PostScanActionsResult>,
{
self.post_scan_actions_result = v.map(|x| x.into());
self
}
/// Sets the value of [catalog_publishing_status][crate::model::DataProfileResult::catalog_publishing_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// let x = DataProfileResult::new().set_catalog_publishing_status(DataScanCatalogPublishingStatus::default()/* use setters */);
/// ```
pub fn set_catalog_publishing_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataScanCatalogPublishingStatus>,
{
self.catalog_publishing_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [catalog_publishing_status][crate::model::DataProfileResult::catalog_publishing_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataProfileResult;
/// use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// let x = DataProfileResult::new().set_or_clear_catalog_publishing_status(Some(DataScanCatalogPublishingStatus::default()/* use setters */));
/// let x = DataProfileResult::new().set_or_clear_catalog_publishing_status(None::<DataScanCatalogPublishingStatus>);
/// ```
pub fn set_or_clear_catalog_publishing_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataScanCatalogPublishingStatus>,
{
self.catalog_publishing_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataProfileResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult"
}
}
/// Defines additional types related to [DataProfileResult].
pub mod data_profile_result {
#[allow(unused_imports)]
use super::*;
/// Contains name, type, mode and field type specific profile information.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Profile {
/// Output only. List of fields with structural and profile information for
/// each field.
pub fields: std::vec::Vec<crate::model::data_profile_result::profile::Field>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Profile {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [fields][crate::model::data_profile_result::Profile::fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::Profile;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::Field;
/// let x = Profile::new()
/// .set_fields([
/// Field::default()/* use setters */,
/// Field::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_profile_result::profile::Field>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Profile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile"
}
}
/// Defines additional types related to [Profile].
pub mod profile {
#[allow(unused_imports)]
use super::*;
/// A field within a table.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Field {
/// Output only. The name of the field.
pub name: std::string::String,
/// Output only. The data type retrieved from the schema of the data
/// source. For instance, for a BigQuery native table, it is the [BigQuery
/// Table
/// Schema](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#tablefieldschema).
/// For a Dataplex Universal Catalog Entity, it is the [Entity
/// Schema](https://cloud.google.com/dataplex/docs/reference/rpc/google.cloud.dataplex.v1#type_3).
pub r#type: std::string::String,
/// Output only. The mode of the field. Possible values include:
///
/// * REQUIRED, if it is a required field.
/// * NULLABLE, if it is an optional field.
/// * REPEATED, if it is a repeated field.
pub mode: std::string::String,
/// Output only. Profile information for the corresponding field.
pub profile:
std::option::Option<crate::model::data_profile_result::profile::field::ProfileInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Field {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::data_profile_result::profile::Field::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::Field;
/// let x = Field::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [r#type][crate::model::data_profile_result::profile::Field::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::Field;
/// let x = Field::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [mode][crate::model::data_profile_result::profile::Field::mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::Field;
/// let x = Field::new().set_mode("example");
/// ```
pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mode = v.into();
self
}
/// Sets the value of [profile][crate::model::data_profile_result::profile::Field::profile].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::Field;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// let x = Field::new().set_profile(ProfileInfo::default()/* use setters */);
/// ```
pub fn set_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_profile_result::profile::field::ProfileInfo,
>,
{
self.profile = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [profile][crate::model::data_profile_result::profile::Field::profile].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::Field;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// let x = Field::new().set_or_clear_profile(Some(ProfileInfo::default()/* use setters */));
/// let x = Field::new().set_or_clear_profile(None::<ProfileInfo>);
/// ```
pub fn set_or_clear_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_profile_result::profile::field::ProfileInfo,
>,
{
self.profile = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Field {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile.Field"
}
}
/// Defines additional types related to [Field].
pub mod field {
#[allow(unused_imports)]
use super::*;
/// The profile information for each field type.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProfileInfo {
/// Output only. Ratio of rows with null value against total scanned
/// rows.
pub null_ratio: f64,
/// Output only. Ratio of rows with distinct values against total scanned
/// rows. Not available for complex non-groupable field type, including
/// RECORD, ARRAY, GEOGRAPHY, and JSON, as well as fields with REPEATABLE
/// mode.
pub distinct_ratio: f64,
/// Output only. The list of top N non-null values, frequency and ratio
/// with which they occur in the scanned data. N is 10 or equal to the
/// number of distinct values in the field, whichever is smaller. Not
/// available for complex non-groupable field type, including RECORD,
/// ARRAY, GEOGRAPHY, and JSON, as well as fields with REPEATABLE mode.
pub top_n_values: std::vec::Vec<
crate::model::data_profile_result::profile::field::profile_info::TopNValue,
>,
/// Structural and profile information for specific field type. Not
/// available, if mode is REPEATABLE.
pub field_info: std::option::Option<
crate::model::data_profile_result::profile::field::profile_info::FieldInfo,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProfileInfo {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [null_ratio][crate::model::data_profile_result::profile::field::ProfileInfo::null_ratio].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// let x = ProfileInfo::new().set_null_ratio(42.0);
/// ```
pub fn set_null_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.null_ratio = v.into();
self
}
/// Sets the value of [distinct_ratio][crate::model::data_profile_result::profile::field::ProfileInfo::distinct_ratio].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// let x = ProfileInfo::new().set_distinct_ratio(42.0);
/// ```
pub fn set_distinct_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.distinct_ratio = v.into();
self
}
/// Sets the value of [top_n_values][crate::model::data_profile_result::profile::field::ProfileInfo::top_n_values].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::TopNValue;
/// let x = ProfileInfo::new()
/// .set_top_n_values([
/// TopNValue::default()/* use setters */,
/// TopNValue::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_top_n_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_profile_result::profile::field::profile_info::TopNValue>
{
use std::iter::Iterator;
self.top_n_values = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info].
///
/// Note that all the setters affecting `field_info` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::StringFieldInfo;
/// let x = ProfileInfo::new().set_field_info(Some(
/// google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::FieldInfo::StringProfile(StringFieldInfo::default().into())));
/// ```
pub fn set_field_info<T: std::convert::Into<std::option::Option<crate::model::data_profile_result::profile::field::profile_info::FieldInfo>>>(mut self, v: T) -> Self
{
self.field_info = v.into();
self
}
/// The value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info]
/// if it holds a `StringProfile`, `None` if the field is not set or
/// holds a different branch.
pub fn string_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::StringFieldInfo>>{
#[allow(unreachable_patterns)]
self.field_info.as_ref().and_then(|v| match v {
crate::model::data_profile_result::profile::field::profile_info::FieldInfo::StringProfile(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info]
/// to hold a `StringProfile`.
///
/// Note that all the setters affecting `field_info` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::StringFieldInfo;
/// let x = ProfileInfo::new().set_string_profile(StringFieldInfo::default()/* use setters */);
/// assert!(x.string_profile().is_some());
/// assert!(x.integer_profile().is_none());
/// assert!(x.double_profile().is_none());
/// ```
pub fn set_string_profile<T: std::convert::Into<std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::StringFieldInfo>>>(mut self, v: T) -> Self{
self.field_info = std::option::Option::Some(
crate::model::data_profile_result::profile::field::profile_info::FieldInfo::StringProfile(
v.into()
)
);
self
}
/// The value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info]
/// if it holds a `IntegerProfile`, `None` if the field is not set or
/// holds a different branch.
pub fn integer_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo>>{
#[allow(unreachable_patterns)]
self.field_info.as_ref().and_then(|v| match v {
crate::model::data_profile_result::profile::field::profile_info::FieldInfo::IntegerProfile(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info]
/// to hold a `IntegerProfile`.
///
/// Note that all the setters affecting `field_info` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo;
/// let x = ProfileInfo::new().set_integer_profile(IntegerFieldInfo::default()/* use setters */);
/// assert!(x.integer_profile().is_some());
/// assert!(x.string_profile().is_none());
/// assert!(x.double_profile().is_none());
/// ```
pub fn set_integer_profile<T: std::convert::Into<std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo>>>(mut self, v: T) -> Self{
self.field_info = std::option::Option::Some(
crate::model::data_profile_result::profile::field::profile_info::FieldInfo::IntegerProfile(
v.into()
)
);
self
}
/// The value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info]
/// if it holds a `DoubleProfile`, `None` if the field is not set or
/// holds a different branch.
pub fn double_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo>>{
#[allow(unreachable_patterns)]
self.field_info.as_ref().and_then(|v| match v {
crate::model::data_profile_result::profile::field::profile_info::FieldInfo::DoubleProfile(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [field_info][crate::model::data_profile_result::profile::field::ProfileInfo::field_info]
/// to hold a `DoubleProfile`.
///
/// Note that all the setters affecting `field_info` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::ProfileInfo;
/// use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo;
/// let x = ProfileInfo::new().set_double_profile(DoubleFieldInfo::default()/* use setters */);
/// assert!(x.double_profile().is_some());
/// assert!(x.string_profile().is_none());
/// assert!(x.integer_profile().is_none());
/// ```
pub fn set_double_profile<T: std::convert::Into<std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo>>>(mut self, v: T) -> Self{
self.field_info = std::option::Option::Some(
crate::model::data_profile_result::profile::field::profile_info::FieldInfo::DoubleProfile(
v.into()
)
);
self
}
}
impl wkt::message::Message for ProfileInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo"
}
}
/// Defines additional types related to [ProfileInfo].
pub mod profile_info {
#[allow(unused_imports)]
use super::*;
/// The profile information for a string type field.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StringFieldInfo {
/// Output only. Minimum length of non-null values in the scanned data.
pub min_length: i64,
/// Output only. Maximum length of non-null values in the scanned data.
pub max_length: i64,
/// Output only. Average length of non-null values in the scanned data.
pub average_length: f64,
pub(crate) _unknown_fields:
serde_json::Map<std::string::String, serde_json::Value>,
}
impl StringFieldInfo {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [min_length][crate::model::data_profile_result::profile::field::profile_info::StringFieldInfo::min_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::StringFieldInfo;
/// let x = StringFieldInfo::new().set_min_length(42);
/// ```
pub fn set_min_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.min_length = v.into();
self
}
/// Sets the value of [max_length][crate::model::data_profile_result::profile::field::profile_info::StringFieldInfo::max_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::StringFieldInfo;
/// let x = StringFieldInfo::new().set_max_length(42);
/// ```
pub fn set_max_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max_length = v.into();
self
}
/// Sets the value of [average_length][crate::model::data_profile_result::profile::field::profile_info::StringFieldInfo::average_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::StringFieldInfo;
/// let x = StringFieldInfo::new().set_average_length(42.0);
/// ```
pub fn set_average_length<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.average_length = v.into();
self
}
}
impl wkt::message::Message for StringFieldInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.StringFieldInfo"
}
}
/// The profile information for an integer type field.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IntegerFieldInfo {
/// Output only. Average of non-null values in the scanned data. NaN,
/// if the field has a NaN.
pub average: f64,
/// Output only. Standard deviation of non-null values in the scanned
/// data. NaN, if the field has a NaN.
pub standard_deviation: f64,
/// Output only. Minimum of non-null values in the scanned data. NaN,
/// if the field has a NaN.
pub min: i64,
/// Output only. A quartile divides the number of data points into four
/// parts, or quarters, of more-or-less equal size. Three main
/// quartiles used are: The first quartile (Q1) splits off the lowest
/// 25% of data from the highest 75%. It is also known as the lower or
/// 25th empirical quartile, as 25% of the data is below this point.
/// The second quartile (Q2) is the median of a data set. So, 50% of
/// the data lies below this point. The third quartile (Q3) splits off
/// the highest 25% of data from the lowest 75%. It is known as the
/// upper or 75th empirical quartile, as 75% of the data lies below
/// this point. Here, the quartiles is provided as an ordered list of
/// approximate quartile values for the scanned data, occurring in
/// order Q1, median, Q3.
pub quartiles: std::vec::Vec<i64>,
/// Output only. Maximum of non-null values in the scanned data. NaN,
/// if the field has a NaN.
pub max: i64,
pub(crate) _unknown_fields:
serde_json::Map<std::string::String, serde_json::Value>,
}
impl IntegerFieldInfo {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [average][crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo::average].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo;
/// let x = IntegerFieldInfo::new().set_average(42.0);
/// ```
pub fn set_average<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.average = v.into();
self
}
/// Sets the value of [standard_deviation][crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo::standard_deviation].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo;
/// let x = IntegerFieldInfo::new().set_standard_deviation(42.0);
/// ```
pub fn set_standard_deviation<T: std::convert::Into<f64>>(
mut self,
v: T,
) -> Self {
self.standard_deviation = v.into();
self
}
/// Sets the value of [min][crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo::min].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo;
/// let x = IntegerFieldInfo::new().set_min(42);
/// ```
pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.min = v.into();
self
}
/// Sets the value of [quartiles][crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo::quartiles].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo;
/// let x = IntegerFieldInfo::new().set_quartiles([1, 2, 3]);
/// ```
pub fn set_quartiles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.quartiles = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [max][crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo::max].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo;
/// let x = IntegerFieldInfo::new().set_max(42);
/// ```
pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max = v.into();
self
}
}
impl wkt::message::Message for IntegerFieldInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.IntegerFieldInfo"
}
}
/// The profile information for a double type field.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DoubleFieldInfo {
/// Output only. Average of non-null values in the scanned data. NaN,
/// if the field has a NaN.
pub average: f64,
/// Output only. Standard deviation of non-null values in the scanned
/// data. NaN, if the field has a NaN.
pub standard_deviation: f64,
/// Output only. Minimum of non-null values in the scanned data. NaN,
/// if the field has a NaN.
pub min: f64,
/// Output only. A quartile divides the number of data points into four
/// parts, or quarters, of more-or-less equal size. Three main
/// quartiles used are: The first quartile (Q1) splits off the lowest
/// 25% of data from the highest 75%. It is also known as the lower or
/// 25th empirical quartile, as 25% of the data is below this point.
/// The second quartile (Q2) is the median of a data set. So, 50% of
/// the data lies below this point. The third quartile (Q3) splits off
/// the highest 25% of data from the lowest 75%. It is known as the
/// upper or 75th empirical quartile, as 75% of the data lies below
/// this point. Here, the quartiles is provided as an ordered list of
/// quartile values for the scanned data, occurring in order Q1,
/// median, Q3.
pub quartiles: std::vec::Vec<f64>,
/// Output only. Maximum of non-null values in the scanned data. NaN,
/// if the field has a NaN.
pub max: f64,
pub(crate) _unknown_fields:
serde_json::Map<std::string::String, serde_json::Value>,
}
impl DoubleFieldInfo {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [average][crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo::average].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo;
/// let x = DoubleFieldInfo::new().set_average(42.0);
/// ```
pub fn set_average<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.average = v.into();
self
}
/// Sets the value of [standard_deviation][crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo::standard_deviation].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo;
/// let x = DoubleFieldInfo::new().set_standard_deviation(42.0);
/// ```
pub fn set_standard_deviation<T: std::convert::Into<f64>>(
mut self,
v: T,
) -> Self {
self.standard_deviation = v.into();
self
}
/// Sets the value of [min][crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo::min].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo;
/// let x = DoubleFieldInfo::new().set_min(42.0);
/// ```
pub fn set_min<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.min = v.into();
self
}
/// Sets the value of [quartiles][crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo::quartiles].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo;
/// let x = DoubleFieldInfo::new().set_quartiles([1.0, 2.0, 3.0]);
/// ```
pub fn set_quartiles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<f64>,
{
use std::iter::Iterator;
self.quartiles = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [max][crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo::max].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo;
/// let x = DoubleFieldInfo::new().set_max(42.0);
/// ```
pub fn set_max<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.max = v.into();
self
}
}
impl wkt::message::Message for DoubleFieldInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.DoubleFieldInfo"
}
}
/// Top N non-null values in the scanned data.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TopNValue {
/// Output only. String value of a top N non-null value.
pub value: std::string::String,
/// Output only. Count of the corresponding value in the scanned data.
pub count: i64,
/// Output only. Ratio of the corresponding value in the field against
/// the total number of rows in the scanned data.
pub ratio: f64,
pub(crate) _unknown_fields:
serde_json::Map<std::string::String, serde_json::Value>,
}
impl TopNValue {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [value][crate::model::data_profile_result::profile::field::profile_info::TopNValue::value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::TopNValue;
/// let x = TopNValue::new().set_value("example");
/// ```
pub fn set_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.value = v.into();
self
}
/// Sets the value of [count][crate::model::data_profile_result::profile::field::profile_info::TopNValue::count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::TopNValue;
/// let x = TopNValue::new().set_count(42);
/// ```
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
/// Sets the value of [ratio][crate::model::data_profile_result::profile::field::profile_info::TopNValue::ratio].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::profile::field::profile_info::TopNValue;
/// let x = TopNValue::new().set_ratio(42.0);
/// ```
pub fn set_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.ratio = v.into();
self
}
}
impl wkt::message::Message for TopNValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.TopNValue"
}
}
/// Structural and profile information for specific field type. Not
/// available, if mode is REPEATABLE.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FieldInfo {
/// String type field information.
StringProfile(std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::StringFieldInfo>),
/// Integer type field information.
IntegerProfile(std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::IntegerFieldInfo>),
/// Double type field information.
DoubleProfile(std::boxed::Box<crate::model::data_profile_result::profile::field::profile_info::DoubleFieldInfo>),
}
}
}
}
/// The result of post scan actions of DataProfileScan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostScanActionsResult {
/// Output only. The result of BigQuery export post scan action.
pub bigquery_export_result: std::option::Option<
crate::model::data_profile_result::post_scan_actions_result::BigQueryExportResult,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostScanActionsResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_export_result][crate::model::data_profile_result::PostScanActionsResult::bigquery_export_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::PostScanActionsResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::post_scan_actions_result::BigQueryExportResult;
/// let x = PostScanActionsResult::new().set_bigquery_export_result(BigQueryExportResult::default()/* use setters */);
/// ```
pub fn set_bigquery_export_result<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::data_profile_result::post_scan_actions_result::BigQueryExportResult>
{
self.bigquery_export_result = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_export_result][crate::model::data_profile_result::PostScanActionsResult::bigquery_export_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::PostScanActionsResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::post_scan_actions_result::BigQueryExportResult;
/// let x = PostScanActionsResult::new().set_or_clear_bigquery_export_result(Some(BigQueryExportResult::default()/* use setters */));
/// let x = PostScanActionsResult::new().set_or_clear_bigquery_export_result(None::<BigQueryExportResult>);
/// ```
pub fn set_or_clear_bigquery_export_result<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::data_profile_result::post_scan_actions_result::BigQueryExportResult>
{
self.bigquery_export_result = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostScanActionsResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.PostScanActionsResult"
}
}
/// Defines additional types related to [PostScanActionsResult].
pub mod post_scan_actions_result {
#[allow(unused_imports)]
use super::*;
/// The result of BigQuery export post scan action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExportResult {
/// Output only. Execution state for the BigQuery exporting.
pub state: crate::model::data_profile_result::post_scan_actions_result::big_query_export_result::State,
/// Output only. Additional information about the BigQuery exporting.
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExportResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::data_profile_result::post_scan_actions_result::BigQueryExportResult::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::post_scan_actions_result::BigQueryExportResult;
/// use google_cloud_dataplex_v1::model::data_profile_result::post_scan_actions_result::big_query_export_result::State;
/// let x0 = BigQueryExportResult::new().set_state(State::Succeeded);
/// let x1 = BigQueryExportResult::new().set_state(State::Failed);
/// let x2 = BigQueryExportResult::new().set_state(State::Skipped);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::data_profile_result::post_scan_actions_result::big_query_export_result::State>>(mut self, v: T) -> Self{
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::data_profile_result::post_scan_actions_result::BigQueryExportResult::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_profile_result::post_scan_actions_result::BigQueryExportResult;
/// let x = BigQueryExportResult::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for BigQueryExportResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataProfileResult.PostScanActionsResult.BigQueryExportResult"
}
}
/// Defines additional types related to [BigQueryExportResult].
pub mod big_query_export_result {
#[allow(unused_imports)]
use super::*;
/// Execution state for the exporting.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// The exporting state is unspecified.
Unspecified,
/// The exporting completed successfully.
Succeeded,
/// The exporting is no longer running due to an error.
Failed,
/// The exporting is skipped due to no valid scan result to export
/// (usually caused by scan failed).
Skipped,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Skipped => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"SKIPPED" => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Skipped => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.DataProfileResult.PostScanActionsResult.BigQueryExportResult.State"))
}
}
}
}
}
/// DataQualityScan related setting.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualitySpec {
/// Required. The list of rules to evaluate against a data source. At least one
/// rule is required.
pub rules: std::vec::Vec<crate::model::DataQualityRule>,
/// Optional. The percentage of the records to be selected from the dataset for
/// DataScan.
///
/// * Value can range between 0.0 and 100.0 with up to 3 significant decimal
/// digits.
/// * Sampling is not applied if `sampling_percent` is not specified, 0 or
///
pub sampling_percent: f32,
/// Optional. A filter applied to all rows in a single DataScan job.
/// The filter needs to be a valid SQL expression for a [WHERE clause in
/// GoogleSQL
/// syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#where_clause).
///
/// Example: col1 >= 0 AND col2 < 10
pub row_filter: std::string::String,
/// Optional. Actions to take upon job completion.
pub post_scan_actions: std::option::Option<crate::model::data_quality_spec::PostScanActions>,
/// Optional. If set, the latest DataScan job result will be published as
/// Dataplex Universal Catalog metadata.
pub catalog_publishing_enabled: bool,
/// Optional. If enabled, the data scan will retrieve rules defined in the
/// dataplex-types.global.data-rules aspect on all paths of the catalog entry
/// corresponding to the BigQuery table resource and all attached glossary
/// terms. The path that data-rules aspect is attached on the table entry
/// defines the column that the rule will be evaluated against. For glossary
/// terms, the path that the terms are attached on the table entry defines the
/// column that the rule will be evaluated against. At the start of scan
/// execution, the rules reflect the latest state retrieved from the catalog
/// entry and any updates on the rules thereafter are ignored for that
/// execution. The updates will be reflected from the next execution. Rules
/// defined in the datascan must be empty if this field is enabled.
pub enable_catalog_based_rules: bool,
/// Optional. Filter for selectively running a subset of rules. You can filter
/// the request by the name or attribute key-value pairs defined on the rule.
/// If not specified, all rules are run. The filter is applicable to both, the
/// rules retrieved from catalog and explicitly defined rules in the scan.
/// Please see [filter
/// syntax](https://docs.cloud.google.com/dataplex/docs/auto-data-quality-overview#rule-filtering)
/// for more details.
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualitySpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [rules][crate::model::DataQualitySpec::rules].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualitySpec::new()
/// .set_rules([
/// DataQualityRule::default()/* use setters */,
/// DataQualityRule::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataQualityRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [sampling_percent][crate::model::DataQualitySpec::sampling_percent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataQualitySpec::new().set_sampling_percent(42.0);
/// ```
pub fn set_sampling_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.sampling_percent = v.into();
self
}
/// Sets the value of [row_filter][crate::model::DataQualitySpec::row_filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataQualitySpec::new().set_row_filter("example");
/// ```
pub fn set_row_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.row_filter = v.into();
self
}
/// Sets the value of [post_scan_actions][crate::model::DataQualitySpec::post_scan_actions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// use google_cloud_dataplex_v1::model::data_quality_spec::PostScanActions;
/// let x = DataQualitySpec::new().set_post_scan_actions(PostScanActions::default()/* use setters */);
/// ```
pub fn set_post_scan_actions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_quality_spec::PostScanActions>,
{
self.post_scan_actions = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [post_scan_actions][crate::model::DataQualitySpec::post_scan_actions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// use google_cloud_dataplex_v1::model::data_quality_spec::PostScanActions;
/// let x = DataQualitySpec::new().set_or_clear_post_scan_actions(Some(PostScanActions::default()/* use setters */));
/// let x = DataQualitySpec::new().set_or_clear_post_scan_actions(None::<PostScanActions>);
/// ```
pub fn set_or_clear_post_scan_actions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_quality_spec::PostScanActions>,
{
self.post_scan_actions = v.map(|x| x.into());
self
}
/// Sets the value of [catalog_publishing_enabled][crate::model::DataQualitySpec::catalog_publishing_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataQualitySpec::new().set_catalog_publishing_enabled(true);
/// ```
pub fn set_catalog_publishing_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.catalog_publishing_enabled = v.into();
self
}
/// Sets the value of [enable_catalog_based_rules][crate::model::DataQualitySpec::enable_catalog_based_rules].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataQualitySpec::new().set_enable_catalog_based_rules(true);
/// ```
pub fn set_enable_catalog_based_rules<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_catalog_based_rules = v.into();
self
}
/// Sets the value of [filter][crate::model::DataQualitySpec::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataQualitySpec::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for DataQualitySpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec"
}
}
/// Defines additional types related to [DataQualitySpec].
pub mod data_quality_spec {
#[allow(unused_imports)]
use super::*;
/// The configuration of post scan actions of DataQualityScan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostScanActions {
/// Optional. If set, results will be exported to the provided BigQuery
/// table.
pub bigquery_export:
std::option::Option<crate::model::data_quality_spec::post_scan_actions::BigQueryExport>,
/// Optional. If set, results will be sent to the provided notification
/// receipts upon triggers.
pub notification_report: std::option::Option<
crate::model::data_quality_spec::post_scan_actions::NotificationReport,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostScanActions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_export][crate::model::data_quality_spec::PostScanActions::bigquery_export].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::PostScanActions;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::BigQueryExport;
/// let x = PostScanActions::new().set_bigquery_export(BigQueryExport::default()/* use setters */);
/// ```
pub fn set_bigquery_export<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::BigQueryExport,
>,
{
self.bigquery_export = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_export][crate::model::data_quality_spec::PostScanActions::bigquery_export].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::PostScanActions;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::BigQueryExport;
/// let x = PostScanActions::new().set_or_clear_bigquery_export(Some(BigQueryExport::default()/* use setters */));
/// let x = PostScanActions::new().set_or_clear_bigquery_export(None::<BigQueryExport>);
/// ```
pub fn set_or_clear_bigquery_export<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::BigQueryExport,
>,
{
self.bigquery_export = v.map(|x| x.into());
self
}
/// Sets the value of [notification_report][crate::model::data_quality_spec::PostScanActions::notification_report].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::PostScanActions;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// let x = PostScanActions::new().set_notification_report(NotificationReport::default()/* use setters */);
/// ```
pub fn set_notification_report<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::NotificationReport,
>,
{
self.notification_report = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [notification_report][crate::model::data_quality_spec::PostScanActions::notification_report].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::PostScanActions;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// let x = PostScanActions::new().set_or_clear_notification_report(Some(NotificationReport::default()/* use setters */));
/// let x = PostScanActions::new().set_or_clear_notification_report(None::<NotificationReport>);
/// ```
pub fn set_or_clear_notification_report<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::NotificationReport,
>,
{
self.notification_report = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostScanActions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions"
}
}
/// Defines additional types related to [PostScanActions].
pub mod post_scan_actions {
#[allow(unused_imports)]
use super::*;
/// The configuration of BigQuery export post scan action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExport {
/// Optional. The BigQuery table to export DataQualityScan results to.
/// Format:
/// //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
/// or
/// projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
pub results_table: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExport {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [results_table][crate::model::data_quality_spec::post_scan_actions::BigQueryExport::results_table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::BigQueryExport;
/// let x = BigQueryExport::new().set_results_table("example");
/// ```
pub fn set_results_table<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.results_table = v.into();
self
}
}
impl wkt::message::Message for BigQueryExport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.BigQueryExport"
}
}
/// The individuals or groups who are designated to receive notifications
/// upon triggers.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Recipients {
/// Optional. The email recipients who will receive the DataQualityScan
/// results report.
pub emails: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Recipients {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [emails][crate::model::data_quality_spec::post_scan_actions::Recipients::emails].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::Recipients;
/// let x = Recipients::new().set_emails(["a", "b", "c"]);
/// ```
pub fn set_emails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.emails = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Recipients {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.Recipients"
}
}
/// This trigger is triggered when the DQ score in the job result is less
/// than a specified input score.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScoreThresholdTrigger {
/// Optional. The score range is in [0,100].
pub score_threshold: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScoreThresholdTrigger {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [score_threshold][crate::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger::score_threshold].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger;
/// let x = ScoreThresholdTrigger::new().set_score_threshold(42.0);
/// ```
pub fn set_score_threshold<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.score_threshold = v.into();
self
}
}
impl wkt::message::Message for ScoreThresholdTrigger {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.ScoreThresholdTrigger"
}
}
/// This trigger is triggered when the scan job itself fails, regardless of
/// the result.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobFailureTrigger {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobFailureTrigger {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for JobFailureTrigger {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.JobFailureTrigger"
}
}
/// This trigger is triggered whenever a scan job run ends, regardless
/// of the result.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobEndTrigger {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobEndTrigger {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for JobEndTrigger {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.JobEndTrigger"
}
}
/// The configuration of notification report post scan action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NotificationReport {
/// Required. The recipients who will receive the notification report.
pub recipients:
std::option::Option<crate::model::data_quality_spec::post_scan_actions::Recipients>,
/// Optional. If set, report will be sent when score threshold is met.
pub score_threshold_trigger: std::option::Option<
crate::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger,
>,
/// Optional. If set, report will be sent when a scan job fails.
pub job_failure_trigger: std::option::Option<
crate::model::data_quality_spec::post_scan_actions::JobFailureTrigger,
>,
/// Optional. If set, report will be sent when a scan job ends.
pub job_end_trigger: std::option::Option<
crate::model::data_quality_spec::post_scan_actions::JobEndTrigger,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NotificationReport {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [recipients][crate::model::data_quality_spec::post_scan_actions::NotificationReport::recipients].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::Recipients;
/// let x = NotificationReport::new().set_recipients(Recipients::default()/* use setters */);
/// ```
pub fn set_recipients<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::Recipients,
>,
{
self.recipients = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [recipients][crate::model::data_quality_spec::post_scan_actions::NotificationReport::recipients].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::Recipients;
/// let x = NotificationReport::new().set_or_clear_recipients(Some(Recipients::default()/* use setters */));
/// let x = NotificationReport::new().set_or_clear_recipients(None::<Recipients>);
/// ```
pub fn set_or_clear_recipients<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::Recipients,
>,
{
self.recipients = v.map(|x| x.into());
self
}
/// Sets the value of [score_threshold_trigger][crate::model::data_quality_spec::post_scan_actions::NotificationReport::score_threshold_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger;
/// let x = NotificationReport::new().set_score_threshold_trigger(ScoreThresholdTrigger::default()/* use setters */);
/// ```
pub fn set_score_threshold_trigger<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger,
>,
{
self.score_threshold_trigger = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [score_threshold_trigger][crate::model::data_quality_spec::post_scan_actions::NotificationReport::score_threshold_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger;
/// let x = NotificationReport::new().set_or_clear_score_threshold_trigger(Some(ScoreThresholdTrigger::default()/* use setters */));
/// let x = NotificationReport::new().set_or_clear_score_threshold_trigger(None::<ScoreThresholdTrigger>);
/// ```
pub fn set_or_clear_score_threshold_trigger<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::ScoreThresholdTrigger,
>,
{
self.score_threshold_trigger = v.map(|x| x.into());
self
}
/// Sets the value of [job_failure_trigger][crate::model::data_quality_spec::post_scan_actions::NotificationReport::job_failure_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::JobFailureTrigger;
/// let x = NotificationReport::new().set_job_failure_trigger(JobFailureTrigger::default()/* use setters */);
/// ```
pub fn set_job_failure_trigger<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::JobFailureTrigger,
>,
{
self.job_failure_trigger = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [job_failure_trigger][crate::model::data_quality_spec::post_scan_actions::NotificationReport::job_failure_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::JobFailureTrigger;
/// let x = NotificationReport::new().set_or_clear_job_failure_trigger(Some(JobFailureTrigger::default()/* use setters */));
/// let x = NotificationReport::new().set_or_clear_job_failure_trigger(None::<JobFailureTrigger>);
/// ```
pub fn set_or_clear_job_failure_trigger<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::JobFailureTrigger,
>,
{
self.job_failure_trigger = v.map(|x| x.into());
self
}
/// Sets the value of [job_end_trigger][crate::model::data_quality_spec::post_scan_actions::NotificationReport::job_end_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::JobEndTrigger;
/// let x = NotificationReport::new().set_job_end_trigger(JobEndTrigger::default()/* use setters */);
/// ```
pub fn set_job_end_trigger<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::JobEndTrigger,
>,
{
self.job_end_trigger = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [job_end_trigger][crate::model::data_quality_spec::post_scan_actions::NotificationReport::job_end_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::NotificationReport;
/// use google_cloud_dataplex_v1::model::data_quality_spec::post_scan_actions::JobEndTrigger;
/// let x = NotificationReport::new().set_or_clear_job_end_trigger(Some(JobEndTrigger::default()/* use setters */));
/// let x = NotificationReport::new().set_or_clear_job_end_trigger(None::<JobEndTrigger>);
/// ```
pub fn set_or_clear_job_end_trigger<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_quality_spec::post_scan_actions::JobEndTrigger,
>,
{
self.job_end_trigger = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for NotificationReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.NotificationReport"
}
}
}
}
/// The output of a DataQualityScan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityResult {
/// Output only. Overall data quality result -- `true` if all rules passed.
pub passed: bool,
/// Output only. The overall data quality score.
///
/// The score ranges between [0, 100] (up to two decimal points).
pub score: std::option::Option<f32>,
/// Output only. A list of results at the dimension level.
///
/// A dimension will have a corresponding `DataQualityDimensionResult` if and
/// only if there is at least one rule with the 'dimension' field set to it.
pub dimensions: std::vec::Vec<crate::model::DataQualityDimensionResult>,
/// Output only. A list of results at the column level.
///
/// A column will have a corresponding `DataQualityColumnResult` if and only if
/// there is at least one rule with the 'column' field set to it.
pub columns: std::vec::Vec<crate::model::DataQualityColumnResult>,
/// Output only. A list of all the rules in a job, and their results.
pub rules: std::vec::Vec<crate::model::DataQualityRuleResult>,
/// Output only. The count of rows processed.
pub row_count: i64,
/// Output only. The data scanned for this result.
pub scanned_data: std::option::Option<crate::model::ScannedData>,
/// Output only. The result of post scan actions.
pub post_scan_actions_result:
std::option::Option<crate::model::data_quality_result::PostScanActionsResult>,
/// Output only. The status of publishing the data scan as Dataplex Universal
/// Catalog metadata.
pub catalog_publishing_status:
std::option::Option<crate::model::DataScanCatalogPublishingStatus>,
/// Output only. The generated assets for anomaly detection.
pub anomaly_detection_generated_assets:
std::option::Option<crate::model::data_quality_result::AnomalyDetectionGeneratedAssets>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [passed][crate::model::DataQualityResult::passed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataQualityResult::new().set_passed(true);
/// ```
pub fn set_passed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.passed = v.into();
self
}
/// Sets the value of [score][crate::model::DataQualityResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataQualityResult::new().set_score(42.0);
/// ```
pub fn set_score<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f32>,
{
self.score = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [score][crate::model::DataQualityResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataQualityResult::new().set_or_clear_score(Some(42.0));
/// let x = DataQualityResult::new().set_or_clear_score(None::<f32>);
/// ```
pub fn set_or_clear_score<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f32>,
{
self.score = v.map(|x| x.into());
self
}
/// Sets the value of [dimensions][crate::model::DataQualityResult::dimensions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// let x = DataQualityResult::new()
/// .set_dimensions([
/// DataQualityDimensionResult::default()/* use setters */,
/// DataQualityDimensionResult::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_dimensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataQualityDimensionResult>,
{
use std::iter::Iterator;
self.dimensions = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [columns][crate::model::DataQualityResult::columns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::DataQualityColumnResult;
/// let x = DataQualityResult::new()
/// .set_columns([
/// DataQualityColumnResult::default()/* use setters */,
/// DataQualityColumnResult::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_columns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataQualityColumnResult>,
{
use std::iter::Iterator;
self.columns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [rules][crate::model::DataQualityResult::rules].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityResult::new()
/// .set_rules([
/// DataQualityRuleResult::default()/* use setters */,
/// DataQualityRuleResult::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataQualityRuleResult>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [row_count][crate::model::DataQualityResult::row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataQualityResult::new().set_row_count(42);
/// ```
pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.row_count = v.into();
self
}
/// Sets the value of [scanned_data][crate::model::DataQualityResult::scanned_data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::ScannedData;
/// let x = DataQualityResult::new().set_scanned_data(ScannedData::default()/* use setters */);
/// ```
pub fn set_scanned_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ScannedData>,
{
self.scanned_data = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scanned_data][crate::model::DataQualityResult::scanned_data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::ScannedData;
/// let x = DataQualityResult::new().set_or_clear_scanned_data(Some(ScannedData::default()/* use setters */));
/// let x = DataQualityResult::new().set_or_clear_scanned_data(None::<ScannedData>);
/// ```
pub fn set_or_clear_scanned_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ScannedData>,
{
self.scanned_data = v.map(|x| x.into());
self
}
/// Sets the value of [post_scan_actions_result][crate::model::DataQualityResult::post_scan_actions_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::PostScanActionsResult;
/// let x = DataQualityResult::new().set_post_scan_actions_result(PostScanActionsResult::default()/* use setters */);
/// ```
pub fn set_post_scan_actions_result<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_quality_result::PostScanActionsResult>,
{
self.post_scan_actions_result = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [post_scan_actions_result][crate::model::DataQualityResult::post_scan_actions_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::PostScanActionsResult;
/// let x = DataQualityResult::new().set_or_clear_post_scan_actions_result(Some(PostScanActionsResult::default()/* use setters */));
/// let x = DataQualityResult::new().set_or_clear_post_scan_actions_result(None::<PostScanActionsResult>);
/// ```
pub fn set_or_clear_post_scan_actions_result<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_quality_result::PostScanActionsResult>,
{
self.post_scan_actions_result = v.map(|x| x.into());
self
}
/// Sets the value of [catalog_publishing_status][crate::model::DataQualityResult::catalog_publishing_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// let x = DataQualityResult::new().set_catalog_publishing_status(DataScanCatalogPublishingStatus::default()/* use setters */);
/// ```
pub fn set_catalog_publishing_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataScanCatalogPublishingStatus>,
{
self.catalog_publishing_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [catalog_publishing_status][crate::model::DataQualityResult::catalog_publishing_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// let x = DataQualityResult::new().set_or_clear_catalog_publishing_status(Some(DataScanCatalogPublishingStatus::default()/* use setters */));
/// let x = DataQualityResult::new().set_or_clear_catalog_publishing_status(None::<DataScanCatalogPublishingStatus>);
/// ```
pub fn set_or_clear_catalog_publishing_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataScanCatalogPublishingStatus>,
{
self.catalog_publishing_status = v.map(|x| x.into());
self
}
/// Sets the value of [anomaly_detection_generated_assets][crate::model::DataQualityResult::anomaly_detection_generated_assets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::AnomalyDetectionGeneratedAssets;
/// let x = DataQualityResult::new().set_anomaly_detection_generated_assets(AnomalyDetectionGeneratedAssets::default()/* use setters */);
/// ```
pub fn set_anomaly_detection_generated_assets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_quality_result::AnomalyDetectionGeneratedAssets>,
{
self.anomaly_detection_generated_assets = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [anomaly_detection_generated_assets][crate::model::DataQualityResult::anomaly_detection_generated_assets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::AnomalyDetectionGeneratedAssets;
/// let x = DataQualityResult::new().set_or_clear_anomaly_detection_generated_assets(Some(AnomalyDetectionGeneratedAssets::default()/* use setters */));
/// let x = DataQualityResult::new().set_or_clear_anomaly_detection_generated_assets(None::<AnomalyDetectionGeneratedAssets>);
/// ```
pub fn set_or_clear_anomaly_detection_generated_assets<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::data_quality_result::AnomalyDetectionGeneratedAssets>,
{
self.anomaly_detection_generated_assets = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataQualityResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityResult"
}
}
/// Defines additional types related to [DataQualityResult].
pub mod data_quality_result {
#[allow(unused_imports)]
use super::*;
/// The result of post scan actions of DataQualityScan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostScanActionsResult {
/// Output only. The result of BigQuery export post scan action.
pub bigquery_export_result: std::option::Option<
crate::model::data_quality_result::post_scan_actions_result::BigQueryExportResult,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostScanActionsResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_export_result][crate::model::data_quality_result::PostScanActionsResult::bigquery_export_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::PostScanActionsResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::post_scan_actions_result::BigQueryExportResult;
/// let x = PostScanActionsResult::new().set_bigquery_export_result(BigQueryExportResult::default()/* use setters */);
/// ```
pub fn set_bigquery_export_result<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::data_quality_result::post_scan_actions_result::BigQueryExportResult>
{
self.bigquery_export_result = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_export_result][crate::model::data_quality_result::PostScanActionsResult::bigquery_export_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::PostScanActionsResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::post_scan_actions_result::BigQueryExportResult;
/// let x = PostScanActionsResult::new().set_or_clear_bigquery_export_result(Some(BigQueryExportResult::default()/* use setters */));
/// let x = PostScanActionsResult::new().set_or_clear_bigquery_export_result(None::<BigQueryExportResult>);
/// ```
pub fn set_or_clear_bigquery_export_result<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::data_quality_result::post_scan_actions_result::BigQueryExportResult>
{
self.bigquery_export_result = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostScanActionsResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityResult.PostScanActionsResult"
}
}
/// Defines additional types related to [PostScanActionsResult].
pub mod post_scan_actions_result {
#[allow(unused_imports)]
use super::*;
/// The result of BigQuery export post scan action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExportResult {
/// Output only. Execution state for the BigQuery exporting.
pub state: crate::model::data_quality_result::post_scan_actions_result::big_query_export_result::State,
/// Output only. Additional information about the BigQuery exporting.
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExportResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::data_quality_result::post_scan_actions_result::BigQueryExportResult::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::post_scan_actions_result::BigQueryExportResult;
/// use google_cloud_dataplex_v1::model::data_quality_result::post_scan_actions_result::big_query_export_result::State;
/// let x0 = BigQueryExportResult::new().set_state(State::Succeeded);
/// let x1 = BigQueryExportResult::new().set_state(State::Failed);
/// let x2 = BigQueryExportResult::new().set_state(State::Skipped);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::data_quality_result::post_scan_actions_result::big_query_export_result::State>>(mut self, v: T) -> Self{
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::data_quality_result::post_scan_actions_result::BigQueryExportResult::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::post_scan_actions_result::BigQueryExportResult;
/// let x = BigQueryExportResult::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for BigQueryExportResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityResult.PostScanActionsResult.BigQueryExportResult"
}
}
/// Defines additional types related to [BigQueryExportResult].
pub mod big_query_export_result {
#[allow(unused_imports)]
use super::*;
/// Execution state for the exporting.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// The exporting state is unspecified.
Unspecified,
/// The exporting completed successfully.
Succeeded,
/// The exporting is no longer running due to an error.
Failed,
/// The exporting is skipped due to no valid scan result to export
/// (usually caused by scan failed).
Skipped,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Skipped => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"SKIPPED" => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Skipped => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.DataQualityResult.PostScanActionsResult.BigQueryExportResult.State"))
}
}
}
}
/// The assets generated by Anomaly Detection Data Scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AnomalyDetectionGeneratedAssets {
/// Output only. The result table for anomaly detection.
/// Format:
/// PROJECT_ID.DATASET_ID.TABLE_ID
/// If the result table is set at AnomalyDetectionAssets, the result table
/// here would be the same as the one set in the
/// AnomalyDetectionAssets.result_table.
pub result_table: std::string::String,
/// Output only. The intermediate table for data anomaly detection.
/// Format:
/// PROJECT_ID.DATASET_ID.TABLE_ID
pub data_intermediate_table: std::string::String,
/// Output only. The intermediate table for freshness anomaly detection.
/// Format:
/// PROJECT_ID.DATASET_ID.TABLE_ID
pub freshness_intermediate_table: std::string::String,
/// Output only. The intermediate table for volume anomaly detection.
/// Format:
/// PROJECT_ID.DATASET_ID.TABLE_ID
pub volume_intermediate_table: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AnomalyDetectionGeneratedAssets {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [result_table][crate::model::data_quality_result::AnomalyDetectionGeneratedAssets::result_table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::AnomalyDetectionGeneratedAssets;
/// let x = AnomalyDetectionGeneratedAssets::new().set_result_table("example");
/// ```
pub fn set_result_table<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.result_table = v.into();
self
}
/// Sets the value of [data_intermediate_table][crate::model::data_quality_result::AnomalyDetectionGeneratedAssets::data_intermediate_table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::AnomalyDetectionGeneratedAssets;
/// let x = AnomalyDetectionGeneratedAssets::new().set_data_intermediate_table("example");
/// ```
pub fn set_data_intermediate_table<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_intermediate_table = v.into();
self
}
/// Sets the value of [freshness_intermediate_table][crate::model::data_quality_result::AnomalyDetectionGeneratedAssets::freshness_intermediate_table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::AnomalyDetectionGeneratedAssets;
/// let x = AnomalyDetectionGeneratedAssets::new().set_freshness_intermediate_table("example");
/// ```
pub fn set_freshness_intermediate_table<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.freshness_intermediate_table = v.into();
self
}
/// Sets the value of [volume_intermediate_table][crate::model::data_quality_result::AnomalyDetectionGeneratedAssets::volume_intermediate_table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_result::AnomalyDetectionGeneratedAssets;
/// let x = AnomalyDetectionGeneratedAssets::new().set_volume_intermediate_table("example");
/// ```
pub fn set_volume_intermediate_table<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.volume_intermediate_table = v.into();
self
}
}
impl wkt::message::Message for AnomalyDetectionGeneratedAssets {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityResult.AnomalyDetectionGeneratedAssets"
}
}
}
/// DataQualityRuleResult provides a more detailed, per-rule view of the results.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityRuleResult {
/// Output only. The rule specified in the DataQualitySpec, as is.
pub rule: std::option::Option<crate::model::DataQualityRule>,
/// Output only. Whether the rule passed or failed.
pub passed: bool,
/// Output only. The number of rows a rule was evaluated against.
///
/// This field is only valid for row-level type rules.
///
/// Evaluated count can be configured to either
///
/// * include all rows (default) - with `null` rows automatically failing rule
/// evaluation, or
/// * exclude `null` rows from the `evaluated_count`, by setting
/// `ignore_nulls = true`.
///
/// This field is not set for rule SqlAssertion.
pub evaluated_count: i64,
/// Output only. The number of rows which passed a rule evaluation.
///
/// This field is only valid for row-level type rules.
///
/// This field is not set for rule SqlAssertion.
pub passed_count: i64,
/// Output only. The number of rows with null values in the specified column.
pub null_count: i64,
/// Output only. The ratio of **passed_count / evaluated_count**.
///
/// This field is only valid for row-level type rules.
pub pass_ratio: f64,
/// Output only. The query to find rows that did not pass this rule.
///
/// This field is only valid for row-level type rules.
pub failing_rows_query: std::string::String,
/// Output only. The number of rows returned by the SQL statement in a SQL
/// assertion rule.
///
/// This field is only valid for SQL assertion rules.
pub assertion_row_count: i64,
/// Output only. Contains the results of all debug queries for this rule.
/// The number of result sets will correspond to the number of
/// [debug_queries][google.cloud.dataplex.v1.DataQualityRule.debug_queries].
///
/// [google.cloud.dataplex.v1.DataQualityRule.debug_queries]: crate::model::DataQualityRule::debug_queries
pub debug_queries_result_sets:
std::vec::Vec<crate::model::data_quality_rule_result::DebugQueryResultSet>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityRuleResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [rule][crate::model::DataQualityRuleResult::rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRuleResult::new().set_rule(DataQualityRule::default()/* use setters */);
/// ```
pub fn set_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataQualityRule>,
{
self.rule = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rule][crate::model::DataQualityRuleResult::rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRuleResult::new().set_or_clear_rule(Some(DataQualityRule::default()/* use setters */));
/// let x = DataQualityRuleResult::new().set_or_clear_rule(None::<DataQualityRule>);
/// ```
pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataQualityRule>,
{
self.rule = v.map(|x| x.into());
self
}
/// Sets the value of [passed][crate::model::DataQualityRuleResult::passed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_passed(true);
/// ```
pub fn set_passed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.passed = v.into();
self
}
/// Sets the value of [evaluated_count][crate::model::DataQualityRuleResult::evaluated_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_evaluated_count(42);
/// ```
pub fn set_evaluated_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.evaluated_count = v.into();
self
}
/// Sets the value of [passed_count][crate::model::DataQualityRuleResult::passed_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_passed_count(42);
/// ```
pub fn set_passed_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.passed_count = v.into();
self
}
/// Sets the value of [null_count][crate::model::DataQualityRuleResult::null_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_null_count(42);
/// ```
pub fn set_null_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.null_count = v.into();
self
}
/// Sets the value of [pass_ratio][crate::model::DataQualityRuleResult::pass_ratio].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_pass_ratio(42.0);
/// ```
pub fn set_pass_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.pass_ratio = v.into();
self
}
/// Sets the value of [failing_rows_query][crate::model::DataQualityRuleResult::failing_rows_query].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_failing_rows_query("example");
/// ```
pub fn set_failing_rows_query<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.failing_rows_query = v.into();
self
}
/// Sets the value of [assertion_row_count][crate::model::DataQualityRuleResult::assertion_row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// let x = DataQualityRuleResult::new().set_assertion_row_count(42);
/// ```
pub fn set_assertion_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.assertion_row_count = v.into();
self
}
/// Sets the value of [debug_queries_result_sets][crate::model::DataQualityRuleResult::debug_queries_result_sets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleResult;
/// use google_cloud_dataplex_v1::model::data_quality_rule_result::DebugQueryResultSet;
/// let x = DataQualityRuleResult::new()
/// .set_debug_queries_result_sets([
/// DebugQueryResultSet::default()/* use setters */,
/// DebugQueryResultSet::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_debug_queries_result_sets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_quality_rule_result::DebugQueryResultSet>,
{
use std::iter::Iterator;
self.debug_queries_result_sets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataQualityRuleResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRuleResult"
}
}
/// Defines additional types related to [DataQualityRuleResult].
pub mod data_quality_rule_result {
#[allow(unused_imports)]
use super::*;
/// Contains a single result from the debug query.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DebugQueryResult {
/// Specifies the name of the result. Available if provided with an explicit
/// alias using `[AS] alias`.
pub name: std::string::String,
/// Indicates the data type of the result. For more information, see
/// [BigQuery data
/// types](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types).
pub r#type: std::string::String,
/// Represents the value of the result as a string.
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DebugQueryResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::data_quality_rule_result::DebugQueryResult::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_result::DebugQueryResult;
/// let x = DebugQueryResult::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [r#type][crate::model::data_quality_rule_result::DebugQueryResult::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_result::DebugQueryResult;
/// let x = DebugQueryResult::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [value][crate::model::data_quality_rule_result::DebugQueryResult::value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_result::DebugQueryResult;
/// let x = DebugQueryResult::new().set_value("example");
/// ```
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for DebugQueryResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRuleResult.DebugQueryResult"
}
}
/// Contains all results from a debug query.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DebugQueryResultSet {
/// Output only. Contains all results. Up to 10 results can be returned.
pub results: std::vec::Vec<crate::model::data_quality_rule_result::DebugQueryResult>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DebugQueryResultSet {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [results][crate::model::data_quality_rule_result::DebugQueryResultSet::results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_result::DebugQueryResultSet;
/// use google_cloud_dataplex_v1::model::data_quality_rule_result::DebugQueryResult;
/// let x = DebugQueryResultSet::new()
/// .set_results([
/// DebugQueryResult::default()/* use setters */,
/// DebugQueryResult::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_quality_rule_result::DebugQueryResult>,
{
use std::iter::Iterator;
self.results = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DebugQueryResultSet {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRuleResult.DebugQueryResultSet"
}
}
}
/// DataQualityDimensionResult provides a more detailed, per-dimension view of
/// the results.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityDimensionResult {
/// Output only. The dimension config specified in the DataQualitySpec, as is.
pub dimension: std::option::Option<crate::model::DataQualityDimension>,
/// Output only. Whether the dimension passed or failed.
pub passed: bool,
/// Output only. The dimension-level data quality score for this data scan job
/// if and only if the 'dimension' field is set.
///
/// The score ranges between [0, 100] (up to two decimal
/// points).
pub score: std::option::Option<f32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityDimensionResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dimension][crate::model::DataQualityDimensionResult::dimension].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// use google_cloud_dataplex_v1::model::DataQualityDimension;
/// let x = DataQualityDimensionResult::new().set_dimension(DataQualityDimension::default()/* use setters */);
/// ```
pub fn set_dimension<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataQualityDimension>,
{
self.dimension = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dimension][crate::model::DataQualityDimensionResult::dimension].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// use google_cloud_dataplex_v1::model::DataQualityDimension;
/// let x = DataQualityDimensionResult::new().set_or_clear_dimension(Some(DataQualityDimension::default()/* use setters */));
/// let x = DataQualityDimensionResult::new().set_or_clear_dimension(None::<DataQualityDimension>);
/// ```
pub fn set_or_clear_dimension<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataQualityDimension>,
{
self.dimension = v.map(|x| x.into());
self
}
/// Sets the value of [passed][crate::model::DataQualityDimensionResult::passed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// let x = DataQualityDimensionResult::new().set_passed(true);
/// ```
pub fn set_passed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.passed = v.into();
self
}
/// Sets the value of [score][crate::model::DataQualityDimensionResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// let x = DataQualityDimensionResult::new().set_score(42.0);
/// ```
pub fn set_score<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f32>,
{
self.score = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [score][crate::model::DataQualityDimensionResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// let x = DataQualityDimensionResult::new().set_or_clear_score(Some(42.0));
/// let x = DataQualityDimensionResult::new().set_or_clear_score(None::<f32>);
/// ```
pub fn set_or_clear_score<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f32>,
{
self.score = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataQualityDimensionResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityDimensionResult"
}
}
/// A dimension captures data quality intent about a defined subset of the rules
/// specified.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityDimension {
/// Output only. The dimension name a rule belongs to. Custom dimension name is
/// supported with all uppercase letters and maximum length of 30 characters.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityDimension {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataQualityDimension::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityDimension;
/// let x = DataQualityDimension::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DataQualityDimension {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityDimension"
}
}
/// A rule captures data quality intent about a data source.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityRule {
/// Optional. The unnested column which this rule is evaluated against.
pub column: std::string::String,
/// Optional. Rows with `null` values will automatically fail a rule, unless
/// `ignore_null` is `true`. In that case, such `null` rows are trivially
/// considered passing.
///
/// This field is only valid for the following type of rules:
///
/// * RangeExpectation
/// * RegexExpectation
/// * SetExpectation
/// * UniquenessExpectation
pub ignore_null: bool,
/// Optional. The dimension a rule belongs to. Results are also aggregated at
/// the dimension level. Custom dimension name is supported with all uppercase
/// letters and maximum length of 30 characters.
pub dimension: std::string::String,
/// Optional. The minimum ratio of **passing_rows / total_rows** required to
/// pass this rule, with a range of [0.0, 1.0].
///
/// 0 indicates default value (i.e. 1.0).
///
/// This field is only valid for row-level type rules.
pub threshold: f64,
/// Optional. A mutable name for the rule.
///
/// * The name must contain only letters (a-z, A-Z), numbers (0-9), or
/// hyphens (-).
/// * The maximum length is 63 characters.
/// * Must start with a letter.
/// * Must end with a number or a letter.
pub name: std::string::String,
/// Optional. Description of the rule.
///
/// * The maximum length is 1,024 characters.
pub description: std::string::String,
/// Optional. Whether the Rule is active or suspended.
/// Default is false.
pub suspended: bool,
/// Optional. Map of attribute name and value linked to the rule. The rules to
/// evaluate can be filtered based on attributes provided here and a filter
/// expression provided in the DataQualitySpec.filter field.
pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
/// Output only. Contains information about the source of the rule and its
/// relationship with the BigQuery table, where applicable.
pub rule_source: std::option::Option<crate::model::data_quality_rule::RuleSource>,
/// Optional. Specifies the debug queries for this rule.
/// Currently, only one query is supported, but this may be expanded in the
/// future.
pub debug_queries: std::vec::Vec<crate::model::data_quality_rule::DebugQuery>,
/// The rule-specific configuration.
pub rule_type: std::option::Option<crate::model::data_quality_rule::RuleType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityRule {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [column][crate::model::DataQualityRule::column].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_column("example");
/// ```
pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.column = v.into();
self
}
/// Sets the value of [ignore_null][crate::model::DataQualityRule::ignore_null].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_ignore_null(true);
/// ```
pub fn set_ignore_null<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_null = v.into();
self
}
/// Sets the value of [dimension][crate::model::DataQualityRule::dimension].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_dimension("example");
/// ```
pub fn set_dimension<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dimension = v.into();
self
}
/// Sets the value of [threshold][crate::model::DataQualityRule::threshold].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_threshold(42.0);
/// ```
pub fn set_threshold<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.threshold = v.into();
self
}
/// Sets the value of [name][crate::model::DataQualityRule::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [description][crate::model::DataQualityRule::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [suspended][crate::model::DataQualityRule::suspended].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_suspended(true);
/// ```
pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.suspended = v.into();
self
}
/// Sets the value of [attributes][crate::model::DataQualityRule::attributes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = DataQualityRule::new().set_attributes([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [rule_source][crate::model::DataQualityRule::rule_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::RuleSource;
/// let x = DataQualityRule::new().set_rule_source(RuleSource::default()/* use setters */);
/// ```
pub fn set_rule_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_quality_rule::RuleSource>,
{
self.rule_source = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rule_source][crate::model::DataQualityRule::rule_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::RuleSource;
/// let x = DataQualityRule::new().set_or_clear_rule_source(Some(RuleSource::default()/* use setters */));
/// let x = DataQualityRule::new().set_or_clear_rule_source(None::<RuleSource>);
/// ```
pub fn set_or_clear_rule_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_quality_rule::RuleSource>,
{
self.rule_source = v.map(|x| x.into());
self
}
/// Sets the value of [debug_queries][crate::model::DataQualityRule::debug_queries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::DebugQuery;
/// let x = DataQualityRule::new()
/// .set_debug_queries([
/// DebugQuery::default()/* use setters */,
/// DebugQuery::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_debug_queries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_quality_rule::DebugQuery>,
{
use std::iter::Iterator;
self.debug_queries = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type].
///
/// Note that all the setters affecting `rule_type` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
/// let x = DataQualityRule::new().set_rule_type(Some(
/// google_cloud_dataplex_v1::model::data_quality_rule::RuleType::RangeExpectation(RangeExpectation::default().into())));
/// ```
pub fn set_rule_type<
T: std::convert::Into<std::option::Option<crate::model::data_quality_rule::RuleType>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = v.into();
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `RangeExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn range_expectation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::RangeExpectation>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::RangeExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `RangeExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
/// let x = DataQualityRule::new().set_range_expectation(RangeExpectation::default()/* use setters */);
/// assert!(x.range_expectation().is_some());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_range_expectation<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::RangeExpectation>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::RangeExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `NonNullExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn non_null_expectation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::NonNullExpectation>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::NonNullExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `NonNullExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::NonNullExpectation;
/// let x = DataQualityRule::new().set_non_null_expectation(NonNullExpectation::default()/* use setters */);
/// assert!(x.non_null_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_non_null_expectation<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::NonNullExpectation>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::NonNullExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `SetExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn set_expectation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::SetExpectation>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::SetExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `SetExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::SetExpectation;
/// let x = DataQualityRule::new().set_set_expectation(SetExpectation::default()/* use setters */);
/// assert!(x.set_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_set_expectation<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::SetExpectation>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::SetExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `RegexExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn regex_expectation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::RegexExpectation>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::RegexExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `RegexExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::RegexExpectation;
/// let x = DataQualityRule::new().set_regex_expectation(RegexExpectation::default()/* use setters */);
/// assert!(x.regex_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_regex_expectation<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::RegexExpectation>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::RegexExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `UniquenessExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn uniqueness_expectation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::UniquenessExpectation>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::UniquenessExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `UniquenessExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::UniquenessExpectation;
/// let x = DataQualityRule::new().set_uniqueness_expectation(UniquenessExpectation::default()/* use setters */);
/// assert!(x.uniqueness_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_uniqueness_expectation<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::UniquenessExpectation>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::UniquenessExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `StatisticRangeExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn statistic_range_expectation(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::data_quality_rule::StatisticRangeExpectation>,
> {
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::StatisticRangeExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `StatisticRangeExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
/// let x = DataQualityRule::new().set_statistic_range_expectation(StatisticRangeExpectation::default()/* use setters */);
/// assert!(x.statistic_range_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_statistic_range_expectation<
T: std::convert::Into<
std::boxed::Box<crate::model::data_quality_rule::StatisticRangeExpectation>,
>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::StatisticRangeExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `RowConditionExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn row_condition_expectation(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::data_quality_rule::RowConditionExpectation>,
> {
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::RowConditionExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `RowConditionExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::RowConditionExpectation;
/// let x = DataQualityRule::new().set_row_condition_expectation(RowConditionExpectation::default()/* use setters */);
/// assert!(x.row_condition_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_row_condition_expectation<
T: std::convert::Into<
std::boxed::Box<crate::model::data_quality_rule::RowConditionExpectation>,
>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::RowConditionExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `TableConditionExpectation`, `None` if the field is not set or
/// holds a different branch.
pub fn table_condition_expectation(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::data_quality_rule::TableConditionExpectation>,
> {
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::TableConditionExpectation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `TableConditionExpectation`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::TableConditionExpectation;
/// let x = DataQualityRule::new().set_table_condition_expectation(TableConditionExpectation::default()/* use setters */);
/// assert!(x.table_condition_expectation().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_table_condition_expectation<
T: std::convert::Into<
std::boxed::Box<crate::model::data_quality_rule::TableConditionExpectation>,
>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::TableConditionExpectation(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `SqlAssertion`, `None` if the field is not set or
/// holds a different branch.
pub fn sql_assertion(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::SqlAssertion>> {
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::SqlAssertion(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `SqlAssertion`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::SqlAssertion;
/// let x = DataQualityRule::new().set_sql_assertion(SqlAssertion::default()/* use setters */);
/// assert!(x.sql_assertion().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.template_reference().is_none());
/// ```
pub fn set_sql_assertion<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::SqlAssertion>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::SqlAssertion(v.into()),
);
self
}
/// The value of [rule_type][crate::model::DataQualityRule::rule_type]
/// if it holds a `TemplateReference`, `None` if the field is not set or
/// holds a different branch.
pub fn template_reference(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::TemplateReference>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::RuleType::TemplateReference(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [rule_type][crate::model::DataQualityRule::rule_type]
/// to hold a `TemplateReference`.
///
/// Note that all the setters affecting `rule_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRule;
/// use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
/// let x = DataQualityRule::new().set_template_reference(TemplateReference::default()/* use setters */);
/// assert!(x.template_reference().is_some());
/// assert!(x.range_expectation().is_none());
/// assert!(x.non_null_expectation().is_none());
/// assert!(x.set_expectation().is_none());
/// assert!(x.regex_expectation().is_none());
/// assert!(x.uniqueness_expectation().is_none());
/// assert!(x.statistic_range_expectation().is_none());
/// assert!(x.row_condition_expectation().is_none());
/// assert!(x.table_condition_expectation().is_none());
/// assert!(x.sql_assertion().is_none());
/// ```
pub fn set_template_reference<
T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::TemplateReference>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::data_quality_rule::RuleType::TemplateReference(v.into()),
);
self
}
}
impl wkt::message::Message for DataQualityRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule"
}
}
/// Defines additional types related to [DataQualityRule].
pub mod data_quality_rule {
#[allow(unused_imports)]
use super::*;
/// Evaluates whether each column value lies between a specified range.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RangeExpectation {
/// Optional. The minimum column value allowed for a row to pass this
/// validation. At least one of `min_value` and `max_value` need to be
/// provided.
pub min_value: std::string::String,
/// Optional. The maximum column value allowed for a row to pass this
/// validation. At least one of `min_value` and `max_value` need to be
/// provided.
pub max_value: std::string::String,
/// Optional. Whether each value needs to be strictly greater than ('>') the
/// minimum, or if equality is allowed.
///
/// Only relevant if a `min_value` has been defined. Default = false.
pub strict_min_enabled: bool,
/// Optional. Whether each value needs to be strictly lesser than ('<') the
/// maximum, or if equality is allowed.
///
/// Only relevant if a `max_value` has been defined. Default = false.
pub strict_max_enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RangeExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [min_value][crate::model::data_quality_rule::RangeExpectation::min_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
/// let x = RangeExpectation::new().set_min_value("example");
/// ```
pub fn set_min_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.min_value = v.into();
self
}
/// Sets the value of [max_value][crate::model::data_quality_rule::RangeExpectation::max_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
/// let x = RangeExpectation::new().set_max_value("example");
/// ```
pub fn set_max_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.max_value = v.into();
self
}
/// Sets the value of [strict_min_enabled][crate::model::data_quality_rule::RangeExpectation::strict_min_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
/// let x = RangeExpectation::new().set_strict_min_enabled(true);
/// ```
pub fn set_strict_min_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.strict_min_enabled = v.into();
self
}
/// Sets the value of [strict_max_enabled][crate::model::data_quality_rule::RangeExpectation::strict_max_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
/// let x = RangeExpectation::new().set_strict_max_enabled(true);
/// ```
pub fn set_strict_max_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.strict_max_enabled = v.into();
self
}
}
impl wkt::message::Message for RangeExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RangeExpectation"
}
}
/// Evaluates whether each column value is null.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NonNullExpectation {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NonNullExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for NonNullExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.NonNullExpectation"
}
}
/// Evaluates whether each column value is contained by a specified set.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SetExpectation {
/// Optional. Expected values for the column value.
pub values: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [values][crate::model::data_quality_rule::SetExpectation::values].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::SetExpectation;
/// let x = SetExpectation::new().set_values(["a", "b", "c"]);
/// ```
pub fn set_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SetExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.SetExpectation"
}
}
/// Evaluates whether each column value matches a specified regex.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegexExpectation {
/// Optional. A regular expression the column value is expected to match.
pub regex: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RegexExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [regex][crate::model::data_quality_rule::RegexExpectation::regex].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RegexExpectation;
/// let x = RegexExpectation::new().set_regex("example");
/// ```
pub fn set_regex<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.regex = v.into();
self
}
}
impl wkt::message::Message for RegexExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RegexExpectation"
}
}
/// Evaluates whether the column has duplicates.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UniquenessExpectation {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UniquenessExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UniquenessExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.UniquenessExpectation"
}
}
/// Evaluates whether the column aggregate statistic lies between a specified
/// range.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StatisticRangeExpectation {
/// Optional. The aggregate metric to evaluate.
pub statistic:
crate::model::data_quality_rule::statistic_range_expectation::ColumnStatistic,
/// Optional. The minimum column statistic value allowed for a row to pass
/// this validation.
///
/// At least one of `min_value` and `max_value` need to be provided.
pub min_value: std::string::String,
/// Optional. The maximum column statistic value allowed for a row to pass
/// this validation.
///
/// At least one of `min_value` and `max_value` need to be provided.
pub max_value: std::string::String,
/// Optional. Whether column statistic needs to be strictly greater than
/// ('>') the minimum, or if equality is allowed.
///
/// Only relevant if a `min_value` has been defined. Default = false.
pub strict_min_enabled: bool,
/// Optional. Whether column statistic needs to be strictly lesser than ('<')
/// the maximum, or if equality is allowed.
///
/// Only relevant if a `max_value` has been defined. Default = false.
pub strict_max_enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StatisticRangeExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [statistic][crate::model::data_quality_rule::StatisticRangeExpectation::statistic].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
/// use google_cloud_dataplex_v1::model::data_quality_rule::statistic_range_expectation::ColumnStatistic;
/// let x0 = StatisticRangeExpectation::new().set_statistic(ColumnStatistic::Mean);
/// let x1 = StatisticRangeExpectation::new().set_statistic(ColumnStatistic::Min);
/// let x2 = StatisticRangeExpectation::new().set_statistic(ColumnStatistic::Max);
/// ```
pub fn set_statistic<
T: std::convert::Into<
crate::model::data_quality_rule::statistic_range_expectation::ColumnStatistic,
>,
>(
mut self,
v: T,
) -> Self {
self.statistic = v.into();
self
}
/// Sets the value of [min_value][crate::model::data_quality_rule::StatisticRangeExpectation::min_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
/// let x = StatisticRangeExpectation::new().set_min_value("example");
/// ```
pub fn set_min_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.min_value = v.into();
self
}
/// Sets the value of [max_value][crate::model::data_quality_rule::StatisticRangeExpectation::max_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
/// let x = StatisticRangeExpectation::new().set_max_value("example");
/// ```
pub fn set_max_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.max_value = v.into();
self
}
/// Sets the value of [strict_min_enabled][crate::model::data_quality_rule::StatisticRangeExpectation::strict_min_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
/// let x = StatisticRangeExpectation::new().set_strict_min_enabled(true);
/// ```
pub fn set_strict_min_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.strict_min_enabled = v.into();
self
}
/// Sets the value of [strict_max_enabled][crate::model::data_quality_rule::StatisticRangeExpectation::strict_max_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
/// let x = StatisticRangeExpectation::new().set_strict_max_enabled(true);
/// ```
pub fn set_strict_max_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.strict_max_enabled = v.into();
self
}
}
impl wkt::message::Message for StatisticRangeExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation"
}
}
/// Defines additional types related to [StatisticRangeExpectation].
pub mod statistic_range_expectation {
#[allow(unused_imports)]
use super::*;
/// The list of aggregate metrics a rule can be evaluated against.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ColumnStatistic {
/// Unspecified statistic type
StatisticUndefined,
/// Evaluate the column mean
Mean,
/// Evaluate the column min
Min,
/// Evaluate the column max
Max,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ColumnStatistic::value] or
/// [ColumnStatistic::name].
UnknownValue(column_statistic::UnknownValue),
}
#[doc(hidden)]
pub mod column_statistic {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ColumnStatistic {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::StatisticUndefined => std::option::Option::Some(0),
Self::Mean => std::option::Option::Some(1),
Self::Min => std::option::Option::Some(2),
Self::Max => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::StatisticUndefined => std::option::Option::Some("STATISTIC_UNDEFINED"),
Self::Mean => std::option::Option::Some("MEAN"),
Self::Min => std::option::Option::Some("MIN"),
Self::Max => std::option::Option::Some("MAX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ColumnStatistic {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ColumnStatistic {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ColumnStatistic {
fn from(value: i32) -> Self {
match value {
0 => Self::StatisticUndefined,
1 => Self::Mean,
2 => Self::Min,
3 => Self::Max,
_ => Self::UnknownValue(column_statistic::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ColumnStatistic {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATISTIC_UNDEFINED" => Self::StatisticUndefined,
"MEAN" => Self::Mean,
"MIN" => Self::Min,
"MAX" => Self::Max,
_ => Self::UnknownValue(column_statistic::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ColumnStatistic {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::StatisticUndefined => serializer.serialize_i32(0),
Self::Mean => serializer.serialize_i32(1),
Self::Min => serializer.serialize_i32(2),
Self::Max => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ColumnStatistic {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ColumnStatistic>::new(
".google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation.ColumnStatistic"))
}
}
}
/// Evaluates whether each row passes the specified condition.
///
/// The SQL expression needs to use [GoogleSQL
/// syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
/// and should produce a boolean value per row as the result.
///
/// Example: col1 >= 0 AND col2 < 10
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RowConditionExpectation {
/// Optional. The SQL expression.
pub sql_expression: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RowConditionExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sql_expression][crate::model::data_quality_rule::RowConditionExpectation::sql_expression].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RowConditionExpectation;
/// let x = RowConditionExpectation::new().set_sql_expression("example");
/// ```
pub fn set_sql_expression<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sql_expression = v.into();
self
}
}
impl wkt::message::Message for RowConditionExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RowConditionExpectation"
}
}
/// Evaluates whether the provided expression is true.
///
/// The SQL expression needs to use [GoogleSQL
/// syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
/// and should produce a scalar boolean result.
///
/// Example: MIN(col1) >= 0
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TableConditionExpectation {
/// Optional. The SQL expression.
pub sql_expression: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TableConditionExpectation {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sql_expression][crate::model::data_quality_rule::TableConditionExpectation::sql_expression].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::TableConditionExpectation;
/// let x = TableConditionExpectation::new().set_sql_expression("example");
/// ```
pub fn set_sql_expression<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sql_expression = v.into();
self
}
}
impl wkt::message::Message for TableConditionExpectation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.TableConditionExpectation"
}
}
/// A SQL statement that is evaluated to return rows that match an invalid
/// state. If any rows are are returned, this rule fails.
///
/// The SQL statement must use [GoogleSQL
/// syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
/// and must not contain any semicolons.
///
/// You can use the data reference parameter `${data()}` to reference the
/// source table with all of its precondition filters applied. Examples of
/// precondition filters include row filters, incremental data filters, and
/// sampling. For more information, see [Data reference
/// parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
///
/// Example: `SELECT * FROM ${data()} WHERE price < 0`
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlAssertion {
/// Optional. The SQL statement.
pub sql_statement: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlAssertion {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sql_statement][crate::model::data_quality_rule::SqlAssertion::sql_statement].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::SqlAssertion;
/// let x = SqlAssertion::new().set_sql_statement("example");
/// ```
pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sql_statement = v.into();
self
}
}
impl wkt::message::Message for SqlAssertion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.SqlAssertion"
}
}
/// A rule that constructs a SQL statement to evaluate using a rule template
/// and parameter values. If the constructed statement returns any rows, this
/// rule fails
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TemplateReference {
/// Required. The template entry name. Entry must be of EntryType
/// `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
/// and contains top-level aspect of AspectType
/// `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
/// The format is:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
pub name: std::string::String,
/// Optional. Provides the map of parameter name and value.
/// The maximum size of the field is 120KB (encoded as UTF-8).
pub values: std::collections::HashMap<
std::string::String,
crate::model::data_quality_rule::template_reference::ParameterValue,
>,
/// Output only. The resolved SQL statement generated from the template with
/// parameters substituted. It is only populated in the result.
pub resolved_sql: std::string::String,
/// Output only. The rule template used to resolve the rule. It is only
/// populated in the result.
pub rule_template: std::option::Option<crate::model::DataQualityRuleTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TemplateReference {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::data_quality_rule::TemplateReference::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let entry_group_id = "entry_group_id";
/// # let entry_id = "entry_id";
/// let x = TemplateReference::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [values][crate::model::data_quality_rule::TemplateReference::values].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
/// use google_cloud_dataplex_v1::model::data_quality_rule::template_reference::ParameterValue;
/// let x = TemplateReference::new().set_values([
/// ("key0", ParameterValue::default()/* use setters */),
/// ("key1", ParameterValue::default()/* use (different) setters */),
/// ]);
/// ```
pub fn set_values<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<
crate::model::data_quality_rule::template_reference::ParameterValue,
>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [resolved_sql][crate::model::data_quality_rule::TemplateReference::resolved_sql].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
/// let x = TemplateReference::new().set_resolved_sql("example");
/// ```
pub fn set_resolved_sql<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resolved_sql = v.into();
self
}
/// Sets the value of [rule_template][crate::model::data_quality_rule::TemplateReference::rule_template].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
/// use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// let x = TemplateReference::new().set_rule_template(DataQualityRuleTemplate::default()/* use setters */);
/// ```
pub fn set_rule_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataQualityRuleTemplate>,
{
self.rule_template = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rule_template][crate::model::data_quality_rule::TemplateReference::rule_template].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
/// use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// let x = TemplateReference::new().set_or_clear_rule_template(Some(DataQualityRuleTemplate::default()/* use setters */));
/// let x = TemplateReference::new().set_or_clear_rule_template(None::<DataQualityRuleTemplate>);
/// ```
pub fn set_or_clear_rule_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataQualityRuleTemplate>,
{
self.rule_template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TemplateReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.TemplateReference"
}
}
/// Defines additional types related to [TemplateReference].
pub mod template_reference {
#[allow(unused_imports)]
use super::*;
/// Represents a parameter value.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ParameterValue {
/// Required. Represents the string value of the parameter.
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ParameterValue {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [value][crate::model::data_quality_rule::template_reference::ParameterValue::value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::template_reference::ParameterValue;
/// let x = ParameterValue::new().set_value("example");
/// ```
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for ParameterValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.TemplateReference.ParameterValue"
}
}
}
/// Represents the rule source information from Catalog.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuleSource {
/// Output only. Rule path elements represent information about the
/// individual items in the relationship path between the scan resource and
/// rule origin in that order.
pub rule_path_elements:
std::vec::Vec<crate::model::data_quality_rule::rule_source::RulePathElement>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuleSource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [rule_path_elements][crate::model::data_quality_rule::RuleSource::rule_path_elements].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::RuleSource;
/// use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::RulePathElement;
/// let x = RuleSource::new()
/// .set_rule_path_elements([
/// RulePathElement::default()/* use setters */,
/// RulePathElement::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_rule_path_elements<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_quality_rule::rule_source::RulePathElement>,
{
use std::iter::Iterator;
self.rule_path_elements = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RuleSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RuleSource"
}
}
/// Defines additional types related to [RuleSource].
pub mod rule_source {
#[allow(unused_imports)]
use super::*;
/// Path Element represents the direct relationship between the rule origin
/// (aspects) to the BigQuery Entry. Ordering of the rule relationship will
/// be maintained such that the first entry in the list is the closest
/// ancestor (BigQuery table itself). A blank source denotes that the rule is
/// derived directly from the DataScan itself.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RulePathElement {
/// The source type of the rule.
pub source_type: std::option::Option<
crate::model::data_quality_rule::rule_source::rule_path_element::SourceType,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RulePathElement {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [source_type][crate::model::data_quality_rule::rule_source::RulePathElement::source_type].
///
/// Note that all the setters affecting `source_type` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::RulePathElement;
/// use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntrySource;
/// let x = RulePathElement::new().set_source_type(Some(
/// google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::SourceType::EntrySource(EntrySource::default().into())));
/// ```
pub fn set_source_type<T: std::convert::Into<std::option::Option<crate::model::data_quality_rule::rule_source::rule_path_element::SourceType>>>(mut self, v: T) -> Self
{
self.source_type = v.into();
self
}
/// The value of [source_type][crate::model::data_quality_rule::rule_source::RulePathElement::source_type]
/// if it holds a `EntrySource`, `None` if the field is not set or
/// holds a different branch.
pub fn entry_source(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::data_quality_rule::rule_source::rule_path_element::EntrySource,
>,
> {
#[allow(unreachable_patterns)]
self.source_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::rule_source::rule_path_element::SourceType::EntrySource(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [source_type][crate::model::data_quality_rule::rule_source::RulePathElement::source_type]
/// to hold a `EntrySource`.
///
/// Note that all the setters affecting `source_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::RulePathElement;
/// use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntrySource;
/// let x = RulePathElement::new().set_entry_source(EntrySource::default()/* use setters */);
/// assert!(x.entry_source().is_some());
/// assert!(x.entry_link_source().is_none());
/// ```
pub fn set_entry_source<T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::rule_source::rule_path_element::EntrySource>>>(mut self, v: T) -> Self{
self.source_type = std::option::Option::Some(
crate::model::data_quality_rule::rule_source::rule_path_element::SourceType::EntrySource(
v.into()
)
);
self
}
/// The value of [source_type][crate::model::data_quality_rule::rule_source::RulePathElement::source_type]
/// if it holds a `EntryLinkSource`, `None` if the field is not set or
/// holds a different branch.
pub fn entry_link_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource>>{
#[allow(unreachable_patterns)]
self.source_type.as_ref().and_then(|v| match v {
crate::model::data_quality_rule::rule_source::rule_path_element::SourceType::EntryLinkSource(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [source_type][crate::model::data_quality_rule::rule_source::RulePathElement::source_type]
/// to hold a `EntryLinkSource`.
///
/// Note that all the setters affecting `source_type` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::RulePathElement;
/// use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource;
/// let x = RulePathElement::new().set_entry_link_source(EntryLinkSource::default()/* use setters */);
/// assert!(x.entry_link_source().is_some());
/// assert!(x.entry_source().is_none());
/// ```
pub fn set_entry_link_source<T: std::convert::Into<std::boxed::Box<crate::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource>>>(mut self, v: T) -> Self{
self.source_type = std::option::Option::Some(
crate::model::data_quality_rule::rule_source::rule_path_element::SourceType::EntryLinkSource(
v.into()
)
);
self
}
}
impl wkt::message::Message for RulePathElement {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RuleSource.RulePathElement"
}
}
/// Defines additional types related to [RulePathElement].
pub mod rule_path_element {
#[allow(unused_imports)]
use super::*;
/// Entry source represents information about the related source entry.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntrySource {
/// Output only. The entry type to represent the current characteristics
/// of the entry in the form of:
/// `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
pub entry_type: std::string::String,
/// Output only. The entry name in the form of:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
pub entry: std::string::String,
/// Output only. The display name of the entry.
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntrySource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_type][crate::model::data_quality_rule::rule_source::rule_path_element::EntrySource::entry_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntrySource;
/// let x = EntrySource::new().set_entry_type("example");
/// ```
pub fn set_entry_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entry_type = v.into();
self
}
/// Sets the value of [entry][crate::model::data_quality_rule::rule_source::rule_path_element::EntrySource::entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntrySource;
/// let x = EntrySource::new().set_entry("example");
/// ```
pub fn set_entry<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entry = v.into();
self
}
/// Sets the value of [display_name][crate::model::data_quality_rule::rule_source::rule_path_element::EntrySource::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntrySource;
/// let x = EntrySource::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for EntrySource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RuleSource.RulePathElement.EntrySource"
}
}
/// Entry link source represents information about the entry link.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntryLinkSource {
/// Output only. The entry link type to represent the current
/// relationship between the entry and the next entry in the path.
/// In the form of:
/// `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
pub entry_link_type: std::string::String,
/// Output only. The entry link name in the form of:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
pub entry_link: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntryLinkSource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entry_link_type][crate::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource::entry_link_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource;
/// let x = EntryLinkSource::new().set_entry_link_type("example");
/// ```
pub fn set_entry_link_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entry_link_type = v.into();
self
}
/// Sets the value of [entry_link][crate::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource::entry_link].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource;
/// let x = EntryLinkSource::new().set_entry_link("example");
/// ```
pub fn set_entry_link<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entry_link = v.into();
self
}
}
impl wkt::message::Message for EntryLinkSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.RuleSource.RulePathElement.EntryLinkSource"
}
}
/// The source type of the rule.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceType {
/// Output only. Entry source represents information about the related
/// source entry.
EntrySource(std::boxed::Box<crate::model::data_quality_rule::rule_source::rule_path_element::EntrySource>),
/// Output only. Entry link source represents information about the entry
/// link.
EntryLinkSource(std::boxed::Box<crate::model::data_quality_rule::rule_source::rule_path_element::EntryLinkSource>),
}
}
}
/// Specifies a SQL statement that is evaluated to return up to 10 scalar
/// values that are used to debug rules. If the rule fails, the values can help
/// diagnose the cause of the failure.
///
/// The SQL statement must use [GoogleSQL
/// syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
/// and must not contain any semicolons.
///
/// You can use the data reference parameter `${data()}` to reference the
/// source table with all of its precondition filters applied. Examples of
/// precondition filters include row filters, incremental data filters, and
/// sampling. For more information, see [Data reference
/// parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
///
/// You can also name results with an explicit alias using `[AS] alias`. For
/// more information, see [BigQuery explicit
/// aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
///
/// Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
/// ${data()}`
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DebugQuery {
/// Optional. Specifies the description of the debug query.
///
/// * The maximum length is 1,024 characters.
pub description: std::string::String,
/// Required. Specifies the SQL statement to be executed.
pub sql_statement: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DebugQuery {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [description][crate::model::data_quality_rule::DebugQuery::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::DebugQuery;
/// let x = DebugQuery::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [sql_statement][crate::model::data_quality_rule::DebugQuery::sql_statement].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule::DebugQuery;
/// let x = DebugQuery::new().set_sql_statement("example");
/// ```
pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sql_statement = v.into();
self
}
}
impl wkt::message::Message for DebugQuery {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRule.DebugQuery"
}
}
/// The rule-specific configuration.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleType {
/// Row-level rule which evaluates whether each column value lies between a
/// specified range.
RangeExpectation(std::boxed::Box<crate::model::data_quality_rule::RangeExpectation>),
/// Row-level rule which evaluates whether each column value is null.
NonNullExpectation(std::boxed::Box<crate::model::data_quality_rule::NonNullExpectation>),
/// Row-level rule which evaluates whether each column value is contained by
/// a specified set.
SetExpectation(std::boxed::Box<crate::model::data_quality_rule::SetExpectation>),
/// Row-level rule which evaluates whether each column value matches a
/// specified regex.
RegexExpectation(std::boxed::Box<crate::model::data_quality_rule::RegexExpectation>),
/// Row-level rule which evaluates whether each column value is unique.
UniquenessExpectation(
std::boxed::Box<crate::model::data_quality_rule::UniquenessExpectation>,
),
/// Aggregate rule which evaluates whether the column aggregate
/// statistic lies between a specified range.
StatisticRangeExpectation(
std::boxed::Box<crate::model::data_quality_rule::StatisticRangeExpectation>,
),
/// Row-level rule which evaluates whether each row in a table passes the
/// specified condition.
RowConditionExpectation(
std::boxed::Box<crate::model::data_quality_rule::RowConditionExpectation>,
),
/// Aggregate rule which evaluates whether the provided expression is true
/// for a table.
TableConditionExpectation(
std::boxed::Box<crate::model::data_quality_rule::TableConditionExpectation>,
),
/// Aggregate rule which evaluates the number of rows returned for the
/// provided statement. If any rows are returned, this rule fails.
SqlAssertion(std::boxed::Box<crate::model::data_quality_rule::SqlAssertion>),
/// Aggregate rule which references a rule template and provides the
/// parameters to be substituted in the template. If any rows are returned,
/// this rule fails.
TemplateReference(std::boxed::Box<crate::model::data_quality_rule::TemplateReference>),
}
}
/// DataQualityColumnResult provides a more detailed, per-column view of
/// the results.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityColumnResult {
/// Output only. The column specified in the DataQualityRule.
pub column: std::string::String,
/// Output only. The column-level data quality score for this data scan job if
/// and only if the 'column' field is set.
///
/// The score ranges between between [0, 100] (up to two decimal
/// points).
pub score: std::option::Option<f32>,
/// Output only. Whether the column passed or failed.
pub passed: bool,
/// Output only. The dimension-level results for this column.
pub dimensions: std::vec::Vec<crate::model::DataQualityDimensionResult>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityColumnResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [column][crate::model::DataQualityColumnResult::column].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityColumnResult;
/// let x = DataQualityColumnResult::new().set_column("example");
/// ```
pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.column = v.into();
self
}
/// Sets the value of [score][crate::model::DataQualityColumnResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityColumnResult;
/// let x = DataQualityColumnResult::new().set_score(42.0);
/// ```
pub fn set_score<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f32>,
{
self.score = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [score][crate::model::DataQualityColumnResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityColumnResult;
/// let x = DataQualityColumnResult::new().set_or_clear_score(Some(42.0));
/// let x = DataQualityColumnResult::new().set_or_clear_score(None::<f32>);
/// ```
pub fn set_or_clear_score<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f32>,
{
self.score = v.map(|x| x.into());
self
}
/// Sets the value of [passed][crate::model::DataQualityColumnResult::passed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityColumnResult;
/// let x = DataQualityColumnResult::new().set_passed(true);
/// ```
pub fn set_passed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.passed = v.into();
self
}
/// Sets the value of [dimensions][crate::model::DataQualityColumnResult::dimensions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityColumnResult;
/// use google_cloud_dataplex_v1::model::DataQualityDimensionResult;
/// let x = DataQualityColumnResult::new()
/// .set_dimensions([
/// DataQualityDimensionResult::default()/* use setters */,
/// DataQualityDimensionResult::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_dimensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataQualityDimensionResult>,
{
use std::iter::Iterator;
self.dimensions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataQualityColumnResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityColumnResult"
}
}
/// DataQualityRuleTemplate represents a template which can be reused across
/// multiple data quality rules.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityRuleTemplate {
/// Output only. The name of the rule template in the format:
/// `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
pub name: std::string::String,
/// Output only. The dimension a rule template belongs to. Rule level results
/// are also aggregated at the dimension level.
pub dimension: std::string::String,
/// Output only. Collection of SQLs for data quality rules. Currently only one
/// SQL is supported.
pub sql_collection: std::vec::Vec<crate::model::data_quality_rule_template::Sql>,
/// Output only. Description for input parameters
pub input_parameters: std::collections::HashMap<
std::string::String,
crate::model::data_quality_rule_template::ParameterDescription,
>,
/// Output only. A list of features or properties supported by this rule
/// template.
pub capabilities: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityRuleTemplate {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataQualityRuleTemplate::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// let x = DataQualityRuleTemplate::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [dimension][crate::model::DataQualityRuleTemplate::dimension].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// let x = DataQualityRuleTemplate::new().set_dimension("example");
/// ```
pub fn set_dimension<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dimension = v.into();
self
}
/// Sets the value of [sql_collection][crate::model::DataQualityRuleTemplate::sql_collection].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// use google_cloud_dataplex_v1::model::data_quality_rule_template::Sql;
/// let x = DataQualityRuleTemplate::new()
/// .set_sql_collection([
/// Sql::default()/* use setters */,
/// Sql::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_sql_collection<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_quality_rule_template::Sql>,
{
use std::iter::Iterator;
self.sql_collection = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [input_parameters][crate::model::DataQualityRuleTemplate::input_parameters].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// use google_cloud_dataplex_v1::model::data_quality_rule_template::ParameterDescription;
/// let x = DataQualityRuleTemplate::new().set_input_parameters([
/// ("key0", ParameterDescription::default()/* use setters */),
/// ("key1", ParameterDescription::default()/* use (different) setters */),
/// ]);
/// ```
pub fn set_input_parameters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::data_quality_rule_template::ParameterDescription>,
{
use std::iter::Iterator;
self.input_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [capabilities][crate::model::DataQualityRuleTemplate::capabilities].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityRuleTemplate;
/// let x = DataQualityRuleTemplate::new().set_capabilities(["a", "b", "c"]);
/// ```
pub fn set_capabilities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.capabilities = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataQualityRuleTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRuleTemplate"
}
}
/// Defines additional types related to [DataQualityRuleTemplate].
pub mod data_quality_rule_template {
#[allow(unused_imports)]
use super::*;
/// Templatized SQL query for data quality rules. It can have parameters that
/// can be substituted with values when a rule is created using this template.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Sql {
/// Output only. Templatized SQL query for data quality rules.
pub query: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Sql {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [query][crate::model::data_quality_rule_template::Sql::query].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_template::Sql;
/// let x = Sql::new().set_query("example");
/// ```
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
}
impl wkt::message::Message for Sql {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRuleTemplate.Sql"
}
}
/// Description of the input parameter. It can include the type(s) supported
/// by the parameter and intended usage. It is for information purposes only
/// and does not affect the behavior of the rule template.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ParameterDescription {
/// Output only. Description of the input parameter. It can include the
/// type(s) supported by the parameter and intended usage. It is for
/// information purposes only and does not affect the behavior of the rule
/// template.
pub description: std::string::String,
/// Output only. The default value for the parameter if no value is provided.
pub default_value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ParameterDescription {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [description][crate::model::data_quality_rule_template::ParameterDescription::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_template::ParameterDescription;
/// let x = ParameterDescription::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [default_value][crate::model::data_quality_rule_template::ParameterDescription::default_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_quality_rule_template::ParameterDescription;
/// let x = ParameterDescription::new().set_default_value("example");
/// ```
pub fn set_default_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_value = v.into();
self
}
}
impl wkt::message::Message for ParameterDescription {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityRuleTemplate.ParameterDescription"
}
}
}
/// DataTaxonomy represents a set of hierarchical DataAttributes resources,
/// grouped with a common theme Eg: 'SensitiveDataTaxonomy' can have attributes
/// to manage PII data. It is defined at project level.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct DataTaxonomy {
/// Output only. The relative resource name of the DataTaxonomy, of the form:
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the dataTaxonomy. This
/// ID will be different if the DataTaxonomy is deleted and re-created with the
/// same name.
pub uid: std::string::String,
/// Output only. The time when the DataTaxonomy was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the DataTaxonomy was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the DataTaxonomy.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Optional. User-defined labels for the DataTaxonomy.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Output only. The number of attributes in the DataTaxonomy.
pub attribute_count: i32,
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the
/// client has an up-to-date value before proceeding.
pub etag: std::string::String,
/// Output only. The number of classes in the DataTaxonomy.
pub class_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataTaxonomy {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataTaxonomy::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// let x = DataTaxonomy::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataTaxonomy::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataTaxonomy::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// use wkt::Timestamp;
/// let x = DataTaxonomy::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataTaxonomy::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// use wkt::Timestamp;
/// let x = DataTaxonomy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataTaxonomy::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::DataTaxonomy::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// use wkt::Timestamp;
/// let x = DataTaxonomy::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::DataTaxonomy::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// use wkt::Timestamp;
/// let x = DataTaxonomy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DataTaxonomy::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::DataTaxonomy::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::DataTaxonomy::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::DataTaxonomy::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [attribute_count][crate::model::DataTaxonomy::attribute_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_attribute_count(42);
/// ```
pub fn set_attribute_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.attribute_count = v.into();
self
}
/// Sets the value of [etag][crate::model::DataTaxonomy::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [class_count][crate::model::DataTaxonomy::class_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = DataTaxonomy::new().set_class_count(42);
/// ```
pub fn set_class_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.class_count = v.into();
self
}
}
impl wkt::message::Message for DataTaxonomy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataTaxonomy"
}
}
/// Denotes one dataAttribute in a dataTaxonomy, for example, PII.
/// DataAttribute resources can be defined in a hierarchy.
/// A single dataAttribute resource can contain specs of multiple types
///
/// ```norust
/// PII
/// - ResourceAccessSpec :
/// - readers :foo@bar.com
/// - DataAccessSpec :
/// - readers :bar@foo.com
/// ```
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct DataAttribute {
/// Output only. The relative resource name of the dataAttribute, of the form:
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the DataAttribute.
/// This ID will be different if the DataAttribute is deleted and re-created
/// with the same name.
pub uid: std::string::String,
/// Output only. The time when the DataAttribute was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the DataAttribute was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the DataAttribute.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Optional. User-defined labels for the DataAttribute.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. The ID of the parent DataAttribute resource, should belong to the
/// same data taxonomy. Circular dependency in parent chain is not valid.
/// Maximum depth of the hierarchy allowed is 4.
/// [a -> b -> c -> d -> e, depth = 4]
pub parent_id: std::string::String,
/// Output only. The number of child attributes present for this attribute.
pub attribute_count: i32,
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the
/// client has an up-to-date value before proceeding.
pub etag: std::string::String,
/// Optional. Specified when applied to a resource (eg: Cloud Storage bucket,
/// BigQuery dataset, BigQuery table).
pub resource_access_spec: std::option::Option<crate::model::ResourceAccessSpec>,
/// Optional. Specified when applied to data stored on the resource (eg: rows,
/// columns in BigQuery Tables).
pub data_access_spec: std::option::Option<crate::model::DataAccessSpec>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAttribute {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataAttribute::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// # let data_attribute_id = "data_attribute_id";
/// let x = DataAttribute::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataAttribute::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = DataAttribute::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataAttribute::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use wkt::Timestamp;
/// let x = DataAttribute::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataAttribute::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use wkt::Timestamp;
/// let x = DataAttribute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataAttribute::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::DataAttribute::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use wkt::Timestamp;
/// let x = DataAttribute::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::DataAttribute::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use wkt::Timestamp;
/// let x = DataAttribute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DataAttribute::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::DataAttribute::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = DataAttribute::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::DataAttribute::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = DataAttribute::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::DataAttribute::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = DataAttribute::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [parent_id][crate::model::DataAttribute::parent_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// # let data_attribute_id = "data_attribute_id";
/// let x = DataAttribute::new().set_parent_id(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"));
/// ```
pub fn set_parent_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent_id = v.into();
self
}
/// Sets the value of [attribute_count][crate::model::DataAttribute::attribute_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = DataAttribute::new().set_attribute_count(42);
/// ```
pub fn set_attribute_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.attribute_count = v.into();
self
}
/// Sets the value of [etag][crate::model::DataAttribute::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = DataAttribute::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [resource_access_spec][crate::model::DataAttribute::resource_access_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use google_cloud_dataplex_v1::model::ResourceAccessSpec;
/// let x = DataAttribute::new().set_resource_access_spec(ResourceAccessSpec::default()/* use setters */);
/// ```
pub fn set_resource_access_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourceAccessSpec>,
{
self.resource_access_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [resource_access_spec][crate::model::DataAttribute::resource_access_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use google_cloud_dataplex_v1::model::ResourceAccessSpec;
/// let x = DataAttribute::new().set_or_clear_resource_access_spec(Some(ResourceAccessSpec::default()/* use setters */));
/// let x = DataAttribute::new().set_or_clear_resource_access_spec(None::<ResourceAccessSpec>);
/// ```
pub fn set_or_clear_resource_access_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourceAccessSpec>,
{
self.resource_access_spec = v.map(|x| x.into());
self
}
/// Sets the value of [data_access_spec][crate::model::DataAttribute::data_access_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use google_cloud_dataplex_v1::model::DataAccessSpec;
/// let x = DataAttribute::new().set_data_access_spec(DataAccessSpec::default()/* use setters */);
/// ```
pub fn set_data_access_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAccessSpec>,
{
self.data_access_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_access_spec][crate::model::DataAttribute::data_access_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttribute;
/// use google_cloud_dataplex_v1::model::DataAccessSpec;
/// let x = DataAttribute::new().set_or_clear_data_access_spec(Some(DataAccessSpec::default()/* use setters */));
/// let x = DataAttribute::new().set_or_clear_data_access_spec(None::<DataAccessSpec>);
/// ```
pub fn set_or_clear_data_access_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAccessSpec>,
{
self.data_access_spec = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataAttribute {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataAttribute"
}
}
/// DataAttributeBinding represents binding of attributes to resources. Eg: Bind
/// 'CustomerInfo' entity with 'PII' attribute.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct DataAttributeBinding {
/// Output only. The relative resource name of the Data Attribute Binding, of
/// the form:
/// projects/{project_number}/locations/{location}/dataAttributeBindings/{data_attribute_binding_id}
pub name: std::string::String,
/// Output only. System generated globally unique ID for the
/// DataAttributeBinding. This ID will be different if the DataAttributeBinding
/// is deleted and re-created with the same name.
pub uid: std::string::String,
/// Output only. The time when the DataAttributeBinding was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the DataAttributeBinding was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the DataAttributeBinding.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Optional. User-defined labels for the DataAttributeBinding.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the
/// client has an up-to-date value before proceeding.
/// Etags must be used when calling the DeleteDataAttributeBinding and the
/// UpdateDataAttributeBinding method.
pub etag: std::string::String,
/// Optional. List of attributes to be associated with the resource, provided
/// in the form:
/// projects/{project}/locations/{location}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}
pub attributes: std::vec::Vec<std::string::String>,
/// Optional. The list of paths for items within the associated resource (eg.
/// columns and partitions within a table) along with attribute bindings.
pub paths: std::vec::Vec<crate::model::data_attribute_binding::Path>,
/// The reference to the resource that is associated to attributes, or
/// the query to match resources and associate attributes.
pub resource_reference:
std::option::Option<crate::model::data_attribute_binding::ResourceReference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAttributeBinding {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataAttributeBinding::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_attribute_binding_id = "data_attribute_binding_id";
/// let x = DataAttributeBinding::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataAttributeBinding::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataAttributeBinding::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// use wkt::Timestamp;
/// let x = DataAttributeBinding::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataAttributeBinding::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// use wkt::Timestamp;
/// let x = DataAttributeBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataAttributeBinding::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::DataAttributeBinding::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// use wkt::Timestamp;
/// let x = DataAttributeBinding::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::DataAttributeBinding::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// use wkt::Timestamp;
/// let x = DataAttributeBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DataAttributeBinding::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::DataAttributeBinding::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::DataAttributeBinding::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::DataAttributeBinding::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [etag][crate::model::DataAttributeBinding::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [attributes][crate::model::DataAttributeBinding::attributes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_attributes(["a", "b", "c"]);
/// ```
pub fn set_attributes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.attributes = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [paths][crate::model::DataAttributeBinding::paths].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// use google_cloud_dataplex_v1::model::data_attribute_binding::Path;
/// let x = DataAttributeBinding::new()
/// .set_paths([
/// Path::default()/* use setters */,
/// Path::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_paths<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_attribute_binding::Path>,
{
use std::iter::Iterator;
self.paths = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [resource_reference][crate::model::DataAttributeBinding::resource_reference].
///
/// Note that all the setters affecting `resource_reference` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// use google_cloud_dataplex_v1::model::data_attribute_binding::ResourceReference;
/// let x = DataAttributeBinding::new().set_resource_reference(Some(ResourceReference::Resource("example".to_string())));
/// ```
pub fn set_resource_reference<
T: std::convert::Into<
std::option::Option<crate::model::data_attribute_binding::ResourceReference>,
>,
>(
mut self,
v: T,
) -> Self {
self.resource_reference = v.into();
self
}
/// The value of [resource_reference][crate::model::DataAttributeBinding::resource_reference]
/// if it holds a `Resource`, `None` if the field is not set or
/// holds a different branch.
pub fn resource(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.resource_reference.as_ref().and_then(|v| match v {
crate::model::data_attribute_binding::ResourceReference::Resource(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [resource_reference][crate::model::DataAttributeBinding::resource_reference]
/// to hold a `Resource`.
///
/// Note that all the setters affecting `resource_reference` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = DataAttributeBinding::new().set_resource("example");
/// assert!(x.resource().is_some());
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_reference = std::option::Option::Some(
crate::model::data_attribute_binding::ResourceReference::Resource(v.into()),
);
self
}
}
impl wkt::message::Message for DataAttributeBinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataAttributeBinding"
}
}
/// Defines additional types related to [DataAttributeBinding].
pub mod data_attribute_binding {
#[allow(unused_imports)]
use super::*;
/// Represents a subresource of the given resource, and associated bindings
/// with it. Currently supported subresources are column and partition schema
/// fields within a table.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Path {
/// Required. The name identifier of the path.
/// Nested columns should be of the form: 'address.city'.
pub name: std::string::String,
/// Optional. List of attributes to be associated with the path of the
/// resource, provided in the form:
/// projects/{project}/locations/{location}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}
pub attributes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Path {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::data_attribute_binding::Path::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_attribute_binding::Path;
/// let x = Path::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [attributes][crate::model::data_attribute_binding::Path::attributes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_attribute_binding::Path;
/// let x = Path::new().set_attributes(["a", "b", "c"]);
/// ```
pub fn set_attributes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.attributes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Path {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataAttributeBinding.Path"
}
}
/// The reference to the resource that is associated to attributes, or
/// the query to match resources and associate attributes.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceReference {
/// Optional. Immutable. The resource name of the resource that is associated
/// to attributes. Presently, only entity resource is supported in the form:
/// projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity_id}
/// Must belong in the same project and region as the attribute binding, and
/// there can only exist one active binding for a resource.
Resource(std::string::String),
}
}
/// Create DataTaxonomy request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct CreateDataTaxonomyRequest {
#[allow(missing_docs)]
pub parent: std::string::String,
/// Required. DataTaxonomy identifier.
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must be between 1-63 characters.
/// * Must end with a number or a letter.
/// * Must be unique within the Project.
pub data_taxonomy_id: std::string::String,
/// Required. DataTaxonomy resource.
pub data_taxonomy: std::option::Option<crate::model::DataTaxonomy>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataTaxonomyRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateDataTaxonomyRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataTaxonomyRequest;
/// let x = CreateDataTaxonomyRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [data_taxonomy_id][crate::model::CreateDataTaxonomyRequest::data_taxonomy_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataTaxonomyRequest;
/// let x = CreateDataTaxonomyRequest::new().set_data_taxonomy_id("example");
/// ```
pub fn set_data_taxonomy_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_taxonomy_id = v.into();
self
}
/// Sets the value of [data_taxonomy][crate::model::CreateDataTaxonomyRequest::data_taxonomy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataTaxonomyRequest;
/// use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = CreateDataTaxonomyRequest::new().set_data_taxonomy(DataTaxonomy::default()/* use setters */);
/// ```
pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTaxonomy>,
{
self.data_taxonomy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_taxonomy][crate::model::CreateDataTaxonomyRequest::data_taxonomy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataTaxonomyRequest;
/// use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = CreateDataTaxonomyRequest::new().set_or_clear_data_taxonomy(Some(DataTaxonomy::default()/* use setters */));
/// let x = CreateDataTaxonomyRequest::new().set_or_clear_data_taxonomy(None::<DataTaxonomy>);
/// ```
pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTaxonomy>,
{
self.data_taxonomy = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateDataTaxonomyRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataTaxonomyRequest;
/// let x = CreateDataTaxonomyRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDataTaxonomyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateDataTaxonomyRequest"
}
}
/// Update DataTaxonomy request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct UpdateDataTaxonomyRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Only fields specified in `update_mask` are updated.
pub data_taxonomy: std::option::Option<crate::model::DataTaxonomy>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataTaxonomyRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateDataTaxonomyRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataTaxonomyRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataTaxonomyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateDataTaxonomyRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataTaxonomyRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataTaxonomyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateDataTaxonomyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [data_taxonomy][crate::model::UpdateDataTaxonomyRequest::data_taxonomy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataTaxonomyRequest;
/// use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = UpdateDataTaxonomyRequest::new().set_data_taxonomy(DataTaxonomy::default()/* use setters */);
/// ```
pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTaxonomy>,
{
self.data_taxonomy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_taxonomy][crate::model::UpdateDataTaxonomyRequest::data_taxonomy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataTaxonomyRequest;
/// use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = UpdateDataTaxonomyRequest::new().set_or_clear_data_taxonomy(Some(DataTaxonomy::default()/* use setters */));
/// let x = UpdateDataTaxonomyRequest::new().set_or_clear_data_taxonomy(None::<DataTaxonomy>);
/// ```
pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTaxonomy>,
{
self.data_taxonomy = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateDataTaxonomyRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataTaxonomyRequest;
/// let x = UpdateDataTaxonomyRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDataTaxonomyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateDataTaxonomyRequest"
}
}
/// Get DataTaxonomy request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct GetDataTaxonomyRequest {
#[allow(missing_docs)]
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataTaxonomyRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataTaxonomyRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataTaxonomyRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// let x = GetDataTaxonomyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDataTaxonomyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataTaxonomyRequest"
}
}
/// List DataTaxonomies request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataTaxonomiesRequest {
/// Required. The resource name of the DataTaxonomy location, of the form:
/// projects/{project_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of DataTaxonomies to return. The service may
/// return fewer than this value. If unspecified, at most 10 DataTaxonomies
/// will be returned. The maximum value is 1000; values above 1000 will be
/// coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous ` ListDataTaxonomies` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to ` ListDataTaxonomies` must match the call that
/// provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataTaxonomiesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataTaxonomiesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesRequest;
/// let x = ListDataTaxonomiesRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataTaxonomiesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesRequest;
/// let x = ListDataTaxonomiesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataTaxonomiesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesRequest;
/// let x = ListDataTaxonomiesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataTaxonomiesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesRequest;
/// let x = ListDataTaxonomiesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListDataTaxonomiesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesRequest;
/// let x = ListDataTaxonomiesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDataTaxonomiesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataTaxonomiesRequest"
}
}
/// List DataTaxonomies response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataTaxonomiesResponse {
/// DataTaxonomies under the given parent location.
pub data_taxonomies: std::vec::Vec<crate::model::DataTaxonomy>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataTaxonomiesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_taxonomies][crate::model::ListDataTaxonomiesResponse::data_taxonomies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesResponse;
/// use google_cloud_dataplex_v1::model::DataTaxonomy;
/// let x = ListDataTaxonomiesResponse::new()
/// .set_data_taxonomies([
/// DataTaxonomy::default()/* use setters */,
/// DataTaxonomy::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_taxonomies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTaxonomy>,
{
use std::iter::Iterator;
self.data_taxonomies = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataTaxonomiesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesResponse;
/// let x = ListDataTaxonomiesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListDataTaxonomiesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataTaxonomiesResponse;
/// let x = ListDataTaxonomiesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDataTaxonomiesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataTaxonomiesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataTaxonomiesResponse {
type PageItem = crate::model::DataTaxonomy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_taxonomies
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Delete DataTaxonomy request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct DeleteDataTaxonomyRequest {
/// Required. The resource name of the DataTaxonomy:
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}
pub name: std::string::String,
/// Optional. If the client provided etag value does not match the current etag
/// value,the DeleteDataTaxonomy method returns an ABORTED error.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataTaxonomyRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteDataTaxonomyRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataTaxonomyRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// let x = DeleteDataTaxonomyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteDataTaxonomyRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataTaxonomyRequest;
/// let x = DeleteDataTaxonomyRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDataTaxonomyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteDataTaxonomyRequest"
}
}
/// Create DataAttribute request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataAttributeRequest {
/// Required. The resource name of the parent data taxonomy
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}
pub parent: std::string::String,
/// Required. DataAttribute identifier.
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must be between 1-63 characters.
/// * Must end with a number or a letter.
/// * Must be unique within the DataTaxonomy.
pub data_attribute_id: std::string::String,
/// Required. DataAttribute resource.
pub data_attribute: std::option::Option<crate::model::DataAttribute>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataAttributeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateDataAttributeRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// let x = CreateDataAttributeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [data_attribute_id][crate::model::CreateDataAttributeRequest::data_attribute_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeRequest;
/// let x = CreateDataAttributeRequest::new().set_data_attribute_id("example");
/// ```
pub fn set_data_attribute_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_attribute_id = v.into();
self
}
/// Sets the value of [data_attribute][crate::model::CreateDataAttributeRequest::data_attribute].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeRequest;
/// use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = CreateDataAttributeRequest::new().set_data_attribute(DataAttribute::default()/* use setters */);
/// ```
pub fn set_data_attribute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAttribute>,
{
self.data_attribute = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_attribute][crate::model::CreateDataAttributeRequest::data_attribute].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeRequest;
/// use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = CreateDataAttributeRequest::new().set_or_clear_data_attribute(Some(DataAttribute::default()/* use setters */));
/// let x = CreateDataAttributeRequest::new().set_or_clear_data_attribute(None::<DataAttribute>);
/// ```
pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAttribute>,
{
self.data_attribute = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateDataAttributeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeRequest;
/// let x = CreateDataAttributeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDataAttributeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateDataAttributeRequest"
}
}
/// Update DataAttribute request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataAttributeRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Only fields specified in `update_mask` are updated.
pub data_attribute: std::option::Option<crate::model::DataAttribute>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataAttributeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateDataAttributeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataAttributeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateDataAttributeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataAttributeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateDataAttributeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [data_attribute][crate::model::UpdateDataAttributeRequest::data_attribute].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeRequest;
/// use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = UpdateDataAttributeRequest::new().set_data_attribute(DataAttribute::default()/* use setters */);
/// ```
pub fn set_data_attribute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAttribute>,
{
self.data_attribute = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_attribute][crate::model::UpdateDataAttributeRequest::data_attribute].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeRequest;
/// use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = UpdateDataAttributeRequest::new().set_or_clear_data_attribute(Some(DataAttribute::default()/* use setters */));
/// let x = UpdateDataAttributeRequest::new().set_or_clear_data_attribute(None::<DataAttribute>);
/// ```
pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAttribute>,
{
self.data_attribute = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateDataAttributeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeRequest;
/// let x = UpdateDataAttributeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDataAttributeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateDataAttributeRequest"
}
}
/// Get DataAttribute request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataAttributeRequest {
/// Required. The resource name of the dataAttribute:
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataAttributeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataAttributeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataAttributeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// # let data_attribute_id = "data_attribute_id";
/// let x = GetDataAttributeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDataAttributeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataAttributeRequest"
}
}
/// List DataAttributes request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAttributesRequest {
/// Required. The resource name of the DataTaxonomy:
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}
pub parent: std::string::String,
/// Optional. Maximum number of DataAttributes to return. The service may
/// return fewer than this value. If unspecified, at most 10 dataAttributes
/// will be returned. The maximum value is 1000; values above 1000 will be
/// coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListDataAttributes` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListDataAttributes` must match the call that
/// provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAttributesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataAttributesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// let x = ListDataAttributesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataAttributesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesRequest;
/// let x = ListDataAttributesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataAttributesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesRequest;
/// let x = ListDataAttributesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataAttributesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesRequest;
/// let x = ListDataAttributesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListDataAttributesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesRequest;
/// let x = ListDataAttributesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDataAttributesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataAttributesRequest"
}
}
/// List DataAttributes response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAttributesResponse {
/// DataAttributes under the given parent DataTaxonomy.
pub data_attributes: std::vec::Vec<crate::model::DataAttribute>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAttributesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_attributes][crate::model::ListDataAttributesResponse::data_attributes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesResponse;
/// use google_cloud_dataplex_v1::model::DataAttribute;
/// let x = ListDataAttributesResponse::new()
/// .set_data_attributes([
/// DataAttribute::default()/* use setters */,
/// DataAttribute::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_attributes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAttribute>,
{
use std::iter::Iterator;
self.data_attributes = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataAttributesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesResponse;
/// let x = ListDataAttributesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListDataAttributesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributesResponse;
/// let x = ListDataAttributesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDataAttributesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataAttributesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAttributesResponse {
type PageItem = crate::model::DataAttribute;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_attributes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Delete DataAttribute request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataAttributeRequest {
/// Required. The resource name of the DataAttribute:
/// projects/{project_number}/locations/{location_id}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}
pub name: std::string::String,
/// Optional. If the client provided etag value does not match the current etag
/// value, the DeleteDataAttribute method returns an ABORTED error response.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataAttributeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteDataAttributeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAttributeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_taxonomy_id = "data_taxonomy_id";
/// # let data_attribute_id = "data_attribute_id";
/// let x = DeleteDataAttributeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteDataAttributeRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAttributeRequest;
/// let x = DeleteDataAttributeRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDataAttributeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteDataAttributeRequest"
}
}
/// Create DataAttributeBinding request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataAttributeBindingRequest {
/// Required. The resource name of the parent data taxonomy
/// projects/{project_number}/locations/{location_id}
pub parent: std::string::String,
/// Required. DataAttributeBinding identifier.
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must be between 1-63 characters.
/// * Must end with a number or a letter.
/// * Must be unique within the Location.
pub data_attribute_binding_id: std::string::String,
/// Required. DataAttributeBinding resource.
pub data_attribute_binding: std::option::Option<crate::model::DataAttributeBinding>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataAttributeBindingRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateDataAttributeBindingRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeBindingRequest;
/// let x = CreateDataAttributeBindingRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [data_attribute_binding_id][crate::model::CreateDataAttributeBindingRequest::data_attribute_binding_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeBindingRequest;
/// let x = CreateDataAttributeBindingRequest::new().set_data_attribute_binding_id("example");
/// ```
pub fn set_data_attribute_binding_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_attribute_binding_id = v.into();
self
}
/// Sets the value of [data_attribute_binding][crate::model::CreateDataAttributeBindingRequest::data_attribute_binding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeBindingRequest;
/// use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = CreateDataAttributeBindingRequest::new().set_data_attribute_binding(DataAttributeBinding::default()/* use setters */);
/// ```
pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAttributeBinding>,
{
self.data_attribute_binding = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_attribute_binding][crate::model::CreateDataAttributeBindingRequest::data_attribute_binding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeBindingRequest;
/// use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = CreateDataAttributeBindingRequest::new().set_or_clear_data_attribute_binding(Some(DataAttributeBinding::default()/* use setters */));
/// let x = CreateDataAttributeBindingRequest::new().set_or_clear_data_attribute_binding(None::<DataAttributeBinding>);
/// ```
pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAttributeBinding>,
{
self.data_attribute_binding = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateDataAttributeBindingRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataAttributeBindingRequest;
/// let x = CreateDataAttributeBindingRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDataAttributeBindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateDataAttributeBindingRequest"
}
}
/// Update DataAttributeBinding request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataAttributeBindingRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Only fields specified in `update_mask` are updated.
pub data_attribute_binding: std::option::Option<crate::model::DataAttributeBinding>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataAttributeBindingRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateDataAttributeBindingRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeBindingRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataAttributeBindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateDataAttributeBindingRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeBindingRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataAttributeBindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateDataAttributeBindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [data_attribute_binding][crate::model::UpdateDataAttributeBindingRequest::data_attribute_binding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeBindingRequest;
/// use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = UpdateDataAttributeBindingRequest::new().set_data_attribute_binding(DataAttributeBinding::default()/* use setters */);
/// ```
pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAttributeBinding>,
{
self.data_attribute_binding = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_attribute_binding][crate::model::UpdateDataAttributeBindingRequest::data_attribute_binding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeBindingRequest;
/// use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = UpdateDataAttributeBindingRequest::new().set_or_clear_data_attribute_binding(Some(DataAttributeBinding::default()/* use setters */));
/// let x = UpdateDataAttributeBindingRequest::new().set_or_clear_data_attribute_binding(None::<DataAttributeBinding>);
/// ```
pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAttributeBinding>,
{
self.data_attribute_binding = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateDataAttributeBindingRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataAttributeBindingRequest;
/// let x = UpdateDataAttributeBindingRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDataAttributeBindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateDataAttributeBindingRequest"
}
}
/// Get DataAttributeBinding request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataAttributeBindingRequest {
/// Required. The resource name of the DataAttributeBinding:
/// projects/{project_number}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataAttributeBindingRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataAttributeBindingRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataAttributeBindingRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_attribute_binding_id = "data_attribute_binding_id";
/// let x = GetDataAttributeBindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDataAttributeBindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataAttributeBindingRequest"
}
}
/// List DataAttributeBindings request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAttributeBindingsRequest {
/// Required. The resource name of the Location:
/// projects/{project_number}/locations/{location_id}
pub parent: std::string::String,
/// Optional. Maximum number of DataAttributeBindings to return. The service
/// may return fewer than this value. If unspecified, at most 10
/// DataAttributeBindings will be returned. The maximum value is 1000; values
/// above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListDataAttributeBindings`
/// call. Provide this to retrieve the subsequent page. When paginating, all
/// other parameters provided to `ListDataAttributeBindings` must match the
/// call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
/// Filter using resource: filter=resource:"resource-name"
/// Filter using attribute: filter=attributes:"attribute-name"
/// Filter using attribute in paths list:
/// filter=paths.attributes:"attribute-name"
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAttributeBindingsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataAttributeBindingsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsRequest;
/// let x = ListDataAttributeBindingsRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataAttributeBindingsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsRequest;
/// let x = ListDataAttributeBindingsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataAttributeBindingsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsRequest;
/// let x = ListDataAttributeBindingsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataAttributeBindingsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsRequest;
/// let x = ListDataAttributeBindingsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListDataAttributeBindingsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsRequest;
/// let x = ListDataAttributeBindingsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDataAttributeBindingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataAttributeBindingsRequest"
}
}
/// List DataAttributeBindings response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAttributeBindingsResponse {
/// DataAttributeBindings under the given parent Location.
pub data_attribute_bindings: std::vec::Vec<crate::model::DataAttributeBinding>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAttributeBindingsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_attribute_bindings][crate::model::ListDataAttributeBindingsResponse::data_attribute_bindings].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsResponse;
/// use google_cloud_dataplex_v1::model::DataAttributeBinding;
/// let x = ListDataAttributeBindingsResponse::new()
/// .set_data_attribute_bindings([
/// DataAttributeBinding::default()/* use setters */,
/// DataAttributeBinding::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_attribute_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAttributeBinding>,
{
use std::iter::Iterator;
self.data_attribute_bindings = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataAttributeBindingsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsResponse;
/// let x = ListDataAttributeBindingsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListDataAttributeBindingsResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataAttributeBindingsResponse;
/// let x = ListDataAttributeBindingsResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDataAttributeBindingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataAttributeBindingsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAttributeBindingsResponse {
type PageItem = crate::model::DataAttributeBinding;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_attribute_bindings
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Delete DataAttributeBinding request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataAttributeBindingRequest {
/// Required. The resource name of the DataAttributeBinding:
/// projects/{project_number}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}
pub name: std::string::String,
/// Required. If the client provided etag value does not match the current etag
/// value, the DeleteDataAttributeBindingRequest method returns an ABORTED
/// error response. Etags must be used when calling the
/// DeleteDataAttributeBinding.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataAttributeBindingRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteDataAttributeBindingRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAttributeBindingRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_attribute_binding_id = "data_attribute_binding_id";
/// let x = DeleteDataAttributeBindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteDataAttributeBindingRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataAttributeBindingRequest;
/// let x = DeleteDataAttributeBindingRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDataAttributeBindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteDataAttributeBindingRequest"
}
}
/// Create dataScan request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataScanRequest {
/// Required. The resource name of the parent location:
/// `projects/{project}/locations/{location_id}`
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. DataScan resource.
pub data_scan: std::option::Option<crate::model::DataScan>,
/// Optional. DataScan identifier. If not provided, a unique ID will be
/// generated with the prefix "data-scan-".
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must end with a number or a letter.
/// * Must be between 1-63 characters.
/// * Must be unique within the customer project / location.
pub data_scan_id: std::string::String,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is `false`.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataScanRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateDataScanRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataScanRequest;
/// let x = CreateDataScanRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [data_scan][crate::model::CreateDataScanRequest::data_scan].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataScanRequest;
/// use google_cloud_dataplex_v1::model::DataScan;
/// let x = CreateDataScanRequest::new().set_data_scan(DataScan::default()/* use setters */);
/// ```
pub fn set_data_scan<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataScan>,
{
self.data_scan = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_scan][crate::model::CreateDataScanRequest::data_scan].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataScanRequest;
/// use google_cloud_dataplex_v1::model::DataScan;
/// let x = CreateDataScanRequest::new().set_or_clear_data_scan(Some(DataScan::default()/* use setters */));
/// let x = CreateDataScanRequest::new().set_or_clear_data_scan(None::<DataScan>);
/// ```
pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataScan>,
{
self.data_scan = v.map(|x| x.into());
self
}
/// Sets the value of [data_scan_id][crate::model::CreateDataScanRequest::data_scan_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataScanRequest;
/// let x = CreateDataScanRequest::new().set_data_scan_id("example");
/// ```
pub fn set_data_scan_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_scan_id = v.into();
self
}
/// Sets the value of [validate_only][crate::model::CreateDataScanRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateDataScanRequest;
/// let x = CreateDataScanRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDataScanRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateDataScanRequest"
}
}
/// Update dataScan request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataScanRequest {
/// Required. DataScan resource to be updated.
///
/// Only fields specified in `update_mask` are updated.
pub data_scan: std::option::Option<crate::model::DataScan>,
/// Optional. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is `false`.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataScanRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_scan][crate::model::UpdateDataScanRequest::data_scan].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataScanRequest;
/// use google_cloud_dataplex_v1::model::DataScan;
/// let x = UpdateDataScanRequest::new().set_data_scan(DataScan::default()/* use setters */);
/// ```
pub fn set_data_scan<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataScan>,
{
self.data_scan = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data_scan][crate::model::UpdateDataScanRequest::data_scan].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataScanRequest;
/// use google_cloud_dataplex_v1::model::DataScan;
/// let x = UpdateDataScanRequest::new().set_or_clear_data_scan(Some(DataScan::default()/* use setters */));
/// let x = UpdateDataScanRequest::new().set_or_clear_data_scan(None::<DataScan>);
/// ```
pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataScan>,
{
self.data_scan = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::UpdateDataScanRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataScanRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataScanRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateDataScanRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataScanRequest;
/// use wkt::FieldMask;
/// let x = UpdateDataScanRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateDataScanRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateDataScanRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateDataScanRequest;
/// let x = UpdateDataScanRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDataScanRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateDataScanRequest"
}
}
/// Delete dataScan request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataScanRequest {
/// Required. The resource name of the dataScan:
/// `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub name: std::string::String,
/// Optional. If set to true, any child resources of this data scan will also
/// be deleted. (Otherwise, the request will only work if the data scan has no
/// child resources.)
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataScanRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteDataScanRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataScanRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// let x = DeleteDataScanRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [force][crate::model::DeleteDataScanRequest::force].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteDataScanRequest;
/// let x = DeleteDataScanRequest::new().set_force(true);
/// ```
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteDataScanRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteDataScanRequest"
}
}
/// Get dataScan request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataScanRequest {
/// Required. The resource name of the dataScan:
/// `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub name: std::string::String,
/// Optional. Select the DataScan view to return. Defaults to `BASIC`.
pub view: crate::model::get_data_scan_request::DataScanView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataScanRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataScanRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataScanRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// let x = GetDataScanRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [view][crate::model::GetDataScanRequest::view].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataScanRequest;
/// use google_cloud_dataplex_v1::model::get_data_scan_request::DataScanView;
/// let x0 = GetDataScanRequest::new().set_view(DataScanView::Basic);
/// let x1 = GetDataScanRequest::new().set_view(DataScanView::Full);
/// ```
pub fn set_view<T: std::convert::Into<crate::model::get_data_scan_request::DataScanView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetDataScanRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataScanRequest"
}
}
/// Defines additional types related to [GetDataScanRequest].
pub mod get_data_scan_request {
#[allow(unused_imports)]
use super::*;
/// DataScan view options.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataScanView {
/// The API will default to the `BASIC` view.
Unspecified,
/// Basic view that does not include *spec* and *result*.
Basic,
/// Include everything.
Full,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [DataScanView::value] or
/// [DataScanView::name].
UnknownValue(data_scan_view::UnknownValue),
}
#[doc(hidden)]
pub mod data_scan_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataScanView {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_SCAN_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataScanView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataScanView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DataScanView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
10 => Self::Full,
_ => Self::UnknownValue(data_scan_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataScanView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_SCAN_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
_ => Self::UnknownValue(data_scan_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataScanView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataScanView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataScanView>::new(
".google.cloud.dataplex.v1.GetDataScanRequest.DataScanView",
))
}
}
}
/// List dataScans request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataScansRequest {
/// Required. The resource name of the parent location:
/// `projects/{project}/locations/{location_id}`
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of dataScans to return. The service may return
/// fewer than this value. If unspecified, at most 500 scans will be returned.
/// The maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListDataScans` call. Provide
/// this to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListDataScans` must match the call that provided the
/// page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields (`name` or `create_time`) for the result.
/// If not specified, the ordering is undefined.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataScansRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataScansRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansRequest;
/// let x = ListDataScansRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataScansRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansRequest;
/// let x = ListDataScansRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataScansRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansRequest;
/// let x = ListDataScansRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataScansRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansRequest;
/// let x = ListDataScansRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListDataScansRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansRequest;
/// let x = ListDataScansRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDataScansRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataScansRequest"
}
}
/// List dataScans response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataScansResponse {
/// DataScans (`BASIC` view only) under the given parent location.
pub data_scans: std::vec::Vec<crate::model::DataScan>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataScansResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_scans][crate::model::ListDataScansResponse::data_scans].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansResponse;
/// use google_cloud_dataplex_v1::model::DataScan;
/// let x = ListDataScansResponse::new()
/// .set_data_scans([
/// DataScan::default()/* use setters */,
/// DataScan::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_scans<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataScan>,
{
use std::iter::Iterator;
self.data_scans = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataScansResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansResponse;
/// let x = ListDataScansResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable][crate::model::ListDataScansResponse::unreachable].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScansResponse;
/// let x = ListDataScansResponse::new().set_unreachable(["a", "b", "c"]);
/// ```
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDataScansResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataScansResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataScansResponse {
type PageItem = crate::model::DataScan;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_scans
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Run DataScan Request
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunDataScanRequest {
/// Required. The resource name of the DataScan:
/// `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`.
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
///
/// Only **OnDemand** data scans are allowed.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunDataScanRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::RunDataScanRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunDataScanRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// let x = RunDataScanRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for RunDataScanRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.RunDataScanRequest"
}
}
/// Run DataScan Response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunDataScanResponse {
/// DataScanJob created by RunDataScan request.
pub job: std::option::Option<crate::model::DataScanJob>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunDataScanResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [job][crate::model::RunDataScanResponse::job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunDataScanResponse;
/// use google_cloud_dataplex_v1::model::DataScanJob;
/// let x = RunDataScanResponse::new().set_job(DataScanJob::default()/* use setters */);
/// ```
pub fn set_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataScanJob>,
{
self.job = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [job][crate::model::RunDataScanResponse::job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunDataScanResponse;
/// use google_cloud_dataplex_v1::model::DataScanJob;
/// let x = RunDataScanResponse::new().set_or_clear_job(Some(DataScanJob::default()/* use setters */));
/// let x = RunDataScanResponse::new().set_or_clear_job(None::<DataScanJob>);
/// ```
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataScanJob>,
{
self.job = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RunDataScanResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.RunDataScanResponse"
}
}
/// Get DataScanJob request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataScanJobRequest {
/// Required. The resource name of the DataScanJob:
/// `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}`
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub name: std::string::String,
/// Optional. Select the DataScanJob view to return. Defaults to `BASIC`.
pub view: crate::model::get_data_scan_job_request::DataScanJobView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataScanJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetDataScanJobRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataScanJobRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// # let job_id = "job_id";
/// let x = GetDataScanJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [view][crate::model::GetDataScanJobRequest::view].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetDataScanJobRequest;
/// use google_cloud_dataplex_v1::model::get_data_scan_job_request::DataScanJobView;
/// let x0 = GetDataScanJobRequest::new().set_view(DataScanJobView::Basic);
/// let x1 = GetDataScanJobRequest::new().set_view(DataScanJobView::Full);
/// ```
pub fn set_view<
T: std::convert::Into<crate::model::get_data_scan_job_request::DataScanJobView>,
>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetDataScanJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetDataScanJobRequest"
}
}
/// Defines additional types related to [GetDataScanJobRequest].
pub mod get_data_scan_job_request {
#[allow(unused_imports)]
use super::*;
/// DataScanJob view options.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataScanJobView {
/// The API will default to the `BASIC` view.
Unspecified,
/// Basic view that does not include *spec* and *result*.
Basic,
/// Include everything.
Full,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [DataScanJobView::value] or
/// [DataScanJobView::name].
UnknownValue(data_scan_job_view::UnknownValue),
}
#[doc(hidden)]
pub mod data_scan_job_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataScanJobView {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_SCAN_JOB_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataScanJobView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataScanJobView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DataScanJobView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
10 => Self::Full,
_ => Self::UnknownValue(data_scan_job_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataScanJobView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_SCAN_JOB_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
_ => Self::UnknownValue(data_scan_job_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataScanJobView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataScanJobView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataScanJobView>::new(
".google.cloud.dataplex.v1.GetDataScanJobRequest.DataScanJobView",
))
}
}
}
/// List DataScanJobs request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataScanJobsRequest {
/// Required. The resource name of the parent environment:
/// `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of DataScanJobs to return. The service may return
/// fewer than this value. If unspecified, at most 10 DataScanJobs will be
/// returned. The maximum value is 1000; values above 1000 will be coerced to
/// 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListDataScanJobs` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListDataScanJobs` must match the call that provided
/// the page token.
pub page_token: std::string::String,
/// Optional. An expression for filtering the results of the ListDataScanJobs
/// request.
///
/// If unspecified, all datascan jobs will be returned. Multiple filters can be
/// applied (with `AND`, `OR` logical operators). Filters are case-sensitive.
///
/// Allowed fields are:
///
/// - `start_time`
/// - `end_time`
///
/// `start_time` and `end_time` expect RFC-3339 formatted strings (e.g.
/// 2018-10-08T18:30:00-07:00).
///
/// For instance, 'start_time > 2018-10-08T00:00:00.123456789Z AND end_time <
/// 2018-10-09T00:00:00.123456789Z' limits results to DataScanJobs between
/// specified start and end times.
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataScanJobsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListDataScanJobsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScanJobsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// let x = ListDataScanJobsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListDataScanJobsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScanJobsRequest;
/// let x = ListDataScanJobsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListDataScanJobsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScanJobsRequest;
/// let x = ListDataScanJobsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListDataScanJobsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScanJobsRequest;
/// let x = ListDataScanJobsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListDataScanJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataScanJobsRequest"
}
}
/// List DataScanJobs response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataScanJobsResponse {
/// DataScanJobs (`BASIC` view only) under a given dataScan.
pub data_scan_jobs: std::vec::Vec<crate::model::DataScanJob>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataScanJobsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_scan_jobs][crate::model::ListDataScanJobsResponse::data_scan_jobs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScanJobsResponse;
/// use google_cloud_dataplex_v1::model::DataScanJob;
/// let x = ListDataScanJobsResponse::new()
/// .set_data_scan_jobs([
/// DataScanJob::default()/* use setters */,
/// DataScanJob::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_data_scan_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataScanJob>,
{
use std::iter::Iterator;
self.data_scan_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListDataScanJobsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListDataScanJobsResponse;
/// let x = ListDataScanJobsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListDataScanJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListDataScanJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataScanJobsResponse {
type PageItem = crate::model::DataScanJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_scan_jobs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Request message for the `CancelDataScanJob` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelDataScanJobRequest {
/// Required. The resource name of the DataScanJob:
/// `projects/{project_id_or_number}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}`
/// where `project_id_or_number` refers to a *project_id* or *project_number*
/// and `location_id` refers to a Google Cloud region.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelDataScanJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::CancelDataScanJobRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CancelDataScanJobRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// # let job_id = "job_id";
/// let x = CancelDataScanJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for CancelDataScanJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CancelDataScanJobRequest"
}
}
/// Response message for the `CancelDataScanJob` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelDataScanJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelDataScanJobResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelDataScanJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CancelDataScanJobResponse"
}
}
/// Request details for generating data quality rule recommendations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateDataQualityRulesRequest {
/// Required. The name must be one of the following:
///
/// * The name of a data scan with at least one successful, completed data
/// profiling job
/// * The name of a successful, completed data profiling job (a data scan job
/// where the job type is data profiling)
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateDataQualityRulesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GenerateDataQualityRulesRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GenerateDataQualityRulesRequest;
/// let x = GenerateDataQualityRulesRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GenerateDataQualityRulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GenerateDataQualityRulesRequest"
}
}
/// Response details for data quality rule recommendations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateDataQualityRulesResponse {
/// The data quality rules that Dataplex Universal Catalog generates based on
/// the results of a data profiling scan.
pub rule: std::vec::Vec<crate::model::DataQualityRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateDataQualityRulesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [rule][crate::model::GenerateDataQualityRulesResponse::rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GenerateDataQualityRulesResponse;
/// use google_cloud_dataplex_v1::model::DataQualityRule;
/// let x = GenerateDataQualityRulesResponse::new()
/// .set_rule([
/// DataQualityRule::default()/* use setters */,
/// DataQualityRule::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_rule<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataQualityRule>,
{
use std::iter::Iterator;
self.rule = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GenerateDataQualityRulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GenerateDataQualityRulesResponse"
}
}
/// Represents a user-visible job which provides the insights for the related
/// data source.
///
/// For example:
///
/// * Data quality: generates queries based on the rules and runs against the
/// data to get data quality check results. For more information, see [Auto
/// data quality
/// overview](https://cloud.google.com/dataplex/docs/auto-data-quality-overview).
/// * Data profile: analyzes the data in tables and generates insights about
/// the structure, content and relationships (such as null percent,
/// cardinality, min/max/mean, etc). For more information, see [About data
/// profiling](https://cloud.google.com/dataplex/docs/data-profiling-overview).
/// * Data discovery: scans data in Cloud Storage buckets to extract and then
/// catalog metadata. For more information, see [Discover and catalog Cloud
/// Storage data](https://cloud.google.com/bigquery/docs/automatic-discovery).
/// * Data documentation: analyzes the table or dataset metadata and generates
/// insights. For tables, insights include descriptions and sample SQL
/// queries. For datasets, insights include descriptions, schema relationships
/// and sample SQL queries. For more information, see [Generate data insights
/// in BigQuery](https://cloud.google.com/bigquery/docs/data-insights).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataScan {
/// Output only. Identifier. The relative resource name of the scan, of the
/// form: `projects/{project}/locations/{location_id}/dataScans/{datascan_id}`,
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the scan. This ID will
/// be different if the scan is deleted and re-created with the same name.
pub uid: std::string::String,
/// Optional. Description of the scan.
///
/// * Must be between 1-1024 characters.
pub description: std::string::String,
/// Optional. User friendly display name.
///
/// * Must be between 1-256 characters.
pub display_name: std::string::String,
/// Optional. User-defined labels for the scan.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Output only. Current state of the DataScan.
pub state: crate::model::State,
/// Output only. The time when the scan was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the scan was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Required. The data source for DataScan.
pub data: std::option::Option<crate::model::DataSource>,
/// Optional. DataScan execution settings.
///
/// If not specified, the fields in it will use their default values.
pub execution_spec: std::option::Option<crate::model::data_scan::ExecutionSpec>,
/// Output only. Status of the data scan execution.
pub execution_status: std::option::Option<crate::model::data_scan::ExecutionStatus>,
/// Output only. The type of DataScan.
pub r#type: crate::model::DataScanType,
/// Optional. Immutable. The identity to run the datascan.
/// If not specified, defaults to the Dataplex Service Agent.
pub execution_identity: std::option::Option<crate::model::ExecutionIdentity>,
/// Data scan related setting.
/// The settings are required and immutable. After you configure the settings
/// for one type of data scan, you can't change the data scan to a different
/// type of data scan.
pub spec: std::option::Option<crate::model::data_scan::Spec>,
/// The result of the data scan.
pub result: std::option::Option<crate::model::data_scan::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataScan {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataScan::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// let x = DataScan::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataScan::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// let x = DataScan::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [description][crate::model::DataScan::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// let x = DataScan::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::DataScan::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// let x = DataScan::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [labels][crate::model::DataScan::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// let x = DataScan::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [state][crate::model::DataScan::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = DataScan::new().set_state(State::Active);
/// let x1 = DataScan::new().set_state(State::Creating);
/// let x2 = DataScan::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataScan::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use wkt::Timestamp;
/// let x = DataScan::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataScan::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use wkt::Timestamp;
/// let x = DataScan::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScan::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::DataScan::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use wkt::Timestamp;
/// let x = DataScan::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::DataScan::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use wkt::Timestamp;
/// let x = DataScan::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScan::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [data][crate::model::DataScan::data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataSource;
/// let x = DataScan::new().set_data(DataSource::default()/* use setters */);
/// ```
pub fn set_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataSource>,
{
self.data = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [data][crate::model::DataScan::data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataSource;
/// let x = DataScan::new().set_or_clear_data(Some(DataSource::default()/* use setters */));
/// let x = DataScan::new().set_or_clear_data(None::<DataSource>);
/// ```
pub fn set_or_clear_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataSource>,
{
self.data = v.map(|x| x.into());
self
}
/// Sets the value of [execution_spec][crate::model::DataScan::execution_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::data_scan::ExecutionSpec;
/// let x = DataScan::new().set_execution_spec(ExecutionSpec::default()/* use setters */);
/// ```
pub fn set_execution_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_scan::ExecutionSpec>,
{
self.execution_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [execution_spec][crate::model::DataScan::execution_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::data_scan::ExecutionSpec;
/// let x = DataScan::new().set_or_clear_execution_spec(Some(ExecutionSpec::default()/* use setters */));
/// let x = DataScan::new().set_or_clear_execution_spec(None::<ExecutionSpec>);
/// ```
pub fn set_or_clear_execution_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_scan::ExecutionSpec>,
{
self.execution_spec = v.map(|x| x.into());
self
}
/// Sets the value of [execution_status][crate::model::DataScan::execution_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// let x = DataScan::new().set_execution_status(ExecutionStatus::default()/* use setters */);
/// ```
pub fn set_execution_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_scan::ExecutionStatus>,
{
self.execution_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [execution_status][crate::model::DataScan::execution_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// let x = DataScan::new().set_or_clear_execution_status(Some(ExecutionStatus::default()/* use setters */));
/// let x = DataScan::new().set_or_clear_execution_status(None::<ExecutionStatus>);
/// ```
pub fn set_or_clear_execution_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_scan::ExecutionStatus>,
{
self.execution_status = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::DataScan::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataScanType;
/// let x0 = DataScan::new().set_type(DataScanType::DataQuality);
/// let x1 = DataScan::new().set_type(DataScanType::DataProfile);
/// let x2 = DataScan::new().set_type(DataScanType::DataDiscovery);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::DataScanType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [execution_identity][crate::model::DataScan::execution_identity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::ExecutionIdentity;
/// let x = DataScan::new().set_execution_identity(ExecutionIdentity::default()/* use setters */);
/// ```
pub fn set_execution_identity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExecutionIdentity>,
{
self.execution_identity = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [execution_identity][crate::model::DataScan::execution_identity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::ExecutionIdentity;
/// let x = DataScan::new().set_or_clear_execution_identity(Some(ExecutionIdentity::default()/* use setters */));
/// let x = DataScan::new().set_or_clear_execution_identity(None::<ExecutionIdentity>);
/// ```
pub fn set_or_clear_execution_identity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExecutionIdentity>,
{
self.execution_identity = v.map(|x| x.into());
self
}
/// Sets the value of [spec][crate::model::DataScan::spec].
///
/// Note that all the setters affecting `spec` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataScan::new().set_spec(Some(
/// google_cloud_dataplex_v1::model::data_scan::Spec::DataQualitySpec(DataQualitySpec::default().into())));
/// ```
pub fn set_spec<T: std::convert::Into<std::option::Option<crate::model::data_scan::Spec>>>(
mut self,
v: T,
) -> Self {
self.spec = v.into();
self
}
/// The value of [spec][crate::model::DataScan::spec]
/// if it holds a `DataQualitySpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_quality_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataQualitySpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan::Spec::DataQualitySpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScan::spec]
/// to hold a `DataQualitySpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataScan::new().set_data_quality_spec(DataQualitySpec::default()/* use setters */);
/// assert!(x.data_quality_spec().is_some());
/// assert!(x.data_profile_spec().is_none());
/// assert!(x.data_discovery_spec().is_none());
/// assert!(x.data_documentation_spec().is_none());
/// ```
pub fn set_data_quality_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataQualitySpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::data_scan::Spec::DataQualitySpec(v.into()));
self
}
/// The value of [spec][crate::model::DataScan::spec]
/// if it holds a `DataProfileSpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_profile_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataProfileSpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan::Spec::DataProfileSpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScan::spec]
/// to hold a `DataProfileSpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataProfileSpec;
/// let x = DataScan::new().set_data_profile_spec(DataProfileSpec::default()/* use setters */);
/// assert!(x.data_profile_spec().is_some());
/// assert!(x.data_quality_spec().is_none());
/// assert!(x.data_discovery_spec().is_none());
/// assert!(x.data_documentation_spec().is_none());
/// ```
pub fn set_data_profile_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataProfileSpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::data_scan::Spec::DataProfileSpec(v.into()));
self
}
/// The value of [spec][crate::model::DataScan::spec]
/// if it holds a `DataDiscoverySpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_discovery_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDiscoverySpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan::Spec::DataDiscoverySpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScan::spec]
/// to hold a `DataDiscoverySpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataDiscoverySpec;
/// let x = DataScan::new().set_data_discovery_spec(DataDiscoverySpec::default()/* use setters */);
/// assert!(x.data_discovery_spec().is_some());
/// assert!(x.data_quality_spec().is_none());
/// assert!(x.data_profile_spec().is_none());
/// assert!(x.data_documentation_spec().is_none());
/// ```
pub fn set_data_discovery_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataDiscoverySpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::data_scan::Spec::DataDiscoverySpec(v.into()));
self
}
/// The value of [spec][crate::model::DataScan::spec]
/// if it holds a `DataDocumentationSpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_documentation_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDocumentationSpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan::Spec::DataDocumentationSpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScan::spec]
/// to hold a `DataDocumentationSpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataDocumentationSpec;
/// let x = DataScan::new().set_data_documentation_spec(DataDocumentationSpec::default()/* use setters */);
/// assert!(x.data_documentation_spec().is_some());
/// assert!(x.data_quality_spec().is_none());
/// assert!(x.data_profile_spec().is_none());
/// assert!(x.data_discovery_spec().is_none());
/// ```
pub fn set_data_documentation_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataDocumentationSpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec = std::option::Option::Some(
crate::model::data_scan::Spec::DataDocumentationSpec(v.into()),
);
self
}
/// Sets the value of [result][crate::model::DataScan::result].
///
/// Note that all the setters affecting `result` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataScan::new().set_result(Some(
/// google_cloud_dataplex_v1::model::data_scan::Result::DataQualityResult(DataQualityResult::default().into())));
/// ```
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::data_scan::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
/// The value of [result][crate::model::DataScan::result]
/// if it holds a `DataQualityResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_quality_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataQualityResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan::Result::DataQualityResult(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScan::result]
/// to hold a `DataQualityResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataScan::new().set_data_quality_result(DataQualityResult::default()/* use setters */);
/// assert!(x.data_quality_result().is_some());
/// assert!(x.data_profile_result().is_none());
/// assert!(x.data_discovery_result().is_none());
/// assert!(x.data_documentation_result().is_none());
/// ```
pub fn set_data_quality_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataQualityResult>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::data_scan::Result::DataQualityResult(v.into()));
self
}
/// The value of [result][crate::model::DataScan::result]
/// if it holds a `DataProfileResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_profile_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataProfileResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan::Result::DataProfileResult(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScan::result]
/// to hold a `DataProfileResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataProfileResult;
/// let x = DataScan::new().set_data_profile_result(DataProfileResult::default()/* use setters */);
/// assert!(x.data_profile_result().is_some());
/// assert!(x.data_quality_result().is_none());
/// assert!(x.data_discovery_result().is_none());
/// assert!(x.data_documentation_result().is_none());
/// ```
pub fn set_data_profile_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataProfileResult>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::data_scan::Result::DataProfileResult(v.into()));
self
}
/// The value of [result][crate::model::DataScan::result]
/// if it holds a `DataDiscoveryResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_discovery_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDiscoveryResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan::Result::DataDiscoveryResult(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScan::result]
/// to hold a `DataDiscoveryResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataDiscoveryResult;
/// let x = DataScan::new().set_data_discovery_result(DataDiscoveryResult::default()/* use setters */);
/// assert!(x.data_discovery_result().is_some());
/// assert!(x.data_quality_result().is_none());
/// assert!(x.data_profile_result().is_none());
/// assert!(x.data_documentation_result().is_none());
/// ```
pub fn set_data_discovery_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataDiscoveryResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_scan::Result::DataDiscoveryResult(v.into()),
);
self
}
/// The value of [result][crate::model::DataScan::result]
/// if it holds a `DataDocumentationResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_documentation_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDocumentationResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan::Result::DataDocumentationResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScan::result]
/// to hold a `DataDocumentationResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScan;
/// use google_cloud_dataplex_v1::model::DataDocumentationResult;
/// let x = DataScan::new().set_data_documentation_result(DataDocumentationResult::default()/* use setters */);
/// assert!(x.data_documentation_result().is_some());
/// assert!(x.data_quality_result().is_none());
/// assert!(x.data_profile_result().is_none());
/// assert!(x.data_discovery_result().is_none());
/// ```
pub fn set_data_documentation_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataDocumentationResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_scan::Result::DataDocumentationResult(v.into()),
);
self
}
}
impl wkt::message::Message for DataScan {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScan"
}
}
/// Defines additional types related to [DataScan].
pub mod data_scan {
#[allow(unused_imports)]
use super::*;
/// DataScan execution settings.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionSpec {
/// Optional. Spec related to how often and when a scan should be triggered.
///
/// If not specified, the default is `OnDemand`, which means the scan will
/// not run until the user calls `RunDataScan` API.
pub trigger: std::option::Option<crate::model::Trigger>,
/// Spec related to incremental scan of the data
///
/// When an option is selected for incremental scan, it cannot be unset or
/// changed. If not specified, a data scan will run for all data in the
/// table.
pub incremental: std::option::Option<crate::model::data_scan::execution_spec::Incremental>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [trigger][crate::model::data_scan::ExecutionSpec::trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionSpec;
/// use google_cloud_dataplex_v1::model::Trigger;
/// let x = ExecutionSpec::new().set_trigger(Trigger::default()/* use setters */);
/// ```
pub fn set_trigger<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Trigger>,
{
self.trigger = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [trigger][crate::model::data_scan::ExecutionSpec::trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionSpec;
/// use google_cloud_dataplex_v1::model::Trigger;
/// let x = ExecutionSpec::new().set_or_clear_trigger(Some(Trigger::default()/* use setters */));
/// let x = ExecutionSpec::new().set_or_clear_trigger(None::<Trigger>);
/// ```
pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Trigger>,
{
self.trigger = v.map(|x| x.into());
self
}
/// Sets the value of [incremental][crate::model::data_scan::ExecutionSpec::incremental].
///
/// Note that all the setters affecting `incremental` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionSpec;
/// use google_cloud_dataplex_v1::model::data_scan::execution_spec::Incremental;
/// let x = ExecutionSpec::new().set_incremental(Some(Incremental::Field("example".to_string())));
/// ```
pub fn set_incremental<
T: std::convert::Into<
std::option::Option<crate::model::data_scan::execution_spec::Incremental>,
>,
>(
mut self,
v: T,
) -> Self {
self.incremental = v.into();
self
}
/// The value of [incremental][crate::model::data_scan::ExecutionSpec::incremental]
/// if it holds a `Field`, `None` if the field is not set or
/// holds a different branch.
pub fn field(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.incremental.as_ref().and_then(|v| match v {
crate::model::data_scan::execution_spec::Incremental::Field(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [incremental][crate::model::data_scan::ExecutionSpec::incremental]
/// to hold a `Field`.
///
/// Note that all the setters affecting `incremental` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionSpec;
/// let x = ExecutionSpec::new().set_field("example");
/// assert!(x.field().is_some());
/// ```
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.incremental = std::option::Option::Some(
crate::model::data_scan::execution_spec::Incremental::Field(v.into()),
);
self
}
}
impl wkt::message::Message for ExecutionSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScan.ExecutionSpec"
}
}
/// Defines additional types related to [ExecutionSpec].
pub mod execution_spec {
#[allow(unused_imports)]
use super::*;
/// Spec related to incremental scan of the data
///
/// When an option is selected for incremental scan, it cannot be unset or
/// changed. If not specified, a data scan will run for all data in the
/// table.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Incremental {
/// Immutable. The unnested field (of type *Date* or *Timestamp*) that
/// contains values which monotonically increase over time.
///
/// If not specified, a data scan will run for all data in the table.
Field(std::string::String),
}
}
/// Status of the data scan execution.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionStatus {
/// Optional. The time when the latest DataScanJob started.
pub latest_job_start_time: std::option::Option<wkt::Timestamp>,
/// Optional. The time when the latest DataScanJob ended.
pub latest_job_end_time: std::option::Option<wkt::Timestamp>,
/// Optional. The time when the DataScanJob execution was created.
pub latest_job_create_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [latest_job_start_time][crate::model::data_scan::ExecutionStatus::latest_job_start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_latest_job_start_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_latest_job_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_job_start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [latest_job_start_time][crate::model::data_scan::ExecutionStatus::latest_job_start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_or_clear_latest_job_start_time(Some(Timestamp::default()/* use setters */));
/// let x = ExecutionStatus::new().set_or_clear_latest_job_start_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_latest_job_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_job_start_time = v.map(|x| x.into());
self
}
/// Sets the value of [latest_job_end_time][crate::model::data_scan::ExecutionStatus::latest_job_end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_latest_job_end_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_latest_job_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_job_end_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [latest_job_end_time][crate::model::data_scan::ExecutionStatus::latest_job_end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_or_clear_latest_job_end_time(Some(Timestamp::default()/* use setters */));
/// let x = ExecutionStatus::new().set_or_clear_latest_job_end_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_latest_job_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_job_end_time = v.map(|x| x.into());
self
}
/// Sets the value of [latest_job_create_time][crate::model::data_scan::ExecutionStatus::latest_job_create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_latest_job_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_latest_job_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_job_create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [latest_job_create_time][crate::model::data_scan::ExecutionStatus::latest_job_create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_or_clear_latest_job_create_time(Some(Timestamp::default()/* use setters */));
/// let x = ExecutionStatus::new().set_or_clear_latest_job_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_latest_job_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_job_create_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecutionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScan.ExecutionStatus"
}
}
/// Data scan related setting.
/// The settings are required and immutable. After you configure the settings
/// for one type of data scan, you can't change the data scan to a different
/// type of data scan.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Spec {
/// Settings for a data quality scan.
DataQualitySpec(std::boxed::Box<crate::model::DataQualitySpec>),
/// Settings for a data profile scan.
DataProfileSpec(std::boxed::Box<crate::model::DataProfileSpec>),
/// Settings for a data discovery scan.
DataDiscoverySpec(std::boxed::Box<crate::model::DataDiscoverySpec>),
/// Settings for a data documentation scan.
DataDocumentationSpec(std::boxed::Box<crate::model::DataDocumentationSpec>),
}
/// The result of the data scan.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
/// Output only. The result of a data quality scan.
DataQualityResult(std::boxed::Box<crate::model::DataQualityResult>),
/// Output only. The result of a data profile scan.
DataProfileResult(std::boxed::Box<crate::model::DataProfileResult>),
/// Output only. The result of a data discovery scan.
DataDiscoveryResult(std::boxed::Box<crate::model::DataDiscoveryResult>),
/// Output only. The result of a data documentation scan.
DataDocumentationResult(std::boxed::Box<crate::model::DataDocumentationResult>),
}
}
/// The identity to run the datascan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionIdentity {
/// The identity to run the datascan.
pub identity: std::option::Option<crate::model::execution_identity::Identity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionIdentity {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [identity][crate::model::ExecutionIdentity::identity].
///
/// Note that all the setters affecting `identity` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ExecutionIdentity;
/// use google_cloud_dataplex_v1::model::execution_identity::DataplexServiceAgent;
/// let x = ExecutionIdentity::new().set_identity(Some(
/// google_cloud_dataplex_v1::model::execution_identity::Identity::DataplexServiceAgent(DataplexServiceAgent::default().into())));
/// ```
pub fn set_identity<
T: std::convert::Into<std::option::Option<crate::model::execution_identity::Identity>>,
>(
mut self,
v: T,
) -> Self {
self.identity = v.into();
self
}
/// The value of [identity][crate::model::ExecutionIdentity::identity]
/// if it holds a `DataplexServiceAgent`, `None` if the field is not set or
/// holds a different branch.
pub fn dataplex_service_agent(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::execution_identity::DataplexServiceAgent>>
{
#[allow(unreachable_patterns)]
self.identity.as_ref().and_then(|v| match v {
crate::model::execution_identity::Identity::DataplexServiceAgent(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [identity][crate::model::ExecutionIdentity::identity]
/// to hold a `DataplexServiceAgent`.
///
/// Note that all the setters affecting `identity` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ExecutionIdentity;
/// use google_cloud_dataplex_v1::model::execution_identity::DataplexServiceAgent;
/// let x = ExecutionIdentity::new().set_dataplex_service_agent(DataplexServiceAgent::default()/* use setters */);
/// assert!(x.dataplex_service_agent().is_some());
/// assert!(x.user_credential().is_none());
/// assert!(x.service_account().is_none());
/// ```
pub fn set_dataplex_service_agent<
T: std::convert::Into<std::boxed::Box<crate::model::execution_identity::DataplexServiceAgent>>,
>(
mut self,
v: T,
) -> Self {
self.identity = std::option::Option::Some(
crate::model::execution_identity::Identity::DataplexServiceAgent(v.into()),
);
self
}
/// The value of [identity][crate::model::ExecutionIdentity::identity]
/// if it holds a `UserCredential`, `None` if the field is not set or
/// holds a different branch.
pub fn user_credential(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::execution_identity::UserCredential>>
{
#[allow(unreachable_patterns)]
self.identity.as_ref().and_then(|v| match v {
crate::model::execution_identity::Identity::UserCredential(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [identity][crate::model::ExecutionIdentity::identity]
/// to hold a `UserCredential`.
///
/// Note that all the setters affecting `identity` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ExecutionIdentity;
/// use google_cloud_dataplex_v1::model::execution_identity::UserCredential;
/// let x = ExecutionIdentity::new().set_user_credential(UserCredential::default()/* use setters */);
/// assert!(x.user_credential().is_some());
/// assert!(x.dataplex_service_agent().is_none());
/// assert!(x.service_account().is_none());
/// ```
pub fn set_user_credential<
T: std::convert::Into<std::boxed::Box<crate::model::execution_identity::UserCredential>>,
>(
mut self,
v: T,
) -> Self {
self.identity = std::option::Option::Some(
crate::model::execution_identity::Identity::UserCredential(v.into()),
);
self
}
/// The value of [identity][crate::model::ExecutionIdentity::identity]
/// if it holds a `ServiceAccount`, `None` if the field is not set or
/// holds a different branch.
pub fn service_account(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::execution_identity::ServiceAccount>>
{
#[allow(unreachable_patterns)]
self.identity.as_ref().and_then(|v| match v {
crate::model::execution_identity::Identity::ServiceAccount(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [identity][crate::model::ExecutionIdentity::identity]
/// to hold a `ServiceAccount`.
///
/// Note that all the setters affecting `identity` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ExecutionIdentity;
/// use google_cloud_dataplex_v1::model::execution_identity::ServiceAccount;
/// let x = ExecutionIdentity::new().set_service_account(ServiceAccount::default()/* use setters */);
/// assert!(x.service_account().is_some());
/// assert!(x.dataplex_service_agent().is_none());
/// assert!(x.user_credential().is_none());
/// ```
pub fn set_service_account<
T: std::convert::Into<std::boxed::Box<crate::model::execution_identity::ServiceAccount>>,
>(
mut self,
v: T,
) -> Self {
self.identity = std::option::Option::Some(
crate::model::execution_identity::Identity::ServiceAccount(v.into()),
);
self
}
}
impl wkt::message::Message for ExecutionIdentity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ExecutionIdentity"
}
}
/// Defines additional types related to [ExecutionIdentity].
pub mod execution_identity {
#[allow(unused_imports)]
use super::*;
/// The Dataplex service agent associated with the user's project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataplexServiceAgent {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataplexServiceAgent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DataplexServiceAgent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ExecutionIdentity.DataplexServiceAgent"
}
}
/// The credential of the calling user.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserCredential {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserCredential {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UserCredential {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ExecutionIdentity.UserCredential"
}
}
/// The service account
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAccount {
/// Required. Service account email. The datascan will execute with this
/// service account's credentials. The user calling this API must have
/// permissions to act as this service account. Dataplex service agent must
/// be granted iam.serviceAccounts.getAccessToken permission on this service
/// account, for example, through the iam.serviceAccountTokenCreator role .
pub email: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAccount {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [email][crate::model::execution_identity::ServiceAccount::email].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::execution_identity::ServiceAccount;
/// let x = ServiceAccount::new().set_email("example");
/// ```
pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.email = v.into();
self
}
}
impl wkt::message::Message for ServiceAccount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ExecutionIdentity.ServiceAccount"
}
}
/// The identity to run the datascan.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Identity {
/// Optional. The Dataplex service agent associated with the user's project.
DataplexServiceAgent(
std::boxed::Box<crate::model::execution_identity::DataplexServiceAgent>,
),
/// Optional. The credential of the calling user. Supports only ONE_TIME
/// trigger type.
UserCredential(std::boxed::Box<crate::model::execution_identity::UserCredential>),
/// Optional. The provided service account.
ServiceAccount(std::boxed::Box<crate::model::execution_identity::ServiceAccount>),
}
}
/// A DataScanJob represents an instance of DataScan execution.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataScanJob {
/// Output only. Identifier. The relative resource name of the DataScanJob, of
/// the form:
/// `projects/{project}/locations/{location_id}/dataScans/{datascan_id}/jobs/{job_id}`,
/// where `project` refers to a *project_id* or *project_number* and
/// `location_id` refers to a Google Cloud region.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the DataScanJob.
pub uid: std::string::String,
/// Output only. The time when the DataScanJob was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. A message indicating partial failure details.
pub partial_failure_message: std::string::String,
/// Output only. The time when the DataScanJob was started.
pub start_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the DataScanJob ended.
pub end_time: std::option::Option<wkt::Timestamp>,
/// Output only. Execution state for the DataScanJob.
pub state: crate::model::data_scan_job::State,
/// Output only. Additional information about the current state.
pub message: std::string::String,
/// Output only. The type of the parent DataScan.
pub r#type: crate::model::DataScanType,
/// Data scan related setting.
pub spec: std::option::Option<crate::model::data_scan_job::Spec>,
/// The result of the data scan.
pub result: std::option::Option<crate::model::data_scan_job::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataScanJob {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DataScanJob::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let data_scan_id = "data_scan_id";
/// # let job_id = "job_id";
/// let x = DataScanJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::DataScanJob::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// let x = DataScanJob::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataScanJob::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use wkt::Timestamp;
/// let x = DataScanJob::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataScanJob::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use wkt::Timestamp;
/// let x = DataScanJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScanJob::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [partial_failure_message][crate::model::DataScanJob::partial_failure_message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// let x = DataScanJob::new().set_partial_failure_message("example");
/// ```
pub fn set_partial_failure_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.partial_failure_message = v.into();
self
}
/// Sets the value of [start_time][crate::model::DataScanJob::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use wkt::Timestamp;
/// let x = DataScanJob::new().set_start_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::DataScanJob::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use wkt::Timestamp;
/// let x = DataScanJob::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScanJob::new().set_or_clear_start_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [end_time][crate::model::DataScanJob::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use wkt::Timestamp;
/// let x = DataScanJob::new().set_end_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [end_time][crate::model::DataScanJob::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use wkt::Timestamp;
/// let x = DataScanJob::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScanJob::new().set_or_clear_end_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
/// Sets the value of [state][crate::model::DataScanJob::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::data_scan_job::State;
/// let x0 = DataScanJob::new().set_state(State::Running);
/// let x1 = DataScanJob::new().set_state(State::Canceling);
/// let x2 = DataScanJob::new().set_state(State::Cancelled);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::data_scan_job::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::DataScanJob::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// let x = DataScanJob::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [r#type][crate::model::DataScanJob::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataScanType;
/// let x0 = DataScanJob::new().set_type(DataScanType::DataQuality);
/// let x1 = DataScanJob::new().set_type(DataScanType::DataProfile);
/// let x2 = DataScanJob::new().set_type(DataScanType::DataDiscovery);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::DataScanType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [spec][crate::model::DataScanJob::spec].
///
/// Note that all the setters affecting `spec` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataScanJob::new().set_spec(Some(
/// google_cloud_dataplex_v1::model::data_scan_job::Spec::DataQualitySpec(DataQualitySpec::default().into())));
/// ```
pub fn set_spec<
T: std::convert::Into<std::option::Option<crate::model::data_scan_job::Spec>>,
>(
mut self,
v: T,
) -> Self {
self.spec = v.into();
self
}
/// The value of [spec][crate::model::DataScanJob::spec]
/// if it holds a `DataQualitySpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_quality_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataQualitySpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Spec::DataQualitySpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScanJob::spec]
/// to hold a `DataQualitySpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataQualitySpec;
/// let x = DataScanJob::new().set_data_quality_spec(DataQualitySpec::default()/* use setters */);
/// assert!(x.data_quality_spec().is_some());
/// assert!(x.data_profile_spec().is_none());
/// assert!(x.data_discovery_spec().is_none());
/// assert!(x.data_documentation_spec().is_none());
/// ```
pub fn set_data_quality_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataQualitySpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::data_scan_job::Spec::DataQualitySpec(v.into()));
self
}
/// The value of [spec][crate::model::DataScanJob::spec]
/// if it holds a `DataProfileSpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_profile_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataProfileSpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Spec::DataProfileSpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScanJob::spec]
/// to hold a `DataProfileSpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataProfileSpec;
/// let x = DataScanJob::new().set_data_profile_spec(DataProfileSpec::default()/* use setters */);
/// assert!(x.data_profile_spec().is_some());
/// assert!(x.data_quality_spec().is_none());
/// assert!(x.data_discovery_spec().is_none());
/// assert!(x.data_documentation_spec().is_none());
/// ```
pub fn set_data_profile_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataProfileSpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec =
std::option::Option::Some(crate::model::data_scan_job::Spec::DataProfileSpec(v.into()));
self
}
/// The value of [spec][crate::model::DataScanJob::spec]
/// if it holds a `DataDiscoverySpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_discovery_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDiscoverySpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Spec::DataDiscoverySpec(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScanJob::spec]
/// to hold a `DataDiscoverySpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataDiscoverySpec;
/// let x = DataScanJob::new().set_data_discovery_spec(DataDiscoverySpec::default()/* use setters */);
/// assert!(x.data_discovery_spec().is_some());
/// assert!(x.data_quality_spec().is_none());
/// assert!(x.data_profile_spec().is_none());
/// assert!(x.data_documentation_spec().is_none());
/// ```
pub fn set_data_discovery_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataDiscoverySpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec = std::option::Option::Some(
crate::model::data_scan_job::Spec::DataDiscoverySpec(v.into()),
);
self
}
/// The value of [spec][crate::model::DataScanJob::spec]
/// if it holds a `DataDocumentationSpec`, `None` if the field is not set or
/// holds a different branch.
pub fn data_documentation_spec(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDocumentationSpec>> {
#[allow(unreachable_patterns)]
self.spec.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Spec::DataDocumentationSpec(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [spec][crate::model::DataScanJob::spec]
/// to hold a `DataDocumentationSpec`.
///
/// Note that all the setters affecting `spec` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataDocumentationSpec;
/// let x = DataScanJob::new().set_data_documentation_spec(DataDocumentationSpec::default()/* use setters */);
/// assert!(x.data_documentation_spec().is_some());
/// assert!(x.data_quality_spec().is_none());
/// assert!(x.data_profile_spec().is_none());
/// assert!(x.data_discovery_spec().is_none());
/// ```
pub fn set_data_documentation_spec<
T: std::convert::Into<std::boxed::Box<crate::model::DataDocumentationSpec>>,
>(
mut self,
v: T,
) -> Self {
self.spec = std::option::Option::Some(
crate::model::data_scan_job::Spec::DataDocumentationSpec(v.into()),
);
self
}
/// Sets the value of [result][crate::model::DataScanJob::result].
///
/// Note that all the setters affecting `result` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataScanJob::new().set_result(Some(
/// google_cloud_dataplex_v1::model::data_scan_job::Result::DataQualityResult(DataQualityResult::default().into())));
/// ```
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::data_scan_job::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
/// The value of [result][crate::model::DataScanJob::result]
/// if it holds a `DataQualityResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_quality_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataQualityResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Result::DataQualityResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScanJob::result]
/// to hold a `DataQualityResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataQualityResult;
/// let x = DataScanJob::new().set_data_quality_result(DataQualityResult::default()/* use setters */);
/// assert!(x.data_quality_result().is_some());
/// assert!(x.data_profile_result().is_none());
/// assert!(x.data_discovery_result().is_none());
/// assert!(x.data_documentation_result().is_none());
/// ```
pub fn set_data_quality_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataQualityResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_scan_job::Result::DataQualityResult(v.into()),
);
self
}
/// The value of [result][crate::model::DataScanJob::result]
/// if it holds a `DataProfileResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_profile_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataProfileResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Result::DataProfileResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScanJob::result]
/// to hold a `DataProfileResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataProfileResult;
/// let x = DataScanJob::new().set_data_profile_result(DataProfileResult::default()/* use setters */);
/// assert!(x.data_profile_result().is_some());
/// assert!(x.data_quality_result().is_none());
/// assert!(x.data_discovery_result().is_none());
/// assert!(x.data_documentation_result().is_none());
/// ```
pub fn set_data_profile_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataProfileResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_scan_job::Result::DataProfileResult(v.into()),
);
self
}
/// The value of [result][crate::model::DataScanJob::result]
/// if it holds a `DataDiscoveryResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_discovery_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDiscoveryResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Result::DataDiscoveryResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScanJob::result]
/// to hold a `DataDiscoveryResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataDiscoveryResult;
/// let x = DataScanJob::new().set_data_discovery_result(DataDiscoveryResult::default()/* use setters */);
/// assert!(x.data_discovery_result().is_some());
/// assert!(x.data_quality_result().is_none());
/// assert!(x.data_profile_result().is_none());
/// assert!(x.data_documentation_result().is_none());
/// ```
pub fn set_data_discovery_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataDiscoveryResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_scan_job::Result::DataDiscoveryResult(v.into()),
);
self
}
/// The value of [result][crate::model::DataScanJob::result]
/// if it holds a `DataDocumentationResult`, `None` if the field is not set or
/// holds a different branch.
pub fn data_documentation_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDocumentationResult>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan_job::Result::DataDocumentationResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScanJob::result]
/// to hold a `DataDocumentationResult`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanJob;
/// use google_cloud_dataplex_v1::model::DataDocumentationResult;
/// let x = DataScanJob::new().set_data_documentation_result(DataDocumentationResult::default()/* use setters */);
/// assert!(x.data_documentation_result().is_some());
/// assert!(x.data_quality_result().is_none());
/// assert!(x.data_profile_result().is_none());
/// assert!(x.data_discovery_result().is_none());
/// ```
pub fn set_data_documentation_result<
T: std::convert::Into<std::boxed::Box<crate::model::DataDocumentationResult>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::data_scan_job::Result::DataDocumentationResult(v.into()),
);
self
}
}
impl wkt::message::Message for DataScanJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanJob"
}
}
/// Defines additional types related to [DataScanJob].
pub mod data_scan_job {
#[allow(unused_imports)]
use super::*;
/// Execution state for the DataScanJob.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// The DataScanJob state is unspecified.
Unspecified,
/// The DataScanJob is running.
Running,
/// The DataScanJob is canceling.
Canceling,
/// The DataScanJob cancellation was successful.
Cancelled,
/// The DataScanJob completed successfully.
Succeeded,
/// The DataScanJob is no longer running due to an error.
Failed,
/// The DataScanJob has been created but not started to run yet.
Pending,
/// The DataScanJob succeeded with errors.
SucceededWithErrors,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Running => std::option::Option::Some(1),
Self::Canceling => std::option::Option::Some(2),
Self::Cancelled => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::Pending => std::option::Option::Some(7),
Self::SucceededWithErrors => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Canceling => std::option::Option::Some("CANCELING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::SucceededWithErrors => std::option::Option::Some("SUCCEEDED_WITH_ERRORS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Running,
2 => Self::Canceling,
3 => Self::Cancelled,
4 => Self::Succeeded,
5 => Self::Failed,
7 => Self::Pending,
8 => Self::SucceededWithErrors,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"RUNNING" => Self::Running,
"CANCELING" => Self::Canceling,
"CANCELLED" => Self::Cancelled,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"PENDING" => Self::Pending,
"SUCCEEDED_WITH_ERRORS" => Self::SucceededWithErrors,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Running => serializer.serialize_i32(1),
Self::Canceling => serializer.serialize_i32(2),
Self::Cancelled => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::Pending => serializer.serialize_i32(7),
Self::SucceededWithErrors => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.DataScanJob.State",
))
}
}
/// Data scan related setting.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Spec {
/// Output only. Settings for a data quality scan.
DataQualitySpec(std::boxed::Box<crate::model::DataQualitySpec>),
/// Output only. Settings for a data profile scan.
DataProfileSpec(std::boxed::Box<crate::model::DataProfileSpec>),
/// Output only. Settings for a data discovery scan.
DataDiscoverySpec(std::boxed::Box<crate::model::DataDiscoverySpec>),
/// Output only. Settings for a data documentation scan.
DataDocumentationSpec(std::boxed::Box<crate::model::DataDocumentationSpec>),
}
/// The result of the data scan.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
/// Output only. The result of a data quality scan.
DataQualityResult(std::boxed::Box<crate::model::DataQualityResult>),
/// Output only. The result of a data profile scan.
DataProfileResult(std::boxed::Box<crate::model::DataProfileResult>),
/// Output only. The result of a data discovery scan.
DataDiscoveryResult(std::boxed::Box<crate::model::DataDiscoveryResult>),
/// Output only. The result of a data documentation scan.
DataDocumentationResult(std::boxed::Box<crate::model::DataDocumentationResult>),
}
}
/// The status of publishing the data scan result as Dataplex Universal Catalog
/// metadata. Multiple DataScan log events may exist, each with different
/// publishing information depending on the type of publishing triggered.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataScanCatalogPublishingStatus {
/// Output only. Execution state for publishing.
pub state: crate::model::data_scan_catalog_publishing_status::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataScanCatalogPublishingStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::DataScanCatalogPublishingStatus::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// use google_cloud_dataplex_v1::model::data_scan_catalog_publishing_status::State;
/// let x0 = DataScanCatalogPublishingStatus::new().set_state(State::Succeeded);
/// let x1 = DataScanCatalogPublishingStatus::new().set_state(State::Failed);
/// let x2 = DataScanCatalogPublishingStatus::new().set_state(State::Skipped);
/// ```
pub fn set_state<
T: std::convert::Into<crate::model::data_scan_catalog_publishing_status::State>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for DataScanCatalogPublishingStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanCatalogPublishingStatus"
}
}
/// Defines additional types related to [DataScanCatalogPublishingStatus].
pub mod data_scan_catalog_publishing_status {
#[allow(unused_imports)]
use super::*;
/// Execution state for the publishing.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// The publishing state is unspecified.
Unspecified,
/// Publishing to catalog completed successfully.
Succeeded,
/// Publish to catalog failed.
Failed,
/// Publishing to catalog was skipped.
Skipped,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Skipped => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"SKIPPED" => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Skipped => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.DataScanCatalogPublishingStatus.State",
))
}
}
}
/// The payload associated with Discovery data processing.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoveryEvent {
/// The log message.
pub message: std::string::String,
/// The id of the associated lake.
pub lake_id: std::string::String,
/// The id of the associated zone.
pub zone_id: std::string::String,
/// The id of the associated asset.
pub asset_id: std::string::String,
/// The data location associated with the event.
pub data_location: std::string::String,
/// The id of the associated datascan for standalone discovery.
pub datascan_id: std::string::String,
/// The type of the event being logged.
pub r#type: crate::model::discovery_event::EventType,
/// Additional details about the event.
pub details: std::option::Option<crate::model::discovery_event::Details>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiscoveryEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [message][crate::model::DiscoveryEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// let x = DiscoveryEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [lake_id][crate::model::DiscoveryEvent::lake_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// let x = DiscoveryEvent::new().set_lake_id("example");
/// ```
pub fn set_lake_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lake_id = v.into();
self
}
/// Sets the value of [zone_id][crate::model::DiscoveryEvent::zone_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// let x = DiscoveryEvent::new().set_zone_id("example");
/// ```
pub fn set_zone_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone_id = v.into();
self
}
/// Sets the value of [asset_id][crate::model::DiscoveryEvent::asset_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// let x = DiscoveryEvent::new().set_asset_id("example");
/// ```
pub fn set_asset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.asset_id = v.into();
self
}
/// Sets the value of [data_location][crate::model::DiscoveryEvent::data_location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// let x = DiscoveryEvent::new().set_data_location("example");
/// ```
pub fn set_data_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_location = v.into();
self
}
/// Sets the value of [datascan_id][crate::model::DiscoveryEvent::datascan_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// let x = DiscoveryEvent::new().set_datascan_id("example");
/// ```
pub fn set_datascan_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.datascan_id = v.into();
self
}
/// Sets the value of [r#type][crate::model::DiscoveryEvent::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::EventType;
/// let x0 = DiscoveryEvent::new().set_type(EventType::Config);
/// let x1 = DiscoveryEvent::new().set_type(EventType::EntityCreated);
/// let x2 = DiscoveryEvent::new().set_type(EventType::EntityUpdated);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::discovery_event::EventType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [details][crate::model::DiscoveryEvent::details].
///
/// Note that all the setters affecting `details` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::ConfigDetails;
/// let x = DiscoveryEvent::new().set_details(Some(
/// google_cloud_dataplex_v1::model::discovery_event::Details::Config(ConfigDetails::default().into())));
/// ```
pub fn set_details<
T: std::convert::Into<std::option::Option<crate::model::discovery_event::Details>>,
>(
mut self,
v: T,
) -> Self {
self.details = v.into();
self
}
/// The value of [details][crate::model::DiscoveryEvent::details]
/// if it holds a `Config`, `None` if the field is not set or
/// holds a different branch.
pub fn config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::discovery_event::ConfigDetails>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::discovery_event::Details::Config(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::DiscoveryEvent::details]
/// to hold a `Config`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::ConfigDetails;
/// let x = DiscoveryEvent::new().set_config(ConfigDetails::default()/* use setters */);
/// assert!(x.config().is_some());
/// assert!(x.entity().is_none());
/// assert!(x.partition().is_none());
/// assert!(x.action().is_none());
/// assert!(x.table().is_none());
/// ```
pub fn set_config<
T: std::convert::Into<std::boxed::Box<crate::model::discovery_event::ConfigDetails>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::discovery_event::Details::Config(v.into()));
self
}
/// The value of [details][crate::model::DiscoveryEvent::details]
/// if it holds a `Entity`, `None` if the field is not set or
/// holds a different branch.
pub fn entity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::discovery_event::EntityDetails>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::discovery_event::Details::Entity(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::DiscoveryEvent::details]
/// to hold a `Entity`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::EntityDetails;
/// let x = DiscoveryEvent::new().set_entity(EntityDetails::default()/* use setters */);
/// assert!(x.entity().is_some());
/// assert!(x.config().is_none());
/// assert!(x.partition().is_none());
/// assert!(x.action().is_none());
/// assert!(x.table().is_none());
/// ```
pub fn set_entity<
T: std::convert::Into<std::boxed::Box<crate::model::discovery_event::EntityDetails>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::discovery_event::Details::Entity(v.into()));
self
}
/// The value of [details][crate::model::DiscoveryEvent::details]
/// if it holds a `Partition`, `None` if the field is not set or
/// holds a different branch.
pub fn partition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::discovery_event::PartitionDetails>>
{
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::discovery_event::Details::Partition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::DiscoveryEvent::details]
/// to hold a `Partition`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::PartitionDetails;
/// let x = DiscoveryEvent::new().set_partition(PartitionDetails::default()/* use setters */);
/// assert!(x.partition().is_some());
/// assert!(x.config().is_none());
/// assert!(x.entity().is_none());
/// assert!(x.action().is_none());
/// assert!(x.table().is_none());
/// ```
pub fn set_partition<
T: std::convert::Into<std::boxed::Box<crate::model::discovery_event::PartitionDetails>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::discovery_event::Details::Partition(v.into()));
self
}
/// The value of [details][crate::model::DiscoveryEvent::details]
/// if it holds a `Action`, `None` if the field is not set or
/// holds a different branch.
pub fn action(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::discovery_event::ActionDetails>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::discovery_event::Details::Action(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::DiscoveryEvent::details]
/// to hold a `Action`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::ActionDetails;
/// let x = DiscoveryEvent::new().set_action(ActionDetails::default()/* use setters */);
/// assert!(x.action().is_some());
/// assert!(x.config().is_none());
/// assert!(x.entity().is_none());
/// assert!(x.partition().is_none());
/// assert!(x.table().is_none());
/// ```
pub fn set_action<
T: std::convert::Into<std::boxed::Box<crate::model::discovery_event::ActionDetails>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::discovery_event::Details::Action(v.into()));
self
}
/// The value of [details][crate::model::DiscoveryEvent::details]
/// if it holds a `Table`, `None` if the field is not set or
/// holds a different branch.
pub fn table(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::discovery_event::TableDetails>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::discovery_event::Details::Table(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::DiscoveryEvent::details]
/// to hold a `Table`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DiscoveryEvent;
/// use google_cloud_dataplex_v1::model::discovery_event::TableDetails;
/// let x = DiscoveryEvent::new().set_table(TableDetails::default()/* use setters */);
/// assert!(x.table().is_some());
/// assert!(x.config().is_none());
/// assert!(x.entity().is_none());
/// assert!(x.partition().is_none());
/// assert!(x.action().is_none());
/// ```
pub fn set_table<
T: std::convert::Into<std::boxed::Box<crate::model::discovery_event::TableDetails>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::discovery_event::Details::Table(v.into()));
self
}
}
impl wkt::message::Message for DiscoveryEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DiscoveryEvent"
}
}
/// Defines additional types related to [DiscoveryEvent].
pub mod discovery_event {
#[allow(unused_imports)]
use super::*;
/// Details about configuration events.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigDetails {
/// A list of discovery configuration parameters in effect.
/// The keys are the field paths within DiscoverySpec.
/// Eg. includePatterns, excludePatterns, csvOptions.disableTypeInference,
/// etc.
pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfigDetails {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parameters][crate::model::discovery_event::ConfigDetails::parameters].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::ConfigDetails;
/// let x = ConfigDetails::new().set_parameters([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for ConfigDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails"
}
}
/// Details about the entity.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityDetails {
/// The name of the entity resource.
/// The name is the fully-qualified resource name.
pub entity: std::string::String,
/// The type of the entity resource.
pub r#type: crate::model::discovery_event::EntityType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityDetails {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entity][crate::model::discovery_event::EntityDetails::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::EntityDetails;
/// let x = EntityDetails::new().set_entity("example");
/// ```
pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity = v.into();
self
}
/// Sets the value of [r#type][crate::model::discovery_event::EntityDetails::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::EntityDetails;
/// use google_cloud_dataplex_v1::model::discovery_event::EntityType;
/// let x0 = EntityDetails::new().set_type(EntityType::Table);
/// let x1 = EntityDetails::new().set_type(EntityType::Fileset);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::discovery_event::EntityType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for EntityDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails"
}
}
/// Details about the published table.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TableDetails {
/// The fully-qualified resource name of the table resource.
pub table: std::string::String,
/// The type of the table resource.
pub r#type: crate::model::discovery_event::TableType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TableDetails {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [table][crate::model::discovery_event::TableDetails::table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::TableDetails;
/// let x = TableDetails::new().set_table("example");
/// ```
pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table = v.into();
self
}
/// Sets the value of [r#type][crate::model::discovery_event::TableDetails::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::TableDetails;
/// use google_cloud_dataplex_v1::model::discovery_event::TableType;
/// let x0 = TableDetails::new().set_type(TableType::ExternalTable);
/// let x1 = TableDetails::new().set_type(TableType::BiglakeTable);
/// let x2 = TableDetails::new().set_type(TableType::ObjectTable);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::discovery_event::TableType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for TableDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DiscoveryEvent.TableDetails"
}
}
/// Details about the partition.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PartitionDetails {
/// The name to the partition resource.
/// The name is the fully-qualified resource name.
pub partition: std::string::String,
/// The name to the containing entity resource.
/// The name is the fully-qualified resource name.
pub entity: std::string::String,
/// The type of the containing entity resource.
pub r#type: crate::model::discovery_event::EntityType,
/// The locations of the data items (e.g., a Cloud Storage objects) sampled
/// for metadata inference.
pub sampled_data_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PartitionDetails {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [partition][crate::model::discovery_event::PartitionDetails::partition].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::PartitionDetails;
/// let x = PartitionDetails::new().set_partition("example");
/// ```
pub fn set_partition<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.partition = v.into();
self
}
/// Sets the value of [entity][crate::model::discovery_event::PartitionDetails::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::PartitionDetails;
/// let x = PartitionDetails::new().set_entity("example");
/// ```
pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity = v.into();
self
}
/// Sets the value of [r#type][crate::model::discovery_event::PartitionDetails::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::PartitionDetails;
/// use google_cloud_dataplex_v1::model::discovery_event::EntityType;
/// let x0 = PartitionDetails::new().set_type(EntityType::Table);
/// let x1 = PartitionDetails::new().set_type(EntityType::Fileset);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::discovery_event::EntityType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [sampled_data_locations][crate::model::discovery_event::PartitionDetails::sampled_data_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::PartitionDetails;
/// let x = PartitionDetails::new().set_sampled_data_locations(["a", "b", "c"]);
/// ```
pub fn set_sampled_data_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.sampled_data_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PartitionDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails"
}
}
/// Details about the action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActionDetails {
/// The type of action.
/// Eg. IncompatibleDataSchema, InvalidDataFormat
pub r#type: std::string::String,
/// The human readable issue associated with the action.
pub issue: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ActionDetails {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [r#type][crate::model::discovery_event::ActionDetails::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::ActionDetails;
/// let x = ActionDetails::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [issue][crate::model::discovery_event::ActionDetails::issue].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::discovery_event::ActionDetails;
/// let x = ActionDetails::new().set_issue("example");
/// ```
pub fn set_issue<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issue = v.into();
self
}
}
impl wkt::message::Message for ActionDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails"
}
}
/// The type of the event.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EventType {
/// An unspecified event type.
Unspecified,
/// An event representing discovery configuration in effect.
Config,
/// An event representing a metadata entity being created.
EntityCreated,
/// An event representing a metadata entity being updated.
EntityUpdated,
/// An event representing a metadata entity being deleted.
EntityDeleted,
/// An event representing a partition being created.
PartitionCreated,
/// An event representing a partition being updated.
PartitionUpdated,
/// An event representing a partition being deleted.
PartitionDeleted,
/// An event representing a table being published.
TablePublished,
/// An event representing a table being updated.
TableUpdated,
/// An event representing a table being skipped in publishing.
TableIgnored,
/// An event representing a table being deleted.
TableDeleted,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EventType::value] or
/// [EventType::name].
UnknownValue(event_type::UnknownValue),
}
#[doc(hidden)]
pub mod event_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EventType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Config => std::option::Option::Some(1),
Self::EntityCreated => std::option::Option::Some(2),
Self::EntityUpdated => std::option::Option::Some(3),
Self::EntityDeleted => std::option::Option::Some(4),
Self::PartitionCreated => std::option::Option::Some(5),
Self::PartitionUpdated => std::option::Option::Some(6),
Self::PartitionDeleted => std::option::Option::Some(7),
Self::TablePublished => std::option::Option::Some(10),
Self::TableUpdated => std::option::Option::Some(11),
Self::TableIgnored => std::option::Option::Some(12),
Self::TableDeleted => std::option::Option::Some(13),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
Self::Config => std::option::Option::Some("CONFIG"),
Self::EntityCreated => std::option::Option::Some("ENTITY_CREATED"),
Self::EntityUpdated => std::option::Option::Some("ENTITY_UPDATED"),
Self::EntityDeleted => std::option::Option::Some("ENTITY_DELETED"),
Self::PartitionCreated => std::option::Option::Some("PARTITION_CREATED"),
Self::PartitionUpdated => std::option::Option::Some("PARTITION_UPDATED"),
Self::PartitionDeleted => std::option::Option::Some("PARTITION_DELETED"),
Self::TablePublished => std::option::Option::Some("TABLE_PUBLISHED"),
Self::TableUpdated => std::option::Option::Some("TABLE_UPDATED"),
Self::TableIgnored => std::option::Option::Some("TABLE_IGNORED"),
Self::TableDeleted => std::option::Option::Some("TABLE_DELETED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EventType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EventType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Config,
2 => Self::EntityCreated,
3 => Self::EntityUpdated,
4 => Self::EntityDeleted,
5 => Self::PartitionCreated,
6 => Self::PartitionUpdated,
7 => Self::PartitionDeleted,
10 => Self::TablePublished,
11 => Self::TableUpdated,
12 => Self::TableIgnored,
13 => Self::TableDeleted,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EventType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"CONFIG" => Self::Config,
"ENTITY_CREATED" => Self::EntityCreated,
"ENTITY_UPDATED" => Self::EntityUpdated,
"ENTITY_DELETED" => Self::EntityDeleted,
"PARTITION_CREATED" => Self::PartitionCreated,
"PARTITION_UPDATED" => Self::PartitionUpdated,
"PARTITION_DELETED" => Self::PartitionDeleted,
"TABLE_PUBLISHED" => Self::TablePublished,
"TABLE_UPDATED" => Self::TableUpdated,
"TABLE_IGNORED" => Self::TableIgnored,
"TABLE_DELETED" => Self::TableDeleted,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EventType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Config => serializer.serialize_i32(1),
Self::EntityCreated => serializer.serialize_i32(2),
Self::EntityUpdated => serializer.serialize_i32(3),
Self::EntityDeleted => serializer.serialize_i32(4),
Self::PartitionCreated => serializer.serialize_i32(5),
Self::PartitionUpdated => serializer.serialize_i32(6),
Self::PartitionDeleted => serializer.serialize_i32(7),
Self::TablePublished => serializer.serialize_i32(10),
Self::TableUpdated => serializer.serialize_i32(11),
Self::TableIgnored => serializer.serialize_i32(12),
Self::TableDeleted => serializer.serialize_i32(13),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EventType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
".google.cloud.dataplex.v1.DiscoveryEvent.EventType",
))
}
}
/// The type of the entity.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntityType {
/// An unspecified event type.
Unspecified,
/// Entities representing structured data.
Table,
/// Entities representing unstructured data.
Fileset,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EntityType::value] or
/// [EntityType::name].
UnknownValue(entity_type::UnknownValue),
}
#[doc(hidden)]
pub mod entity_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntityType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Table => std::option::Option::Some(1),
Self::Fileset => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENTITY_TYPE_UNSPECIFIED"),
Self::Table => std::option::Option::Some("TABLE"),
Self::Fileset => std::option::Option::Some("FILESET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntityType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntityType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EntityType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Table,
2 => Self::Fileset,
_ => Self::UnknownValue(entity_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntityType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTITY_TYPE_UNSPECIFIED" => Self::Unspecified,
"TABLE" => Self::Table,
"FILESET" => Self::Fileset,
_ => Self::UnknownValue(entity_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntityType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Table => serializer.serialize_i32(1),
Self::Fileset => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntityType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityType>::new(
".google.cloud.dataplex.v1.DiscoveryEvent.EntityType",
))
}
}
/// The type of the published table.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TableType {
/// An unspecified table type.
Unspecified,
/// External table type.
ExternalTable,
/// BigLake table type.
BiglakeTable,
/// Object table type for unstructured data.
ObjectTable,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [TableType::value] or
/// [TableType::name].
UnknownValue(table_type::UnknownValue),
}
#[doc(hidden)]
pub mod table_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TableType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ExternalTable => std::option::Option::Some(1),
Self::BiglakeTable => std::option::Option::Some(2),
Self::ObjectTable => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TABLE_TYPE_UNSPECIFIED"),
Self::ExternalTable => std::option::Option::Some("EXTERNAL_TABLE"),
Self::BiglakeTable => std::option::Option::Some("BIGLAKE_TABLE"),
Self::ObjectTable => std::option::Option::Some("OBJECT_TABLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TableType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TableType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TableType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ExternalTable,
2 => Self::BiglakeTable,
3 => Self::ObjectTable,
_ => Self::UnknownValue(table_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TableType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TABLE_TYPE_UNSPECIFIED" => Self::Unspecified,
"EXTERNAL_TABLE" => Self::ExternalTable,
"BIGLAKE_TABLE" => Self::BiglakeTable,
"OBJECT_TABLE" => Self::ObjectTable,
_ => Self::UnknownValue(table_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TableType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ExternalTable => serializer.serialize_i32(1),
Self::BiglakeTable => serializer.serialize_i32(2),
Self::ObjectTable => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TableType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableType>::new(
".google.cloud.dataplex.v1.DiscoveryEvent.TableType",
))
}
}
/// Additional details about the event.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Details {
/// Details about discovery configuration in effect.
Config(std::boxed::Box<crate::model::discovery_event::ConfigDetails>),
/// Details about the entity associated with the event.
Entity(std::boxed::Box<crate::model::discovery_event::EntityDetails>),
/// Details about the partition associated with the event.
Partition(std::boxed::Box<crate::model::discovery_event::PartitionDetails>),
/// Details about the action associated with the event.
Action(std::boxed::Box<crate::model::discovery_event::ActionDetails>),
/// Details about the BigQuery table publishing associated with the event.
Table(std::boxed::Box<crate::model::discovery_event::TableDetails>),
}
}
/// The payload associated with Job logs that contains events describing jobs
/// that have run within a Lake.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobEvent {
/// The log message.
pub message: std::string::String,
/// The unique id identifying the job.
pub job_id: std::string::String,
/// The time when the job started running.
pub start_time: std::option::Option<wkt::Timestamp>,
/// The time when the job ended running.
pub end_time: std::option::Option<wkt::Timestamp>,
/// The job state on completion.
pub state: crate::model::job_event::State,
/// The number of retries.
pub retries: i32,
/// The type of the job.
pub r#type: crate::model::job_event::Type,
/// The service used to execute the job.
pub service: crate::model::job_event::Service,
/// The reference to the job within the service.
pub service_job: std::string::String,
/// Job execution trigger.
pub execution_trigger: crate::model::job_event::ExecutionTrigger,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [message][crate::model::JobEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// let x = JobEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [job_id][crate::model::JobEvent::job_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// let x = JobEvent::new().set_job_id("example");
/// ```
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
/// Sets the value of [start_time][crate::model::JobEvent::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use wkt::Timestamp;
/// let x = JobEvent::new().set_start_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::JobEvent::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use wkt::Timestamp;
/// let x = JobEvent::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
/// let x = JobEvent::new().set_or_clear_start_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [end_time][crate::model::JobEvent::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use wkt::Timestamp;
/// let x = JobEvent::new().set_end_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [end_time][crate::model::JobEvent::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use wkt::Timestamp;
/// let x = JobEvent::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
/// let x = JobEvent::new().set_or_clear_end_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
/// Sets the value of [state][crate::model::JobEvent::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use google_cloud_dataplex_v1::model::job_event::State;
/// let x0 = JobEvent::new().set_state(State::Succeeded);
/// let x1 = JobEvent::new().set_state(State::Failed);
/// let x2 = JobEvent::new().set_state(State::Cancelled);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::job_event::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [retries][crate::model::JobEvent::retries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// let x = JobEvent::new().set_retries(42);
/// ```
pub fn set_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.retries = v.into();
self
}
/// Sets the value of [r#type][crate::model::JobEvent::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use google_cloud_dataplex_v1::model::job_event::Type;
/// let x0 = JobEvent::new().set_type(Type::Spark);
/// let x1 = JobEvent::new().set_type(Type::Notebook);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::job_event::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [service][crate::model::JobEvent::service].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use google_cloud_dataplex_v1::model::job_event::Service;
/// let x0 = JobEvent::new().set_service(Service::Dataproc);
/// ```
pub fn set_service<T: std::convert::Into<crate::model::job_event::Service>>(
mut self,
v: T,
) -> Self {
self.service = v.into();
self
}
/// Sets the value of [service_job][crate::model::JobEvent::service_job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// let x = JobEvent::new().set_service_job("example");
/// ```
pub fn set_service_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_job = v.into();
self
}
/// Sets the value of [execution_trigger][crate::model::JobEvent::execution_trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::JobEvent;
/// use google_cloud_dataplex_v1::model::job_event::ExecutionTrigger;
/// let x0 = JobEvent::new().set_execution_trigger(ExecutionTrigger::TaskConfig);
/// let x1 = JobEvent::new().set_execution_trigger(ExecutionTrigger::RunRequest);
/// ```
pub fn set_execution_trigger<
T: std::convert::Into<crate::model::job_event::ExecutionTrigger>,
>(
mut self,
v: T,
) -> Self {
self.execution_trigger = v.into();
self
}
}
impl wkt::message::Message for JobEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.JobEvent"
}
}
/// Defines additional types related to [JobEvent].
pub mod job_event {
#[allow(unused_imports)]
use super::*;
/// The type of the job.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Unspecified job type.
Unspecified,
/// Spark jobs.
Spark,
/// Notebook jobs.
Notebook,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Spark => std::option::Option::Some(1),
Self::Notebook => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Spark => std::option::Option::Some("SPARK"),
Self::Notebook => std::option::Option::Some("NOTEBOOK"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Spark,
2 => Self::Notebook,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"SPARK" => Self::Spark,
"NOTEBOOK" => Self::Notebook,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Spark => serializer.serialize_i32(1),
Self::Notebook => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.JobEvent.Type",
))
}
}
/// The completion status of the job.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// Unspecified job state.
Unspecified,
/// Job successfully completed.
Succeeded,
/// Job was unsuccessful.
Failed,
/// Job was cancelled by the user.
Cancelled,
/// Job was cancelled or aborted via the service executing the job.
Aborted,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Cancelled => std::option::Option::Some(3),
Self::Aborted => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Aborted => std::option::Option::Some("ABORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::Cancelled,
4 => Self::Aborted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"CANCELLED" => Self::Cancelled,
"ABORTED" => Self::Aborted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Cancelled => serializer.serialize_i32(3),
Self::Aborted => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.JobEvent.State",
))
}
}
/// The service used to execute the job.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Service {
/// Unspecified service.
Unspecified,
/// Cloud Dataproc.
Dataproc,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Service::value] or
/// [Service::name].
UnknownValue(service::UnknownValue),
}
#[doc(hidden)]
pub mod service {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Service {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Dataproc => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SERVICE_UNSPECIFIED"),
Self::Dataproc => std::option::Option::Some("DATAPROC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Service {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Service {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Service {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Dataproc,
_ => Self::UnknownValue(service::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Service {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SERVICE_UNSPECIFIED" => Self::Unspecified,
"DATAPROC" => Self::Dataproc,
_ => Self::UnknownValue(service::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Service {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Dataproc => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Service {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Service>::new(
".google.cloud.dataplex.v1.JobEvent.Service",
))
}
}
/// Job Execution trigger.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionTrigger {
/// The job execution trigger is unspecified.
Unspecified,
/// The job was triggered by Dataplex Universal Catalog based on trigger spec
/// from task definition.
TaskConfig,
/// The job was triggered by the explicit call of Task API.
RunRequest,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ExecutionTrigger::value] or
/// [ExecutionTrigger::name].
UnknownValue(execution_trigger::UnknownValue),
}
#[doc(hidden)]
pub mod execution_trigger {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionTrigger {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::TaskConfig => std::option::Option::Some(1),
Self::RunRequest => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXECUTION_TRIGGER_UNSPECIFIED"),
Self::TaskConfig => std::option::Option::Some("TASK_CONFIG"),
Self::RunRequest => std::option::Option::Some("RUN_REQUEST"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionTrigger {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionTrigger {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExecutionTrigger {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::TaskConfig,
2 => Self::RunRequest,
_ => Self::UnknownValue(execution_trigger::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionTrigger {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_TRIGGER_UNSPECIFIED" => Self::Unspecified,
"TASK_CONFIG" => Self::TaskConfig,
"RUN_REQUEST" => Self::RunRequest,
_ => Self::UnknownValue(execution_trigger::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionTrigger {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::TaskConfig => serializer.serialize_i32(1),
Self::RunRequest => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionTrigger {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionTrigger>::new(
".google.cloud.dataplex.v1.JobEvent.ExecutionTrigger",
))
}
}
}
/// These messages contain information about sessions within an environment.
/// The monitored resource is 'Environment'.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionEvent {
/// The log message.
pub message: std::string::String,
/// The information about the user that created the session. It will be the
/// email address of the user.
pub user_id: std::string::String,
/// Unique identifier for the session.
pub session_id: std::string::String,
/// The type of the event.
pub r#type: crate::model::session_event::EventType,
/// The status of the event.
pub event_succeeded: bool,
/// If the session is associated with an environment with fast startup enabled,
/// and was created before being assigned to a user.
pub fast_startup_enabled: bool,
/// The idle duration of a warm pooled session before it is assigned to user.
pub unassigned_duration: std::option::Option<wkt::Duration>,
/// Additional information about the Query metadata.
pub detail: std::option::Option<crate::model::session_event::Detail>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [message][crate::model::SessionEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// let x = SessionEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [user_id][crate::model::SessionEvent::user_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// let x = SessionEvent::new().set_user_id("example");
/// ```
pub fn set_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user_id = v.into();
self
}
/// Sets the value of [session_id][crate::model::SessionEvent::session_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// let x = SessionEvent::new().set_session_id("example");
/// ```
pub fn set_session_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.session_id = v.into();
self
}
/// Sets the value of [r#type][crate::model::SessionEvent::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// use google_cloud_dataplex_v1::model::session_event::EventType;
/// let x0 = SessionEvent::new().set_type(EventType::Start);
/// let x1 = SessionEvent::new().set_type(EventType::Stop);
/// let x2 = SessionEvent::new().set_type(EventType::Query);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::session_event::EventType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [event_succeeded][crate::model::SessionEvent::event_succeeded].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// let x = SessionEvent::new().set_event_succeeded(true);
/// ```
pub fn set_event_succeeded<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.event_succeeded = v.into();
self
}
/// Sets the value of [fast_startup_enabled][crate::model::SessionEvent::fast_startup_enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// let x = SessionEvent::new().set_fast_startup_enabled(true);
/// ```
pub fn set_fast_startup_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.fast_startup_enabled = v.into();
self
}
/// Sets the value of [unassigned_duration][crate::model::SessionEvent::unassigned_duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// use wkt::Duration;
/// let x = SessionEvent::new().set_unassigned_duration(Duration::default()/* use setters */);
/// ```
pub fn set_unassigned_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.unassigned_duration = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [unassigned_duration][crate::model::SessionEvent::unassigned_duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// use wkt::Duration;
/// let x = SessionEvent::new().set_or_clear_unassigned_duration(Some(Duration::default()/* use setters */));
/// let x = SessionEvent::new().set_or_clear_unassigned_duration(None::<Duration>);
/// ```
pub fn set_or_clear_unassigned_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.unassigned_duration = v.map(|x| x.into());
self
}
/// Sets the value of [detail][crate::model::SessionEvent::detail].
///
/// Note that all the setters affecting `detail` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// let x = SessionEvent::new().set_detail(Some(
/// google_cloud_dataplex_v1::model::session_event::Detail::Query(QueryDetail::default().into())));
/// ```
pub fn set_detail<
T: std::convert::Into<std::option::Option<crate::model::session_event::Detail>>,
>(
mut self,
v: T,
) -> Self {
self.detail = v.into();
self
}
/// The value of [detail][crate::model::SessionEvent::detail]
/// if it holds a `Query`, `None` if the field is not set or
/// holds a different branch.
pub fn query(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::session_event::QueryDetail>> {
#[allow(unreachable_patterns)]
self.detail.as_ref().and_then(|v| match v {
crate::model::session_event::Detail::Query(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [detail][crate::model::SessionEvent::detail]
/// to hold a `Query`.
///
/// Note that all the setters affecting `detail` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::SessionEvent;
/// use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// let x = SessionEvent::new().set_query(QueryDetail::default()/* use setters */);
/// assert!(x.query().is_some());
/// ```
pub fn set_query<
T: std::convert::Into<std::boxed::Box<crate::model::session_event::QueryDetail>>,
>(
mut self,
v: T,
) -> Self {
self.detail =
std::option::Option::Some(crate::model::session_event::Detail::Query(v.into()));
self
}
}
impl wkt::message::Message for SessionEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.SessionEvent"
}
}
/// Defines additional types related to [SessionEvent].
pub mod session_event {
#[allow(unused_imports)]
use super::*;
/// Execution details of the query.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryDetail {
/// The unique Query id identifying the query.
pub query_id: std::string::String,
/// The query text executed.
pub query_text: std::string::String,
/// Query Execution engine.
pub engine: crate::model::session_event::query_detail::Engine,
/// Time taken for execution of the query.
pub duration: std::option::Option<wkt::Duration>,
/// The size of results the query produced.
pub result_size_bytes: i64,
/// The data processed by the query.
pub data_processed_bytes: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryDetail {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [query_id][crate::model::session_event::QueryDetail::query_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// let x = QueryDetail::new().set_query_id("example");
/// ```
pub fn set_query_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query_id = v.into();
self
}
/// Sets the value of [query_text][crate::model::session_event::QueryDetail::query_text].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// let x = QueryDetail::new().set_query_text("example");
/// ```
pub fn set_query_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query_text = v.into();
self
}
/// Sets the value of [engine][crate::model::session_event::QueryDetail::engine].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// use google_cloud_dataplex_v1::model::session_event::query_detail::Engine;
/// let x0 = QueryDetail::new().set_engine(Engine::SparkSql);
/// let x1 = QueryDetail::new().set_engine(Engine::Bigquery);
/// ```
pub fn set_engine<
T: std::convert::Into<crate::model::session_event::query_detail::Engine>,
>(
mut self,
v: T,
) -> Self {
self.engine = v.into();
self
}
/// Sets the value of [duration][crate::model::session_event::QueryDetail::duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// use wkt::Duration;
/// let x = QueryDetail::new().set_duration(Duration::default()/* use setters */);
/// ```
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [duration][crate::model::session_event::QueryDetail::duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// use wkt::Duration;
/// let x = QueryDetail::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
/// let x = QueryDetail::new().set_or_clear_duration(None::<Duration>);
/// ```
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
/// Sets the value of [result_size_bytes][crate::model::session_event::QueryDetail::result_size_bytes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// let x = QueryDetail::new().set_result_size_bytes(42);
/// ```
pub fn set_result_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.result_size_bytes = v.into();
self
}
/// Sets the value of [data_processed_bytes][crate::model::session_event::QueryDetail::data_processed_bytes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::session_event::QueryDetail;
/// let x = QueryDetail::new().set_data_processed_bytes(42);
/// ```
pub fn set_data_processed_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.data_processed_bytes = v.into();
self
}
}
impl wkt::message::Message for QueryDetail {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.SessionEvent.QueryDetail"
}
}
/// Defines additional types related to [QueryDetail].
pub mod query_detail {
#[allow(unused_imports)]
use super::*;
/// Query Execution engine.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Engine {
/// An unspecified Engine type.
Unspecified,
/// Spark-sql engine is specified in Query.
SparkSql,
/// BigQuery engine is specified in Query.
Bigquery,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Engine::value] or
/// [Engine::name].
UnknownValue(engine::UnknownValue),
}
#[doc(hidden)]
pub mod engine {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Engine {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SparkSql => std::option::Option::Some(1),
Self::Bigquery => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENGINE_UNSPECIFIED"),
Self::SparkSql => std::option::Option::Some("SPARK_SQL"),
Self::Bigquery => std::option::Option::Some("BIGQUERY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Engine {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Engine {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Engine {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SparkSql,
2 => Self::Bigquery,
_ => Self::UnknownValue(engine::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Engine {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENGINE_UNSPECIFIED" => Self::Unspecified,
"SPARK_SQL" => Self::SparkSql,
"BIGQUERY" => Self::Bigquery,
_ => Self::UnknownValue(engine::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Engine {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::SparkSql => serializer.serialize_i32(1),
Self::Bigquery => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Engine {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Engine>::new(
".google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine",
))
}
}
}
/// The type of the event.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EventType {
/// An unspecified event type.
Unspecified,
/// Event when the session is assigned to a user.
Start,
/// Event for stop of a session.
Stop,
/// Query events in the session.
Query,
/// Event for creation of a cluster. It is not yet assigned to a user.
/// This comes before START in the sequence
Create,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EventType::value] or
/// [EventType::name].
UnknownValue(event_type::UnknownValue),
}
#[doc(hidden)]
pub mod event_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EventType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Start => std::option::Option::Some(1),
Self::Stop => std::option::Option::Some(2),
Self::Query => std::option::Option::Some(3),
Self::Create => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
Self::Start => std::option::Option::Some("START"),
Self::Stop => std::option::Option::Some("STOP"),
Self::Query => std::option::Option::Some("QUERY"),
Self::Create => std::option::Option::Some("CREATE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EventType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EventType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Start,
2 => Self::Stop,
3 => Self::Query,
4 => Self::Create,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EventType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"START" => Self::Start,
"STOP" => Self::Stop,
"QUERY" => Self::Query,
"CREATE" => Self::Create,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EventType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Start => serializer.serialize_i32(1),
Self::Stop => serializer.serialize_i32(2),
Self::Query => serializer.serialize_i32(3),
Self::Create => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EventType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
".google.cloud.dataplex.v1.SessionEvent.EventType",
))
}
}
/// Additional information about the Query metadata.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Detail {
/// The execution details of the query.
Query(std::boxed::Box<crate::model::session_event::QueryDetail>),
}
}
/// Payload associated with Governance related log events.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GovernanceEvent {
/// The log message.
pub message: std::string::String,
/// The type of the event.
pub event_type: crate::model::governance_event::EventType,
/// Entity resource information if the log event is associated with a
/// specific entity.
pub entity: std::option::Option<crate::model::governance_event::Entity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GovernanceEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [message][crate::model::GovernanceEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GovernanceEvent;
/// let x = GovernanceEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [event_type][crate::model::GovernanceEvent::event_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GovernanceEvent;
/// use google_cloud_dataplex_v1::model::governance_event::EventType;
/// let x0 = GovernanceEvent::new().set_event_type(EventType::ResourceIamPolicyUpdate);
/// let x1 = GovernanceEvent::new().set_event_type(EventType::BigqueryTableCreate);
/// let x2 = GovernanceEvent::new().set_event_type(EventType::BigqueryTableUpdate);
/// ```
pub fn set_event_type<T: std::convert::Into<crate::model::governance_event::EventType>>(
mut self,
v: T,
) -> Self {
self.event_type = v.into();
self
}
/// Sets the value of [entity][crate::model::GovernanceEvent::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GovernanceEvent;
/// use google_cloud_dataplex_v1::model::governance_event::Entity;
/// let x = GovernanceEvent::new().set_entity(Entity::default()/* use setters */);
/// ```
pub fn set_entity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::governance_event::Entity>,
{
self.entity = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entity][crate::model::GovernanceEvent::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GovernanceEvent;
/// use google_cloud_dataplex_v1::model::governance_event::Entity;
/// let x = GovernanceEvent::new().set_or_clear_entity(Some(Entity::default()/* use setters */));
/// let x = GovernanceEvent::new().set_or_clear_entity(None::<Entity>);
/// ```
pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::governance_event::Entity>,
{
self.entity = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GovernanceEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GovernanceEvent"
}
}
/// Defines additional types related to [GovernanceEvent].
pub mod governance_event {
#[allow(unused_imports)]
use super::*;
/// Information about Entity resource that the log event is associated with.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Entity {
/// The Entity resource the log event is associated with.
/// Format:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`
pub entity: std::string::String,
/// Type of entity.
pub entity_type: crate::model::governance_event::entity::EntityType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Entity {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entity][crate::model::governance_event::Entity::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::governance_event::Entity;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = Entity::new().set_entity(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// ```
pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity = v.into();
self
}
/// Sets the value of [entity_type][crate::model::governance_event::Entity::entity_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::governance_event::Entity;
/// use google_cloud_dataplex_v1::model::governance_event::entity::EntityType;
/// let x0 = Entity::new().set_entity_type(EntityType::Table);
/// let x1 = Entity::new().set_entity_type(EntityType::Fileset);
/// ```
pub fn set_entity_type<
T: std::convert::Into<crate::model::governance_event::entity::EntityType>,
>(
mut self,
v: T,
) -> Self {
self.entity_type = v.into();
self
}
}
impl wkt::message::Message for Entity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GovernanceEvent.Entity"
}
}
/// Defines additional types related to [Entity].
pub mod entity {
#[allow(unused_imports)]
use super::*;
/// Type of entity.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntityType {
/// An unspecified Entity type.
Unspecified,
/// Table entity type.
Table,
/// Fileset entity type.
Fileset,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EntityType::value] or
/// [EntityType::name].
UnknownValue(entity_type::UnknownValue),
}
#[doc(hidden)]
pub mod entity_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntityType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Table => std::option::Option::Some(1),
Self::Fileset => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENTITY_TYPE_UNSPECIFIED"),
Self::Table => std::option::Option::Some("TABLE"),
Self::Fileset => std::option::Option::Some("FILESET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntityType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntityType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EntityType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Table,
2 => Self::Fileset,
_ => Self::UnknownValue(entity_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntityType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTITY_TYPE_UNSPECIFIED" => Self::Unspecified,
"TABLE" => Self::Table,
"FILESET" => Self::Fileset,
_ => Self::UnknownValue(entity_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntityType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Table => serializer.serialize_i32(1),
Self::Fileset => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntityType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityType>::new(
".google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType",
))
}
}
}
/// Type of governance log event.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EventType {
/// An unspecified event type.
Unspecified,
/// Resource IAM policy update event.
ResourceIamPolicyUpdate,
/// BigQuery table create event.
BigqueryTableCreate,
/// BigQuery table update event.
BigqueryTableUpdate,
/// BigQuery table delete event.
BigqueryTableDelete,
/// BigQuery connection create event.
BigqueryConnectionCreate,
/// BigQuery connection update event.
BigqueryConnectionUpdate,
/// BigQuery connection delete event.
BigqueryConnectionDelete,
/// BigQuery taxonomy created.
BigqueryTaxonomyCreate,
/// BigQuery policy tag created.
BigqueryPolicyTagCreate,
/// BigQuery policy tag deleted.
BigqueryPolicyTagDelete,
/// BigQuery set iam policy for policy tag.
BigqueryPolicyTagSetIamPolicy,
/// Access policy update event.
AccessPolicyUpdate,
/// Number of resources matched with particular Query.
GovernanceRuleMatchedResources,
/// Rule processing exceeds the allowed limit.
GovernanceRuleSearchLimitExceeds,
/// Rule processing errors.
GovernanceRuleErrors,
/// Governance rule processing Event.
GovernanceRuleProcessing,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EventType::value] or
/// [EventType::name].
UnknownValue(event_type::UnknownValue),
}
#[doc(hidden)]
pub mod event_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EventType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ResourceIamPolicyUpdate => std::option::Option::Some(1),
Self::BigqueryTableCreate => std::option::Option::Some(2),
Self::BigqueryTableUpdate => std::option::Option::Some(3),
Self::BigqueryTableDelete => std::option::Option::Some(4),
Self::BigqueryConnectionCreate => std::option::Option::Some(5),
Self::BigqueryConnectionUpdate => std::option::Option::Some(6),
Self::BigqueryConnectionDelete => std::option::Option::Some(7),
Self::BigqueryTaxonomyCreate => std::option::Option::Some(10),
Self::BigqueryPolicyTagCreate => std::option::Option::Some(11),
Self::BigqueryPolicyTagDelete => std::option::Option::Some(12),
Self::BigqueryPolicyTagSetIamPolicy => std::option::Option::Some(13),
Self::AccessPolicyUpdate => std::option::Option::Some(14),
Self::GovernanceRuleMatchedResources => std::option::Option::Some(15),
Self::GovernanceRuleSearchLimitExceeds => std::option::Option::Some(16),
Self::GovernanceRuleErrors => std::option::Option::Some(17),
Self::GovernanceRuleProcessing => std::option::Option::Some(18),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
Self::ResourceIamPolicyUpdate => {
std::option::Option::Some("RESOURCE_IAM_POLICY_UPDATE")
}
Self::BigqueryTableCreate => std::option::Option::Some("BIGQUERY_TABLE_CREATE"),
Self::BigqueryTableUpdate => std::option::Option::Some("BIGQUERY_TABLE_UPDATE"),
Self::BigqueryTableDelete => std::option::Option::Some("BIGQUERY_TABLE_DELETE"),
Self::BigqueryConnectionCreate => {
std::option::Option::Some("BIGQUERY_CONNECTION_CREATE")
}
Self::BigqueryConnectionUpdate => {
std::option::Option::Some("BIGQUERY_CONNECTION_UPDATE")
}
Self::BigqueryConnectionDelete => {
std::option::Option::Some("BIGQUERY_CONNECTION_DELETE")
}
Self::BigqueryTaxonomyCreate => {
std::option::Option::Some("BIGQUERY_TAXONOMY_CREATE")
}
Self::BigqueryPolicyTagCreate => {
std::option::Option::Some("BIGQUERY_POLICY_TAG_CREATE")
}
Self::BigqueryPolicyTagDelete => {
std::option::Option::Some("BIGQUERY_POLICY_TAG_DELETE")
}
Self::BigqueryPolicyTagSetIamPolicy => {
std::option::Option::Some("BIGQUERY_POLICY_TAG_SET_IAM_POLICY")
}
Self::AccessPolicyUpdate => std::option::Option::Some("ACCESS_POLICY_UPDATE"),
Self::GovernanceRuleMatchedResources => {
std::option::Option::Some("GOVERNANCE_RULE_MATCHED_RESOURCES")
}
Self::GovernanceRuleSearchLimitExceeds => {
std::option::Option::Some("GOVERNANCE_RULE_SEARCH_LIMIT_EXCEEDS")
}
Self::GovernanceRuleErrors => std::option::Option::Some("GOVERNANCE_RULE_ERRORS"),
Self::GovernanceRuleProcessing => {
std::option::Option::Some("GOVERNANCE_RULE_PROCESSING")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EventType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EventType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ResourceIamPolicyUpdate,
2 => Self::BigqueryTableCreate,
3 => Self::BigqueryTableUpdate,
4 => Self::BigqueryTableDelete,
5 => Self::BigqueryConnectionCreate,
6 => Self::BigqueryConnectionUpdate,
7 => Self::BigqueryConnectionDelete,
10 => Self::BigqueryTaxonomyCreate,
11 => Self::BigqueryPolicyTagCreate,
12 => Self::BigqueryPolicyTagDelete,
13 => Self::BigqueryPolicyTagSetIamPolicy,
14 => Self::AccessPolicyUpdate,
15 => Self::GovernanceRuleMatchedResources,
16 => Self::GovernanceRuleSearchLimitExceeds,
17 => Self::GovernanceRuleErrors,
18 => Self::GovernanceRuleProcessing,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EventType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"RESOURCE_IAM_POLICY_UPDATE" => Self::ResourceIamPolicyUpdate,
"BIGQUERY_TABLE_CREATE" => Self::BigqueryTableCreate,
"BIGQUERY_TABLE_UPDATE" => Self::BigqueryTableUpdate,
"BIGQUERY_TABLE_DELETE" => Self::BigqueryTableDelete,
"BIGQUERY_CONNECTION_CREATE" => Self::BigqueryConnectionCreate,
"BIGQUERY_CONNECTION_UPDATE" => Self::BigqueryConnectionUpdate,
"BIGQUERY_CONNECTION_DELETE" => Self::BigqueryConnectionDelete,
"BIGQUERY_TAXONOMY_CREATE" => Self::BigqueryTaxonomyCreate,
"BIGQUERY_POLICY_TAG_CREATE" => Self::BigqueryPolicyTagCreate,
"BIGQUERY_POLICY_TAG_DELETE" => Self::BigqueryPolicyTagDelete,
"BIGQUERY_POLICY_TAG_SET_IAM_POLICY" => Self::BigqueryPolicyTagSetIamPolicy,
"ACCESS_POLICY_UPDATE" => Self::AccessPolicyUpdate,
"GOVERNANCE_RULE_MATCHED_RESOURCES" => Self::GovernanceRuleMatchedResources,
"GOVERNANCE_RULE_SEARCH_LIMIT_EXCEEDS" => Self::GovernanceRuleSearchLimitExceeds,
"GOVERNANCE_RULE_ERRORS" => Self::GovernanceRuleErrors,
"GOVERNANCE_RULE_PROCESSING" => Self::GovernanceRuleProcessing,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EventType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ResourceIamPolicyUpdate => serializer.serialize_i32(1),
Self::BigqueryTableCreate => serializer.serialize_i32(2),
Self::BigqueryTableUpdate => serializer.serialize_i32(3),
Self::BigqueryTableDelete => serializer.serialize_i32(4),
Self::BigqueryConnectionCreate => serializer.serialize_i32(5),
Self::BigqueryConnectionUpdate => serializer.serialize_i32(6),
Self::BigqueryConnectionDelete => serializer.serialize_i32(7),
Self::BigqueryTaxonomyCreate => serializer.serialize_i32(10),
Self::BigqueryPolicyTagCreate => serializer.serialize_i32(11),
Self::BigqueryPolicyTagDelete => serializer.serialize_i32(12),
Self::BigqueryPolicyTagSetIamPolicy => serializer.serialize_i32(13),
Self::AccessPolicyUpdate => serializer.serialize_i32(14),
Self::GovernanceRuleMatchedResources => serializer.serialize_i32(15),
Self::GovernanceRuleSearchLimitExceeds => serializer.serialize_i32(16),
Self::GovernanceRuleErrors => serializer.serialize_i32(17),
Self::GovernanceRuleProcessing => serializer.serialize_i32(18),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EventType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
".google.cloud.dataplex.v1.GovernanceEvent.EventType",
))
}
}
}
/// These messages contain information about the execution of a datascan.
/// The monitored resource is 'DataScan'
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataScanEvent {
/// The data source of the data scan
pub data_source: std::string::String,
/// The identifier of the specific data scan job this log entry is for.
pub job_id: std::string::String,
/// The time when the data scan job was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// The time when the data scan job started to run.
pub start_time: std::option::Option<wkt::Timestamp>,
/// The time when the data scan job finished.
pub end_time: std::option::Option<wkt::Timestamp>,
/// The type of the data scan.
pub r#type: crate::model::data_scan_event::ScanType,
/// The status of the data scan job.
pub state: crate::model::data_scan_event::State,
/// The message describing the data scan job event.
pub message: std::string::String,
/// A version identifier of the spec which was used to execute this job.
pub spec_version: std::string::String,
/// The trigger type of the data scan job.
pub trigger: crate::model::data_scan_event::Trigger,
/// The scope of the data scan (e.g. full, incremental).
pub scope: crate::model::data_scan_event::Scope,
/// The result of post scan actions.
pub post_scan_actions_result:
std::option::Option<crate::model::data_scan_event::PostScanActionsResult>,
/// The status of publishing the data scan as Dataplex Universal Catalog
/// metadata.
pub catalog_publishing_status:
std::option::Option<crate::model::DataScanCatalogPublishingStatus>,
/// The result of the data scan job.
pub result: std::option::Option<crate::model::data_scan_event::Result>,
/// The applied configs in the data scan job.
pub applied_configs: std::option::Option<crate::model::data_scan_event::AppliedConfigs>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataScanEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_source][crate::model::DataScanEvent::data_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// let x = DataScanEvent::new().set_data_source("example");
/// ```
pub fn set_data_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_source = v.into();
self
}
/// Sets the value of [job_id][crate::model::DataScanEvent::job_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// let x = DataScanEvent::new().set_job_id("example");
/// ```
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
/// Sets the value of [create_time][crate::model::DataScanEvent::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use wkt::Timestamp;
/// let x = DataScanEvent::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::DataScanEvent::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use wkt::Timestamp;
/// let x = DataScanEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScanEvent::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [start_time][crate::model::DataScanEvent::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use wkt::Timestamp;
/// let x = DataScanEvent::new().set_start_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::DataScanEvent::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use wkt::Timestamp;
/// let x = DataScanEvent::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScanEvent::new().set_or_clear_start_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [end_time][crate::model::DataScanEvent::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use wkt::Timestamp;
/// let x = DataScanEvent::new().set_end_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [end_time][crate::model::DataScanEvent::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use wkt::Timestamp;
/// let x = DataScanEvent::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
/// let x = DataScanEvent::new().set_or_clear_end_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::DataScanEvent::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::ScanType;
/// let x0 = DataScanEvent::new().set_type(ScanType::DataProfile);
/// let x1 = DataScanEvent::new().set_type(ScanType::DataQuality);
/// let x2 = DataScanEvent::new().set_type(ScanType::DataDiscovery);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::data_scan_event::ScanType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [state][crate::model::DataScanEvent::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::State;
/// let x0 = DataScanEvent::new().set_state(State::Started);
/// let x1 = DataScanEvent::new().set_state(State::Succeeded);
/// let x2 = DataScanEvent::new().set_state(State::Failed);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::data_scan_event::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::DataScanEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// let x = DataScanEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [spec_version][crate::model::DataScanEvent::spec_version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// let x = DataScanEvent::new().set_spec_version("example");
/// ```
pub fn set_spec_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spec_version = v.into();
self
}
/// Sets the value of [trigger][crate::model::DataScanEvent::trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::Trigger;
/// let x0 = DataScanEvent::new().set_trigger(Trigger::OnDemand);
/// let x1 = DataScanEvent::new().set_trigger(Trigger::Schedule);
/// let x2 = DataScanEvent::new().set_trigger(Trigger::OneTime);
/// ```
pub fn set_trigger<T: std::convert::Into<crate::model::data_scan_event::Trigger>>(
mut self,
v: T,
) -> Self {
self.trigger = v.into();
self
}
/// Sets the value of [scope][crate::model::DataScanEvent::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::Scope;
/// let x0 = DataScanEvent::new().set_scope(Scope::Full);
/// let x1 = DataScanEvent::new().set_scope(Scope::Incremental);
/// ```
pub fn set_scope<T: std::convert::Into<crate::model::data_scan_event::Scope>>(
mut self,
v: T,
) -> Self {
self.scope = v.into();
self
}
/// Sets the value of [post_scan_actions_result][crate::model::DataScanEvent::post_scan_actions_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::PostScanActionsResult;
/// let x = DataScanEvent::new().set_post_scan_actions_result(PostScanActionsResult::default()/* use setters */);
/// ```
pub fn set_post_scan_actions_result<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_scan_event::PostScanActionsResult>,
{
self.post_scan_actions_result = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [post_scan_actions_result][crate::model::DataScanEvent::post_scan_actions_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::PostScanActionsResult;
/// let x = DataScanEvent::new().set_or_clear_post_scan_actions_result(Some(PostScanActionsResult::default()/* use setters */));
/// let x = DataScanEvent::new().set_or_clear_post_scan_actions_result(None::<PostScanActionsResult>);
/// ```
pub fn set_or_clear_post_scan_actions_result<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_scan_event::PostScanActionsResult>,
{
self.post_scan_actions_result = v.map(|x| x.into());
self
}
/// Sets the value of [catalog_publishing_status][crate::model::DataScanEvent::catalog_publishing_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// let x = DataScanEvent::new().set_catalog_publishing_status(DataScanCatalogPublishingStatus::default()/* use setters */);
/// ```
pub fn set_catalog_publishing_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataScanCatalogPublishingStatus>,
{
self.catalog_publishing_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [catalog_publishing_status][crate::model::DataScanEvent::catalog_publishing_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::DataScanCatalogPublishingStatus;
/// let x = DataScanEvent::new().set_or_clear_catalog_publishing_status(Some(DataScanCatalogPublishingStatus::default()/* use setters */));
/// let x = DataScanEvent::new().set_or_clear_catalog_publishing_status(None::<DataScanCatalogPublishingStatus>);
/// ```
pub fn set_or_clear_catalog_publishing_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataScanCatalogPublishingStatus>,
{
self.catalog_publishing_status = v.map(|x| x.into());
self
}
/// Sets the value of [result][crate::model::DataScanEvent::result].
///
/// Note that all the setters affecting `result` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::DataProfileResult;
/// let x = DataScanEvent::new().set_result(Some(
/// google_cloud_dataplex_v1::model::data_scan_event::Result::DataProfile(DataProfileResult::default().into())));
/// ```
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::data_scan_event::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
/// The value of [result][crate::model::DataScanEvent::result]
/// if it holds a `DataProfile`, `None` if the field is not set or
/// holds a different branch.
pub fn data_profile(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_scan_event::DataProfileResult>>
{
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan_event::Result::DataProfile(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScanEvent::result]
/// to hold a `DataProfile`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::DataProfileResult;
/// let x = DataScanEvent::new().set_data_profile(DataProfileResult::default()/* use setters */);
/// assert!(x.data_profile().is_some());
/// assert!(x.data_quality().is_none());
/// ```
pub fn set_data_profile<
T: std::convert::Into<std::boxed::Box<crate::model::data_scan_event::DataProfileResult>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::data_scan_event::Result::DataProfile(v.into()));
self
}
/// The value of [result][crate::model::DataScanEvent::result]
/// if it holds a `DataQuality`, `None` if the field is not set or
/// holds a different branch.
pub fn data_quality(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_scan_event::DataQualityResult>>
{
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::data_scan_event::Result::DataQuality(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [result][crate::model::DataScanEvent::result]
/// to hold a `DataQuality`.
///
/// Note that all the setters affecting `result` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataScanEvent::new().set_data_quality(DataQualityResult::default()/* use setters */);
/// assert!(x.data_quality().is_some());
/// assert!(x.data_profile().is_none());
/// ```
pub fn set_data_quality<
T: std::convert::Into<std::boxed::Box<crate::model::data_scan_event::DataQualityResult>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::data_scan_event::Result::DataQuality(v.into()));
self
}
/// Sets the value of [applied_configs][crate::model::DataScanEvent::applied_configs].
///
/// Note that all the setters affecting `applied_configs` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::DataProfileAppliedConfigs;
/// let x = DataScanEvent::new().set_applied_configs(Some(
/// google_cloud_dataplex_v1::model::data_scan_event::AppliedConfigs::DataProfileConfigs(DataProfileAppliedConfigs::default().into())));
/// ```
pub fn set_applied_configs<
T: std::convert::Into<std::option::Option<crate::model::data_scan_event::AppliedConfigs>>,
>(
mut self,
v: T,
) -> Self {
self.applied_configs = v.into();
self
}
/// The value of [applied_configs][crate::model::DataScanEvent::applied_configs]
/// if it holds a `DataProfileConfigs`, `None` if the field is not set or
/// holds a different branch.
pub fn data_profile_configs(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::data_scan_event::DataProfileAppliedConfigs>,
> {
#[allow(unreachable_patterns)]
self.applied_configs.as_ref().and_then(|v| match v {
crate::model::data_scan_event::AppliedConfigs::DataProfileConfigs(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [applied_configs][crate::model::DataScanEvent::applied_configs]
/// to hold a `DataProfileConfigs`.
///
/// Note that all the setters affecting `applied_configs` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::DataProfileAppliedConfigs;
/// let x = DataScanEvent::new().set_data_profile_configs(DataProfileAppliedConfigs::default()/* use setters */);
/// assert!(x.data_profile_configs().is_some());
/// assert!(x.data_quality_configs().is_none());
/// ```
pub fn set_data_profile_configs<
T: std::convert::Into<
std::boxed::Box<crate::model::data_scan_event::DataProfileAppliedConfigs>,
>,
>(
mut self,
v: T,
) -> Self {
self.applied_configs = std::option::Option::Some(
crate::model::data_scan_event::AppliedConfigs::DataProfileConfigs(v.into()),
);
self
}
/// The value of [applied_configs][crate::model::DataScanEvent::applied_configs]
/// if it holds a `DataQualityConfigs`, `None` if the field is not set or
/// holds a different branch.
pub fn data_quality_configs(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::data_scan_event::DataQualityAppliedConfigs>,
> {
#[allow(unreachable_patterns)]
self.applied_configs.as_ref().and_then(|v| match v {
crate::model::data_scan_event::AppliedConfigs::DataQualityConfigs(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [applied_configs][crate::model::DataScanEvent::applied_configs]
/// to hold a `DataQualityConfigs`.
///
/// Note that all the setters affecting `applied_configs` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataScanEvent;
/// use google_cloud_dataplex_v1::model::data_scan_event::DataQualityAppliedConfigs;
/// let x = DataScanEvent::new().set_data_quality_configs(DataQualityAppliedConfigs::default()/* use setters */);
/// assert!(x.data_quality_configs().is_some());
/// assert!(x.data_profile_configs().is_none());
/// ```
pub fn set_data_quality_configs<
T: std::convert::Into<
std::boxed::Box<crate::model::data_scan_event::DataQualityAppliedConfigs>,
>,
>(
mut self,
v: T,
) -> Self {
self.applied_configs = std::option::Option::Some(
crate::model::data_scan_event::AppliedConfigs::DataQualityConfigs(v.into()),
);
self
}
}
impl wkt::message::Message for DataScanEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent"
}
}
/// Defines additional types related to [DataScanEvent].
pub mod data_scan_event {
#[allow(unused_imports)]
use super::*;
/// Data profile result for data scan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataProfileResult {
/// The count of rows processed in the data scan job.
pub row_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataProfileResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [row_count][crate::model::data_scan_event::DataProfileResult::row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataProfileResult;
/// let x = DataProfileResult::new().set_row_count(42);
/// ```
pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.row_count = v.into();
self
}
}
impl wkt::message::Message for DataProfileResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent.DataProfileResult"
}
}
/// Data quality result for data scan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityResult {
/// The count of rows processed in the data scan job.
pub row_count: i64,
/// Whether the data quality result was `pass` or not.
pub passed: bool,
/// The result of each dimension for data quality result.
/// The key of the map is the name of the dimension.
/// The value is the bool value depicting whether the dimension result was
/// `pass` or not.
pub dimension_passed: std::collections::HashMap<std::string::String, bool>,
/// The table-level data quality score for the data scan job.
///
/// The data quality score ranges between [0, 100] (up to two decimal
/// points).
pub score: f32,
/// The score of each dimension for data quality result.
/// The key of the map is the name of the dimension.
/// The value is the data quality score for the dimension.
///
/// The score ranges between [0, 100] (up to two decimal
/// points).
pub dimension_score: std::collections::HashMap<std::string::String, f32>,
/// The score of each column scanned in the data scan job.
/// The key of the map is the name of the column.
/// The value is the data quality score for the column.
///
/// The score ranges between [0, 100] (up to two decimal
/// points).
pub column_score: std::collections::HashMap<std::string::String, f32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [row_count][crate::model::data_scan_event::DataQualityResult::row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataQualityResult::new().set_row_count(42);
/// ```
pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.row_count = v.into();
self
}
/// Sets the value of [passed][crate::model::data_scan_event::DataQualityResult::passed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataQualityResult::new().set_passed(true);
/// ```
pub fn set_passed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.passed = v.into();
self
}
/// Sets the value of [dimension_passed][crate::model::data_scan_event::DataQualityResult::dimension_passed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataQualityResult::new().set_dimension_passed([
/// ("key0", true),
/// ("key1", false),
/// ]);
/// ```
pub fn set_dimension_passed<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<bool>,
{
use std::iter::Iterator;
self.dimension_passed = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [score][crate::model::data_scan_event::DataQualityResult::score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataQualityResult::new().set_score(42.0);
/// ```
pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.score = v.into();
self
}
/// Sets the value of [dimension_score][crate::model::data_scan_event::DataQualityResult::dimension_score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataQualityResult::new().set_dimension_score([
/// ("key0", 123.5),
/// ("key1", 456.5),
/// ]);
/// ```
pub fn set_dimension_score<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<f32>,
{
use std::iter::Iterator;
self.dimension_score = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [column_score][crate::model::data_scan_event::DataQualityResult::column_score].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityResult;
/// let x = DataQualityResult::new().set_column_score([
/// ("key0", 123.5),
/// ("key1", 456.5),
/// ]);
/// ```
pub fn set_column_score<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<f32>,
{
use std::iter::Iterator;
self.column_score = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for DataQualityResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent.DataQualityResult"
}
}
/// Applied configs for data profile type data scan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataProfileAppliedConfigs {
/// The percentage of the records selected from the dataset for DataScan.
///
/// * Value ranges between 0.0 and 100.0.
/// * Value 0.0 or 100.0 imply that sampling was not applied.
pub sampling_percent: f32,
/// Boolean indicating whether a row filter was applied in the DataScan job.
pub row_filter_applied: bool,
/// Boolean indicating whether a column filter was applied in the DataScan
/// job.
pub column_filter_applied: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataProfileAppliedConfigs {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sampling_percent][crate::model::data_scan_event::DataProfileAppliedConfigs::sampling_percent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataProfileAppliedConfigs;
/// let x = DataProfileAppliedConfigs::new().set_sampling_percent(42.0);
/// ```
pub fn set_sampling_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.sampling_percent = v.into();
self
}
/// Sets the value of [row_filter_applied][crate::model::data_scan_event::DataProfileAppliedConfigs::row_filter_applied].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataProfileAppliedConfigs;
/// let x = DataProfileAppliedConfigs::new().set_row_filter_applied(true);
/// ```
pub fn set_row_filter_applied<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.row_filter_applied = v.into();
self
}
/// Sets the value of [column_filter_applied][crate::model::data_scan_event::DataProfileAppliedConfigs::column_filter_applied].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataProfileAppliedConfigs;
/// let x = DataProfileAppliedConfigs::new().set_column_filter_applied(true);
/// ```
pub fn set_column_filter_applied<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.column_filter_applied = v.into();
self
}
}
impl wkt::message::Message for DataProfileAppliedConfigs {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent.DataProfileAppliedConfigs"
}
}
/// Applied configs for data quality type data scan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityAppliedConfigs {
/// The percentage of the records selected from the dataset for DataScan.
///
/// * Value ranges between 0.0 and 100.0.
/// * Value 0.0 or 100.0 imply that sampling was not applied.
pub sampling_percent: f32,
/// Boolean indicating whether a row filter was applied in the DataScan job.
pub row_filter_applied: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityAppliedConfigs {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sampling_percent][crate::model::data_scan_event::DataQualityAppliedConfigs::sampling_percent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityAppliedConfigs;
/// let x = DataQualityAppliedConfigs::new().set_sampling_percent(42.0);
/// ```
pub fn set_sampling_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.sampling_percent = v.into();
self
}
/// Sets the value of [row_filter_applied][crate::model::data_scan_event::DataQualityAppliedConfigs::row_filter_applied].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::DataQualityAppliedConfigs;
/// let x = DataQualityAppliedConfigs::new().set_row_filter_applied(true);
/// ```
pub fn set_row_filter_applied<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.row_filter_applied = v.into();
self
}
}
impl wkt::message::Message for DataQualityAppliedConfigs {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent.DataQualityAppliedConfigs"
}
}
/// Post scan actions result for data scan job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostScanActionsResult {
/// The result of BigQuery export post scan action.
pub bigquery_export_result: std::option::Option<
crate::model::data_scan_event::post_scan_actions_result::BigQueryExportResult,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostScanActionsResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [bigquery_export_result][crate::model::data_scan_event::PostScanActionsResult::bigquery_export_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::PostScanActionsResult;
/// use google_cloud_dataplex_v1::model::data_scan_event::post_scan_actions_result::BigQueryExportResult;
/// let x = PostScanActionsResult::new().set_bigquery_export_result(BigQueryExportResult::default()/* use setters */);
/// ```
pub fn set_bigquery_export_result<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::data_scan_event::post_scan_actions_result::BigQueryExportResult,
>,
{
self.bigquery_export_result = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery_export_result][crate::model::data_scan_event::PostScanActionsResult::bigquery_export_result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::PostScanActionsResult;
/// use google_cloud_dataplex_v1::model::data_scan_event::post_scan_actions_result::BigQueryExportResult;
/// let x = PostScanActionsResult::new().set_or_clear_bigquery_export_result(Some(BigQueryExportResult::default()/* use setters */));
/// let x = PostScanActionsResult::new().set_or_clear_bigquery_export_result(None::<BigQueryExportResult>);
/// ```
pub fn set_or_clear_bigquery_export_result<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::data_scan_event::post_scan_actions_result::BigQueryExportResult,
>,
{
self.bigquery_export_result = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostScanActionsResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent.PostScanActionsResult"
}
}
/// Defines additional types related to [PostScanActionsResult].
pub mod post_scan_actions_result {
#[allow(unused_imports)]
use super::*;
/// The result of BigQuery export post scan action.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExportResult {
/// Execution state for the BigQuery exporting.
pub state: crate::model::data_scan_event::post_scan_actions_result::big_query_export_result::State,
/// Additional information about the BigQuery exporting.
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExportResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::data_scan_event::post_scan_actions_result::BigQueryExportResult::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::post_scan_actions_result::BigQueryExportResult;
/// use google_cloud_dataplex_v1::model::data_scan_event::post_scan_actions_result::big_query_export_result::State;
/// let x0 = BigQueryExportResult::new().set_state(State::Succeeded);
/// let x1 = BigQueryExportResult::new().set_state(State::Failed);
/// let x2 = BigQueryExportResult::new().set_state(State::Skipped);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::data_scan_event::post_scan_actions_result::big_query_export_result::State>>(mut self, v: T) -> Self{
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::data_scan_event::post_scan_actions_result::BigQueryExportResult::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::data_scan_event::post_scan_actions_result::BigQueryExportResult;
/// let x = BigQueryExportResult::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for BigQueryExportResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataScanEvent.PostScanActionsResult.BigQueryExportResult"
}
}
/// Defines additional types related to [BigQueryExportResult].
pub mod big_query_export_result {
#[allow(unused_imports)]
use super::*;
/// Execution state for the exporting.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// The exporting state is unspecified.
Unspecified,
/// The exporting completed successfully.
Succeeded,
/// The exporting is no longer running due to an error.
Failed,
/// The exporting is skipped due to no valid scan result to export
/// (usually caused by scan failed).
Skipped,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Skipped => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"SKIPPED" => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Skipped => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.DataScanEvent.PostScanActionsResult.BigQueryExportResult.State"))
}
}
}
}
/// The type of the data scan.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ScanType {
/// An unspecified data scan type.
Unspecified,
/// Data scan for data profile.
DataProfile,
/// Data scan for data quality.
DataQuality,
/// Data scan for data discovery.
DataDiscovery,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ScanType::value] or
/// [ScanType::name].
UnknownValue(scan_type::UnknownValue),
}
#[doc(hidden)]
pub mod scan_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ScanType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DataProfile => std::option::Option::Some(1),
Self::DataQuality => std::option::Option::Some(2),
Self::DataDiscovery => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SCAN_TYPE_UNSPECIFIED"),
Self::DataProfile => std::option::Option::Some("DATA_PROFILE"),
Self::DataQuality => std::option::Option::Some("DATA_QUALITY"),
Self::DataDiscovery => std::option::Option::Some("DATA_DISCOVERY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ScanType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ScanType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ScanType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DataProfile,
2 => Self::DataQuality,
4 => Self::DataDiscovery,
_ => Self::UnknownValue(scan_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ScanType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SCAN_TYPE_UNSPECIFIED" => Self::Unspecified,
"DATA_PROFILE" => Self::DataProfile,
"DATA_QUALITY" => Self::DataQuality,
"DATA_DISCOVERY" => Self::DataDiscovery,
_ => Self::UnknownValue(scan_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ScanType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DataProfile => serializer.serialize_i32(1),
Self::DataQuality => serializer.serialize_i32(2),
Self::DataDiscovery => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ScanType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScanType>::new(
".google.cloud.dataplex.v1.DataScanEvent.ScanType",
))
}
}
/// The job state of the data scan.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// Unspecified job state.
Unspecified,
/// Data scan job started.
Started,
/// Data scan job successfully completed.
Succeeded,
/// Data scan job was unsuccessful.
Failed,
/// Data scan job was cancelled.
Cancelled,
/// Data scan job was created.
Created,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Started => std::option::Option::Some(1),
Self::Succeeded => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Cancelled => std::option::Option::Some(4),
Self::Created => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Started => std::option::Option::Some("STARTED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Created => std::option::Option::Some("CREATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Started,
2 => Self::Succeeded,
3 => Self::Failed,
4 => Self::Cancelled,
5 => Self::Created,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"STARTED" => Self::Started,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"CANCELLED" => Self::Cancelled,
"CREATED" => Self::Created,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Started => serializer.serialize_i32(1),
Self::Succeeded => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Cancelled => serializer.serialize_i32(4),
Self::Created => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.DataScanEvent.State",
))
}
}
/// The trigger type for the data scan.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Trigger {
/// An unspecified trigger type.
Unspecified,
/// Data scan triggers on demand.
OnDemand,
/// Data scan triggers as per schedule.
Schedule,
/// Data scan is run one time on creation.
OneTime,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Trigger::value] or
/// [Trigger::name].
UnknownValue(trigger::UnknownValue),
}
#[doc(hidden)]
pub mod trigger {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Trigger {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OnDemand => std::option::Option::Some(1),
Self::Schedule => std::option::Option::Some(2),
Self::OneTime => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::Schedule => std::option::Option::Some("SCHEDULE"),
Self::OneTime => std::option::Option::Some("ONE_TIME"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Trigger {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Trigger {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Trigger {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OnDemand,
2 => Self::Schedule,
3 => Self::OneTime,
_ => Self::UnknownValue(trigger::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Trigger {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRIGGER_UNSPECIFIED" => Self::Unspecified,
"ON_DEMAND" => Self::OnDemand,
"SCHEDULE" => Self::Schedule,
"ONE_TIME" => Self::OneTime,
_ => Self::UnknownValue(trigger::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Trigger {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::OnDemand => serializer.serialize_i32(1),
Self::Schedule => serializer.serialize_i32(2),
Self::OneTime => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Trigger {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
".google.cloud.dataplex.v1.DataScanEvent.Trigger",
))
}
}
/// The scope of job for the data scan.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Scope {
/// An unspecified scope type.
Unspecified,
/// Data scan runs on all of the data.
Full,
/// Data scan runs on incremental data.
Incremental,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Scope::value] or
/// [Scope::name].
UnknownValue(scope::UnknownValue),
}
#[doc(hidden)]
pub mod scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Scope {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Full => std::option::Option::Some(1),
Self::Incremental => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
Self::Full => std::option::Option::Some("FULL"),
Self::Incremental => std::option::Option::Some("INCREMENTAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Scope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Scope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Scope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Full,
2 => Self::Incremental,
_ => Self::UnknownValue(scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Scope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SCOPE_UNSPECIFIED" => Self::Unspecified,
"FULL" => Self::Full,
"INCREMENTAL" => Self::Incremental,
_ => Self::UnknownValue(scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Scope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Full => serializer.serialize_i32(1),
Self::Incremental => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Scope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
".google.cloud.dataplex.v1.DataScanEvent.Scope",
))
}
}
/// The result of the data scan job.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
/// Data profile result for data profile type data scan.
DataProfile(std::boxed::Box<crate::model::data_scan_event::DataProfileResult>),
/// Data quality result for data quality type data scan.
DataQuality(std::boxed::Box<crate::model::data_scan_event::DataQualityResult>),
}
/// The applied configs in the data scan job.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AppliedConfigs {
/// Applied configs for data profile type data scan.
DataProfileConfigs(
std::boxed::Box<crate::model::data_scan_event::DataProfileAppliedConfigs>,
),
/// Applied configs for data quality type data scan.
DataQualityConfigs(
std::boxed::Box<crate::model::data_scan_event::DataQualityAppliedConfigs>,
),
}
}
/// Information about the result of a data quality rule for data quality scan.
/// The monitored resource is 'DataScan'.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataQualityScanRuleResult {
/// Identifier of the specific data scan job this log entry is for.
pub job_id: std::string::String,
/// The data source of the data scan (e.g. BigQuery table name).
pub data_source: std::string::String,
/// The column which this rule is evaluated against.
pub column: std::string::String,
/// The name of the data quality rule.
pub rule_name: std::string::String,
/// The type of the data quality rule.
pub rule_type: crate::model::data_quality_scan_rule_result::RuleType,
/// The evaluation type of the data quality rule.
pub evalution_type: crate::model::data_quality_scan_rule_result::EvaluationType,
/// The dimension of the data quality rule.
pub rule_dimension: std::string::String,
/// The passing threshold ([0.0, 100.0]) of the data quality rule.
pub threshold_percent: f64,
/// The result of the data quality rule.
pub result: crate::model::data_quality_scan_rule_result::Result,
/// The number of rows evaluated against the data quality rule.
/// This field is only valid for rules of PER_ROW evaluation type.
pub evaluated_row_count: i64,
/// The number of rows which passed a rule evaluation.
/// This field is only valid for rules of PER_ROW evaluation type.
pub passed_row_count: i64,
/// The number of rows with null values in the specified column.
pub null_row_count: i64,
/// The number of rows returned by the SQL statement in a SQL assertion rule.
/// This field is only valid for SQL assertion rules.
pub assertion_row_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataQualityScanRuleResult {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [job_id][crate::model::DataQualityScanRuleResult::job_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_job_id("example");
/// ```
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
/// Sets the value of [data_source][crate::model::DataQualityScanRuleResult::data_source].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_data_source("example");
/// ```
pub fn set_data_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_source = v.into();
self
}
/// Sets the value of [column][crate::model::DataQualityScanRuleResult::column].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_column("example");
/// ```
pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.column = v.into();
self
}
/// Sets the value of [rule_name][crate::model::DataQualityScanRuleResult::rule_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_rule_name("example");
/// ```
pub fn set_rule_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_name = v.into();
self
}
/// Sets the value of [rule_type][crate::model::DataQualityScanRuleResult::rule_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// use google_cloud_dataplex_v1::model::data_quality_scan_rule_result::RuleType;
/// let x0 = DataQualityScanRuleResult::new().set_rule_type(RuleType::NonNullExpectation);
/// let x1 = DataQualityScanRuleResult::new().set_rule_type(RuleType::RangeExpectation);
/// let x2 = DataQualityScanRuleResult::new().set_rule_type(RuleType::RegexExpectation);
/// ```
pub fn set_rule_type<
T: std::convert::Into<crate::model::data_quality_scan_rule_result::RuleType>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = v.into();
self
}
/// Sets the value of [evalution_type][crate::model::DataQualityScanRuleResult::evalution_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// use google_cloud_dataplex_v1::model::data_quality_scan_rule_result::EvaluationType;
/// let x0 = DataQualityScanRuleResult::new().set_evalution_type(EvaluationType::PerRow);
/// let x1 = DataQualityScanRuleResult::new().set_evalution_type(EvaluationType::Aggregate);
/// ```
pub fn set_evalution_type<
T: std::convert::Into<crate::model::data_quality_scan_rule_result::EvaluationType>,
>(
mut self,
v: T,
) -> Self {
self.evalution_type = v.into();
self
}
/// Sets the value of [rule_dimension][crate::model::DataQualityScanRuleResult::rule_dimension].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_rule_dimension("example");
/// ```
pub fn set_rule_dimension<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_dimension = v.into();
self
}
/// Sets the value of [threshold_percent][crate::model::DataQualityScanRuleResult::threshold_percent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_threshold_percent(42.0);
/// ```
pub fn set_threshold_percent<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.threshold_percent = v.into();
self
}
/// Sets the value of [result][crate::model::DataQualityScanRuleResult::result].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// use google_cloud_dataplex_v1::model::data_quality_scan_rule_result::Result;
/// let x0 = DataQualityScanRuleResult::new().set_result(Result::Passed);
/// let x1 = DataQualityScanRuleResult::new().set_result(Result::Failed);
/// ```
pub fn set_result<
T: std::convert::Into<crate::model::data_quality_scan_rule_result::Result>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
/// Sets the value of [evaluated_row_count][crate::model::DataQualityScanRuleResult::evaluated_row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_evaluated_row_count(42);
/// ```
pub fn set_evaluated_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.evaluated_row_count = v.into();
self
}
/// Sets the value of [passed_row_count][crate::model::DataQualityScanRuleResult::passed_row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_passed_row_count(42);
/// ```
pub fn set_passed_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.passed_row_count = v.into();
self
}
/// Sets the value of [null_row_count][crate::model::DataQualityScanRuleResult::null_row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_null_row_count(42);
/// ```
pub fn set_null_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.null_row_count = v.into();
self
}
/// Sets the value of [assertion_row_count][crate::model::DataQualityScanRuleResult::assertion_row_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataQualityScanRuleResult;
/// let x = DataQualityScanRuleResult::new().set_assertion_row_count(42);
/// ```
pub fn set_assertion_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.assertion_row_count = v.into();
self
}
}
impl wkt::message::Message for DataQualityScanRuleResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataQualityScanRuleResult"
}
}
/// Defines additional types related to [DataQualityScanRuleResult].
pub mod data_quality_scan_rule_result {
#[allow(unused_imports)]
use super::*;
/// The type of the data quality rule.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleType {
/// An unspecified rule type.
Unspecified,
/// See
/// [DataQualityRule.NonNullExpectation][google.cloud.dataplex.v1.DataQualityRule.NonNullExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.NonNullExpectation]: crate::model::data_quality_rule::NonNullExpectation
NonNullExpectation,
/// See
/// [DataQualityRule.RangeExpectation][google.cloud.dataplex.v1.DataQualityRule.RangeExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.RangeExpectation]: crate::model::data_quality_rule::RangeExpectation
RangeExpectation,
/// See
/// [DataQualityRule.RegexExpectation][google.cloud.dataplex.v1.DataQualityRule.RegexExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.RegexExpectation]: crate::model::data_quality_rule::RegexExpectation
RegexExpectation,
/// See
/// [DataQualityRule.RowConditionExpectation][google.cloud.dataplex.v1.DataQualityRule.RowConditionExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.RowConditionExpectation]: crate::model::data_quality_rule::RowConditionExpectation
RowConditionExpectation,
/// See
/// [DataQualityRule.SetExpectation][google.cloud.dataplex.v1.DataQualityRule.SetExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.SetExpectation]: crate::model::data_quality_rule::SetExpectation
SetExpectation,
/// See
/// [DataQualityRule.StatisticRangeExpectation][google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation]: crate::model::data_quality_rule::StatisticRangeExpectation
StatisticRangeExpectation,
/// See
/// [DataQualityRule.TableConditionExpectation][google.cloud.dataplex.v1.DataQualityRule.TableConditionExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.TableConditionExpectation]: crate::model::data_quality_rule::TableConditionExpectation
TableConditionExpectation,
/// See
/// [DataQualityRule.UniquenessExpectation][google.cloud.dataplex.v1.DataQualityRule.UniquenessExpectation].
///
/// [google.cloud.dataplex.v1.DataQualityRule.UniquenessExpectation]: crate::model::data_quality_rule::UniquenessExpectation
UniquenessExpectation,
/// See
/// [DataQualityRule.SqlAssertion][google.cloud.dataplex.v1.DataQualityRule.SqlAssertion].
///
/// [google.cloud.dataplex.v1.DataQualityRule.SqlAssertion]: crate::model::data_quality_rule::SqlAssertion
SqlAssertion,
/// See
/// [DataQualityRule.TemplateReference][google.cloud.dataplex.v1.DataQualityRule.TemplateReference].
///
/// [google.cloud.dataplex.v1.DataQualityRule.TemplateReference]: crate::model::data_quality_rule::TemplateReference
TemplateReference,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [RuleType::value] or
/// [RuleType::name].
UnknownValue(rule_type::UnknownValue),
}
#[doc(hidden)]
pub mod rule_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RuleType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NonNullExpectation => std::option::Option::Some(1),
Self::RangeExpectation => std::option::Option::Some(2),
Self::RegexExpectation => std::option::Option::Some(3),
Self::RowConditionExpectation => std::option::Option::Some(4),
Self::SetExpectation => std::option::Option::Some(5),
Self::StatisticRangeExpectation => std::option::Option::Some(6),
Self::TableConditionExpectation => std::option::Option::Some(7),
Self::UniquenessExpectation => std::option::Option::Some(8),
Self::SqlAssertion => std::option::Option::Some(9),
Self::TemplateReference => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RULE_TYPE_UNSPECIFIED"),
Self::NonNullExpectation => std::option::Option::Some("NON_NULL_EXPECTATION"),
Self::RangeExpectation => std::option::Option::Some("RANGE_EXPECTATION"),
Self::RegexExpectation => std::option::Option::Some("REGEX_EXPECTATION"),
Self::RowConditionExpectation => {
std::option::Option::Some("ROW_CONDITION_EXPECTATION")
}
Self::SetExpectation => std::option::Option::Some("SET_EXPECTATION"),
Self::StatisticRangeExpectation => {
std::option::Option::Some("STATISTIC_RANGE_EXPECTATION")
}
Self::TableConditionExpectation => {
std::option::Option::Some("TABLE_CONDITION_EXPECTATION")
}
Self::UniquenessExpectation => std::option::Option::Some("UNIQUENESS_EXPECTATION"),
Self::SqlAssertion => std::option::Option::Some("SQL_ASSERTION"),
Self::TemplateReference => std::option::Option::Some("TEMPLATE_REFERENCE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RuleType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RuleType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RuleType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NonNullExpectation,
2 => Self::RangeExpectation,
3 => Self::RegexExpectation,
4 => Self::RowConditionExpectation,
5 => Self::SetExpectation,
6 => Self::StatisticRangeExpectation,
7 => Self::TableConditionExpectation,
8 => Self::UniquenessExpectation,
9 => Self::SqlAssertion,
10 => Self::TemplateReference,
_ => Self::UnknownValue(rule_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RuleType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
"NON_NULL_EXPECTATION" => Self::NonNullExpectation,
"RANGE_EXPECTATION" => Self::RangeExpectation,
"REGEX_EXPECTATION" => Self::RegexExpectation,
"ROW_CONDITION_EXPECTATION" => Self::RowConditionExpectation,
"SET_EXPECTATION" => Self::SetExpectation,
"STATISTIC_RANGE_EXPECTATION" => Self::StatisticRangeExpectation,
"TABLE_CONDITION_EXPECTATION" => Self::TableConditionExpectation,
"UNIQUENESS_EXPECTATION" => Self::UniquenessExpectation,
"SQL_ASSERTION" => Self::SqlAssertion,
"TEMPLATE_REFERENCE" => Self::TemplateReference,
_ => Self::UnknownValue(rule_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RuleType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NonNullExpectation => serializer.serialize_i32(1),
Self::RangeExpectation => serializer.serialize_i32(2),
Self::RegexExpectation => serializer.serialize_i32(3),
Self::RowConditionExpectation => serializer.serialize_i32(4),
Self::SetExpectation => serializer.serialize_i32(5),
Self::StatisticRangeExpectation => serializer.serialize_i32(6),
Self::TableConditionExpectation => serializer.serialize_i32(7),
Self::UniquenessExpectation => serializer.serialize_i32(8),
Self::SqlAssertion => serializer.serialize_i32(9),
Self::TemplateReference => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RuleType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleType>::new(
".google.cloud.dataplex.v1.DataQualityScanRuleResult.RuleType",
))
}
}
/// The evaluation type of the data quality rule.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EvaluationType {
/// An unspecified evaluation type.
Unspecified,
/// The rule evaluation is done at per row level.
PerRow,
/// The rule evaluation is done for an aggregate of rows.
Aggregate,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EvaluationType::value] or
/// [EvaluationType::name].
UnknownValue(evaluation_type::UnknownValue),
}
#[doc(hidden)]
pub mod evaluation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EvaluationType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PerRow => std::option::Option::Some(1),
Self::Aggregate => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVALUATION_TYPE_UNSPECIFIED"),
Self::PerRow => std::option::Option::Some("PER_ROW"),
Self::Aggregate => std::option::Option::Some("AGGREGATE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EvaluationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EvaluationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EvaluationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PerRow,
2 => Self::Aggregate,
_ => Self::UnknownValue(evaluation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EvaluationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVALUATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"PER_ROW" => Self::PerRow,
"AGGREGATE" => Self::Aggregate,
_ => Self::UnknownValue(evaluation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EvaluationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::PerRow => serializer.serialize_i32(1),
Self::Aggregate => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EvaluationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationType>::new(
".google.cloud.dataplex.v1.DataQualityScanRuleResult.EvaluationType",
))
}
}
/// Whether the data quality rule passed or failed.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
/// An unspecified result.
Unspecified,
/// The data quality rule passed.
Passed,
/// The data quality rule failed.
Failed,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Result::value] or
/// [Result::name].
UnknownValue(result::UnknownValue),
}
#[doc(hidden)]
pub mod result {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Result {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Passed => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
Self::Passed => std::option::Option::Some("PASSED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Result {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Result {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Result {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Passed,
2 => Self::Failed,
_ => Self::UnknownValue(result::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Result {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESULT_UNSPECIFIED" => Self::Unspecified,
"PASSED" => Self::Passed,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(result::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Result {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Passed => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Result {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
".google.cloud.dataplex.v1.DataQualityScanRuleResult.Result",
))
}
}
}
/// Payload associated with Business Glossary related log events.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BusinessGlossaryEvent {
/// The log message.
pub message: std::string::String,
/// The type of the event.
pub event_type: crate::model::business_glossary_event::EventType,
/// Name of the resource.
pub resource: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BusinessGlossaryEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [message][crate::model::BusinessGlossaryEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::BusinessGlossaryEvent;
/// let x = BusinessGlossaryEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [event_type][crate::model::BusinessGlossaryEvent::event_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::BusinessGlossaryEvent;
/// use google_cloud_dataplex_v1::model::business_glossary_event::EventType;
/// let x0 = BusinessGlossaryEvent::new().set_event_type(EventType::GlossaryCreate);
/// let x1 = BusinessGlossaryEvent::new().set_event_type(EventType::GlossaryUpdate);
/// let x2 = BusinessGlossaryEvent::new().set_event_type(EventType::GlossaryDelete);
/// ```
pub fn set_event_type<
T: std::convert::Into<crate::model::business_glossary_event::EventType>,
>(
mut self,
v: T,
) -> Self {
self.event_type = v.into();
self
}
/// Sets the value of [resource][crate::model::BusinessGlossaryEvent::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::BusinessGlossaryEvent;
/// let x = BusinessGlossaryEvent::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
}
impl wkt::message::Message for BusinessGlossaryEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.BusinessGlossaryEvent"
}
}
/// Defines additional types related to [BusinessGlossaryEvent].
pub mod business_glossary_event {
#[allow(unused_imports)]
use super::*;
/// Type of glossary log event.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EventType {
/// An unspecified event type.
Unspecified,
/// Glossary create event.
GlossaryCreate,
/// Glossary update event.
GlossaryUpdate,
/// Glossary delete event.
GlossaryDelete,
/// Glossary category create event.
GlossaryCategoryCreate,
/// Glossary category update event.
GlossaryCategoryUpdate,
/// Glossary category delete event.
GlossaryCategoryDelete,
/// Glossary term create event.
GlossaryTermCreate,
/// Glossary term update event.
GlossaryTermUpdate,
/// Glossary term delete event.
GlossaryTermDelete,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EventType::value] or
/// [EventType::name].
UnknownValue(event_type::UnknownValue),
}
#[doc(hidden)]
pub mod event_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EventType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GlossaryCreate => std::option::Option::Some(1),
Self::GlossaryUpdate => std::option::Option::Some(2),
Self::GlossaryDelete => std::option::Option::Some(3),
Self::GlossaryCategoryCreate => std::option::Option::Some(4),
Self::GlossaryCategoryUpdate => std::option::Option::Some(5),
Self::GlossaryCategoryDelete => std::option::Option::Some(6),
Self::GlossaryTermCreate => std::option::Option::Some(7),
Self::GlossaryTermUpdate => std::option::Option::Some(8),
Self::GlossaryTermDelete => std::option::Option::Some(9),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
Self::GlossaryCreate => std::option::Option::Some("GLOSSARY_CREATE"),
Self::GlossaryUpdate => std::option::Option::Some("GLOSSARY_UPDATE"),
Self::GlossaryDelete => std::option::Option::Some("GLOSSARY_DELETE"),
Self::GlossaryCategoryCreate => {
std::option::Option::Some("GLOSSARY_CATEGORY_CREATE")
}
Self::GlossaryCategoryUpdate => {
std::option::Option::Some("GLOSSARY_CATEGORY_UPDATE")
}
Self::GlossaryCategoryDelete => {
std::option::Option::Some("GLOSSARY_CATEGORY_DELETE")
}
Self::GlossaryTermCreate => std::option::Option::Some("GLOSSARY_TERM_CREATE"),
Self::GlossaryTermUpdate => std::option::Option::Some("GLOSSARY_TERM_UPDATE"),
Self::GlossaryTermDelete => std::option::Option::Some("GLOSSARY_TERM_DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EventType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EventType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GlossaryCreate,
2 => Self::GlossaryUpdate,
3 => Self::GlossaryDelete,
4 => Self::GlossaryCategoryCreate,
5 => Self::GlossaryCategoryUpdate,
6 => Self::GlossaryCategoryDelete,
7 => Self::GlossaryTermCreate,
8 => Self::GlossaryTermUpdate,
9 => Self::GlossaryTermDelete,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EventType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"GLOSSARY_CREATE" => Self::GlossaryCreate,
"GLOSSARY_UPDATE" => Self::GlossaryUpdate,
"GLOSSARY_DELETE" => Self::GlossaryDelete,
"GLOSSARY_CATEGORY_CREATE" => Self::GlossaryCategoryCreate,
"GLOSSARY_CATEGORY_UPDATE" => Self::GlossaryCategoryUpdate,
"GLOSSARY_CATEGORY_DELETE" => Self::GlossaryCategoryDelete,
"GLOSSARY_TERM_CREATE" => Self::GlossaryTermCreate,
"GLOSSARY_TERM_UPDATE" => Self::GlossaryTermUpdate,
"GLOSSARY_TERM_DELETE" => Self::GlossaryTermDelete,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EventType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GlossaryCreate => serializer.serialize_i32(1),
Self::GlossaryUpdate => serializer.serialize_i32(2),
Self::GlossaryDelete => serializer.serialize_i32(3),
Self::GlossaryCategoryCreate => serializer.serialize_i32(4),
Self::GlossaryCategoryUpdate => serializer.serialize_i32(5),
Self::GlossaryCategoryDelete => serializer.serialize_i32(6),
Self::GlossaryTermCreate => serializer.serialize_i32(7),
Self::GlossaryTermUpdate => serializer.serialize_i32(8),
Self::GlossaryTermDelete => serializer.serialize_i32(9),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EventType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
".google.cloud.dataplex.v1.BusinessGlossaryEvent.EventType",
))
}
}
}
/// Payload associated with Entry related log events.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntryLinkEvent {
/// The log message.
pub message: std::string::String,
/// The type of the event.
pub event_type: crate::model::entry_link_event::EventType,
/// Name of the resource.
pub resource: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntryLinkEvent {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [message][crate::model::EntryLinkEvent::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLinkEvent;
/// let x = EntryLinkEvent::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [event_type][crate::model::EntryLinkEvent::event_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLinkEvent;
/// use google_cloud_dataplex_v1::model::entry_link_event::EventType;
/// let x0 = EntryLinkEvent::new().set_event_type(EventType::EntryLinkCreate);
/// let x1 = EntryLinkEvent::new().set_event_type(EventType::EntryLinkDelete);
/// ```
pub fn set_event_type<T: std::convert::Into<crate::model::entry_link_event::EventType>>(
mut self,
v: T,
) -> Self {
self.event_type = v.into();
self
}
/// Sets the value of [resource][crate::model::EntryLinkEvent::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::EntryLinkEvent;
/// let x = EntryLinkEvent::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
}
impl wkt::message::Message for EntryLinkEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.EntryLinkEvent"
}
}
/// Defines additional types related to [EntryLinkEvent].
pub mod entry_link_event {
#[allow(unused_imports)]
use super::*;
/// Type of entry link log event.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EventType {
/// An unspecified event type.
Unspecified,
/// EntryLink create event.
EntryLinkCreate,
/// EntryLink delete event.
EntryLinkDelete,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EventType::value] or
/// [EventType::name].
UnknownValue(event_type::UnknownValue),
}
#[doc(hidden)]
pub mod event_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EventType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::EntryLinkCreate => std::option::Option::Some(1),
Self::EntryLinkDelete => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
Self::EntryLinkCreate => std::option::Option::Some("ENTRY_LINK_CREATE"),
Self::EntryLinkDelete => std::option::Option::Some("ENTRY_LINK_DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EventType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EventType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EntryLinkCreate,
2 => Self::EntryLinkDelete,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EventType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"ENTRY_LINK_CREATE" => Self::EntryLinkCreate,
"ENTRY_LINK_DELETE" => Self::EntryLinkDelete,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EventType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::EntryLinkCreate => serializer.serialize_i32(1),
Self::EntryLinkDelete => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EventType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
".google.cloud.dataplex.v1.EntryLinkEvent.EventType",
))
}
}
}
/// Create a metadata entity request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEntityRequest {
/// Required. The resource name of the parent zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub parent: std::string::String,
/// Required. Entity resource.
pub entity: std::option::Option<crate::model::Entity>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEntityRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateEntityRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntityRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = CreateEntityRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [entity][crate::model::CreateEntityRequest::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntityRequest;
/// use google_cloud_dataplex_v1::model::Entity;
/// let x = CreateEntityRequest::new().set_entity(Entity::default()/* use setters */);
/// ```
pub fn set_entity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entity][crate::model::CreateEntityRequest::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntityRequest;
/// use google_cloud_dataplex_v1::model::Entity;
/// let x = CreateEntityRequest::new().set_or_clear_entity(Some(Entity::default()/* use setters */));
/// let x = CreateEntityRequest::new().set_or_clear_entity(None::<Entity>);
/// ```
pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateEntityRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateEntityRequest;
/// let x = CreateEntityRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateEntityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateEntityRequest"
}
}
/// Update a metadata entity request.
/// The exiting entity will be fully replaced by the entity in the request.
/// The entity ID is mutable. To modify the ID, use the current entity ID in the
/// request URL and specify the new ID in the request body.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEntityRequest {
/// Required. Update description.
pub entity: std::option::Option<crate::model::Entity>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEntityRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entity][crate::model::UpdateEntityRequest::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntityRequest;
/// use google_cloud_dataplex_v1::model::Entity;
/// let x = UpdateEntityRequest::new().set_entity(Entity::default()/* use setters */);
/// ```
pub fn set_entity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [entity][crate::model::UpdateEntityRequest::entity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntityRequest;
/// use google_cloud_dataplex_v1::model::Entity;
/// let x = UpdateEntityRequest::new().set_or_clear_entity(Some(Entity::default()/* use setters */));
/// let x = UpdateEntityRequest::new().set_or_clear_entity(None::<Entity>);
/// ```
pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateEntityRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateEntityRequest;
/// let x = UpdateEntityRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateEntityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateEntityRequest"
}
}
/// Delete a metadata entity request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEntityRequest {
/// Required. The resource name of the entity:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`.
pub name: std::string::String,
/// Required. The etag associated with the entity, which can be retrieved with
/// a [GetEntity][] request.
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEntityRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteEntityRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntityRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = DeleteEntityRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeleteEntityRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteEntityRequest;
/// let x = DeleteEntityRequest::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteEntityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteEntityRequest"
}
}
/// List metadata entities request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntitiesRequest {
/// Required. The resource name of the parent zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub parent: std::string::String,
/// Required. Specify the entity view to make a partial list request.
pub view: crate::model::list_entities_request::EntityView,
/// Optional. Maximum number of entities to return. The service may return
/// fewer than this value. If unspecified, 100 entities will be returned by
/// default. The maximum value is 500; larger values will will be truncated to
/// 500.
pub page_size: i32,
/// Optional. Page token received from a previous `ListEntities` call. Provide
/// this to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListEntities` must match the call that provided the
/// page token.
pub page_token: std::string::String,
/// Optional. The following filter parameters can be added to the URL to limit
/// the entities returned by the API:
///
/// - Entity ID: ?filter="id=entityID"
/// - Asset ID: ?filter="asset=assetID"
/// - Data path ?filter="data_path=gs://my-bucket"
/// - Is HIVE compatible: ?filter="hive_compatible=true"
/// - Is BigQuery compatible: ?filter="bigquery_compatible=true"
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntitiesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListEntitiesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = ListEntitiesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [view][crate::model::ListEntitiesRequest::view].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesRequest;
/// use google_cloud_dataplex_v1::model::list_entities_request::EntityView;
/// let x0 = ListEntitiesRequest::new().set_view(EntityView::Tables);
/// let x1 = ListEntitiesRequest::new().set_view(EntityView::Filesets);
/// ```
pub fn set_view<T: std::convert::Into<crate::model::list_entities_request::EntityView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListEntitiesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesRequest;
/// let x = ListEntitiesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListEntitiesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesRequest;
/// let x = ListEntitiesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListEntitiesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesRequest;
/// let x = ListEntitiesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListEntitiesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntitiesRequest"
}
}
/// Defines additional types related to [ListEntitiesRequest].
pub mod list_entities_request {
#[allow(unused_imports)]
use super::*;
/// Entity views.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntityView {
/// The default unset value. Return both table and fileset entities
/// if unspecified.
Unspecified,
/// Only list table entities.
Tables,
/// Only list fileset entities.
Filesets,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EntityView::value] or
/// [EntityView::name].
UnknownValue(entity_view::UnknownValue),
}
#[doc(hidden)]
pub mod entity_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntityView {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Tables => std::option::Option::Some(1),
Self::Filesets => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENTITY_VIEW_UNSPECIFIED"),
Self::Tables => std::option::Option::Some("TABLES"),
Self::Filesets => std::option::Option::Some("FILESETS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntityView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntityView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EntityView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Tables,
2 => Self::Filesets,
_ => Self::UnknownValue(entity_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntityView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTITY_VIEW_UNSPECIFIED" => Self::Unspecified,
"TABLES" => Self::Tables,
"FILESETS" => Self::Filesets,
_ => Self::UnknownValue(entity_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntityView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Tables => serializer.serialize_i32(1),
Self::Filesets => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntityView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityView>::new(
".google.cloud.dataplex.v1.ListEntitiesRequest.EntityView",
))
}
}
}
/// List metadata entities response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEntitiesResponse {
/// Entities in the specified parent zone.
pub entities: std::vec::Vec<crate::model::Entity>,
/// Token to retrieve the next page of results, or empty if there are no
/// remaining results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEntitiesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [entities][crate::model::ListEntitiesResponse::entities].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesResponse;
/// use google_cloud_dataplex_v1::model::Entity;
/// let x = ListEntitiesResponse::new()
/// .set_entities([
/// Entity::default()/* use setters */,
/// Entity::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_entities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Entity>,
{
use std::iter::Iterator;
self.entities = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListEntitiesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListEntitiesResponse;
/// let x = ListEntitiesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListEntitiesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListEntitiesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEntitiesResponse {
type PageItem = crate::model::Entity;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.entities
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get metadata entity request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEntityRequest {
/// Required. The resource name of the entity:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}.`
pub name: std::string::String,
/// Optional. Used to select the subset of entity information to return.
/// Defaults to `BASIC`.
pub view: crate::model::get_entity_request::EntityView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEntityRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetEntityRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntityRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = GetEntityRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [view][crate::model::GetEntityRequest::view].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetEntityRequest;
/// use google_cloud_dataplex_v1::model::get_entity_request::EntityView;
/// let x0 = GetEntityRequest::new().set_view(EntityView::Basic);
/// let x1 = GetEntityRequest::new().set_view(EntityView::Schema);
/// let x2 = GetEntityRequest::new().set_view(EntityView::Full);
/// ```
pub fn set_view<T: std::convert::Into<crate::model::get_entity_request::EntityView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetEntityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetEntityRequest"
}
}
/// Defines additional types related to [GetEntityRequest].
pub mod get_entity_request {
#[allow(unused_imports)]
use super::*;
/// Entity views for get entity partial result.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntityView {
/// The API will default to the `BASIC` view.
Unspecified,
/// Minimal view that does not include the schema.
Basic,
/// Include basic information and schema.
Schema,
/// Include everything. Currently, this is the same as the SCHEMA view.
Full,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EntityView::value] or
/// [EntityView::name].
UnknownValue(entity_view::UnknownValue),
}
#[doc(hidden)]
pub mod entity_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntityView {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Schema => std::option::Option::Some(2),
Self::Full => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENTITY_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Schema => std::option::Option::Some("SCHEMA"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntityView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntityView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EntityView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Schema,
4 => Self::Full,
_ => Self::UnknownValue(entity_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntityView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTITY_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"SCHEMA" => Self::Schema,
"FULL" => Self::Full,
_ => Self::UnknownValue(entity_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntityView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Basic => serializer.serialize_i32(1),
Self::Schema => serializer.serialize_i32(2),
Self::Full => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntityView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityView>::new(
".google.cloud.dataplex.v1.GetEntityRequest.EntityView",
))
}
}
}
/// List metadata partitions request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPartitionsRequest {
/// Required. The resource name of the parent entity:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of partitions to return. The service may return
/// fewer than this value. If unspecified, 100 partitions will be returned by
/// default. The maximum page size is 500; larger values will will be truncated
/// to 500.
pub page_size: i32,
/// Optional. Page token received from a previous `ListPartitions` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListPartitions` must match the call that provided
/// the page token.
pub page_token: std::string::String,
/// Optional. Filter the partitions returned to the caller using a key value
/// pair expression. Supported operators and syntax:
///
/// - logic operators: AND, OR
/// - comparison operators: <, >, >=, <= ,=, !=
/// - LIKE operators:
/// - The right hand of a LIKE operator supports "." and
/// "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
/// - parenthetical grouping: ( )
///
/// Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
///
/// **Notes:**
///
/// - Keys to the left of operators are case insensitive.
/// - Partition results are sorted first by creation time, then by
/// lexicographic order.
/// - Up to 20 key value filter pairs are allowed, but due to performance
/// considerations, only the first 10 will be used as a filter.
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPartitionsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListPartitionsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListPartitionsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = ListPartitionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListPartitionsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListPartitionsRequest;
/// let x = ListPartitionsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListPartitionsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListPartitionsRequest;
/// let x = ListPartitionsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListPartitionsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListPartitionsRequest;
/// let x = ListPartitionsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListPartitionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListPartitionsRequest"
}
}
/// Create metadata partition request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePartitionRequest {
/// Required. The resource name of the parent zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`.
pub parent: std::string::String,
/// Required. Partition resource.
pub partition: std::option::Option<crate::model::Partition>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatePartitionRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreatePartitionRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreatePartitionRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = CreatePartitionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [partition][crate::model::CreatePartitionRequest::partition].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreatePartitionRequest;
/// use google_cloud_dataplex_v1::model::Partition;
/// let x = CreatePartitionRequest::new().set_partition(Partition::default()/* use setters */);
/// ```
pub fn set_partition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Partition>,
{
self.partition = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [partition][crate::model::CreatePartitionRequest::partition].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreatePartitionRequest;
/// use google_cloud_dataplex_v1::model::Partition;
/// let x = CreatePartitionRequest::new().set_or_clear_partition(Some(Partition::default()/* use setters */));
/// let x = CreatePartitionRequest::new().set_or_clear_partition(None::<Partition>);
/// ```
pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Partition>,
{
self.partition = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreatePartitionRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreatePartitionRequest;
/// let x = CreatePartitionRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreatePartitionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreatePartitionRequest"
}
}
/// Delete metadata partition request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePartitionRequest {
/// Required. The resource name of the partition.
/// format:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`.
/// The {partition_value_path} segment consists of an ordered sequence of
/// partition values separated by "/". All values must be provided.
pub name: std::string::String,
/// Optional. The etag associated with the partition.
#[deprecated]
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeletePartitionRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeletePartitionRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeletePartitionRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// # let partition_id = "partition_id";
/// let x = DeletePartitionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [etag][crate::model::DeletePartitionRequest::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeletePartitionRequest;
/// let x = DeletePartitionRequest::new().set_etag("example");
/// ```
#[deprecated]
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeletePartitionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeletePartitionRequest"
}
}
/// List metadata partitions response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPartitionsResponse {
/// Partitions under the specified parent entity.
pub partitions: std::vec::Vec<crate::model::Partition>,
/// Token to retrieve the next page of results, or empty if there are no
/// remaining results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPartitionsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [partitions][crate::model::ListPartitionsResponse::partitions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListPartitionsResponse;
/// use google_cloud_dataplex_v1::model::Partition;
/// let x = ListPartitionsResponse::new()
/// .set_partitions([
/// Partition::default()/* use setters */,
/// Partition::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_partitions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Partition>,
{
use std::iter::Iterator;
self.partitions = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListPartitionsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListPartitionsResponse;
/// let x = ListPartitionsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListPartitionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListPartitionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListPartitionsResponse {
type PageItem = crate::model::Partition;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.partitions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get metadata partition request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPartitionRequest {
/// Required. The resource name of the partition:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`.
/// The {partition_value_path} segment consists of an ordered sequence of
/// partition values separated by "/". All values must be provided.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetPartitionRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetPartitionRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetPartitionRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// # let partition_id = "partition_id";
/// let x = GetPartitionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetPartitionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetPartitionRequest"
}
}
/// Represents tables and fileset metadata contained within a zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Entity {
/// Output only. The resource name of the entity, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{id}`.
pub name: std::string::String,
/// Optional. Display name must be shorter than or equal to 256 characters.
pub display_name: std::string::String,
/// Optional. User friendly longer description text. Must be shorter than or
/// equal to 1024 characters.
pub description: std::string::String,
/// Output only. The time when the entity was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the entity was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Required. A user-provided entity ID. It is mutable, and will be used as the
/// published table name. Specifying a new ID in an update entity
/// request will override the existing value.
/// The ID must contain only letters (a-z, A-Z), numbers (0-9), and
/// underscores, and consist of 256 or fewer characters.
pub id: std::string::String,
/// Optional. The etag associated with the entity, which can be retrieved with
/// a [GetEntity][] request. Required for update and delete requests.
pub etag: std::string::String,
/// Required. Immutable. The type of entity.
pub r#type: crate::model::entity::Type,
/// Required. Immutable. The ID of the asset associated with the storage
/// location containing the entity data. The entity must be with in the same
/// zone with the asset.
pub asset: std::string::String,
/// Required. Immutable. The storage path of the entity data.
/// For Cloud Storage data, this is the fully-qualified path to the entity,
/// such as `gs://bucket/path/to/data`. For BigQuery data, this is the name of
/// the table resource, such as
/// `projects/project_id/datasets/dataset_id/tables/table_id`.
pub data_path: std::string::String,
/// Optional. The set of items within the data path constituting the data in
/// the entity, represented as a glob path. Example:
/// `gs://bucket/path/to/data/**/*.csv`.
pub data_path_pattern: std::string::String,
/// Output only. The name of the associated Data Catalog entry.
pub catalog_entry: std::string::String,
/// Required. Immutable. Identifies the storage system of the entity data.
pub system: crate::model::StorageSystem,
/// Required. Identifies the storage format of the entity data.
/// It does not apply to entities with data stored in BigQuery.
pub format: std::option::Option<crate::model::StorageFormat>,
/// Output only. Metadata stores that the entity is compatible with.
pub compatibility: std::option::Option<crate::model::entity::CompatibilityStatus>,
/// Output only. Identifies the access mechanism to the entity. Not user
/// settable.
pub access: std::option::Option<crate::model::StorageAccess>,
/// Output only. System generated unique ID for the Entity. This ID will be
/// different if the Entity is deleted and re-created with the same name.
pub uid: std::string::String,
/// Required. The description of the data structure and layout.
/// The schema is not included in list responses. It is only included in
/// `SCHEMA` and `FULL` entity views of a `GetEntity` response.
pub schema: std::option::Option<crate::model::Schema>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Entity {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Entity::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = Entity::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [display_name][crate::model::Entity::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [description][crate::model::Entity::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [create_time][crate::model::Entity::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use wkt::Timestamp;
/// let x = Entity::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Entity::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use wkt::Timestamp;
/// let x = Entity::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Entity::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Entity::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use wkt::Timestamp;
/// let x = Entity::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Entity::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use wkt::Timestamp;
/// let x = Entity::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Entity::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [id][crate::model::Entity::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_id("example");
/// ```
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
/// Sets the value of [etag][crate::model::Entity::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_etag("example");
/// ```
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
/// Sets the value of [r#type][crate::model::Entity::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::entity::Type;
/// let x0 = Entity::new().set_type(Type::Table);
/// let x1 = Entity::new().set_type(Type::Fileset);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::entity::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [asset][crate::model::Entity::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_asset("example");
/// ```
pub fn set_asset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.asset = v.into();
self
}
/// Sets the value of [data_path][crate::model::Entity::data_path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_data_path("example");
/// ```
pub fn set_data_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_path = v.into();
self
}
/// Sets the value of [data_path_pattern][crate::model::Entity::data_path_pattern].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_data_path_pattern("example");
/// ```
pub fn set_data_path_pattern<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_path_pattern = v.into();
self
}
/// Sets the value of [catalog_entry][crate::model::Entity::catalog_entry].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_catalog_entry("example");
/// ```
pub fn set_catalog_entry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.catalog_entry = v.into();
self
}
/// Sets the value of [system][crate::model::Entity::system].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::StorageSystem;
/// let x0 = Entity::new().set_system(StorageSystem::CloudStorage);
/// let x1 = Entity::new().set_system(StorageSystem::Bigquery);
/// ```
pub fn set_system<T: std::convert::Into<crate::model::StorageSystem>>(mut self, v: T) -> Self {
self.system = v.into();
self
}
/// Sets the value of [format][crate::model::Entity::format].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::StorageFormat;
/// let x = Entity::new().set_format(StorageFormat::default()/* use setters */);
/// ```
pub fn set_format<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StorageFormat>,
{
self.format = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [format][crate::model::Entity::format].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::StorageFormat;
/// let x = Entity::new().set_or_clear_format(Some(StorageFormat::default()/* use setters */));
/// let x = Entity::new().set_or_clear_format(None::<StorageFormat>);
/// ```
pub fn set_or_clear_format<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StorageFormat>,
{
self.format = v.map(|x| x.into());
self
}
/// Sets the value of [compatibility][crate::model::Entity::compatibility].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::entity::CompatibilityStatus;
/// let x = Entity::new().set_compatibility(CompatibilityStatus::default()/* use setters */);
/// ```
pub fn set_compatibility<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::entity::CompatibilityStatus>,
{
self.compatibility = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [compatibility][crate::model::Entity::compatibility].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::entity::CompatibilityStatus;
/// let x = Entity::new().set_or_clear_compatibility(Some(CompatibilityStatus::default()/* use setters */));
/// let x = Entity::new().set_or_clear_compatibility(None::<CompatibilityStatus>);
/// ```
pub fn set_or_clear_compatibility<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::entity::CompatibilityStatus>,
{
self.compatibility = v.map(|x| x.into());
self
}
/// Sets the value of [access][crate::model::Entity::access].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::StorageAccess;
/// let x = Entity::new().set_access(StorageAccess::default()/* use setters */);
/// ```
pub fn set_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StorageAccess>,
{
self.access = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [access][crate::model::Entity::access].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::StorageAccess;
/// let x = Entity::new().set_or_clear_access(Some(StorageAccess::default()/* use setters */));
/// let x = Entity::new().set_or_clear_access(None::<StorageAccess>);
/// ```
pub fn set_or_clear_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StorageAccess>,
{
self.access = v.map(|x| x.into());
self
}
/// Sets the value of [uid][crate::model::Entity::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// let x = Entity::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [schema][crate::model::Entity::schema].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::Schema;
/// let x = Entity::new().set_schema(Schema::default()/* use setters */);
/// ```
pub fn set_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.schema = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [schema][crate::model::Entity::schema].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Entity;
/// use google_cloud_dataplex_v1::model::Schema;
/// let x = Entity::new().set_or_clear_schema(Some(Schema::default()/* use setters */));
/// let x = Entity::new().set_or_clear_schema(None::<Schema>);
/// ```
pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.schema = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Entity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Entity"
}
}
/// Defines additional types related to [Entity].
pub mod entity {
#[allow(unused_imports)]
use super::*;
/// Provides compatibility information for various metadata stores.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompatibilityStatus {
/// Output only. Whether this entity is compatible with Hive Metastore.
pub hive_metastore:
std::option::Option<crate::model::entity::compatibility_status::Compatibility>,
/// Output only. Whether this entity is compatible with BigQuery.
pub bigquery:
std::option::Option<crate::model::entity::compatibility_status::Compatibility>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CompatibilityStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [hive_metastore][crate::model::entity::CompatibilityStatus::hive_metastore].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entity::CompatibilityStatus;
/// use google_cloud_dataplex_v1::model::entity::compatibility_status::Compatibility;
/// let x = CompatibilityStatus::new().set_hive_metastore(Compatibility::default()/* use setters */);
/// ```
pub fn set_hive_metastore<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::entity::compatibility_status::Compatibility>,
{
self.hive_metastore = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [hive_metastore][crate::model::entity::CompatibilityStatus::hive_metastore].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entity::CompatibilityStatus;
/// use google_cloud_dataplex_v1::model::entity::compatibility_status::Compatibility;
/// let x = CompatibilityStatus::new().set_or_clear_hive_metastore(Some(Compatibility::default()/* use setters */));
/// let x = CompatibilityStatus::new().set_or_clear_hive_metastore(None::<Compatibility>);
/// ```
pub fn set_or_clear_hive_metastore<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::entity::compatibility_status::Compatibility>,
{
self.hive_metastore = v.map(|x| x.into());
self
}
/// Sets the value of [bigquery][crate::model::entity::CompatibilityStatus::bigquery].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entity::CompatibilityStatus;
/// use google_cloud_dataplex_v1::model::entity::compatibility_status::Compatibility;
/// let x = CompatibilityStatus::new().set_bigquery(Compatibility::default()/* use setters */);
/// ```
pub fn set_bigquery<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::entity::compatibility_status::Compatibility>,
{
self.bigquery = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [bigquery][crate::model::entity::CompatibilityStatus::bigquery].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entity::CompatibilityStatus;
/// use google_cloud_dataplex_v1::model::entity::compatibility_status::Compatibility;
/// let x = CompatibilityStatus::new().set_or_clear_bigquery(Some(Compatibility::default()/* use setters */));
/// let x = CompatibilityStatus::new().set_or_clear_bigquery(None::<Compatibility>);
/// ```
pub fn set_or_clear_bigquery<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::entity::compatibility_status::Compatibility>,
{
self.bigquery = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CompatibilityStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Entity.CompatibilityStatus"
}
}
/// Defines additional types related to [CompatibilityStatus].
pub mod compatibility_status {
#[allow(unused_imports)]
use super::*;
/// Provides compatibility information for a specific metadata store.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Compatibility {
/// Output only. Whether the entity is compatible and can be represented in
/// the metadata store.
pub compatible: bool,
/// Output only. Provides additional detail if the entity is incompatible
/// with the metadata store.
pub reason: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Compatibility {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [compatible][crate::model::entity::compatibility_status::Compatibility::compatible].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entity::compatibility_status::Compatibility;
/// let x = Compatibility::new().set_compatible(true);
/// ```
pub fn set_compatible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.compatible = v.into();
self
}
/// Sets the value of [reason][crate::model::entity::compatibility_status::Compatibility::reason].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::entity::compatibility_status::Compatibility;
/// let x = Compatibility::new().set_reason("example");
/// ```
pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.reason = v.into();
self
}
}
impl wkt::message::Message for Compatibility {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility"
}
}
}
/// The type of entity.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Type unspecified.
Unspecified,
/// Structured and semi-structured data.
Table,
/// Unstructured data.
Fileset,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Table => std::option::Option::Some(1),
Self::Fileset => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Table => std::option::Option::Some("TABLE"),
Self::Fileset => std::option::Option::Some("FILESET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Table,
2 => Self::Fileset,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"TABLE" => Self::Table,
"FILESET" => Self::Fileset,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Table => serializer.serialize_i32(1),
Self::Fileset => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.Entity.Type",
))
}
}
}
/// Represents partition metadata contained within entity instances.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Partition {
/// Output only. Partition values used in the HTTP URL must be
/// double encoded. For example, `url_encode(url_encode(value))` can be used
/// to encode "US:CA/CA#Sunnyvale so that the request URL ends
/// with "/partitions/US%253ACA/CA%2523Sunnyvale".
/// The name field in the response retains the encoded format.
pub name: std::string::String,
/// Required. Immutable. The set of values representing the partition, which
/// correspond to the partition schema defined in the parent entity.
pub values: std::vec::Vec<std::string::String>,
/// Required. Immutable. The location of the entity data within the partition,
/// for example, `gs://bucket/path/to/entity/key1=value1/key2=value2`. Or
/// `projects/<project_id>/datasets/<dataset_id>/tables/<table_id>`
pub location: std::string::String,
/// Optional. The etag for this partition.
#[deprecated]
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Partition {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Partition::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Partition;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// # let partition_id = "partition_id";
/// let x = Partition::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [values][crate::model::Partition::values].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Partition;
/// let x = Partition::new().set_values(["a", "b", "c"]);
/// ```
pub fn set_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [location][crate::model::Partition::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Partition;
/// let x = Partition::new().set_location("example");
/// ```
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
/// Sets the value of [etag][crate::model::Partition::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Partition;
/// let x = Partition::new().set_etag("example");
/// ```
#[deprecated]
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for Partition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Partition"
}
}
/// Schema information describing the structure and layout of the data.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Schema {
/// Required. Set to `true` if user-managed or `false` if managed by Dataplex
/// Universal Catalog. The default is `false` (managed by Dataplex Universal
/// Catalog).
///
/// - Set to `false`to enable Dataplex Universal Catalog discovery to update
/// the schema.
/// including new data discovery, schema inference, and schema evolution.
/// Users retain the ability to input and edit the schema. Dataplex Universal
/// Catalog treats schema input by the user as though produced by a previous
/// Dataplex Universal Catalog discovery operation, and it will evolve the
/// schema and take action based on that treatment.
///
/// - Set to `true` to fully manage the entity
/// schema. This setting guarantees that Dataplex Universal Catalog will not
/// change schema fields.
///
pub user_managed: bool,
/// Optional. The sequence of fields describing data in table entities.
/// **Note:** BigQuery SchemaFields are immutable.
pub fields: std::vec::Vec<crate::model::schema::SchemaField>,
/// Optional. The sequence of fields describing the partition structure in
/// entities. If this field is empty, there are no partitions within the data.
pub partition_fields: std::vec::Vec<crate::model::schema::PartitionField>,
/// Optional. The structure of paths containing partition data within the
/// entity.
pub partition_style: crate::model::schema::PartitionStyle,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Schema {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [user_managed][crate::model::Schema::user_managed].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Schema;
/// let x = Schema::new().set_user_managed(true);
/// ```
pub fn set_user_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.user_managed = v.into();
self
}
/// Sets the value of [fields][crate::model::Schema::fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Schema;
/// use google_cloud_dataplex_v1::model::schema::SchemaField;
/// let x = Schema::new()
/// .set_fields([
/// SchemaField::default()/* use setters */,
/// SchemaField::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::schema::SchemaField>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [partition_fields][crate::model::Schema::partition_fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Schema;
/// use google_cloud_dataplex_v1::model::schema::PartitionField;
/// let x = Schema::new()
/// .set_partition_fields([
/// PartitionField::default()/* use setters */,
/// PartitionField::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_partition_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::schema::PartitionField>,
{
use std::iter::Iterator;
self.partition_fields = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [partition_style][crate::model::Schema::partition_style].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Schema;
/// use google_cloud_dataplex_v1::model::schema::PartitionStyle;
/// let x0 = Schema::new().set_partition_style(PartitionStyle::HiveCompatible);
/// ```
pub fn set_partition_style<T: std::convert::Into<crate::model::schema::PartitionStyle>>(
mut self,
v: T,
) -> Self {
self.partition_style = v.into();
self
}
}
impl wkt::message::Message for Schema {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Schema"
}
}
/// Defines additional types related to [Schema].
pub mod schema {
#[allow(unused_imports)]
use super::*;
/// Represents a column field within a table schema.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchemaField {
/// Required. The name of the field. Must contain only letters, numbers and
/// underscores, with a maximum length of 767 characters,
/// and must begin with a letter or underscore.
pub name: std::string::String,
/// Optional. User friendly field description. Must be less than or equal to
/// 1024 characters.
pub description: std::string::String,
/// Required. The type of field.
pub r#type: crate::model::schema::Type,
/// Required. Additional field semantics.
pub mode: crate::model::schema::Mode,
/// Optional. Any nested field for complex types.
pub fields: std::vec::Vec<crate::model::schema::SchemaField>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchemaField {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::schema::SchemaField::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::SchemaField;
/// let x = SchemaField::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [description][crate::model::schema::SchemaField::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::SchemaField;
/// let x = SchemaField::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [r#type][crate::model::schema::SchemaField::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::SchemaField;
/// use google_cloud_dataplex_v1::model::schema::Type;
/// let x0 = SchemaField::new().set_type(Type::Boolean);
/// let x1 = SchemaField::new().set_type(Type::Byte);
/// let x2 = SchemaField::new().set_type(Type::Int16);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::schema::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [mode][crate::model::schema::SchemaField::mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::SchemaField;
/// use google_cloud_dataplex_v1::model::schema::Mode;
/// let x0 = SchemaField::new().set_mode(Mode::Required);
/// let x1 = SchemaField::new().set_mode(Mode::Nullable);
/// let x2 = SchemaField::new().set_mode(Mode::Repeated);
/// ```
pub fn set_mode<T: std::convert::Into<crate::model::schema::Mode>>(mut self, v: T) -> Self {
self.mode = v.into();
self
}
/// Sets the value of [fields][crate::model::schema::SchemaField::fields].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::SchemaField;
/// let x = SchemaField::new()
/// .set_fields([
/// SchemaField::default()/* use setters */,
/// SchemaField::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::schema::SchemaField>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SchemaField {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Schema.SchemaField"
}
}
/// Represents a key field within the entity's partition structure. You could
/// have up to 20 partition fields, but only the first 10 partitions have the
/// filtering ability due to performance consideration. **Note:**
/// Partition fields are immutable.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PartitionField {
/// Required. Partition field name must consist of letters, numbers, and
/// underscores only, with a maximum of length of 256 characters, and must
/// begin with a letter or underscore..
pub name: std::string::String,
/// Required. Immutable. The type of field.
pub r#type: crate::model::schema::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PartitionField {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::schema::PartitionField::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::PartitionField;
/// let x = PartitionField::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [r#type][crate::model::schema::PartitionField::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::schema::PartitionField;
/// use google_cloud_dataplex_v1::model::schema::Type;
/// let x0 = PartitionField::new().set_type(Type::Boolean);
/// let x1 = PartitionField::new().set_type(Type::Byte);
/// let x2 = PartitionField::new().set_type(Type::Int16);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::schema::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for PartitionField {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Schema.PartitionField"
}
}
/// Type information for fields in schemas and partition schemas.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// SchemaType unspecified.
Unspecified,
/// Boolean field.
Boolean,
/// Single byte numeric field.
Byte,
/// 16-bit numeric field.
Int16,
/// 32-bit numeric field.
Int32,
/// 64-bit numeric field.
Int64,
/// Floating point numeric field.
Float,
/// Double precision numeric field.
Double,
/// Real value numeric field.
Decimal,
/// Sequence of characters field.
String,
/// Sequence of bytes field.
Binary,
/// Date and time field.
Timestamp,
/// Date field.
Date,
/// Time field.
Time,
/// Structured field. Nested fields that define the structure of the map.
/// If all nested fields are nullable, this field represents a union.
Record,
/// Null field that does not have values.
Null,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Boolean => std::option::Option::Some(1),
Self::Byte => std::option::Option::Some(2),
Self::Int16 => std::option::Option::Some(3),
Self::Int32 => std::option::Option::Some(4),
Self::Int64 => std::option::Option::Some(5),
Self::Float => std::option::Option::Some(6),
Self::Double => std::option::Option::Some(7),
Self::Decimal => std::option::Option::Some(8),
Self::String => std::option::Option::Some(9),
Self::Binary => std::option::Option::Some(10),
Self::Timestamp => std::option::Option::Some(11),
Self::Date => std::option::Option::Some(12),
Self::Time => std::option::Option::Some(13),
Self::Record => std::option::Option::Some(14),
Self::Null => std::option::Option::Some(100),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Boolean => std::option::Option::Some("BOOLEAN"),
Self::Byte => std::option::Option::Some("BYTE"),
Self::Int16 => std::option::Option::Some("INT16"),
Self::Int32 => std::option::Option::Some("INT32"),
Self::Int64 => std::option::Option::Some("INT64"),
Self::Float => std::option::Option::Some("FLOAT"),
Self::Double => std::option::Option::Some("DOUBLE"),
Self::Decimal => std::option::Option::Some("DECIMAL"),
Self::String => std::option::Option::Some("STRING"),
Self::Binary => std::option::Option::Some("BINARY"),
Self::Timestamp => std::option::Option::Some("TIMESTAMP"),
Self::Date => std::option::Option::Some("DATE"),
Self::Time => std::option::Option::Some("TIME"),
Self::Record => std::option::Option::Some("RECORD"),
Self::Null => std::option::Option::Some("NULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Boolean,
2 => Self::Byte,
3 => Self::Int16,
4 => Self::Int32,
5 => Self::Int64,
6 => Self::Float,
7 => Self::Double,
8 => Self::Decimal,
9 => Self::String,
10 => Self::Binary,
11 => Self::Timestamp,
12 => Self::Date,
13 => Self::Time,
14 => Self::Record,
100 => Self::Null,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"BOOLEAN" => Self::Boolean,
"BYTE" => Self::Byte,
"INT16" => Self::Int16,
"INT32" => Self::Int32,
"INT64" => Self::Int64,
"FLOAT" => Self::Float,
"DOUBLE" => Self::Double,
"DECIMAL" => Self::Decimal,
"STRING" => Self::String,
"BINARY" => Self::Binary,
"TIMESTAMP" => Self::Timestamp,
"DATE" => Self::Date,
"TIME" => Self::Time,
"RECORD" => Self::Record,
"NULL" => Self::Null,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Boolean => serializer.serialize_i32(1),
Self::Byte => serializer.serialize_i32(2),
Self::Int16 => serializer.serialize_i32(3),
Self::Int32 => serializer.serialize_i32(4),
Self::Int64 => serializer.serialize_i32(5),
Self::Float => serializer.serialize_i32(6),
Self::Double => serializer.serialize_i32(7),
Self::Decimal => serializer.serialize_i32(8),
Self::String => serializer.serialize_i32(9),
Self::Binary => serializer.serialize_i32(10),
Self::Timestamp => serializer.serialize_i32(11),
Self::Date => serializer.serialize_i32(12),
Self::Time => serializer.serialize_i32(13),
Self::Record => serializer.serialize_i32(14),
Self::Null => serializer.serialize_i32(100),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.Schema.Type",
))
}
}
/// Additional qualifiers to define field semantics.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
/// Mode unspecified.
Unspecified,
/// The field has required semantics.
Required,
/// The field has optional semantics, and may be null.
Nullable,
/// The field has repeated (0 or more) semantics, and is a list of values.
Repeated,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Mode::value] or
/// [Mode::name].
UnknownValue(mode::UnknownValue),
}
#[doc(hidden)]
pub mod mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Mode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Required => std::option::Option::Some(1),
Self::Nullable => std::option::Option::Some(2),
Self::Repeated => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
Self::Required => std::option::Option::Some("REQUIRED"),
Self::Nullable => std::option::Option::Some("NULLABLE"),
Self::Repeated => std::option::Option::Some("REPEATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Mode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Mode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Mode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Required,
2 => Self::Nullable,
3 => Self::Repeated,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Mode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MODE_UNSPECIFIED" => Self::Unspecified,
"REQUIRED" => Self::Required,
"NULLABLE" => Self::Nullable,
"REPEATED" => Self::Repeated,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Mode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Required => serializer.serialize_i32(1),
Self::Nullable => serializer.serialize_i32(2),
Self::Repeated => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Mode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
".google.cloud.dataplex.v1.Schema.Mode",
))
}
}
/// The structure of paths within the entity, which represent partitions.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PartitionStyle {
/// PartitionStyle unspecified
Unspecified,
/// Partitions are hive-compatible.
/// Examples: `gs://bucket/path/to/table/dt=2019-10-31/lang=en`,
/// `gs://bucket/path/to/table/dt=2019-10-31/lang=en/late`.
HiveCompatible,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [PartitionStyle::value] or
/// [PartitionStyle::name].
UnknownValue(partition_style::UnknownValue),
}
#[doc(hidden)]
pub mod partition_style {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PartitionStyle {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::HiveCompatible => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PARTITION_STYLE_UNSPECIFIED"),
Self::HiveCompatible => std::option::Option::Some("HIVE_COMPATIBLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PartitionStyle {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PartitionStyle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PartitionStyle {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::HiveCompatible,
_ => Self::UnknownValue(partition_style::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PartitionStyle {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PARTITION_STYLE_UNSPECIFIED" => Self::Unspecified,
"HIVE_COMPATIBLE" => Self::HiveCompatible,
_ => Self::UnknownValue(partition_style::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PartitionStyle {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::HiveCompatible => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PartitionStyle {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartitionStyle>::new(
".google.cloud.dataplex.v1.Schema.PartitionStyle",
))
}
}
}
/// Describes the format of the data within its storage location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageFormat {
/// Output only. The data format associated with the stored data, which
/// represents content type values. The value is inferred from mime type.
pub format: crate::model::storage_format::Format,
/// Optional. The compression type associated with the stored data.
/// If unspecified, the data is uncompressed.
pub compression_format: crate::model::storage_format::CompressionFormat,
/// Required. The mime type descriptor for the data. Must match the pattern
/// {type}/{subtype}. Supported values:
///
/// - application/x-parquet
/// - application/x-avro
/// - application/x-orc
/// - application/x-tfrecord
/// - application/x-parquet+iceberg
/// - application/x-avro+iceberg
/// - application/x-orc+iceberg
/// - application/json
/// - application/{subtypes}
/// - text/csv
/// - text/\<subtypes\>
/// - image/{image subtype}
/// - video/{video subtype}
/// - audio/{audio subtype}
pub mime_type: std::string::String,
/// Additional format-specific options.
pub options: std::option::Option<crate::model::storage_format::Options>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageFormat {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [format][crate::model::StorageFormat::format].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// use google_cloud_dataplex_v1::model::storage_format::Format;
/// let x0 = StorageFormat::new().set_format(Format::Parquet);
/// let x1 = StorageFormat::new().set_format(Format::Avro);
/// let x2 = StorageFormat::new().set_format(Format::Orc);
/// ```
pub fn set_format<T: std::convert::Into<crate::model::storage_format::Format>>(
mut self,
v: T,
) -> Self {
self.format = v.into();
self
}
/// Sets the value of [compression_format][crate::model::StorageFormat::compression_format].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// use google_cloud_dataplex_v1::model::storage_format::CompressionFormat;
/// let x0 = StorageFormat::new().set_compression_format(CompressionFormat::Gzip);
/// let x1 = StorageFormat::new().set_compression_format(CompressionFormat::Bzip2);
/// ```
pub fn set_compression_format<
T: std::convert::Into<crate::model::storage_format::CompressionFormat>,
>(
mut self,
v: T,
) -> Self {
self.compression_format = v.into();
self
}
/// Sets the value of [mime_type][crate::model::StorageFormat::mime_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// let x = StorageFormat::new().set_mime_type("example");
/// ```
pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mime_type = v.into();
self
}
/// Sets the value of [options][crate::model::StorageFormat::options].
///
/// Note that all the setters affecting `options` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// use google_cloud_dataplex_v1::model::storage_format::CsvOptions;
/// let x = StorageFormat::new().set_options(Some(
/// google_cloud_dataplex_v1::model::storage_format::Options::Csv(CsvOptions::default().into())));
/// ```
pub fn set_options<
T: std::convert::Into<std::option::Option<crate::model::storage_format::Options>>,
>(
mut self,
v: T,
) -> Self {
self.options = v.into();
self
}
/// The value of [options][crate::model::StorageFormat::options]
/// if it holds a `Csv`, `None` if the field is not set or
/// holds a different branch.
pub fn csv(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::storage_format::CsvOptions>> {
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::storage_format::Options::Csv(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [options][crate::model::StorageFormat::options]
/// to hold a `Csv`.
///
/// Note that all the setters affecting `options` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// use google_cloud_dataplex_v1::model::storage_format::CsvOptions;
/// let x = StorageFormat::new().set_csv(CsvOptions::default()/* use setters */);
/// assert!(x.csv().is_some());
/// assert!(x.json().is_none());
/// assert!(x.iceberg().is_none());
/// ```
pub fn set_csv<
T: std::convert::Into<std::boxed::Box<crate::model::storage_format::CsvOptions>>,
>(
mut self,
v: T,
) -> Self {
self.options =
std::option::Option::Some(crate::model::storage_format::Options::Csv(v.into()));
self
}
/// The value of [options][crate::model::StorageFormat::options]
/// if it holds a `Json`, `None` if the field is not set or
/// holds a different branch.
pub fn json(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::storage_format::JsonOptions>> {
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::storage_format::Options::Json(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [options][crate::model::StorageFormat::options]
/// to hold a `Json`.
///
/// Note that all the setters affecting `options` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// use google_cloud_dataplex_v1::model::storage_format::JsonOptions;
/// let x = StorageFormat::new().set_json(JsonOptions::default()/* use setters */);
/// assert!(x.json().is_some());
/// assert!(x.csv().is_none());
/// assert!(x.iceberg().is_none());
/// ```
pub fn set_json<
T: std::convert::Into<std::boxed::Box<crate::model::storage_format::JsonOptions>>,
>(
mut self,
v: T,
) -> Self {
self.options =
std::option::Option::Some(crate::model::storage_format::Options::Json(v.into()));
self
}
/// The value of [options][crate::model::StorageFormat::options]
/// if it holds a `Iceberg`, `None` if the field is not set or
/// holds a different branch.
pub fn iceberg(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::storage_format::IcebergOptions>> {
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::storage_format::Options::Iceberg(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [options][crate::model::StorageFormat::options]
/// to hold a `Iceberg`.
///
/// Note that all the setters affecting `options` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageFormat;
/// use google_cloud_dataplex_v1::model::storage_format::IcebergOptions;
/// let x = StorageFormat::new().set_iceberg(IcebergOptions::default()/* use setters */);
/// assert!(x.iceberg().is_some());
/// assert!(x.csv().is_none());
/// assert!(x.json().is_none());
/// ```
pub fn set_iceberg<
T: std::convert::Into<std::boxed::Box<crate::model::storage_format::IcebergOptions>>,
>(
mut self,
v: T,
) -> Self {
self.options =
std::option::Option::Some(crate::model::storage_format::Options::Iceberg(v.into()));
self
}
}
impl wkt::message::Message for StorageFormat {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.StorageFormat"
}
}
/// Defines additional types related to [StorageFormat].
pub mod storage_format {
#[allow(unused_imports)]
use super::*;
/// Describes CSV and similar semi-structured data formats.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CsvOptions {
/// Optional. The character encoding of the data. Accepts "US-ASCII",
/// "UTF-8", and "ISO-8859-1". Defaults to UTF-8 if unspecified.
pub encoding: std::string::String,
/// Optional. The number of rows to interpret as header rows that should be
/// skipped when reading data rows. Defaults to 0.
pub header_rows: i32,
/// Optional. The delimiter used to separate values. Defaults to ','.
pub delimiter: std::string::String,
/// Optional. The character used to quote column values. Accepts '"'
/// (double quotation mark) or ''' (single quotation mark). Defaults to
/// '"' (double quotation mark) if unspecified.
pub quote: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CsvOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encoding][crate::model::storage_format::CsvOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::storage_format::CsvOptions;
/// let x = CsvOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [header_rows][crate::model::storage_format::CsvOptions::header_rows].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::storage_format::CsvOptions;
/// let x = CsvOptions::new().set_header_rows(42);
/// ```
pub fn set_header_rows<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.header_rows = v.into();
self
}
/// Sets the value of [delimiter][crate::model::storage_format::CsvOptions::delimiter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::storage_format::CsvOptions;
/// let x = CsvOptions::new().set_delimiter("example");
/// ```
pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.delimiter = v.into();
self
}
/// Sets the value of [quote][crate::model::storage_format::CsvOptions::quote].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::storage_format::CsvOptions;
/// let x = CsvOptions::new().set_quote("example");
/// ```
pub fn set_quote<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.quote = v.into();
self
}
}
impl wkt::message::Message for CsvOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.StorageFormat.CsvOptions"
}
}
/// Describes JSON data format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JsonOptions {
/// Optional. The character encoding of the data. Accepts "US-ASCII", "UTF-8"
/// and "ISO-8859-1". Defaults to UTF-8 if not specified.
pub encoding: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JsonOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encoding][crate::model::storage_format::JsonOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::storage_format::JsonOptions;
/// let x = JsonOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encoding = v.into();
self
}
}
impl wkt::message::Message for JsonOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.StorageFormat.JsonOptions"
}
}
/// Describes Iceberg data format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IcebergOptions {
/// Optional. The location of where the iceberg metadata is present, must be
/// within the table path
pub metadata_location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IcebergOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [metadata_location][crate::model::storage_format::IcebergOptions::metadata_location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::storage_format::IcebergOptions;
/// let x = IcebergOptions::new().set_metadata_location("example");
/// ```
pub fn set_metadata_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.metadata_location = v.into();
self
}
}
impl wkt::message::Message for IcebergOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.StorageFormat.IcebergOptions"
}
}
/// The specific file format of the data.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Format {
/// Format unspecified.
Unspecified,
/// Parquet-formatted structured data.
Parquet,
/// Avro-formatted structured data.
Avro,
/// Orc-formatted structured data.
Orc,
/// Csv-formatted semi-structured data.
Csv,
/// Json-formatted semi-structured data.
Json,
/// Image data formats (such as jpg and png).
Image,
/// Audio data formats (such as mp3, and wav).
Audio,
/// Video data formats (such as mp4 and mpg).
Video,
/// Textual data formats (such as txt and xml).
Text,
/// TensorFlow record format.
Tfrecord,
/// Data that doesn't match a specific format.
Other,
/// Data of an unknown format.
Unknown,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Format::value] or
/// [Format::name].
UnknownValue(format::UnknownValue),
}
#[doc(hidden)]
pub mod format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Format {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Parquet => std::option::Option::Some(1),
Self::Avro => std::option::Option::Some(2),
Self::Orc => std::option::Option::Some(3),
Self::Csv => std::option::Option::Some(100),
Self::Json => std::option::Option::Some(101),
Self::Image => std::option::Option::Some(200),
Self::Audio => std::option::Option::Some(201),
Self::Video => std::option::Option::Some(202),
Self::Text => std::option::Option::Some(203),
Self::Tfrecord => std::option::Option::Some(204),
Self::Other => std::option::Option::Some(1000),
Self::Unknown => std::option::Option::Some(1001),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
Self::Parquet => std::option::Option::Some("PARQUET"),
Self::Avro => std::option::Option::Some("AVRO"),
Self::Orc => std::option::Option::Some("ORC"),
Self::Csv => std::option::Option::Some("CSV"),
Self::Json => std::option::Option::Some("JSON"),
Self::Image => std::option::Option::Some("IMAGE"),
Self::Audio => std::option::Option::Some("AUDIO"),
Self::Video => std::option::Option::Some("VIDEO"),
Self::Text => std::option::Option::Some("TEXT"),
Self::Tfrecord => std::option::Option::Some("TFRECORD"),
Self::Other => std::option::Option::Some("OTHER"),
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Format {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Format {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Format {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Parquet,
2 => Self::Avro,
3 => Self::Orc,
100 => Self::Csv,
101 => Self::Json,
200 => Self::Image,
201 => Self::Audio,
202 => Self::Video,
203 => Self::Text,
204 => Self::Tfrecord,
1000 => Self::Other,
1001 => Self::Unknown,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Format {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FORMAT_UNSPECIFIED" => Self::Unspecified,
"PARQUET" => Self::Parquet,
"AVRO" => Self::Avro,
"ORC" => Self::Orc,
"CSV" => Self::Csv,
"JSON" => Self::Json,
"IMAGE" => Self::Image,
"AUDIO" => Self::Audio,
"VIDEO" => Self::Video,
"TEXT" => Self::Text,
"TFRECORD" => Self::Tfrecord,
"OTHER" => Self::Other,
"UNKNOWN" => Self::Unknown,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Format {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Parquet => serializer.serialize_i32(1),
Self::Avro => serializer.serialize_i32(2),
Self::Orc => serializer.serialize_i32(3),
Self::Csv => serializer.serialize_i32(100),
Self::Json => serializer.serialize_i32(101),
Self::Image => serializer.serialize_i32(200),
Self::Audio => serializer.serialize_i32(201),
Self::Video => serializer.serialize_i32(202),
Self::Text => serializer.serialize_i32(203),
Self::Tfrecord => serializer.serialize_i32(204),
Self::Other => serializer.serialize_i32(1000),
Self::Unknown => serializer.serialize_i32(1001),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Format {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
".google.cloud.dataplex.v1.StorageFormat.Format",
))
}
}
/// The specific compressed file format of the data.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CompressionFormat {
/// CompressionFormat unspecified. Implies uncompressed data.
Unspecified,
/// GZip compressed set of files.
Gzip,
/// BZip2 compressed set of files.
Bzip2,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [CompressionFormat::value] or
/// [CompressionFormat::name].
UnknownValue(compression_format::UnknownValue),
}
#[doc(hidden)]
pub mod compression_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CompressionFormat {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Gzip => std::option::Option::Some(2),
Self::Bzip2 => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("COMPRESSION_FORMAT_UNSPECIFIED"),
Self::Gzip => std::option::Option::Some("GZIP"),
Self::Bzip2 => std::option::Option::Some("BZIP2"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CompressionFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CompressionFormat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CompressionFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Gzip,
3 => Self::Bzip2,
_ => Self::UnknownValue(compression_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CompressionFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPRESSION_FORMAT_UNSPECIFIED" => Self::Unspecified,
"GZIP" => Self::Gzip,
"BZIP2" => Self::Bzip2,
_ => Self::UnknownValue(compression_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CompressionFormat {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Gzip => serializer.serialize_i32(2),
Self::Bzip2 => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CompressionFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompressionFormat>::new(
".google.cloud.dataplex.v1.StorageFormat.CompressionFormat",
))
}
}
/// Additional format-specific options.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Options {
/// Optional. Additional information about CSV formatted data.
Csv(std::boxed::Box<crate::model::storage_format::CsvOptions>),
/// Optional. Additional information about CSV formatted data.
Json(std::boxed::Box<crate::model::storage_format::JsonOptions>),
/// Optional. Additional information about iceberg tables.
Iceberg(std::boxed::Box<crate::model::storage_format::IcebergOptions>),
}
}
/// Describes the access mechanism of the data within its storage location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageAccess {
/// Output only. Describes the read access mechanism of the data. Not user
/// settable.
pub read: crate::model::storage_access::AccessMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageAccess {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [read][crate::model::StorageAccess::read].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::StorageAccess;
/// use google_cloud_dataplex_v1::model::storage_access::AccessMode;
/// let x0 = StorageAccess::new().set_read(AccessMode::Direct);
/// let x1 = StorageAccess::new().set_read(AccessMode::Managed);
/// ```
pub fn set_read<T: std::convert::Into<crate::model::storage_access::AccessMode>>(
mut self,
v: T,
) -> Self {
self.read = v.into();
self
}
}
impl wkt::message::Message for StorageAccess {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.StorageAccess"
}
}
/// Defines additional types related to [StorageAccess].
pub mod storage_access {
#[allow(unused_imports)]
use super::*;
/// Access Mode determines how data stored within the Entity is read.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AccessMode {
/// Access mode unspecified.
Unspecified,
/// Default. Data is accessed directly using storage APIs.
Direct,
/// Data is accessed through a managed interface using BigQuery APIs.
Managed,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [AccessMode::value] or
/// [AccessMode::name].
UnknownValue(access_mode::UnknownValue),
}
#[doc(hidden)]
pub mod access_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AccessMode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Direct => std::option::Option::Some(1),
Self::Managed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ACCESS_MODE_UNSPECIFIED"),
Self::Direct => std::option::Option::Some("DIRECT"),
Self::Managed => std::option::Option::Some("MANAGED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AccessMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AccessMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AccessMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Direct,
2 => Self::Managed,
_ => Self::UnknownValue(access_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AccessMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACCESS_MODE_UNSPECIFIED" => Self::Unspecified,
"DIRECT" => Self::Direct,
"MANAGED" => Self::Managed,
_ => Self::UnknownValue(access_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AccessMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Direct => serializer.serialize_i32(1),
Self::Managed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AccessMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessMode>::new(
".google.cloud.dataplex.v1.StorageAccess.AccessMode",
))
}
}
}
/// DataScan scheduling and trigger settings.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Trigger {
/// DataScan scheduling and trigger settings.
///
/// If not specified, the default is `onDemand`.
pub mode: std::option::Option<crate::model::trigger::Mode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Trigger {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [mode][crate::model::Trigger::mode].
///
/// Note that all the setters affecting `mode` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Trigger;
/// use google_cloud_dataplex_v1::model::trigger::OnDemand;
/// let x = Trigger::new().set_mode(Some(
/// google_cloud_dataplex_v1::model::trigger::Mode::OnDemand(OnDemand::default().into())));
/// ```
pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::trigger::Mode>>>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
/// The value of [mode][crate::model::Trigger::mode]
/// if it holds a `OnDemand`, `None` if the field is not set or
/// holds a different branch.
pub fn on_demand(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::trigger::OnDemand>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::trigger::Mode::OnDemand(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [mode][crate::model::Trigger::mode]
/// to hold a `OnDemand`.
///
/// Note that all the setters affecting `mode` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Trigger;
/// use google_cloud_dataplex_v1::model::trigger::OnDemand;
/// let x = Trigger::new().set_on_demand(OnDemand::default()/* use setters */);
/// assert!(x.on_demand().is_some());
/// assert!(x.schedule().is_none());
/// assert!(x.one_time().is_none());
/// ```
pub fn set_on_demand<
T: std::convert::Into<std::boxed::Box<crate::model::trigger::OnDemand>>,
>(
mut self,
v: T,
) -> Self {
self.mode = std::option::Option::Some(crate::model::trigger::Mode::OnDemand(v.into()));
self
}
/// The value of [mode][crate::model::Trigger::mode]
/// if it holds a `Schedule`, `None` if the field is not set or
/// holds a different branch.
pub fn schedule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::trigger::Schedule>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::trigger::Mode::Schedule(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [mode][crate::model::Trigger::mode]
/// to hold a `Schedule`.
///
/// Note that all the setters affecting `mode` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Trigger;
/// use google_cloud_dataplex_v1::model::trigger::Schedule;
/// let x = Trigger::new().set_schedule(Schedule::default()/* use setters */);
/// assert!(x.schedule().is_some());
/// assert!(x.on_demand().is_none());
/// assert!(x.one_time().is_none());
/// ```
pub fn set_schedule<T: std::convert::Into<std::boxed::Box<crate::model::trigger::Schedule>>>(
mut self,
v: T,
) -> Self {
self.mode = std::option::Option::Some(crate::model::trigger::Mode::Schedule(v.into()));
self
}
/// The value of [mode][crate::model::Trigger::mode]
/// if it holds a `OneTime`, `None` if the field is not set or
/// holds a different branch.
pub fn one_time(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::trigger::OneTime>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::trigger::Mode::OneTime(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [mode][crate::model::Trigger::mode]
/// to hold a `OneTime`.
///
/// Note that all the setters affecting `mode` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Trigger;
/// use google_cloud_dataplex_v1::model::trigger::OneTime;
/// let x = Trigger::new().set_one_time(OneTime::default()/* use setters */);
/// assert!(x.one_time().is_some());
/// assert!(x.on_demand().is_none());
/// assert!(x.schedule().is_none());
/// ```
pub fn set_one_time<T: std::convert::Into<std::boxed::Box<crate::model::trigger::OneTime>>>(
mut self,
v: T,
) -> Self {
self.mode = std::option::Option::Some(crate::model::trigger::Mode::OneTime(v.into()));
self
}
}
impl wkt::message::Message for Trigger {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Trigger"
}
}
/// Defines additional types related to [Trigger].
pub mod trigger {
#[allow(unused_imports)]
use super::*;
/// The scan runs once via `RunDataScan` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OnDemand {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OnDemand {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for OnDemand {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Trigger.OnDemand"
}
}
/// The scan is scheduled to run periodically.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Schedule {
/// Required. [Cron](https://en.wikipedia.org/wiki/Cron) schedule for running
/// scans periodically.
///
/// To explicitly set a timezone in the cron tab, apply a prefix in the
/// cron tab: **"CRON_TZ=${IANA_TIME_ZONE}"** or **"TZ=${IANA_TIME_ZONE}"**.
/// The **${IANA_TIME_ZONE}** may only be a valid string from IANA time zone
/// database
/// ([wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)).
/// For example, `CRON_TZ=America/New_York 1 * * * *`, or
/// `TZ=America/New_York 1 * * * *`.
///
/// This field is required for Schedule scans.
pub cron: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Schedule {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [cron][crate::model::trigger::Schedule::cron].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::trigger::Schedule;
/// let x = Schedule::new().set_cron("example");
/// ```
pub fn set_cron<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cron = v.into();
self
}
}
impl wkt::message::Message for Schedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Trigger.Schedule"
}
}
/// The scan runs once using create API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OneTime {
/// Optional. Time to live for OneTime scans.
/// default value is 24 hours, minimum value is 0 seconds, and maximum value
/// is 365 days. The time is calculated from the data scan job completion
/// time. If value is set as 0 seconds, the scan will be immediately deleted
/// upon job completion, regardless of whether the job succeeded or failed.
pub ttl_after_scan_completion: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OneTime {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [ttl_after_scan_completion][crate::model::trigger::OneTime::ttl_after_scan_completion].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::trigger::OneTime;
/// use wkt::Duration;
/// let x = OneTime::new().set_ttl_after_scan_completion(Duration::default()/* use setters */);
/// ```
pub fn set_ttl_after_scan_completion<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ttl_after_scan_completion = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ttl_after_scan_completion][crate::model::trigger::OneTime::ttl_after_scan_completion].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::trigger::OneTime;
/// use wkt::Duration;
/// let x = OneTime::new().set_or_clear_ttl_after_scan_completion(Some(Duration::default()/* use setters */));
/// let x = OneTime::new().set_or_clear_ttl_after_scan_completion(None::<Duration>);
/// ```
pub fn set_or_clear_ttl_after_scan_completion<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ttl_after_scan_completion = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OneTime {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Trigger.OneTime"
}
}
/// DataScan scheduling and trigger settings.
///
/// If not specified, the default is `onDemand`.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
/// The scan runs once via `RunDataScan` API.
OnDemand(std::boxed::Box<crate::model::trigger::OnDemand>),
/// The scan is scheduled to run periodically.
Schedule(std::boxed::Box<crate::model::trigger::Schedule>),
/// The scan runs once, and does not create an associated ScanJob child
/// resource.
OneTime(std::boxed::Box<crate::model::trigger::OneTime>),
}
}
/// The data source for DataScan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataSource {
/// The source is required and immutable. Once it is set, it cannot be change
/// to others.
pub source: std::option::Option<crate::model::data_source::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataSource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [source][crate::model::DataSource::source].
///
/// Note that all the setters affecting `source` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataSource;
/// use google_cloud_dataplex_v1::model::data_source::Source;
/// let x = DataSource::new().set_source(Some(Source::Entity("example".to_string())));
/// ```
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::data_source::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
/// The value of [source][crate::model::DataSource::source]
/// if it holds a `Entity`, `None` if the field is not set or
/// holds a different branch.
pub fn entity(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::data_source::Source::Entity(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [source][crate::model::DataSource::source]
/// to hold a `Entity`.
///
/// Note that all the setters affecting `source` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataSource;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let entity_id = "entity_id";
/// let x = DataSource::new().set_entity(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"));
/// assert!(x.entity().is_some());
/// assert!(x.resource().is_none());
/// ```
pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source =
std::option::Option::Some(crate::model::data_source::Source::Entity(v.into()));
self
}
/// The value of [source][crate::model::DataSource::source]
/// if it holds a `Resource`, `None` if the field is not set or
/// holds a different branch.
pub fn resource(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::data_source::Source::Resource(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [source][crate::model::DataSource::source]
/// to hold a `Resource`.
///
/// Note that all the setters affecting `source` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataSource;
/// let x = DataSource::new().set_resource("example");
/// assert!(x.resource().is_some());
/// assert!(x.entity().is_none());
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source =
std::option::Option::Some(crate::model::data_source::Source::Resource(v.into()));
self
}
}
impl wkt::message::Message for DataSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataSource"
}
}
/// Defines additional types related to [DataSource].
pub mod data_source {
#[allow(unused_imports)]
use super::*;
/// The source is required and immutable. Once it is set, it cannot be change
/// to others.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
/// Immutable. The Dataplex Universal Catalog entity that represents the data
/// source (e.g. BigQuery table) for DataScan, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`.
Entity(std::string::String),
/// Immutable. The service-qualified full resource name of the cloud resource
/// for a DataScan job to scan against. The field could either be: Cloud
/// Storage bucket for DataDiscoveryScan Format:
/// //storage.googleapis.com/projects/PROJECT_ID/buckets/BUCKET_ID
/// or
/// BigQuery table of type "TABLE" for
/// DataProfileScan/DataQualityScan/DataDocumentationScan
/// Format:
/// //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
/// or
/// BigQuery dataset for DataDocumentationScan only
/// Format:
/// //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID
Resource(std::string::String),
}
}
/// The data scanned during processing (e.g. in incremental DataScan)
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScannedData {
/// The range of scanned data
pub data_range: std::option::Option<crate::model::scanned_data::DataRange>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScannedData {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_range][crate::model::ScannedData::data_range].
///
/// Note that all the setters affecting `data_range` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ScannedData;
/// use google_cloud_dataplex_v1::model::scanned_data::IncrementalField;
/// let x = ScannedData::new().set_data_range(Some(
/// google_cloud_dataplex_v1::model::scanned_data::DataRange::IncrementalField(IncrementalField::default().into())));
/// ```
pub fn set_data_range<
T: std::convert::Into<std::option::Option<crate::model::scanned_data::DataRange>>,
>(
mut self,
v: T,
) -> Self {
self.data_range = v.into();
self
}
/// The value of [data_range][crate::model::ScannedData::data_range]
/// if it holds a `IncrementalField`, `None` if the field is not set or
/// holds a different branch.
pub fn incremental_field(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::scanned_data::IncrementalField>> {
#[allow(unreachable_patterns)]
self.data_range.as_ref().and_then(|v| match v {
crate::model::scanned_data::DataRange::IncrementalField(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [data_range][crate::model::ScannedData::data_range]
/// to hold a `IncrementalField`.
///
/// Note that all the setters affecting `data_range` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ScannedData;
/// use google_cloud_dataplex_v1::model::scanned_data::IncrementalField;
/// let x = ScannedData::new().set_incremental_field(IncrementalField::default()/* use setters */);
/// assert!(x.incremental_field().is_some());
/// ```
pub fn set_incremental_field<
T: std::convert::Into<std::boxed::Box<crate::model::scanned_data::IncrementalField>>,
>(
mut self,
v: T,
) -> Self {
self.data_range = std::option::Option::Some(
crate::model::scanned_data::DataRange::IncrementalField(v.into()),
);
self
}
}
impl wkt::message::Message for ScannedData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ScannedData"
}
}
/// Defines additional types related to [ScannedData].
pub mod scanned_data {
#[allow(unused_imports)]
use super::*;
/// A data range denoted by a pair of start/end values of a field.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IncrementalField {
/// Output only. The field that contains values which monotonically increases
/// over time (e.g. a timestamp column).
pub field: std::string::String,
/// Output only. Value that marks the start of the range.
pub start: std::string::String,
/// Output only. Value that marks the end of the range.
pub end: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IncrementalField {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [field][crate::model::scanned_data::IncrementalField::field].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::scanned_data::IncrementalField;
/// let x = IncrementalField::new().set_field("example");
/// ```
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
/// Sets the value of [start][crate::model::scanned_data::IncrementalField::start].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::scanned_data::IncrementalField;
/// let x = IncrementalField::new().set_start("example");
/// ```
pub fn set_start<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.start = v.into();
self
}
/// Sets the value of [end][crate::model::scanned_data::IncrementalField::end].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::scanned_data::IncrementalField;
/// let x = IncrementalField::new().set_end("example");
/// ```
pub fn set_end<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.end = v.into();
self
}
}
impl wkt::message::Message for IncrementalField {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ScannedData.IncrementalField"
}
}
/// The range of scanned data
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataRange {
/// The range denoted by values of an incremental field
IncrementalField(std::boxed::Box<crate::model::scanned_data::IncrementalField>),
}
}
/// A lake is a centralized repository for managing enterprise data across the
/// organization distributed across many cloud projects, and stored in a variety
/// of storage services such as Google Cloud Storage and BigQuery. The resources
/// attached to a lake are referred to as managed resources. Data within these
/// managed resources can be structured or unstructured. A lake provides data
/// admins with tools to organize, secure and manage their data at scale, and
/// provides data scientists and data engineers an integrated experience to
/// easily search, discover, analyze and transform data and associated metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Lake {
/// Output only. The relative resource name of the lake, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub name: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Output only. System generated globally unique ID for the lake. This ID will
/// be different if the lake is deleted and re-created with the same name.
pub uid: std::string::String,
/// Output only. The time when the lake was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the lake was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User-defined labels for the lake.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Description of the lake.
pub description: std::string::String,
/// Output only. Current state of the lake.
pub state: crate::model::State,
/// Output only. Service account associated with this lake. This service
/// account must be authorized to access or operate on resources managed by the
/// lake.
pub service_account: std::string::String,
/// Optional. Settings to manage lake and Dataproc Metastore service instance
/// association.
pub metastore: std::option::Option<crate::model::lake::Metastore>,
/// Output only. Aggregated status of the underlying assets of the lake.
pub asset_status: std::option::Option<crate::model::AssetStatus>,
/// Output only. Metastore status of the lake.
pub metastore_status: std::option::Option<crate::model::lake::MetastoreStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Lake {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Lake::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = Lake::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [display_name][crate::model::Lake::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// let x = Lake::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [uid][crate::model::Lake::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// let x = Lake::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::Lake::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use wkt::Timestamp;
/// let x = Lake::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Lake::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use wkt::Timestamp;
/// let x = Lake::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Lake::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Lake::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use wkt::Timestamp;
/// let x = Lake::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Lake::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use wkt::Timestamp;
/// let x = Lake::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Lake::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::Lake::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// let x = Lake::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [description][crate::model::Lake::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// let x = Lake::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [state][crate::model::Lake::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = Lake::new().set_state(State::Active);
/// let x1 = Lake::new().set_state(State::Creating);
/// let x2 = Lake::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [service_account][crate::model::Lake::service_account].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// let x = Lake::new().set_service_account("example");
/// ```
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
/// Sets the value of [metastore][crate::model::Lake::metastore].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::lake::Metastore;
/// let x = Lake::new().set_metastore(Metastore::default()/* use setters */);
/// ```
pub fn set_metastore<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::lake::Metastore>,
{
self.metastore = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [metastore][crate::model::Lake::metastore].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::lake::Metastore;
/// let x = Lake::new().set_or_clear_metastore(Some(Metastore::default()/* use setters */));
/// let x = Lake::new().set_or_clear_metastore(None::<Metastore>);
/// ```
pub fn set_or_clear_metastore<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::lake::Metastore>,
{
self.metastore = v.map(|x| x.into());
self
}
/// Sets the value of [asset_status][crate::model::Lake::asset_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::AssetStatus;
/// let x = Lake::new().set_asset_status(AssetStatus::default()/* use setters */);
/// ```
pub fn set_asset_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AssetStatus>,
{
self.asset_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [asset_status][crate::model::Lake::asset_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::AssetStatus;
/// let x = Lake::new().set_or_clear_asset_status(Some(AssetStatus::default()/* use setters */));
/// let x = Lake::new().set_or_clear_asset_status(None::<AssetStatus>);
/// ```
pub fn set_or_clear_asset_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AssetStatus>,
{
self.asset_status = v.map(|x| x.into());
self
}
/// Sets the value of [metastore_status][crate::model::Lake::metastore_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// let x = Lake::new().set_metastore_status(MetastoreStatus::default()/* use setters */);
/// ```
pub fn set_metastore_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::lake::MetastoreStatus>,
{
self.metastore_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [metastore_status][crate::model::Lake::metastore_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Lake;
/// use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// let x = Lake::new().set_or_clear_metastore_status(Some(MetastoreStatus::default()/* use setters */));
/// let x = Lake::new().set_or_clear_metastore_status(None::<MetastoreStatus>);
/// ```
pub fn set_or_clear_metastore_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::lake::MetastoreStatus>,
{
self.metastore_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Lake {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Lake"
}
}
/// Defines additional types related to [Lake].
pub mod lake {
#[allow(unused_imports)]
use super::*;
/// Settings to manage association of Dataproc Metastore with a lake.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Metastore {
/// Optional. A relative reference to the Dataproc Metastore
/// (<https://cloud.google.com/dataproc-metastore/docs>) service associated
/// with the lake:
/// `projects/{project_id}/locations/{location_id}/services/{service_id}`
pub service: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Metastore {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [service][crate::model::lake::Metastore::service].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::lake::Metastore;
/// let x = Metastore::new().set_service("example");
/// ```
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
}
impl wkt::message::Message for Metastore {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Lake.Metastore"
}
}
/// Status of Lake and Dataproc Metastore service instance association.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetastoreStatus {
/// Current state of association.
pub state: crate::model::lake::metastore_status::State,
/// Additional information about the current status.
pub message: std::string::String,
/// Last update time of the metastore status of the lake.
pub update_time: std::option::Option<wkt::Timestamp>,
/// The URI of the endpoint used to access the Metastore service.
pub endpoint: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetastoreStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::lake::MetastoreStatus::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// use google_cloud_dataplex_v1::model::lake::metastore_status::State;
/// let x0 = MetastoreStatus::new().set_state(State::None);
/// let x1 = MetastoreStatus::new().set_state(State::Ready);
/// let x2 = MetastoreStatus::new().set_state(State::Updating);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::lake::metastore_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::lake::MetastoreStatus::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// let x = MetastoreStatus::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [update_time][crate::model::lake::MetastoreStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// use wkt::Timestamp;
/// let x = MetastoreStatus::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::lake::MetastoreStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// use wkt::Timestamp;
/// let x = MetastoreStatus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = MetastoreStatus::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [endpoint][crate::model::lake::MetastoreStatus::endpoint].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::lake::MetastoreStatus;
/// let x = MetastoreStatus::new().set_endpoint("example");
/// ```
pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.endpoint = v.into();
self
}
}
impl wkt::message::Message for MetastoreStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Lake.MetastoreStatus"
}
}
/// Defines additional types related to [MetastoreStatus].
pub mod metastore_status {
#[allow(unused_imports)]
use super::*;
/// Current state of association.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// Unspecified.
Unspecified,
/// A Metastore service instance is not associated with the lake.
None,
/// A Metastore service instance is attached to the lake.
Ready,
/// Attach/detach is in progress.
Updating,
/// Attach/detach could not be done due to errors.
Error,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::None => std::option::Option::Some(1),
Self::Ready => std::option::Option::Some(2),
Self::Updating => std::option::Option::Some(3),
Self::Error => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::None => std::option::Option::Some("NONE"),
Self::Ready => std::option::Option::Some("READY"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::Ready,
3 => Self::Updating,
4 => Self::Error,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"NONE" => Self::None,
"READY" => Self::Ready,
"UPDATING" => Self::Updating,
"ERROR" => Self::Error,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::None => serializer.serialize_i32(1),
Self::Ready => serializer.serialize_i32(2),
Self::Updating => serializer.serialize_i32(3),
Self::Error => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.Lake.MetastoreStatus.State",
))
}
}
}
}
/// Aggregated status of the underlying assets of a lake or zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssetStatus {
/// Last update time of the status.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Number of active assets.
pub active_assets: i32,
/// Number of assets that are in process of updating the security policy on
/// attached resources.
pub security_policy_applying_assets: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssetStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_time][crate::model::AssetStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AssetStatus;
/// use wkt::Timestamp;
/// let x = AssetStatus::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::AssetStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AssetStatus;
/// use wkt::Timestamp;
/// let x = AssetStatus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = AssetStatus::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [active_assets][crate::model::AssetStatus::active_assets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AssetStatus;
/// let x = AssetStatus::new().set_active_assets(42);
/// ```
pub fn set_active_assets<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.active_assets = v.into();
self
}
/// Sets the value of [security_policy_applying_assets][crate::model::AssetStatus::security_policy_applying_assets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::AssetStatus;
/// let x = AssetStatus::new().set_security_policy_applying_assets(42);
/// ```
pub fn set_security_policy_applying_assets<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.security_policy_applying_assets = v.into();
self
}
}
impl wkt::message::Message for AssetStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.AssetStatus"
}
}
/// A zone represents a logical group of related assets within a lake. A zone can
/// be used to map to organizational structure or represent stages of data
/// readiness from raw to curated. It provides managing behavior that is shared
/// or inherited by all contained assets.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Zone {
/// Output only. The relative resource name of the zone, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub name: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Output only. System generated globally unique ID for the zone. This ID will
/// be different if the zone is deleted and re-created with the same name.
pub uid: std::string::String,
/// Output only. The time when the zone was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the zone was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User defined labels for the zone.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Description of the zone.
pub description: std::string::String,
/// Output only. Current state of the zone.
pub state: crate::model::State,
/// Required. Immutable. The type of the zone.
pub r#type: crate::model::zone::Type,
/// Optional. Specification of the discovery feature applied to data in this
/// zone.
pub discovery_spec: std::option::Option<crate::model::zone::DiscoverySpec>,
/// Required. Specification of the resources that are referenced by the assets
/// within this zone.
pub resource_spec: std::option::Option<crate::model::zone::ResourceSpec>,
/// Output only. Aggregated status of the underlying assets of the zone.
pub asset_status: std::option::Option<crate::model::AssetStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Zone {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Zone::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = Zone::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [display_name][crate::model::Zone::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// let x = Zone::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [uid][crate::model::Zone::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// let x = Zone::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::Zone::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use wkt::Timestamp;
/// let x = Zone::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Zone::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use wkt::Timestamp;
/// let x = Zone::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Zone::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Zone::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use wkt::Timestamp;
/// let x = Zone::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Zone::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use wkt::Timestamp;
/// let x = Zone::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Zone::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::Zone::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// let x = Zone::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [description][crate::model::Zone::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// let x = Zone::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [state][crate::model::Zone::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = Zone::new().set_state(State::Active);
/// let x1 = Zone::new().set_state(State::Creating);
/// let x2 = Zone::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [r#type][crate::model::Zone::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::zone::Type;
/// let x0 = Zone::new().set_type(Type::Raw);
/// let x1 = Zone::new().set_type(Type::Curated);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::zone::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [discovery_spec][crate::model::Zone::discovery_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// let x = Zone::new().set_discovery_spec(DiscoverySpec::default()/* use setters */);
/// ```
pub fn set_discovery_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::zone::DiscoverySpec>,
{
self.discovery_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [discovery_spec][crate::model::Zone::discovery_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// let x = Zone::new().set_or_clear_discovery_spec(Some(DiscoverySpec::default()/* use setters */));
/// let x = Zone::new().set_or_clear_discovery_spec(None::<DiscoverySpec>);
/// ```
pub fn set_or_clear_discovery_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::zone::DiscoverySpec>,
{
self.discovery_spec = v.map(|x| x.into());
self
}
/// Sets the value of [resource_spec][crate::model::Zone::resource_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::zone::ResourceSpec;
/// let x = Zone::new().set_resource_spec(ResourceSpec::default()/* use setters */);
/// ```
pub fn set_resource_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::zone::ResourceSpec>,
{
self.resource_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [resource_spec][crate::model::Zone::resource_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::zone::ResourceSpec;
/// let x = Zone::new().set_or_clear_resource_spec(Some(ResourceSpec::default()/* use setters */));
/// let x = Zone::new().set_or_clear_resource_spec(None::<ResourceSpec>);
/// ```
pub fn set_or_clear_resource_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::zone::ResourceSpec>,
{
self.resource_spec = v.map(|x| x.into());
self
}
/// Sets the value of [asset_status][crate::model::Zone::asset_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::AssetStatus;
/// let x = Zone::new().set_asset_status(AssetStatus::default()/* use setters */);
/// ```
pub fn set_asset_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AssetStatus>,
{
self.asset_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [asset_status][crate::model::Zone::asset_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Zone;
/// use google_cloud_dataplex_v1::model::AssetStatus;
/// let x = Zone::new().set_or_clear_asset_status(Some(AssetStatus::default()/* use setters */));
/// let x = Zone::new().set_or_clear_asset_status(None::<AssetStatus>);
/// ```
pub fn set_or_clear_asset_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AssetStatus>,
{
self.asset_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Zone {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Zone"
}
}
/// Defines additional types related to [Zone].
pub mod zone {
#[allow(unused_imports)]
use super::*;
/// Settings for resources attached as assets within a zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceSpec {
/// Required. Immutable. The location type of the resources that are allowed
/// to be attached to the assets within this zone.
pub location_type: crate::model::zone::resource_spec::LocationType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [location_type][crate::model::zone::ResourceSpec::location_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::ResourceSpec;
/// use google_cloud_dataplex_v1::model::zone::resource_spec::LocationType;
/// let x0 = ResourceSpec::new().set_location_type(LocationType::SingleRegion);
/// let x1 = ResourceSpec::new().set_location_type(LocationType::MultiRegion);
/// ```
pub fn set_location_type<
T: std::convert::Into<crate::model::zone::resource_spec::LocationType>,
>(
mut self,
v: T,
) -> Self {
self.location_type = v.into();
self
}
}
impl wkt::message::Message for ResourceSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Zone.ResourceSpec"
}
}
/// Defines additional types related to [ResourceSpec].
pub mod resource_spec {
#[allow(unused_imports)]
use super::*;
/// Location type of the resources attached to a zone.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LocationType {
/// Unspecified location type.
Unspecified,
/// Resources that are associated with a single region.
SingleRegion,
/// Resources that are associated with a multi-region location.
MultiRegion,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [LocationType::value] or
/// [LocationType::name].
UnknownValue(location_type::UnknownValue),
}
#[doc(hidden)]
pub mod location_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LocationType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SingleRegion => std::option::Option::Some(1),
Self::MultiRegion => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LOCATION_TYPE_UNSPECIFIED"),
Self::SingleRegion => std::option::Option::Some("SINGLE_REGION"),
Self::MultiRegion => std::option::Option::Some("MULTI_REGION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LocationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LocationType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LocationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SingleRegion,
2 => Self::MultiRegion,
_ => Self::UnknownValue(location_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LocationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LOCATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"SINGLE_REGION" => Self::SingleRegion,
"MULTI_REGION" => Self::MultiRegion,
_ => Self::UnknownValue(location_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LocationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::SingleRegion => serializer.serialize_i32(1),
Self::MultiRegion => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LocationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationType>::new(
".google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType",
))
}
}
}
/// Settings to manage the metadata discovery and publishing in a zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoverySpec {
/// Required. Whether discovery is enabled.
pub enabled: bool,
/// Optional. The list of patterns to apply for selecting data to include
/// during discovery if only a subset of the data should considered. For
/// Cloud Storage bucket assets, these are interpreted as glob patterns used
/// to match object names. For BigQuery dataset assets, these are interpreted
/// as patterns to match table names.
pub include_patterns: std::vec::Vec<std::string::String>,
/// Optional. The list of patterns to apply for selecting data to exclude
/// during discovery. For Cloud Storage bucket assets, these are interpreted
/// as glob patterns used to match object names. For BigQuery dataset assets,
/// these are interpreted as patterns to match table names.
pub exclude_patterns: std::vec::Vec<std::string::String>,
/// Optional. Configuration for CSV data.
pub csv_options: std::option::Option<crate::model::zone::discovery_spec::CsvOptions>,
/// Optional. Configuration for Json data.
pub json_options: std::option::Option<crate::model::zone::discovery_spec::JsonOptions>,
/// Determines when discovery is triggered.
pub trigger: std::option::Option<crate::model::zone::discovery_spec::Trigger>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiscoverySpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [enabled][crate::model::zone::DiscoverySpec::enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// let x = DiscoverySpec::new().set_enabled(true);
/// ```
pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
/// Sets the value of [include_patterns][crate::model::zone::DiscoverySpec::include_patterns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// let x = DiscoverySpec::new().set_include_patterns(["a", "b", "c"]);
/// ```
pub fn set_include_patterns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_patterns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [exclude_patterns][crate::model::zone::DiscoverySpec::exclude_patterns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// let x = DiscoverySpec::new().set_exclude_patterns(["a", "b", "c"]);
/// ```
pub fn set_exclude_patterns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_patterns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [csv_options][crate::model::zone::DiscoverySpec::csv_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::zone::discovery_spec::CsvOptions;
/// let x = DiscoverySpec::new().set_csv_options(CsvOptions::default()/* use setters */);
/// ```
pub fn set_csv_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::zone::discovery_spec::CsvOptions>,
{
self.csv_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [csv_options][crate::model::zone::DiscoverySpec::csv_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::zone::discovery_spec::CsvOptions;
/// let x = DiscoverySpec::new().set_or_clear_csv_options(Some(CsvOptions::default()/* use setters */));
/// let x = DiscoverySpec::new().set_or_clear_csv_options(None::<CsvOptions>);
/// ```
pub fn set_or_clear_csv_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::zone::discovery_spec::CsvOptions>,
{
self.csv_options = v.map(|x| x.into());
self
}
/// Sets the value of [json_options][crate::model::zone::DiscoverySpec::json_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::zone::discovery_spec::JsonOptions;
/// let x = DiscoverySpec::new().set_json_options(JsonOptions::default()/* use setters */);
/// ```
pub fn set_json_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::zone::discovery_spec::JsonOptions>,
{
self.json_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [json_options][crate::model::zone::DiscoverySpec::json_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::zone::discovery_spec::JsonOptions;
/// let x = DiscoverySpec::new().set_or_clear_json_options(Some(JsonOptions::default()/* use setters */));
/// let x = DiscoverySpec::new().set_or_clear_json_options(None::<JsonOptions>);
/// ```
pub fn set_or_clear_json_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::zone::discovery_spec::JsonOptions>,
{
self.json_options = v.map(|x| x.into());
self
}
/// Sets the value of [trigger][crate::model::zone::DiscoverySpec::trigger].
///
/// Note that all the setters affecting `trigger` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::zone::discovery_spec::Trigger;
/// let x = DiscoverySpec::new().set_trigger(Some(Trigger::Schedule("example".to_string())));
/// ```
pub fn set_trigger<
T: std::convert::Into<std::option::Option<crate::model::zone::discovery_spec::Trigger>>,
>(
mut self,
v: T,
) -> Self {
self.trigger = v.into();
self
}
/// The value of [trigger][crate::model::zone::DiscoverySpec::trigger]
/// if it holds a `Schedule`, `None` if the field is not set or
/// holds a different branch.
pub fn schedule(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.trigger.as_ref().and_then(|v| match v {
crate::model::zone::discovery_spec::Trigger::Schedule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [trigger][crate::model::zone::DiscoverySpec::trigger]
/// to hold a `Schedule`.
///
/// Note that all the setters affecting `trigger` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::DiscoverySpec;
/// let x = DiscoverySpec::new().set_schedule("example");
/// assert!(x.schedule().is_some());
/// ```
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trigger = std::option::Option::Some(
crate::model::zone::discovery_spec::Trigger::Schedule(v.into()),
);
self
}
}
impl wkt::message::Message for DiscoverySpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Zone.DiscoverySpec"
}
}
/// Defines additional types related to [DiscoverySpec].
pub mod discovery_spec {
#[allow(unused_imports)]
use super::*;
/// Describe CSV and similar semi-structured data formats.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CsvOptions {
/// Optional. The number of rows to interpret as header rows that should be
/// skipped when reading data rows.
pub header_rows: i32,
/// Optional. The delimiter being used to separate values. This defaults to
/// ','.
pub delimiter: std::string::String,
/// Optional. The character encoding of the data. The default is UTF-8.
pub encoding: std::string::String,
/// Optional. Whether to disable the inference of data type for CSV data.
/// If true, all columns will be registered as strings.
pub disable_type_inference: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CsvOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [header_rows][crate::model::zone::discovery_spec::CsvOptions::header_rows].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_header_rows(42);
/// ```
pub fn set_header_rows<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.header_rows = v.into();
self
}
/// Sets the value of [delimiter][crate::model::zone::discovery_spec::CsvOptions::delimiter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_delimiter("example");
/// ```
pub fn set_delimiter<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.delimiter = v.into();
self
}
/// Sets the value of [encoding][crate::model::zone::discovery_spec::CsvOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [disable_type_inference][crate::model::zone::discovery_spec::CsvOptions::disable_type_inference].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_disable_type_inference(true);
/// ```
pub fn set_disable_type_inference<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_type_inference = v.into();
self
}
}
impl wkt::message::Message for CsvOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions"
}
}
/// Describe JSON data format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JsonOptions {
/// Optional. The character encoding of the data. The default is UTF-8.
pub encoding: std::string::String,
/// Optional. Whether to disable the inference of data type for Json data.
/// If true, all columns will be registered as their primitive types
/// (strings, number or boolean).
pub disable_type_inference: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JsonOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encoding][crate::model::zone::discovery_spec::JsonOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::discovery_spec::JsonOptions;
/// let x = JsonOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [disable_type_inference][crate::model::zone::discovery_spec::JsonOptions::disable_type_inference].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::zone::discovery_spec::JsonOptions;
/// let x = JsonOptions::new().set_disable_type_inference(true);
/// ```
pub fn set_disable_type_inference<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_type_inference = v.into();
self
}
}
impl wkt::message::Message for JsonOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions"
}
}
/// Determines when discovery is triggered.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Trigger {
/// Optional. Cron schedule (<https://en.wikipedia.org/wiki/Cron>) for
/// running discovery periodically. Successive discovery runs must be
/// scheduled at least 60 minutes apart. The default value is to run
/// discovery every 60 minutes.
///
/// To explicitly set a timezone to the cron tab, apply a prefix in the
/// cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or TZ=${IANA_TIME_ZONE}".
/// The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone
/// database. For example, `CRON_TZ=America/New_York 1 * * * *`, or
/// `TZ=America/New_York 1 * * * *`.
Schedule(std::string::String),
}
}
/// Type of zone.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Zone type not specified.
Unspecified,
/// A zone that contains data that needs further processing before it is
/// considered generally ready for consumption and analytics workloads.
Raw,
/// A zone that contains data that is considered to be ready for broader
/// consumption and analytics workloads. Curated structured data stored in
/// Cloud Storage must conform to certain file formats (parquet, avro and
/// orc) and organized in a hive-compatible directory layout.
Curated,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Raw => std::option::Option::Some(1),
Self::Curated => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Raw => std::option::Option::Some("RAW"),
Self::Curated => std::option::Option::Some("CURATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Raw,
2 => Self::Curated,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"RAW" => Self::Raw,
"CURATED" => Self::Curated,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Raw => serializer.serialize_i32(1),
Self::Curated => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.Zone.Type",
))
}
}
}
/// Action represents an issue requiring administrator action for resolution.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Action {
/// The category of issue associated with the action.
pub category: crate::model::action::Category,
/// Detailed description of the issue requiring action.
pub issue: std::string::String,
/// The time that the issue was detected.
pub detect_time: std::option::Option<wkt::Timestamp>,
/// Output only. The relative resource name of the action, of the form:
/// `projects/{project}/locations/{location}/lakes/{lake}/actions/{action}`
/// `projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action}`
/// `projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}`.
pub name: std::string::String,
/// Output only. The relative resource name of the lake, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub lake: std::string::String,
/// Output only. The relative resource name of the zone, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub zone: std::string::String,
/// Output only. The relative resource name of the asset, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`.
pub asset: std::string::String,
/// The list of data locations associated with this action. Cloud Storage
/// locations are represented as URI paths(E.g.
/// `gs://bucket/table1/year=2020/month=Jan/`). BigQuery locations refer to
/// resource names(E.g.
/// `bigquery.googleapis.com/projects/project-id/datasets/dataset-id`).
pub data_locations: std::vec::Vec<std::string::String>,
/// Additional details about the action based on the action category.
pub details: std::option::Option<crate::model::action::Details>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Action {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [category][crate::model::Action::category].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::Category;
/// let x0 = Action::new().set_category(Category::ResourceManagement);
/// let x1 = Action::new().set_category(Category::SecurityPolicy);
/// let x2 = Action::new().set_category(Category::DataDiscovery);
/// ```
pub fn set_category<T: std::convert::Into<crate::model::action::Category>>(
mut self,
v: T,
) -> Self {
self.category = v.into();
self
}
/// Sets the value of [issue][crate::model::Action::issue].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// let x = Action::new().set_issue("example");
/// ```
pub fn set_issue<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issue = v.into();
self
}
/// Sets the value of [detect_time][crate::model::Action::detect_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use wkt::Timestamp;
/// let x = Action::new().set_detect_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_detect_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.detect_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [detect_time][crate::model::Action::detect_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use wkt::Timestamp;
/// let x = Action::new().set_or_clear_detect_time(Some(Timestamp::default()/* use setters */));
/// let x = Action::new().set_or_clear_detect_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_detect_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.detect_time = v.map(|x| x.into());
self
}
/// Sets the value of [name][crate::model::Action::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let action_id = "action_id";
/// let x = Action::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/actions/{action_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [lake][crate::model::Action::lake].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = Action::new().set_lake(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_lake<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lake = v.into();
self
}
/// Sets the value of [zone][crate::model::Action::zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = Action::new().set_zone(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
/// Sets the value of [asset][crate::model::Action::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let asset_id = "asset_id";
/// let x = Action::new().set_asset(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"));
/// ```
pub fn set_asset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.asset = v.into();
self
}
/// Sets the value of [data_locations][crate::model::Action::data_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// let x = Action::new().set_data_locations(["a", "b", "c"]);
/// ```
pub fn set_data_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.data_locations = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [details][crate::model::Action::details].
///
/// Note that all the setters affecting `details` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::InvalidDataFormat;
/// let x = Action::new().set_details(Some(
/// google_cloud_dataplex_v1::model::action::Details::InvalidDataFormat(InvalidDataFormat::default().into())));
/// ```
pub fn set_details<
T: std::convert::Into<std::option::Option<crate::model::action::Details>>,
>(
mut self,
v: T,
) -> Self {
self.details = v.into();
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `InvalidDataFormat`, `None` if the field is not set or
/// holds a different branch.
pub fn invalid_data_format(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::InvalidDataFormat>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::InvalidDataFormat(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `InvalidDataFormat`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::InvalidDataFormat;
/// let x = Action::new().set_invalid_data_format(InvalidDataFormat::default()/* use setters */);
/// assert!(x.invalid_data_format().is_some());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_invalid_data_format<
T: std::convert::Into<std::boxed::Box<crate::model::action::InvalidDataFormat>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::action::Details::InvalidDataFormat(v.into()));
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `IncompatibleDataSchema`, `None` if the field is not set or
/// holds a different branch.
pub fn incompatible_data_schema(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::IncompatibleDataSchema>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::IncompatibleDataSchema(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `IncompatibleDataSchema`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::IncompatibleDataSchema;
/// let x = Action::new().set_incompatible_data_schema(IncompatibleDataSchema::default()/* use setters */);
/// assert!(x.incompatible_data_schema().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_incompatible_data_schema<
T: std::convert::Into<std::boxed::Box<crate::model::action::IncompatibleDataSchema>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::action::Details::IncompatibleDataSchema(v.into()),
);
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `InvalidDataPartition`, `None` if the field is not set or
/// holds a different branch.
pub fn invalid_data_partition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::InvalidDataPartition>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::InvalidDataPartition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `InvalidDataPartition`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::InvalidDataPartition;
/// let x = Action::new().set_invalid_data_partition(InvalidDataPartition::default()/* use setters */);
/// assert!(x.invalid_data_partition().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_invalid_data_partition<
T: std::convert::Into<std::boxed::Box<crate::model::action::InvalidDataPartition>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::action::Details::InvalidDataPartition(v.into()),
);
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `MissingData`, `None` if the field is not set or
/// holds a different branch.
pub fn missing_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::MissingData>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::MissingData(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `MissingData`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::MissingData;
/// let x = Action::new().set_missing_data(MissingData::default()/* use setters */);
/// assert!(x.missing_data().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_missing_data<
T: std::convert::Into<std::boxed::Box<crate::model::action::MissingData>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::action::Details::MissingData(v.into()));
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `MissingResource`, `None` if the field is not set or
/// holds a different branch.
pub fn missing_resource(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::MissingResource>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::MissingResource(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `MissingResource`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::MissingResource;
/// let x = Action::new().set_missing_resource(MissingResource::default()/* use setters */);
/// assert!(x.missing_resource().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_missing_resource<
T: std::convert::Into<std::boxed::Box<crate::model::action::MissingResource>>,
>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::action::Details::MissingResource(v.into()));
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `UnauthorizedResource`, `None` if the field is not set or
/// holds a different branch.
pub fn unauthorized_resource(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::UnauthorizedResource>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::UnauthorizedResource(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `UnauthorizedResource`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::UnauthorizedResource;
/// let x = Action::new().set_unauthorized_resource(UnauthorizedResource::default()/* use setters */);
/// assert!(x.unauthorized_resource().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_unauthorized_resource<
T: std::convert::Into<std::boxed::Box<crate::model::action::UnauthorizedResource>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::action::Details::UnauthorizedResource(v.into()),
);
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `FailedSecurityPolicyApply`, `None` if the field is not set or
/// holds a different branch.
pub fn failed_security_policy_apply(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::FailedSecurityPolicyApply>>
{
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::FailedSecurityPolicyApply(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `FailedSecurityPolicyApply`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::FailedSecurityPolicyApply;
/// let x = Action::new().set_failed_security_policy_apply(FailedSecurityPolicyApply::default()/* use setters */);
/// assert!(x.failed_security_policy_apply().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.invalid_data_organization().is_none());
/// ```
pub fn set_failed_security_policy_apply<
T: std::convert::Into<std::boxed::Box<crate::model::action::FailedSecurityPolicyApply>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::action::Details::FailedSecurityPolicyApply(v.into()),
);
self
}
/// The value of [details][crate::model::Action::details]
/// if it holds a `InvalidDataOrganization`, `None` if the field is not set or
/// holds a different branch.
pub fn invalid_data_organization(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::InvalidDataOrganization>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::action::Details::InvalidDataOrganization(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [details][crate::model::Action::details]
/// to hold a `InvalidDataOrganization`.
///
/// Note that all the setters affecting `details` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Action;
/// use google_cloud_dataplex_v1::model::action::InvalidDataOrganization;
/// let x = Action::new().set_invalid_data_organization(InvalidDataOrganization::default()/* use setters */);
/// assert!(x.invalid_data_organization().is_some());
/// assert!(x.invalid_data_format().is_none());
/// assert!(x.incompatible_data_schema().is_none());
/// assert!(x.invalid_data_partition().is_none());
/// assert!(x.missing_data().is_none());
/// assert!(x.missing_resource().is_none());
/// assert!(x.unauthorized_resource().is_none());
/// assert!(x.failed_security_policy_apply().is_none());
/// ```
pub fn set_invalid_data_organization<
T: std::convert::Into<std::boxed::Box<crate::model::action::InvalidDataOrganization>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::action::Details::InvalidDataOrganization(v.into()),
);
self
}
}
impl wkt::message::Message for Action {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action"
}
}
/// Defines additional types related to [Action].
pub mod action {
#[allow(unused_imports)]
use super::*;
/// Action details for resource references in assets that cannot be located.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MissingResource {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MissingResource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for MissingResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.MissingResource"
}
}
/// Action details for unauthorized resource issues raised to indicate that the
/// service account associated with the lake instance is not authorized to
/// access or manage the resource associated with an asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UnauthorizedResource {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UnauthorizedResource {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UnauthorizedResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.UnauthorizedResource"
}
}
/// Failed to apply security policy to the managed resource(s) under a
/// lake, zone or an asset. For a lake or zone resource, one or more underlying
/// assets has a failure applying security policy to the associated managed
/// resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FailedSecurityPolicyApply {
/// Resource name of one of the assets with failing security policy
/// application. Populated for a lake or zone resource only.
pub asset: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FailedSecurityPolicyApply {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [asset][crate::model::action::FailedSecurityPolicyApply::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::FailedSecurityPolicyApply;
/// let x = FailedSecurityPolicyApply::new().set_asset("example");
/// ```
pub fn set_asset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.asset = v.into();
self
}
}
impl wkt::message::Message for FailedSecurityPolicyApply {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply"
}
}
/// Action details for invalid or unsupported data files detected by discovery.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InvalidDataFormat {
/// The list of data locations sampled and used for format/schema
/// inference.
pub sampled_data_locations: std::vec::Vec<std::string::String>,
/// The expected data format of the entity.
pub expected_format: std::string::String,
/// The new unexpected data format within the entity.
pub new_format: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InvalidDataFormat {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [sampled_data_locations][crate::model::action::InvalidDataFormat::sampled_data_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::InvalidDataFormat;
/// let x = InvalidDataFormat::new().set_sampled_data_locations(["a", "b", "c"]);
/// ```
pub fn set_sampled_data_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.sampled_data_locations = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [expected_format][crate::model::action::InvalidDataFormat::expected_format].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::InvalidDataFormat;
/// let x = InvalidDataFormat::new().set_expected_format("example");
/// ```
pub fn set_expected_format<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.expected_format = v.into();
self
}
/// Sets the value of [new_format][crate::model::action::InvalidDataFormat::new_format].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::InvalidDataFormat;
/// let x = InvalidDataFormat::new().set_new_format("example");
/// ```
pub fn set_new_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_format = v.into();
self
}
}
impl wkt::message::Message for InvalidDataFormat {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.InvalidDataFormat"
}
}
/// Action details for incompatible schemas detected by discovery.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IncompatibleDataSchema {
/// The name of the table containing invalid data.
pub table: std::string::String,
/// The existing and expected schema of the table. The schema is provided as
/// a JSON formatted structure listing columns and data types.
pub existing_schema: std::string::String,
/// The new and incompatible schema within the table. The schema is provided
/// as a JSON formatted structured listing columns and data types.
pub new_schema: std::string::String,
/// The list of data locations sampled and used for format/schema
/// inference.
pub sampled_data_locations: std::vec::Vec<std::string::String>,
/// Whether the action relates to a schema that is incompatible or modified.
pub schema_change: crate::model::action::incompatible_data_schema::SchemaChange,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IncompatibleDataSchema {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [table][crate::model::action::IncompatibleDataSchema::table].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::IncompatibleDataSchema;
/// let x = IncompatibleDataSchema::new().set_table("example");
/// ```
pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table = v.into();
self
}
/// Sets the value of [existing_schema][crate::model::action::IncompatibleDataSchema::existing_schema].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::IncompatibleDataSchema;
/// let x = IncompatibleDataSchema::new().set_existing_schema("example");
/// ```
pub fn set_existing_schema<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.existing_schema = v.into();
self
}
/// Sets the value of [new_schema][crate::model::action::IncompatibleDataSchema::new_schema].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::IncompatibleDataSchema;
/// let x = IncompatibleDataSchema::new().set_new_schema("example");
/// ```
pub fn set_new_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_schema = v.into();
self
}
/// Sets the value of [sampled_data_locations][crate::model::action::IncompatibleDataSchema::sampled_data_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::IncompatibleDataSchema;
/// let x = IncompatibleDataSchema::new().set_sampled_data_locations(["a", "b", "c"]);
/// ```
pub fn set_sampled_data_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.sampled_data_locations = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [schema_change][crate::model::action::IncompatibleDataSchema::schema_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::IncompatibleDataSchema;
/// use google_cloud_dataplex_v1::model::action::incompatible_data_schema::SchemaChange;
/// let x0 = IncompatibleDataSchema::new().set_schema_change(SchemaChange::Incompatible);
/// let x1 = IncompatibleDataSchema::new().set_schema_change(SchemaChange::Modified);
/// ```
pub fn set_schema_change<
T: std::convert::Into<crate::model::action::incompatible_data_schema::SchemaChange>,
>(
mut self,
v: T,
) -> Self {
self.schema_change = v.into();
self
}
}
impl wkt::message::Message for IncompatibleDataSchema {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.IncompatibleDataSchema"
}
}
/// Defines additional types related to [IncompatibleDataSchema].
pub mod incompatible_data_schema {
#[allow(unused_imports)]
use super::*;
/// Whether the action relates to a schema that is incompatible or modified.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SchemaChange {
/// Schema change unspecified.
Unspecified,
/// Newly discovered schema is incompatible with existing schema.
Incompatible,
/// Newly discovered schema has changed from existing schema for data in a
/// curated zone.
Modified,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [SchemaChange::value] or
/// [SchemaChange::name].
UnknownValue(schema_change::UnknownValue),
}
#[doc(hidden)]
pub mod schema_change {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SchemaChange {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Incompatible => std::option::Option::Some(1),
Self::Modified => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SCHEMA_CHANGE_UNSPECIFIED"),
Self::Incompatible => std::option::Option::Some("INCOMPATIBLE"),
Self::Modified => std::option::Option::Some("MODIFIED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SchemaChange {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SchemaChange {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SchemaChange {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Incompatible,
2 => Self::Modified,
_ => Self::UnknownValue(schema_change::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SchemaChange {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SCHEMA_CHANGE_UNSPECIFIED" => Self::Unspecified,
"INCOMPATIBLE" => Self::Incompatible,
"MODIFIED" => Self::Modified,
_ => Self::UnknownValue(schema_change::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SchemaChange {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Incompatible => serializer.serialize_i32(1),
Self::Modified => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SchemaChange {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaChange>::new(
".google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange",
))
}
}
}
/// Action details for invalid or unsupported partitions detected by discovery.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InvalidDataPartition {
/// The issue type of InvalidDataPartition.
pub expected_structure: crate::model::action::invalid_data_partition::PartitionStructure,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InvalidDataPartition {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [expected_structure][crate::model::action::InvalidDataPartition::expected_structure].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::action::InvalidDataPartition;
/// use google_cloud_dataplex_v1::model::action::invalid_data_partition::PartitionStructure;
/// let x0 = InvalidDataPartition::new().set_expected_structure(PartitionStructure::ConsistentKeys);
/// let x1 = InvalidDataPartition::new().set_expected_structure(PartitionStructure::HiveStyleKeys);
/// ```
pub fn set_expected_structure<
T: std::convert::Into<crate::model::action::invalid_data_partition::PartitionStructure>,
>(
mut self,
v: T,
) -> Self {
self.expected_structure = v.into();
self
}
}
impl wkt::message::Message for InvalidDataPartition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.InvalidDataPartition"
}
}
/// Defines additional types related to [InvalidDataPartition].
pub mod invalid_data_partition {
#[allow(unused_imports)]
use super::*;
/// The expected partition structure.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PartitionStructure {
/// PartitionStructure unspecified.
Unspecified,
/// Consistent hive-style partition definition (both raw and curated zone).
ConsistentKeys,
/// Hive style partition definition (curated zone only).
HiveStyleKeys,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [PartitionStructure::value] or
/// [PartitionStructure::name].
UnknownValue(partition_structure::UnknownValue),
}
#[doc(hidden)]
pub mod partition_structure {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PartitionStructure {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ConsistentKeys => std::option::Option::Some(1),
Self::HiveStyleKeys => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("PARTITION_STRUCTURE_UNSPECIFIED")
}
Self::ConsistentKeys => std::option::Option::Some("CONSISTENT_KEYS"),
Self::HiveStyleKeys => std::option::Option::Some("HIVE_STYLE_KEYS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PartitionStructure {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PartitionStructure {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PartitionStructure {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ConsistentKeys,
2 => Self::HiveStyleKeys,
_ => Self::UnknownValue(partition_structure::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PartitionStructure {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PARTITION_STRUCTURE_UNSPECIFIED" => Self::Unspecified,
"CONSISTENT_KEYS" => Self::ConsistentKeys,
"HIVE_STYLE_KEYS" => Self::HiveStyleKeys,
_ => Self::UnknownValue(partition_structure::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PartitionStructure {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ConsistentKeys => serializer.serialize_i32(1),
Self::HiveStyleKeys => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PartitionStructure {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartitionStructure>::new(
".google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure",
))
}
}
}
/// Action details for absence of data detected by discovery.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MissingData {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MissingData {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for MissingData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.MissingData"
}
}
/// Action details for invalid data arrangement.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InvalidDataOrganization {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InvalidDataOrganization {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for InvalidDataOrganization {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Action.InvalidDataOrganization"
}
}
/// The category of issues.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Category {
/// Unspecified category.
Unspecified,
/// Resource management related issues.
ResourceManagement,
/// Security policy related issues.
SecurityPolicy,
/// Data and discovery related issues.
DataDiscovery,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Category::value] or
/// [Category::name].
UnknownValue(category::UnknownValue),
}
#[doc(hidden)]
pub mod category {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Category {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ResourceManagement => std::option::Option::Some(1),
Self::SecurityPolicy => std::option::Option::Some(2),
Self::DataDiscovery => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
Self::ResourceManagement => std::option::Option::Some("RESOURCE_MANAGEMENT"),
Self::SecurityPolicy => std::option::Option::Some("SECURITY_POLICY"),
Self::DataDiscovery => std::option::Option::Some("DATA_DISCOVERY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Category {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Category {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Category {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ResourceManagement,
2 => Self::SecurityPolicy,
3 => Self::DataDiscovery,
_ => Self::UnknownValue(category::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Category {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CATEGORY_UNSPECIFIED" => Self::Unspecified,
"RESOURCE_MANAGEMENT" => Self::ResourceManagement,
"SECURITY_POLICY" => Self::SecurityPolicy,
"DATA_DISCOVERY" => Self::DataDiscovery,
_ => Self::UnknownValue(category::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Category {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ResourceManagement => serializer.serialize_i32(1),
Self::SecurityPolicy => serializer.serialize_i32(2),
Self::DataDiscovery => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Category {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
".google.cloud.dataplex.v1.Action.Category",
))
}
}
/// Additional details about the action based on the action category.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Details {
/// Details for issues related to invalid or unsupported data formats.
InvalidDataFormat(std::boxed::Box<crate::model::action::InvalidDataFormat>),
/// Details for issues related to incompatible schemas detected within data.
IncompatibleDataSchema(std::boxed::Box<crate::model::action::IncompatibleDataSchema>),
/// Details for issues related to invalid or unsupported data partition
/// structure.
InvalidDataPartition(std::boxed::Box<crate::model::action::InvalidDataPartition>),
/// Details for issues related to absence of data within managed resources.
MissingData(std::boxed::Box<crate::model::action::MissingData>),
/// Details for issues related to absence of a managed resource.
MissingResource(std::boxed::Box<crate::model::action::MissingResource>),
/// Details for issues related to lack of permissions to access data
/// resources.
UnauthorizedResource(std::boxed::Box<crate::model::action::UnauthorizedResource>),
/// Details for issues related to applying security policy.
FailedSecurityPolicyApply(std::boxed::Box<crate::model::action::FailedSecurityPolicyApply>),
/// Details for issues related to invalid data arrangement.
InvalidDataOrganization(std::boxed::Box<crate::model::action::InvalidDataOrganization>),
}
}
/// An asset represents a cloud resource that is being managed within a lake as a
/// member of a zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Asset {
/// Output only. The relative resource name of the asset, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`.
pub name: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Output only. System generated globally unique ID for the asset. This ID
/// will be different if the asset is deleted and re-created with the same
/// name.
pub uid: std::string::String,
/// Output only. The time when the asset was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the asset was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. User defined labels for the asset.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Description of the asset.
pub description: std::string::String,
/// Output only. Current state of the asset.
pub state: crate::model::State,
/// Required. Specification of the resource that is referenced by this asset.
pub resource_spec: std::option::Option<crate::model::asset::ResourceSpec>,
/// Output only. Status of the resource referenced by this asset.
pub resource_status: std::option::Option<crate::model::asset::ResourceStatus>,
/// Output only. Status of the security policy applied to resource referenced
/// by this asset.
pub security_status: std::option::Option<crate::model::asset::SecurityStatus>,
/// Optional. Specification of the discovery feature applied to data referenced
/// by this asset. When this spec is left unset, the asset will use the spec
/// set on the parent zone.
pub discovery_spec: std::option::Option<crate::model::asset::DiscoverySpec>,
/// Output only. Status of the discovery feature applied to data referenced by
/// this asset.
pub discovery_status: std::option::Option<crate::model::asset::DiscoveryStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Asset {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Asset::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let asset_id = "asset_id";
/// let x = Asset::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [display_name][crate::model::Asset::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// let x = Asset::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [uid][crate::model::Asset::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// let x = Asset::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::Asset::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use wkt::Timestamp;
/// let x = Asset::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Asset::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use wkt::Timestamp;
/// let x = Asset::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Asset::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Asset::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use wkt::Timestamp;
/// let x = Asset::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Asset::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use wkt::Timestamp;
/// let x = Asset::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Asset::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::Asset::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// let x = Asset::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [description][crate::model::Asset::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// let x = Asset::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [state][crate::model::Asset::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = Asset::new().set_state(State::Active);
/// let x1 = Asset::new().set_state(State::Creating);
/// let x2 = Asset::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [resource_spec][crate::model::Asset::resource_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::ResourceSpec;
/// let x = Asset::new().set_resource_spec(ResourceSpec::default()/* use setters */);
/// ```
pub fn set_resource_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::ResourceSpec>,
{
self.resource_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [resource_spec][crate::model::Asset::resource_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::ResourceSpec;
/// let x = Asset::new().set_or_clear_resource_spec(Some(ResourceSpec::default()/* use setters */));
/// let x = Asset::new().set_or_clear_resource_spec(None::<ResourceSpec>);
/// ```
pub fn set_or_clear_resource_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::ResourceSpec>,
{
self.resource_spec = v.map(|x| x.into());
self
}
/// Sets the value of [resource_status][crate::model::Asset::resource_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// let x = Asset::new().set_resource_status(ResourceStatus::default()/* use setters */);
/// ```
pub fn set_resource_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::ResourceStatus>,
{
self.resource_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [resource_status][crate::model::Asset::resource_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// let x = Asset::new().set_or_clear_resource_status(Some(ResourceStatus::default()/* use setters */));
/// let x = Asset::new().set_or_clear_resource_status(None::<ResourceStatus>);
/// ```
pub fn set_or_clear_resource_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::ResourceStatus>,
{
self.resource_status = v.map(|x| x.into());
self
}
/// Sets the value of [security_status][crate::model::Asset::security_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::SecurityStatus;
/// let x = Asset::new().set_security_status(SecurityStatus::default()/* use setters */);
/// ```
pub fn set_security_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::SecurityStatus>,
{
self.security_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [security_status][crate::model::Asset::security_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::SecurityStatus;
/// let x = Asset::new().set_or_clear_security_status(Some(SecurityStatus::default()/* use setters */));
/// let x = Asset::new().set_or_clear_security_status(None::<SecurityStatus>);
/// ```
pub fn set_or_clear_security_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::SecurityStatus>,
{
self.security_status = v.map(|x| x.into());
self
}
/// Sets the value of [discovery_spec][crate::model::Asset::discovery_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// let x = Asset::new().set_discovery_spec(DiscoverySpec::default()/* use setters */);
/// ```
pub fn set_discovery_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::DiscoverySpec>,
{
self.discovery_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [discovery_spec][crate::model::Asset::discovery_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// let x = Asset::new().set_or_clear_discovery_spec(Some(DiscoverySpec::default()/* use setters */));
/// let x = Asset::new().set_or_clear_discovery_spec(None::<DiscoverySpec>);
/// ```
pub fn set_or_clear_discovery_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::DiscoverySpec>,
{
self.discovery_spec = v.map(|x| x.into());
self
}
/// Sets the value of [discovery_status][crate::model::Asset::discovery_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// let x = Asset::new().set_discovery_status(DiscoveryStatus::default()/* use setters */);
/// ```
pub fn set_discovery_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::DiscoveryStatus>,
{
self.discovery_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [discovery_status][crate::model::Asset::discovery_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Asset;
/// use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// let x = Asset::new().set_or_clear_discovery_status(Some(DiscoveryStatus::default()/* use setters */));
/// let x = Asset::new().set_or_clear_discovery_status(None::<DiscoveryStatus>);
/// ```
pub fn set_or_clear_discovery_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::DiscoveryStatus>,
{
self.discovery_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Asset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset"
}
}
/// Defines additional types related to [Asset].
pub mod asset {
#[allow(unused_imports)]
use super::*;
/// Security policy status of the asset. Data security policy, i.e., readers,
/// writers & owners, should be specified in the lake/zone/asset IAM policy.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityStatus {
/// The current state of the security policy applied to the attached
/// resource.
pub state: crate::model::asset::security_status::State,
/// Additional information about the current state.
pub message: std::string::String,
/// Last update time of the status.
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::asset::SecurityStatus::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::SecurityStatus;
/// use google_cloud_dataplex_v1::model::asset::security_status::State;
/// let x0 = SecurityStatus::new().set_state(State::Ready);
/// let x1 = SecurityStatus::new().set_state(State::Applying);
/// let x2 = SecurityStatus::new().set_state(State::Error);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::asset::security_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::asset::SecurityStatus::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::SecurityStatus;
/// let x = SecurityStatus::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [update_time][crate::model::asset::SecurityStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::SecurityStatus;
/// use wkt::Timestamp;
/// let x = SecurityStatus::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::asset::SecurityStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::SecurityStatus;
/// use wkt::Timestamp;
/// let x = SecurityStatus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = SecurityStatus::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SecurityStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.SecurityStatus"
}
}
/// Defines additional types related to [SecurityStatus].
pub mod security_status {
#[allow(unused_imports)]
use super::*;
/// The state of the security policy.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// State unspecified.
Unspecified,
/// Security policy has been successfully applied to the attached resource.
Ready,
/// Security policy is in the process of being applied to the attached
/// resource.
Applying,
/// Security policy could not be applied to the attached resource due to
/// errors.
Error,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ready => std::option::Option::Some(1),
Self::Applying => std::option::Option::Some(2),
Self::Error => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Ready => std::option::Option::Some("READY"),
Self::Applying => std::option::Option::Some("APPLYING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ready,
2 => Self::Applying,
3 => Self::Error,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"READY" => Self::Ready,
"APPLYING" => Self::Applying,
"ERROR" => Self::Error,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ready => serializer.serialize_i32(1),
Self::Applying => serializer.serialize_i32(2),
Self::Error => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.Asset.SecurityStatus.State",
))
}
}
}
/// Settings to manage the metadata discovery and publishing for an asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoverySpec {
/// Optional. Whether discovery is enabled.
pub enabled: bool,
/// Optional. The list of patterns to apply for selecting data to include
/// during discovery if only a subset of the data should considered. For
/// Cloud Storage bucket assets, these are interpreted as glob patterns used
/// to match object names. For BigQuery dataset assets, these are interpreted
/// as patterns to match table names.
pub include_patterns: std::vec::Vec<std::string::String>,
/// Optional. The list of patterns to apply for selecting data to exclude
/// during discovery. For Cloud Storage bucket assets, these are interpreted
/// as glob patterns used to match object names. For BigQuery dataset assets,
/// these are interpreted as patterns to match table names.
pub exclude_patterns: std::vec::Vec<std::string::String>,
/// Optional. Configuration for CSV data.
pub csv_options: std::option::Option<crate::model::asset::discovery_spec::CsvOptions>,
/// Optional. Configuration for Json data.
pub json_options: std::option::Option<crate::model::asset::discovery_spec::JsonOptions>,
/// Determines when discovery is triggered.
pub trigger: std::option::Option<crate::model::asset::discovery_spec::Trigger>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiscoverySpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [enabled][crate::model::asset::DiscoverySpec::enabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// let x = DiscoverySpec::new().set_enabled(true);
/// ```
pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
/// Sets the value of [include_patterns][crate::model::asset::DiscoverySpec::include_patterns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// let x = DiscoverySpec::new().set_include_patterns(["a", "b", "c"]);
/// ```
pub fn set_include_patterns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_patterns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [exclude_patterns][crate::model::asset::DiscoverySpec::exclude_patterns].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// let x = DiscoverySpec::new().set_exclude_patterns(["a", "b", "c"]);
/// ```
pub fn set_exclude_patterns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_patterns = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [csv_options][crate::model::asset::DiscoverySpec::csv_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::asset::discovery_spec::CsvOptions;
/// let x = DiscoverySpec::new().set_csv_options(CsvOptions::default()/* use setters */);
/// ```
pub fn set_csv_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::discovery_spec::CsvOptions>,
{
self.csv_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [csv_options][crate::model::asset::DiscoverySpec::csv_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::asset::discovery_spec::CsvOptions;
/// let x = DiscoverySpec::new().set_or_clear_csv_options(Some(CsvOptions::default()/* use setters */));
/// let x = DiscoverySpec::new().set_or_clear_csv_options(None::<CsvOptions>);
/// ```
pub fn set_or_clear_csv_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::discovery_spec::CsvOptions>,
{
self.csv_options = v.map(|x| x.into());
self
}
/// Sets the value of [json_options][crate::model::asset::DiscoverySpec::json_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::asset::discovery_spec::JsonOptions;
/// let x = DiscoverySpec::new().set_json_options(JsonOptions::default()/* use setters */);
/// ```
pub fn set_json_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::discovery_spec::JsonOptions>,
{
self.json_options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [json_options][crate::model::asset::DiscoverySpec::json_options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::asset::discovery_spec::JsonOptions;
/// let x = DiscoverySpec::new().set_or_clear_json_options(Some(JsonOptions::default()/* use setters */));
/// let x = DiscoverySpec::new().set_or_clear_json_options(None::<JsonOptions>);
/// ```
pub fn set_or_clear_json_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::discovery_spec::JsonOptions>,
{
self.json_options = v.map(|x| x.into());
self
}
/// Sets the value of [trigger][crate::model::asset::DiscoverySpec::trigger].
///
/// Note that all the setters affecting `trigger` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// use google_cloud_dataplex_v1::model::asset::discovery_spec::Trigger;
/// let x = DiscoverySpec::new().set_trigger(Some(Trigger::Schedule("example".to_string())));
/// ```
pub fn set_trigger<
T: std::convert::Into<std::option::Option<crate::model::asset::discovery_spec::Trigger>>,
>(
mut self,
v: T,
) -> Self {
self.trigger = v.into();
self
}
/// The value of [trigger][crate::model::asset::DiscoverySpec::trigger]
/// if it holds a `Schedule`, `None` if the field is not set or
/// holds a different branch.
pub fn schedule(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.trigger.as_ref().and_then(|v| match v {
crate::model::asset::discovery_spec::Trigger::Schedule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [trigger][crate::model::asset::DiscoverySpec::trigger]
/// to hold a `Schedule`.
///
/// Note that all the setters affecting `trigger` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoverySpec;
/// let x = DiscoverySpec::new().set_schedule("example");
/// assert!(x.schedule().is_some());
/// ```
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trigger = std::option::Option::Some(
crate::model::asset::discovery_spec::Trigger::Schedule(v.into()),
);
self
}
}
impl wkt::message::Message for DiscoverySpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.DiscoverySpec"
}
}
/// Defines additional types related to [DiscoverySpec].
pub mod discovery_spec {
#[allow(unused_imports)]
use super::*;
/// Describe CSV and similar semi-structured data formats.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CsvOptions {
/// Optional. The number of rows to interpret as header rows that should be
/// skipped when reading data rows.
pub header_rows: i32,
/// Optional. The delimiter being used to separate values. This defaults to
/// ','.
pub delimiter: std::string::String,
/// Optional. The character encoding of the data. The default is UTF-8.
pub encoding: std::string::String,
/// Optional. Whether to disable the inference of data type for CSV data.
/// If true, all columns will be registered as strings.
pub disable_type_inference: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CsvOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [header_rows][crate::model::asset::discovery_spec::CsvOptions::header_rows].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_header_rows(42);
/// ```
pub fn set_header_rows<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.header_rows = v.into();
self
}
/// Sets the value of [delimiter][crate::model::asset::discovery_spec::CsvOptions::delimiter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_delimiter("example");
/// ```
pub fn set_delimiter<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.delimiter = v.into();
self
}
/// Sets the value of [encoding][crate::model::asset::discovery_spec::CsvOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [disable_type_inference][crate::model::asset::discovery_spec::CsvOptions::disable_type_inference].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_spec::CsvOptions;
/// let x = CsvOptions::new().set_disable_type_inference(true);
/// ```
pub fn set_disable_type_inference<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_type_inference = v.into();
self
}
}
impl wkt::message::Message for CsvOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions"
}
}
/// Describe JSON data format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JsonOptions {
/// Optional. The character encoding of the data. The default is UTF-8.
pub encoding: std::string::String,
/// Optional. Whether to disable the inference of data type for Json data.
/// If true, all columns will be registered as their primitive types
/// (strings, number or boolean).
pub disable_type_inference: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JsonOptions {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [encoding][crate::model::asset::discovery_spec::JsonOptions::encoding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_spec::JsonOptions;
/// let x = JsonOptions::new().set_encoding("example");
/// ```
pub fn set_encoding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
/// Sets the value of [disable_type_inference][crate::model::asset::discovery_spec::JsonOptions::disable_type_inference].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_spec::JsonOptions;
/// let x = JsonOptions::new().set_disable_type_inference(true);
/// ```
pub fn set_disable_type_inference<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_type_inference = v.into();
self
}
}
impl wkt::message::Message for JsonOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions"
}
}
/// Determines when discovery is triggered.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Trigger {
/// Optional. Cron schedule (<https://en.wikipedia.org/wiki/Cron>) for
/// running discovery periodically. Successive discovery runs must be
/// scheduled at least 60 minutes apart. The default value is to run
/// discovery every 60 minutes.
///
/// To explicitly set a timezone to the cron tab, apply a prefix in the
/// cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or TZ=${IANA_TIME_ZONE}".
/// The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone
/// database. For example, `CRON_TZ=America/New_York 1 * * * *`, or
/// `TZ=America/New_York 1 * * * *`.
Schedule(std::string::String),
}
}
/// Identifies the cloud resource that is referenced by this asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceSpec {
/// Immutable. Relative name of the cloud resource that contains the data
/// that is being managed within a lake. For example:
/// `projects/{project_number}/buckets/{bucket_id}`
/// `projects/{project_number}/datasets/{dataset_id}`
pub name: std::string::String,
/// Required. Immutable. Type of resource.
pub r#type: crate::model::asset::resource_spec::Type,
/// Optional. Determines how read permissions are handled for each asset and
/// their associated tables. Only available to storage buckets assets.
pub read_access_mode: crate::model::asset::resource_spec::AccessMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::asset::ResourceSpec::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceSpec;
/// let x = ResourceSpec::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [r#type][crate::model::asset::ResourceSpec::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceSpec;
/// use google_cloud_dataplex_v1::model::asset::resource_spec::Type;
/// let x0 = ResourceSpec::new().set_type(Type::StorageBucket);
/// let x1 = ResourceSpec::new().set_type(Type::BigqueryDataset);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::asset::resource_spec::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [read_access_mode][crate::model::asset::ResourceSpec::read_access_mode].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceSpec;
/// use google_cloud_dataplex_v1::model::asset::resource_spec::AccessMode;
/// let x0 = ResourceSpec::new().set_read_access_mode(AccessMode::Direct);
/// let x1 = ResourceSpec::new().set_read_access_mode(AccessMode::Managed);
/// ```
pub fn set_read_access_mode<
T: std::convert::Into<crate::model::asset::resource_spec::AccessMode>,
>(
mut self,
v: T,
) -> Self {
self.read_access_mode = v.into();
self
}
}
impl wkt::message::Message for ResourceSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.ResourceSpec"
}
}
/// Defines additional types related to [ResourceSpec].
pub mod resource_spec {
#[allow(unused_imports)]
use super::*;
/// Type of resource.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Type not specified.
Unspecified,
/// Cloud Storage bucket.
StorageBucket,
/// BigQuery dataset.
BigqueryDataset,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::StorageBucket => std::option::Option::Some(1),
Self::BigqueryDataset => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
Self::BigqueryDataset => std::option::Option::Some("BIGQUERY_DATASET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::StorageBucket,
2 => Self::BigqueryDataset,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"STORAGE_BUCKET" => Self::StorageBucket,
"BIGQUERY_DATASET" => Self::BigqueryDataset,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::StorageBucket => serializer.serialize_i32(1),
Self::BigqueryDataset => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.Asset.ResourceSpec.Type",
))
}
}
/// Access Mode determines how data stored within the resource is read. This
/// is only applicable to storage bucket assets.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AccessMode {
/// Access mode unspecified.
Unspecified,
/// Default. Data is accessed directly using storage APIs.
Direct,
/// Data is accessed through a managed interface using BigQuery APIs.
Managed,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [AccessMode::value] or
/// [AccessMode::name].
UnknownValue(access_mode::UnknownValue),
}
#[doc(hidden)]
pub mod access_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AccessMode {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Direct => std::option::Option::Some(1),
Self::Managed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ACCESS_MODE_UNSPECIFIED"),
Self::Direct => std::option::Option::Some("DIRECT"),
Self::Managed => std::option::Option::Some("MANAGED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AccessMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AccessMode {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AccessMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Direct,
2 => Self::Managed,
_ => Self::UnknownValue(access_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AccessMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACCESS_MODE_UNSPECIFIED" => Self::Unspecified,
"DIRECT" => Self::Direct,
"MANAGED" => Self::Managed,
_ => Self::UnknownValue(access_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AccessMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Direct => serializer.serialize_i32(1),
Self::Managed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AccessMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessMode>::new(
".google.cloud.dataplex.v1.Asset.ResourceSpec.AccessMode",
))
}
}
}
/// Status of the resource referenced by an asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceStatus {
/// The current state of the managed resource.
pub state: crate::model::asset::resource_status::State,
/// Additional information about the current state.
pub message: std::string::String,
/// Last update time of the status.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Output only. Service account associated with the BigQuery Connection.
pub managed_access_identity: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::asset::ResourceStatus::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// use google_cloud_dataplex_v1::model::asset::resource_status::State;
/// let x0 = ResourceStatus::new().set_state(State::Ready);
/// let x1 = ResourceStatus::new().set_state(State::Error);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::asset::resource_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::asset::ResourceStatus::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// let x = ResourceStatus::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [update_time][crate::model::asset::ResourceStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// use wkt::Timestamp;
/// let x = ResourceStatus::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::asset::ResourceStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// use wkt::Timestamp;
/// let x = ResourceStatus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = ResourceStatus::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [managed_access_identity][crate::model::asset::ResourceStatus::managed_access_identity].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::ResourceStatus;
/// let x = ResourceStatus::new().set_managed_access_identity("example");
/// ```
pub fn set_managed_access_identity<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_access_identity = v.into();
self
}
}
impl wkt::message::Message for ResourceStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.ResourceStatus"
}
}
/// Defines additional types related to [ResourceStatus].
pub mod resource_status {
#[allow(unused_imports)]
use super::*;
/// The state of a resource.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// State unspecified.
Unspecified,
/// Resource does not have any errors.
Ready,
/// Resource has errors.
Error,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ready => std::option::Option::Some(1),
Self::Error => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Ready => std::option::Option::Some("READY"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ready,
2 => Self::Error,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"READY" => Self::Ready,
"ERROR" => Self::Error,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ready => serializer.serialize_i32(1),
Self::Error => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.Asset.ResourceStatus.State",
))
}
}
}
/// Status of discovery for an asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoveryStatus {
/// The current status of the discovery feature.
pub state: crate::model::asset::discovery_status::State,
/// Additional information about the current state.
pub message: std::string::String,
/// Last update time of the status.
pub update_time: std::option::Option<wkt::Timestamp>,
/// The start time of the last discovery run.
pub last_run_time: std::option::Option<wkt::Timestamp>,
/// Data Stats of the asset reported by discovery.
pub stats: std::option::Option<crate::model::asset::discovery_status::Stats>,
/// The duration of the last discovery run.
pub last_run_duration: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiscoveryStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [state][crate::model::asset::DiscoveryStatus::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use google_cloud_dataplex_v1::model::asset::discovery_status::State;
/// let x0 = DiscoveryStatus::new().set_state(State::Scheduled);
/// let x1 = DiscoveryStatus::new().set_state(State::InProgress);
/// let x2 = DiscoveryStatus::new().set_state(State::Paused);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::asset::discovery_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
/// Sets the value of [message][crate::model::asset::DiscoveryStatus::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// let x = DiscoveryStatus::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [update_time][crate::model::asset::DiscoveryStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use wkt::Timestamp;
/// let x = DiscoveryStatus::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::asset::DiscoveryStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use wkt::Timestamp;
/// let x = DiscoveryStatus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = DiscoveryStatus::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [last_run_time][crate::model::asset::DiscoveryStatus::last_run_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use wkt::Timestamp;
/// let x = DiscoveryStatus::new().set_last_run_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_last_run_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_run_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [last_run_time][crate::model::asset::DiscoveryStatus::last_run_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use wkt::Timestamp;
/// let x = DiscoveryStatus::new().set_or_clear_last_run_time(Some(Timestamp::default()/* use setters */));
/// let x = DiscoveryStatus::new().set_or_clear_last_run_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_last_run_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_run_time = v.map(|x| x.into());
self
}
/// Sets the value of [stats][crate::model::asset::DiscoveryStatus::stats].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use google_cloud_dataplex_v1::model::asset::discovery_status::Stats;
/// let x = DiscoveryStatus::new().set_stats(Stats::default()/* use setters */);
/// ```
pub fn set_stats<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::asset::discovery_status::Stats>,
{
self.stats = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [stats][crate::model::asset::DiscoveryStatus::stats].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use google_cloud_dataplex_v1::model::asset::discovery_status::Stats;
/// let x = DiscoveryStatus::new().set_or_clear_stats(Some(Stats::default()/* use setters */));
/// let x = DiscoveryStatus::new().set_or_clear_stats(None::<Stats>);
/// ```
pub fn set_or_clear_stats<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::asset::discovery_status::Stats>,
{
self.stats = v.map(|x| x.into());
self
}
/// Sets the value of [last_run_duration][crate::model::asset::DiscoveryStatus::last_run_duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use wkt::Duration;
/// let x = DiscoveryStatus::new().set_last_run_duration(Duration::default()/* use setters */);
/// ```
pub fn set_last_run_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.last_run_duration = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [last_run_duration][crate::model::asset::DiscoveryStatus::last_run_duration].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::DiscoveryStatus;
/// use wkt::Duration;
/// let x = DiscoveryStatus::new().set_or_clear_last_run_duration(Some(Duration::default()/* use setters */));
/// let x = DiscoveryStatus::new().set_or_clear_last_run_duration(None::<Duration>);
/// ```
pub fn set_or_clear_last_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.last_run_duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DiscoveryStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.DiscoveryStatus"
}
}
/// Defines additional types related to [DiscoveryStatus].
pub mod discovery_status {
#[allow(unused_imports)]
use super::*;
/// The aggregated data statistics for the asset reported by discovery.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Stats {
/// The count of data items within the referenced resource.
pub data_items: i64,
/// The number of stored data bytes within the referenced resource.
pub data_size: i64,
/// The count of table entities within the referenced resource.
pub tables: i64,
/// The count of fileset entities within the referenced resource.
pub filesets: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Stats {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [data_items][crate::model::asset::discovery_status::Stats::data_items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_status::Stats;
/// let x = Stats::new().set_data_items(42);
/// ```
pub fn set_data_items<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.data_items = v.into();
self
}
/// Sets the value of [data_size][crate::model::asset::discovery_status::Stats::data_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_status::Stats;
/// let x = Stats::new().set_data_size(42);
/// ```
pub fn set_data_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.data_size = v.into();
self
}
/// Sets the value of [tables][crate::model::asset::discovery_status::Stats::tables].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_status::Stats;
/// let x = Stats::new().set_tables(42);
/// ```
pub fn set_tables<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.tables = v.into();
self
}
/// Sets the value of [filesets][crate::model::asset::discovery_status::Stats::filesets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::asset::discovery_status::Stats;
/// let x = Stats::new().set_filesets(42);
/// ```
pub fn set_filesets<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.filesets = v.into();
self
}
}
impl wkt::message::Message for Stats {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats"
}
}
/// Current state of discovery.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// State is unspecified.
Unspecified,
/// Discovery for the asset is scheduled.
Scheduled,
/// Discovery for the asset is running.
InProgress,
/// Discovery for the asset is currently paused (e.g. due to a lack
/// of available resources). It will be automatically resumed.
Paused,
/// Discovery for the asset is disabled.
Disabled,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Scheduled => std::option::Option::Some(1),
Self::InProgress => std::option::Option::Some(2),
Self::Paused => std::option::Option::Some(3),
Self::Disabled => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Scheduled => std::option::Option::Some("SCHEDULED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Scheduled,
2 => Self::InProgress,
3 => Self::Paused,
5 => Self::Disabled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SCHEDULED" => Self::Scheduled,
"IN_PROGRESS" => Self::InProgress,
"PAUSED" => Self::Paused,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Scheduled => serializer.serialize_i32(1),
Self::InProgress => serializer.serialize_i32(2),
Self::Paused => serializer.serialize_i32(3),
Self::Disabled => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.Asset.DiscoveryStatus.State",
))
}
}
}
}
/// ResourceAccessSpec holds the access control configuration to be enforced
/// on the resources, for example, Cloud Storage bucket, BigQuery dataset,
/// BigQuery table.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceAccessSpec {
/// Optional. The format of strings follows the pattern followed by IAM in the
/// bindings. user:{email}, serviceAccount:{email} group:{email}.
/// The set of principals to be granted reader role on the resource.
pub readers: std::vec::Vec<std::string::String>,
/// Optional. The set of principals to be granted writer role on the resource.
pub writers: std::vec::Vec<std::string::String>,
/// Optional. The set of principals to be granted owner role on the resource.
pub owners: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceAccessSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [readers][crate::model::ResourceAccessSpec::readers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ResourceAccessSpec;
/// let x = ResourceAccessSpec::new().set_readers(["a", "b", "c"]);
/// ```
pub fn set_readers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.readers = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [writers][crate::model::ResourceAccessSpec::writers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ResourceAccessSpec;
/// let x = ResourceAccessSpec::new().set_writers(["a", "b", "c"]);
/// ```
pub fn set_writers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.writers = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [owners][crate::model::ResourceAccessSpec::owners].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ResourceAccessSpec;
/// let x = ResourceAccessSpec::new().set_owners(["a", "b", "c"]);
/// ```
pub fn set_owners<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.owners = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResourceAccessSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ResourceAccessSpec"
}
}
/// DataAccessSpec holds the access control configuration to be enforced on data
/// stored within resources (eg: rows, columns in BigQuery Tables). When
/// associated with data, the data is only accessible to
/// principals explicitly granted access through the DataAccessSpec. Principals
/// with access to the containing resource are not implicitly granted access.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataAccessSpec {
/// Optional. The format of strings follows the pattern followed by IAM in the
/// bindings. user:{email}, serviceAccount:{email} group:{email}.
/// The set of principals to be granted reader role on data
/// stored within resources.
pub readers: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAccessSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [readers][crate::model::DataAccessSpec::readers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DataAccessSpec;
/// let x = DataAccessSpec::new().set_readers(["a", "b", "c"]);
/// ```
pub fn set_readers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.readers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataAccessSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DataAccessSpec"
}
}
/// Create lake request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLakeRequest {
/// Required. The resource name of the lake location, of the form:
/// projects/{project_number}/locations/{location_id}
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Required. Lake identifier.
/// This ID will be used to generate names such as database and dataset names
/// when publishing metadata to Hive Metastore and BigQuery.
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must end with a number or a letter.
/// * Must be between 1-63 characters.
/// * Must be unique within the customer project / location.
pub lake_id: std::string::String,
/// Required. Lake resource
pub lake: std::option::Option<crate::model::Lake>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLakeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateLakeRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateLakeRequest;
/// let x = CreateLakeRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [lake_id][crate::model::CreateLakeRequest::lake_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateLakeRequest;
/// let x = CreateLakeRequest::new().set_lake_id("example");
/// ```
pub fn set_lake_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lake_id = v.into();
self
}
/// Sets the value of [lake][crate::model::CreateLakeRequest::lake].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateLakeRequest;
/// use google_cloud_dataplex_v1::model::Lake;
/// let x = CreateLakeRequest::new().set_lake(Lake::default()/* use setters */);
/// ```
pub fn set_lake<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Lake>,
{
self.lake = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [lake][crate::model::CreateLakeRequest::lake].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateLakeRequest;
/// use google_cloud_dataplex_v1::model::Lake;
/// let x = CreateLakeRequest::new().set_or_clear_lake(Some(Lake::default()/* use setters */));
/// let x = CreateLakeRequest::new().set_or_clear_lake(None::<Lake>);
/// ```
pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Lake>,
{
self.lake = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateLakeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateLakeRequest;
/// let x = CreateLakeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateLakeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateLakeRequest"
}
}
/// Update lake request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateLakeRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Update description.
/// Only fields specified in `update_mask` are updated.
pub lake: std::option::Option<crate::model::Lake>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateLakeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateLakeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateLakeRequest;
/// use wkt::FieldMask;
/// let x = UpdateLakeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateLakeRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateLakeRequest;
/// use wkt::FieldMask;
/// let x = UpdateLakeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateLakeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [lake][crate::model::UpdateLakeRequest::lake].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateLakeRequest;
/// use google_cloud_dataplex_v1::model::Lake;
/// let x = UpdateLakeRequest::new().set_lake(Lake::default()/* use setters */);
/// ```
pub fn set_lake<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Lake>,
{
self.lake = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [lake][crate::model::UpdateLakeRequest::lake].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateLakeRequest;
/// use google_cloud_dataplex_v1::model::Lake;
/// let x = UpdateLakeRequest::new().set_or_clear_lake(Some(Lake::default()/* use setters */));
/// let x = UpdateLakeRequest::new().set_or_clear_lake(None::<Lake>);
/// ```
pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Lake>,
{
self.lake = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateLakeRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateLakeRequest;
/// let x = UpdateLakeRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateLakeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateLakeRequest"
}
}
/// Delete lake request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLakeRequest {
/// Required. The resource name of the lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLakeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteLakeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteLakeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = DeleteLakeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteLakeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteLakeRequest"
}
}
/// List lakes request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLakesRequest {
/// Required. The resource name of the lake location, of the form:
/// `projects/{project_number}/locations/{location_id}`
/// where `location_id` refers to a Google Cloud region.
pub parent: std::string::String,
/// Optional. Maximum number of Lakes to return. The service may return fewer
/// than this value. If unspecified, at most 10 lakes will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListLakes` call. Provide
/// this to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListLakes` must match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLakesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListLakesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesRequest;
/// let x = ListLakesRequest::new().set_parent("example");
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListLakesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesRequest;
/// let x = ListLakesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListLakesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesRequest;
/// let x = ListLakesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListLakesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesRequest;
/// let x = ListLakesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListLakesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesRequest;
/// let x = ListLakesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListLakesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListLakesRequest"
}
}
/// List lakes response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLakesResponse {
/// Lakes under the given parent location.
pub lakes: std::vec::Vec<crate::model::Lake>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLakesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [lakes][crate::model::ListLakesResponse::lakes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesResponse;
/// use google_cloud_dataplex_v1::model::Lake;
/// let x = ListLakesResponse::new()
/// .set_lakes([
/// Lake::default()/* use setters */,
/// Lake::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_lakes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Lake>,
{
use std::iter::Iterator;
self.lakes = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListLakesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesResponse;
/// let x = ListLakesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListLakesResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakesResponse;
/// let x = ListLakesResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListLakesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListLakesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListLakesResponse {
type PageItem = crate::model::Lake;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.lakes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// List lake actions request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLakeActionsRequest {
/// Required. The resource name of the parent lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of actions to return. The service may return fewer
/// than this value. If unspecified, at most 10 actions will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListLakeActions` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListLakeActions` must match the call that provided
/// the page token.
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLakeActionsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListLakeActionsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakeActionsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = ListLakeActionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListLakeActionsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakeActionsRequest;
/// let x = ListLakeActionsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListLakeActionsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListLakeActionsRequest;
/// let x = ListLakeActionsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListLakeActionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListLakeActionsRequest"
}
}
/// List actions response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListActionsResponse {
/// Actions under the given parent lake/zone/asset.
pub actions: std::vec::Vec<crate::model::Action>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListActionsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [actions][crate::model::ListActionsResponse::actions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListActionsResponse;
/// use google_cloud_dataplex_v1::model::Action;
/// let x = ListActionsResponse::new()
/// .set_actions([
/// Action::default()/* use setters */,
/// Action::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Action>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListActionsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListActionsResponse;
/// let x = ListActionsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListActionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListActionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListActionsResponse {
type PageItem = crate::model::Action;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.actions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get lake request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetLakeRequest {
/// Required. The resource name of the lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetLakeRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetLakeRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetLakeRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = GetLakeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetLakeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetLakeRequest"
}
}
/// Create zone request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateZoneRequest {
/// Required. The resource name of the parent lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub parent: std::string::String,
/// Required. Zone identifier.
/// This ID will be used to generate names such as database and dataset names
/// when publishing metadata to Hive Metastore and BigQuery.
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must end with a number or a letter.
/// * Must be between 1-63 characters.
/// * Must be unique across all lakes from all locations in a project.
/// * Must not be one of the reserved IDs (i.e. "default", "global-temp")
pub zone_id: std::string::String,
/// Required. Zone resource.
pub zone: std::option::Option<crate::model::Zone>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateZoneRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateZoneRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateZoneRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = CreateZoneRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [zone_id][crate::model::CreateZoneRequest::zone_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateZoneRequest;
/// let x = CreateZoneRequest::new().set_zone_id("example");
/// ```
pub fn set_zone_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone_id = v.into();
self
}
/// Sets the value of [zone][crate::model::CreateZoneRequest::zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateZoneRequest;
/// use google_cloud_dataplex_v1::model::Zone;
/// let x = CreateZoneRequest::new().set_zone(Zone::default()/* use setters */);
/// ```
pub fn set_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Zone>,
{
self.zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [zone][crate::model::CreateZoneRequest::zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateZoneRequest;
/// use google_cloud_dataplex_v1::model::Zone;
/// let x = CreateZoneRequest::new().set_or_clear_zone(Some(Zone::default()/* use setters */));
/// let x = CreateZoneRequest::new().set_or_clear_zone(None::<Zone>);
/// ```
pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Zone>,
{
self.zone = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateZoneRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateZoneRequest;
/// let x = CreateZoneRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateZoneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateZoneRequest"
}
}
/// Update zone request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateZoneRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Update description.
/// Only fields specified in `update_mask` are updated.
pub zone: std::option::Option<crate::model::Zone>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateZoneRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateZoneRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateZoneRequest;
/// use wkt::FieldMask;
/// let x = UpdateZoneRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateZoneRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateZoneRequest;
/// use wkt::FieldMask;
/// let x = UpdateZoneRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateZoneRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [zone][crate::model::UpdateZoneRequest::zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateZoneRequest;
/// use google_cloud_dataplex_v1::model::Zone;
/// let x = UpdateZoneRequest::new().set_zone(Zone::default()/* use setters */);
/// ```
pub fn set_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Zone>,
{
self.zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [zone][crate::model::UpdateZoneRequest::zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateZoneRequest;
/// use google_cloud_dataplex_v1::model::Zone;
/// let x = UpdateZoneRequest::new().set_or_clear_zone(Some(Zone::default()/* use setters */));
/// let x = UpdateZoneRequest::new().set_or_clear_zone(None::<Zone>);
/// ```
pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Zone>,
{
self.zone = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateZoneRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateZoneRequest;
/// let x = UpdateZoneRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateZoneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateZoneRequest"
}
}
/// Delete zone request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteZoneRequest {
/// Required. The resource name of the zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteZoneRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteZoneRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteZoneRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = DeleteZoneRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteZoneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteZoneRequest"
}
}
/// List zones request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListZonesRequest {
/// Required. The resource name of the parent lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of zones to return. The service may return fewer
/// than this value. If unspecified, at most 10 zones will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListZones` call. Provide
/// this to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListZones` must match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListZonesRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListZonesRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = ListZonesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListZonesRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesRequest;
/// let x = ListZonesRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListZonesRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesRequest;
/// let x = ListZonesRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListZonesRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesRequest;
/// let x = ListZonesRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListZonesRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesRequest;
/// let x = ListZonesRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListZonesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListZonesRequest"
}
}
/// List zones response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListZonesResponse {
/// Zones under the given parent lake.
pub zones: std::vec::Vec<crate::model::Zone>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListZonesResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [zones][crate::model::ListZonesResponse::zones].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesResponse;
/// use google_cloud_dataplex_v1::model::Zone;
/// let x = ListZonesResponse::new()
/// .set_zones([
/// Zone::default()/* use setters */,
/// Zone::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_zones<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Zone>,
{
use std::iter::Iterator;
self.zones = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListZonesResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZonesResponse;
/// let x = ListZonesResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListZonesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListZonesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListZonesResponse {
type PageItem = crate::model::Zone;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.zones
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// List zone actions request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListZoneActionsRequest {
/// Required. The resource name of the parent zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of actions to return. The service may return fewer
/// than this value. If unspecified, at most 10 actions will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListZoneActions` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListZoneActions` must match the call that provided
/// the page token.
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListZoneActionsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListZoneActionsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZoneActionsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = ListZoneActionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListZoneActionsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZoneActionsRequest;
/// let x = ListZoneActionsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListZoneActionsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListZoneActionsRequest;
/// let x = ListZoneActionsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListZoneActionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListZoneActionsRequest"
}
}
/// Get zone request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetZoneRequest {
/// Required. The resource name of the zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetZoneRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetZoneRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetZoneRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = GetZoneRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetZoneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetZoneRequest"
}
}
/// Create asset request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAssetRequest {
/// Required. The resource name of the parent zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub parent: std::string::String,
/// Required. Asset identifier.
/// This ID will be used to generate names such as table names when publishing
/// metadata to Hive Metastore and BigQuery.
///
/// * Must contain only lowercase letters, numbers and hyphens.
/// * Must start with a letter.
/// * Must end with a number or a letter.
/// * Must be between 1-63 characters.
/// * Must be unique within the zone.
pub asset_id: std::string::String,
/// Required. Asset resource.
pub asset: std::option::Option<crate::model::Asset>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateAssetRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAssetRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = CreateAssetRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [asset_id][crate::model::CreateAssetRequest::asset_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAssetRequest;
/// let x = CreateAssetRequest::new().set_asset_id("example");
/// ```
pub fn set_asset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.asset_id = v.into();
self
}
/// Sets the value of [asset][crate::model::CreateAssetRequest::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAssetRequest;
/// use google_cloud_dataplex_v1::model::Asset;
/// let x = CreateAssetRequest::new().set_asset(Asset::default()/* use setters */);
/// ```
pub fn set_asset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Asset>,
{
self.asset = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [asset][crate::model::CreateAssetRequest::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAssetRequest;
/// use google_cloud_dataplex_v1::model::Asset;
/// let x = CreateAssetRequest::new().set_or_clear_asset(Some(Asset::default()/* use setters */));
/// let x = CreateAssetRequest::new().set_or_clear_asset(None::<Asset>);
/// ```
pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Asset>,
{
self.asset = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateAssetRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateAssetRequest;
/// let x = CreateAssetRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateAssetRequest"
}
}
/// Update asset request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAssetRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Update description.
/// Only fields specified in `update_mask` are updated.
pub asset: std::option::Option<crate::model::Asset>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateAssetRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAssetRequest;
/// use wkt::FieldMask;
/// let x = UpdateAssetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateAssetRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAssetRequest;
/// use wkt::FieldMask;
/// let x = UpdateAssetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateAssetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [asset][crate::model::UpdateAssetRequest::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAssetRequest;
/// use google_cloud_dataplex_v1::model::Asset;
/// let x = UpdateAssetRequest::new().set_asset(Asset::default()/* use setters */);
/// ```
pub fn set_asset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Asset>,
{
self.asset = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [asset][crate::model::UpdateAssetRequest::asset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAssetRequest;
/// use google_cloud_dataplex_v1::model::Asset;
/// let x = UpdateAssetRequest::new().set_or_clear_asset(Some(Asset::default()/* use setters */));
/// let x = UpdateAssetRequest::new().set_or_clear_asset(None::<Asset>);
/// ```
pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Asset>,
{
self.asset = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateAssetRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateAssetRequest;
/// let x = UpdateAssetRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateAssetRequest"
}
}
/// Delete asset request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAssetRequest {
/// Required. The resource name of the asset:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteAssetRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteAssetRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let asset_id = "asset_id";
/// let x = DeleteAssetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteAssetRequest"
}
}
/// List assets request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetsRequest {
/// Required. The resource name of the parent zone:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of asset to return. The service may return fewer
/// than this value. If unspecified, at most 10 assets will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListAssets` call. Provide
/// this to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListAssets` must match the call that provided the page
/// token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAssetsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListAssetsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// let x = ListAssetsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListAssetsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsRequest;
/// let x = ListAssetsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListAssetsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsRequest;
/// let x = ListAssetsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListAssetsRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsRequest;
/// let x = ListAssetsRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListAssetsRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsRequest;
/// let x = ListAssetsRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAssetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListAssetsRequest"
}
}
/// List assets response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetsResponse {
/// Asset under the given parent zone.
pub assets: std::vec::Vec<crate::model::Asset>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAssetsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [assets][crate::model::ListAssetsResponse::assets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsResponse;
/// use google_cloud_dataplex_v1::model::Asset;
/// let x = ListAssetsResponse::new()
/// .set_assets([
/// Asset::default()/* use setters */,
/// Asset::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_assets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Asset>,
{
use std::iter::Iterator;
self.assets = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListAssetsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetsResponse;
/// let x = ListAssetsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListAssetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListAssetsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAssetsResponse {
type PageItem = crate::model::Asset;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.assets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// List asset actions request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetActionsRequest {
/// Required. The resource name of the parent asset:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of actions to return. The service may return fewer
/// than this value. If unspecified, at most 10 actions will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListAssetActions` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListAssetActions` must match the call that provided
/// the page token.
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAssetActionsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListAssetActionsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetActionsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let asset_id = "asset_id";
/// let x = ListAssetActionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListAssetActionsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetActionsRequest;
/// let x = ListAssetActionsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListAssetActionsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListAssetActionsRequest;
/// let x = ListAssetActionsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListAssetActionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListAssetActionsRequest"
}
}
/// Get asset request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAssetRequest {
/// Required. The resource name of the asset:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAssetRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetAssetRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetAssetRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let zone_id = "zone_id";
/// # let asset_id = "asset_id";
/// let x = GetAssetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetAssetRequest"
}
}
/// Represents the metadata of a long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
/// Output only. The time the operation was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time the operation finished running.
pub end_time: std::option::Option<wkt::Timestamp>,
/// Output only. Server-defined resource path for the target of the operation.
pub target: std::string::String,
/// Output only. Name of the verb executed by the operation.
pub verb: std::string::String,
/// Output only. Human-readable status of the operation, if any.
pub status_message: std::string::String,
/// Output only. Identifies whether the user has requested cancellation
/// of the operation. Operations that have successfully been cancelled
/// have [Operation.error][] value with a
/// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
/// `Code.CANCELLED`.
pub requested_cancellation: bool,
/// Output only. API version used to start the operation.
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// use wkt::Timestamp;
/// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// use wkt::Timestamp;
/// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// use wkt::Timestamp;
/// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// use wkt::Timestamp;
/// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
/// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
/// Sets the value of [target][crate::model::OperationMetadata::target].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// let x = OperationMetadata::new().set_target("example");
/// ```
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
/// Sets the value of [verb][crate::model::OperationMetadata::verb].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// let x = OperationMetadata::new().set_verb("example");
/// ```
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
/// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// let x = OperationMetadata::new().set_status_message("example");
/// ```
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
/// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// let x = OperationMetadata::new().set_requested_cancellation(true);
/// ```
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
/// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::OperationMetadata;
/// let x = OperationMetadata::new().set_api_version("example");
/// ```
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.OperationMetadata"
}
}
/// Create task request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTaskRequest {
/// Required. The resource name of the parent lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub parent: std::string::String,
/// Required. Task identifier.
pub task_id: std::string::String,
/// Required. Task resource.
pub task: std::option::Option<crate::model::Task>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTaskRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::CreateTaskRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateTaskRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = CreateTaskRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [task_id][crate::model::CreateTaskRequest::task_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateTaskRequest;
/// let x = CreateTaskRequest::new().set_task_id("example");
/// ```
pub fn set_task_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.task_id = v.into();
self
}
/// Sets the value of [task][crate::model::CreateTaskRequest::task].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateTaskRequest;
/// use google_cloud_dataplex_v1::model::Task;
/// let x = CreateTaskRequest::new().set_task(Task::default()/* use setters */);
/// ```
pub fn set_task<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Task>,
{
self.task = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [task][crate::model::CreateTaskRequest::task].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateTaskRequest;
/// use google_cloud_dataplex_v1::model::Task;
/// let x = CreateTaskRequest::new().set_or_clear_task(Some(Task::default()/* use setters */));
/// let x = CreateTaskRequest::new().set_or_clear_task(None::<Task>);
/// ```
pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Task>,
{
self.task = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::CreateTaskRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CreateTaskRequest;
/// let x = CreateTaskRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateTaskRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CreateTaskRequest"
}
}
/// Update task request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTaskRequest {
/// Required. Mask of fields to update.
pub update_mask: std::option::Option<wkt::FieldMask>,
/// Required. Update description.
/// Only fields specified in `update_mask` are updated.
pub task: std::option::Option<crate::model::Task>,
/// Optional. Only validate the request, but do not perform mutations.
/// The default is false.
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTaskRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_mask][crate::model::UpdateTaskRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateTaskRequest;
/// use wkt::FieldMask;
/// let x = UpdateTaskRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::UpdateTaskRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateTaskRequest;
/// use wkt::FieldMask;
/// let x = UpdateTaskRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = UpdateTaskRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
/// Sets the value of [task][crate::model::UpdateTaskRequest::task].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateTaskRequest;
/// use google_cloud_dataplex_v1::model::Task;
/// let x = UpdateTaskRequest::new().set_task(Task::default()/* use setters */);
/// ```
pub fn set_task<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Task>,
{
self.task = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [task][crate::model::UpdateTaskRequest::task].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateTaskRequest;
/// use google_cloud_dataplex_v1::model::Task;
/// let x = UpdateTaskRequest::new().set_or_clear_task(Some(Task::default()/* use setters */));
/// let x = UpdateTaskRequest::new().set_or_clear_task(None::<Task>);
/// ```
pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Task>,
{
self.task = v.map(|x| x.into());
self
}
/// Sets the value of [validate_only][crate::model::UpdateTaskRequest::validate_only].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::UpdateTaskRequest;
/// let x = UpdateTaskRequest::new().set_validate_only(true);
/// ```
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateTaskRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.UpdateTaskRequest"
}
}
/// Delete task request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTaskRequest {
/// Required. The resource name of the task:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTaskRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::DeleteTaskRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::DeleteTaskRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// let x = DeleteTaskRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteTaskRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.DeleteTaskRequest"
}
}
/// List tasks request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTasksRequest {
/// Required. The resource name of the parent lake:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of tasks to return. The service may return fewer
/// than this value. If unspecified, at most 10 tasks will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListZones` call. Provide
/// this to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListZones` must match the call that provided the page token.
pub page_token: std::string::String,
/// Optional. Filter request.
pub filter: std::string::String,
/// Optional. Order by fields for the result.
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTasksRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListTasksRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// let x = ListTasksRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListTasksRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksRequest;
/// let x = ListTasksRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListTasksRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksRequest;
/// let x = ListTasksRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
/// Sets the value of [filter][crate::model::ListTasksRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksRequest;
/// let x = ListTasksRequest::new().set_filter("example");
/// ```
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
/// Sets the value of [order_by][crate::model::ListTasksRequest::order_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksRequest;
/// let x = ListTasksRequest::new().set_order_by("example");
/// ```
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListTasksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListTasksRequest"
}
}
/// List tasks response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTasksResponse {
/// Tasks under the given parent lake.
pub tasks: std::vec::Vec<crate::model::Task>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
/// Locations that could not be reached.
pub unreachable_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTasksResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [tasks][crate::model::ListTasksResponse::tasks].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksResponse;
/// use google_cloud_dataplex_v1::model::Task;
/// let x = ListTasksResponse::new()
/// .set_tasks([
/// Task::default()/* use setters */,
/// Task::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_tasks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Task>,
{
use std::iter::Iterator;
self.tasks = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListTasksResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksResponse;
/// let x = ListTasksResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
/// Sets the value of [unreachable_locations][crate::model::ListTasksResponse::unreachable_locations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListTasksResponse;
/// let x = ListTasksResponse::new().set_unreachable_locations(["a", "b", "c"]);
/// ```
pub fn set_unreachable_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListTasksResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListTasksResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTasksResponse {
type PageItem = crate::model::Task;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tasks
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Get task request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTaskRequest {
/// Required. The resource name of the task:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTaskRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetTaskRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetTaskRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// let x = GetTaskRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetTaskRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetTaskRequest"
}
}
/// Get job request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetJobRequest {
/// Required. The resource name of the job:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::GetJobRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::GetJobRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// # let job_id = "job_id";
/// let x = GetJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.GetJobRequest"
}
}
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunTaskRequest {
/// Required. The resource name of the task:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`.
pub name: std::string::String,
/// Optional. User-defined labels for the task. If the map is left empty, the
/// task will run with existing labels from task definition. If the map
/// contains an entry with a new key, the same will be added to existing set of
/// labels. If the map contains an entry with an existing label key in task
/// definition, the task will run with new label value for that entry. Clearing
/// an existing label will require label value to be explicitly set to a hyphen
/// "-". The label value cannot be empty.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Optional. Execution spec arguments. If the map is left empty, the task will
/// run with existing execution spec args from task definition. If the map
/// contains an entry with a new key, the same will be added to existing set of
/// args. If the map contains an entry with an existing arg key in task
/// definition, the task will run with new arg value for that entry. Clearing
/// an existing arg will require arg value to be explicitly set to a hyphen
/// "-". The arg value cannot be empty.
pub args: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunTaskRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::RunTaskRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunTaskRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// let x = RunTaskRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [labels][crate::model::RunTaskRequest::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunTaskRequest;
/// let x = RunTaskRequest::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [args][crate::model::RunTaskRequest::args].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunTaskRequest;
/// let x = RunTaskRequest::new().set_args([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_args<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for RunTaskRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.RunTaskRequest"
}
}
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunTaskResponse {
/// Jobs created by RunTask API.
pub job: std::option::Option<crate::model::Job>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunTaskResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [job][crate::model::RunTaskResponse::job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunTaskResponse;
/// use google_cloud_dataplex_v1::model::Job;
/// let x = RunTaskResponse::new().set_job(Job::default()/* use setters */);
/// ```
pub fn set_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [job][crate::model::RunTaskResponse::job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::RunTaskResponse;
/// use google_cloud_dataplex_v1::model::Job;
/// let x = RunTaskResponse::new().set_or_clear_job(Some(Job::default()/* use setters */));
/// let x = RunTaskResponse::new().set_or_clear_job(None::<Job>);
/// ```
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RunTaskResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.RunTaskResponse"
}
}
/// List jobs request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsRequest {
/// Required. The resource name of the parent environment:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`.
pub parent: std::string::String,
/// Optional. Maximum number of jobs to return. The service may return fewer
/// than this value. If unspecified, at most 10 jobs will be returned. The
/// maximum value is 1000; values above 1000 will be coerced to 1000.
pub page_size: i32,
/// Optional. Page token received from a previous `ListJobs` call. Provide this
/// to retrieve the subsequent page. When paginating, all other parameters
/// provided to `ListJobs` must match the call that provided the page
/// token.
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobsRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [parent][crate::model::ListJobsRequest::parent].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListJobsRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// let x = ListJobsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"));
/// ```
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
/// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListJobsRequest;
/// let x = ListJobsRequest::new().set_page_size(42);
/// ```
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
/// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListJobsRequest;
/// let x = ListJobsRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListJobsRequest"
}
}
/// List jobs response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsResponse {
/// Jobs under a given task.
pub jobs: std::vec::Vec<crate::model::Job>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobsResponse {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListJobsResponse;
/// use google_cloud_dataplex_v1::model::Job;
/// let x = ListJobsResponse::new()
/// .set_jobs([
/// Job::default()/* use setters */,
/// Job::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Job>,
{
use std::iter::Iterator;
self.jobs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::ListJobsResponse;
/// let x = ListJobsResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.ListJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListJobsResponse {
type PageItem = crate::model::Job;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.jobs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
/// Cancel task jobs.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelJobRequest {
/// Required. The resource name of the job:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}`.
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelJobRequest {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::CancelJobRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::CancelJobRequest;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// # let job_id = "job_id";
/// let x = CancelJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for CancelJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.CancelJobRequest"
}
}
/// A task represents a user-visible job.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Task {
/// Output only. The relative resource name of the task, of the form:
/// projects/{project_number}/locations/{location_id}/lakes/{lake_id}/
/// tasks/{task_id}.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the task. This ID will
/// be different if the task is deleted and re-created with the same name.
pub uid: std::string::String,
/// Output only. The time when the task was created.
pub create_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the task was last updated.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Optional. Description of the task.
pub description: std::string::String,
/// Optional. User friendly display name.
pub display_name: std::string::String,
/// Output only. Current state of the task.
pub state: crate::model::State,
/// Optional. User-defined labels for the task.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Required. Spec related to how often and when a task should be triggered.
pub trigger_spec: std::option::Option<crate::model::task::TriggerSpec>,
/// Required. Spec related to how a task is executed.
pub execution_spec: std::option::Option<crate::model::task::ExecutionSpec>,
/// Output only. Status of the latest task executions.
pub execution_status: std::option::Option<crate::model::task::ExecutionStatus>,
/// Task template specific user-specified config.
pub config: std::option::Option<crate::model::task::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Task {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Task::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// let x = Task::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::Task::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// let x = Task::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [create_time][crate::model::Task::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use wkt::Timestamp;
/// let x = Task::new().set_create_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [create_time][crate::model::Task::create_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use wkt::Timestamp;
/// let x = Task::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
/// let x = Task::new().set_or_clear_create_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
/// Sets the value of [update_time][crate::model::Task::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use wkt::Timestamp;
/// let x = Task::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::Task::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use wkt::Timestamp;
/// let x = Task::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = Task::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::Task::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// let x = Task::new().set_description("example");
/// ```
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
/// Sets the value of [display_name][crate::model::Task::display_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// let x = Task::new().set_display_name("example");
/// ```
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
/// Sets the value of [state][crate::model::Task::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::State;
/// let x0 = Task::new().set_state(State::Active);
/// let x1 = Task::new().set_state(State::Creating);
/// let x2 = Task::new().set_state(State::Deleting);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [labels][crate::model::Task::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// let x = Task::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [trigger_spec][crate::model::Task::trigger_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// let x = Task::new().set_trigger_spec(TriggerSpec::default()/* use setters */);
/// ```
pub fn set_trigger_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::task::TriggerSpec>,
{
self.trigger_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [trigger_spec][crate::model::Task::trigger_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// let x = Task::new().set_or_clear_trigger_spec(Some(TriggerSpec::default()/* use setters */));
/// let x = Task::new().set_or_clear_trigger_spec(None::<TriggerSpec>);
/// ```
pub fn set_or_clear_trigger_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::task::TriggerSpec>,
{
self.trigger_spec = v.map(|x| x.into());
self
}
/// Sets the value of [execution_spec][crate::model::Task::execution_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = Task::new().set_execution_spec(ExecutionSpec::default()/* use setters */);
/// ```
pub fn set_execution_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::task::ExecutionSpec>,
{
self.execution_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [execution_spec][crate::model::Task::execution_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = Task::new().set_or_clear_execution_spec(Some(ExecutionSpec::default()/* use setters */));
/// let x = Task::new().set_or_clear_execution_spec(None::<ExecutionSpec>);
/// ```
pub fn set_or_clear_execution_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::task::ExecutionSpec>,
{
self.execution_spec = v.map(|x| x.into());
self
}
/// Sets the value of [execution_status][crate::model::Task::execution_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::ExecutionStatus;
/// let x = Task::new().set_execution_status(ExecutionStatus::default()/* use setters */);
/// ```
pub fn set_execution_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::task::ExecutionStatus>,
{
self.execution_status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [execution_status][crate::model::Task::execution_status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::ExecutionStatus;
/// let x = Task::new().set_or_clear_execution_status(Some(ExecutionStatus::default()/* use setters */));
/// let x = Task::new().set_or_clear_execution_status(None::<ExecutionStatus>);
/// ```
pub fn set_or_clear_execution_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::task::ExecutionStatus>,
{
self.execution_status = v.map(|x| x.into());
self
}
/// Sets the value of [config][crate::model::Task::config].
///
/// Note that all the setters affecting `config` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = Task::new().set_config(Some(
/// google_cloud_dataplex_v1::model::task::Config::Spark(SparkTaskConfig::default().into())));
/// ```
pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::task::Config>>>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
/// The value of [config][crate::model::Task::config]
/// if it holds a `Spark`, `None` if the field is not set or
/// holds a different branch.
pub fn spark(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::task::SparkTaskConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::task::Config::Spark(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [config][crate::model::Task::config]
/// to hold a `Spark`.
///
/// Note that all the setters affecting `config` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = Task::new().set_spark(SparkTaskConfig::default()/* use setters */);
/// assert!(x.spark().is_some());
/// assert!(x.notebook().is_none());
/// ```
pub fn set_spark<
T: std::convert::Into<std::boxed::Box<crate::model::task::SparkTaskConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(crate::model::task::Config::Spark(v.into()));
self
}
/// The value of [config][crate::model::Task::config]
/// if it holds a `Notebook`, `None` if the field is not set or
/// holds a different branch.
pub fn notebook(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::task::NotebookTaskConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::task::Config::Notebook(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [config][crate::model::Task::config]
/// to hold a `Notebook`.
///
/// Note that all the setters affecting `config` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Task;
/// use google_cloud_dataplex_v1::model::task::NotebookTaskConfig;
/// let x = Task::new().set_notebook(NotebookTaskConfig::default()/* use setters */);
/// assert!(x.notebook().is_some());
/// assert!(x.spark().is_none());
/// ```
pub fn set_notebook<
T: std::convert::Into<std::boxed::Box<crate::model::task::NotebookTaskConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(crate::model::task::Config::Notebook(v.into()));
self
}
}
impl wkt::message::Message for Task {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task"
}
}
/// Defines additional types related to [Task].
pub mod task {
#[allow(unused_imports)]
use super::*;
/// Configuration for the underlying infrastructure used to run workloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InfrastructureSpec {
/// Hardware config.
pub resources: std::option::Option<crate::model::task::infrastructure_spec::Resources>,
/// Software config.
pub runtime: std::option::Option<crate::model::task::infrastructure_spec::Runtime>,
/// Networking config.
pub network: std::option::Option<crate::model::task::infrastructure_spec::Network>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InfrastructureSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [resources][crate::model::task::InfrastructureSpec::resources].
///
/// Note that all the setters affecting `resources` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::BatchComputeResources;
/// let x = InfrastructureSpec::new().set_resources(Some(
/// google_cloud_dataplex_v1::model::task::infrastructure_spec::Resources::Batch(BatchComputeResources::default().into())));
/// ```
pub fn set_resources<
T: std::convert::Into<
std::option::Option<crate::model::task::infrastructure_spec::Resources>,
>,
>(
mut self,
v: T,
) -> Self {
self.resources = v.into();
self
}
/// The value of [resources][crate::model::task::InfrastructureSpec::resources]
/// if it holds a `Batch`, `None` if the field is not set or
/// holds a different branch.
pub fn batch(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::task::infrastructure_spec::BatchComputeResources>,
> {
#[allow(unreachable_patterns)]
self.resources.as_ref().and_then(|v| match v {
crate::model::task::infrastructure_spec::Resources::Batch(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [resources][crate::model::task::InfrastructureSpec::resources]
/// to hold a `Batch`.
///
/// Note that all the setters affecting `resources` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::BatchComputeResources;
/// let x = InfrastructureSpec::new().set_batch(BatchComputeResources::default()/* use setters */);
/// assert!(x.batch().is_some());
/// ```
pub fn set_batch<
T: std::convert::Into<
std::boxed::Box<crate::model::task::infrastructure_spec::BatchComputeResources>,
>,
>(
mut self,
v: T,
) -> Self {
self.resources = std::option::Option::Some(
crate::model::task::infrastructure_spec::Resources::Batch(v.into()),
);
self
}
/// Sets the value of [runtime][crate::model::task::InfrastructureSpec::runtime].
///
/// Note that all the setters affecting `runtime` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::ContainerImageRuntime;
/// let x = InfrastructureSpec::new().set_runtime(Some(
/// google_cloud_dataplex_v1::model::task::infrastructure_spec::Runtime::ContainerImage(ContainerImageRuntime::default().into())));
/// ```
pub fn set_runtime<
T: std::convert::Into<
std::option::Option<crate::model::task::infrastructure_spec::Runtime>,
>,
>(
mut self,
v: T,
) -> Self {
self.runtime = v.into();
self
}
/// The value of [runtime][crate::model::task::InfrastructureSpec::runtime]
/// if it holds a `ContainerImage`, `None` if the field is not set or
/// holds a different branch.
pub fn container_image(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::task::infrastructure_spec::ContainerImageRuntime>,
> {
#[allow(unreachable_patterns)]
self.runtime.as_ref().and_then(|v| match v {
crate::model::task::infrastructure_spec::Runtime::ContainerImage(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [runtime][crate::model::task::InfrastructureSpec::runtime]
/// to hold a `ContainerImage`.
///
/// Note that all the setters affecting `runtime` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::ContainerImageRuntime;
/// let x = InfrastructureSpec::new().set_container_image(ContainerImageRuntime::default()/* use setters */);
/// assert!(x.container_image().is_some());
/// ```
pub fn set_container_image<
T: std::convert::Into<
std::boxed::Box<crate::model::task::infrastructure_spec::ContainerImageRuntime>,
>,
>(
mut self,
v: T,
) -> Self {
self.runtime = std::option::Option::Some(
crate::model::task::infrastructure_spec::Runtime::ContainerImage(v.into()),
);
self
}
/// Sets the value of [network][crate::model::task::InfrastructureSpec::network].
///
/// Note that all the setters affecting `network` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::VpcNetwork;
/// let x = InfrastructureSpec::new().set_network(Some(
/// google_cloud_dataplex_v1::model::task::infrastructure_spec::Network::VpcNetwork(VpcNetwork::default().into())));
/// ```
pub fn set_network<
T: std::convert::Into<
std::option::Option<crate::model::task::infrastructure_spec::Network>,
>,
>(
mut self,
v: T,
) -> Self {
self.network = v.into();
self
}
/// The value of [network][crate::model::task::InfrastructureSpec::network]
/// if it holds a `VpcNetwork`, `None` if the field is not set or
/// holds a different branch.
pub fn vpc_network(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::task::infrastructure_spec::VpcNetwork>,
> {
#[allow(unreachable_patterns)]
self.network.as_ref().and_then(|v| match v {
crate::model::task::infrastructure_spec::Network::VpcNetwork(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [network][crate::model::task::InfrastructureSpec::network]
/// to hold a `VpcNetwork`.
///
/// Note that all the setters affecting `network` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::VpcNetwork;
/// let x = InfrastructureSpec::new().set_vpc_network(VpcNetwork::default()/* use setters */);
/// assert!(x.vpc_network().is_some());
/// ```
pub fn set_vpc_network<
T: std::convert::Into<
std::boxed::Box<crate::model::task::infrastructure_spec::VpcNetwork>,
>,
>(
mut self,
v: T,
) -> Self {
self.network = std::option::Option::Some(
crate::model::task::infrastructure_spec::Network::VpcNetwork(v.into()),
);
self
}
}
impl wkt::message::Message for InfrastructureSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.InfrastructureSpec"
}
}
/// Defines additional types related to [InfrastructureSpec].
pub mod infrastructure_spec {
#[allow(unused_imports)]
use super::*;
/// Batch compute resources associated with the task.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchComputeResources {
/// Optional. Total number of job executors.
/// Executor Count should be between 2 and 100. [Default=2]
pub executors_count: i32,
/// Optional. Max configurable executors.
/// If max_executors_count > executors_count, then auto-scaling is enabled.
/// Max Executor Count should be between 2 and 1000. [Default=1000]
pub max_executors_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchComputeResources {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [executors_count][crate::model::task::infrastructure_spec::BatchComputeResources::executors_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::BatchComputeResources;
/// let x = BatchComputeResources::new().set_executors_count(42);
/// ```
pub fn set_executors_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.executors_count = v.into();
self
}
/// Sets the value of [max_executors_count][crate::model::task::infrastructure_spec::BatchComputeResources::max_executors_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::BatchComputeResources;
/// let x = BatchComputeResources::new().set_max_executors_count(42);
/// ```
pub fn set_max_executors_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_executors_count = v.into();
self
}
}
impl wkt::message::Message for BatchComputeResources {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources"
}
}
/// Container Image Runtime Configuration used with Batch execution.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContainerImageRuntime {
/// Optional. Container image to use.
pub image: std::string::String,
/// Optional. A list of Java JARS to add to the classpath.
/// Valid input includes Cloud Storage URIs to Jar binaries.
/// For example, gs://bucket-name/my/path/to/file.jar
pub java_jars: std::vec::Vec<std::string::String>,
/// Optional. A list of python packages to be installed.
/// Valid formats include Cloud Storage URI to a PIP installable library.
/// For example, gs://bucket-name/my/path/to/lib.tar.gz
pub python_packages: std::vec::Vec<std::string::String>,
/// Optional. Override to common configuration of open source components
/// installed on the Dataproc cluster. The properties to set on daemon
/// config files. Property keys are specified in `prefix:property` format,
/// for example `core:hadoop.tmp.dir`. For more information, see [Cluster
/// properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContainerImageRuntime {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [image][crate::model::task::infrastructure_spec::ContainerImageRuntime::image].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::ContainerImageRuntime;
/// let x = ContainerImageRuntime::new().set_image("example");
/// ```
pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image = v.into();
self
}
/// Sets the value of [java_jars][crate::model::task::infrastructure_spec::ContainerImageRuntime::java_jars].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::ContainerImageRuntime;
/// let x = ContainerImageRuntime::new().set_java_jars(["a", "b", "c"]);
/// ```
pub fn set_java_jars<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.java_jars = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [python_packages][crate::model::task::infrastructure_spec::ContainerImageRuntime::python_packages].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::ContainerImageRuntime;
/// let x = ContainerImageRuntime::new().set_python_packages(["a", "b", "c"]);
/// ```
pub fn set_python_packages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.python_packages = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [properties][crate::model::task::infrastructure_spec::ContainerImageRuntime::properties].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::ContainerImageRuntime;
/// let x = ContainerImageRuntime::new().set_properties([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for ContainerImageRuntime {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime"
}
}
/// Cloud VPC Network used to run the infrastructure.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VpcNetwork {
/// Optional. List of network tags to apply to the job.
pub network_tags: std::vec::Vec<std::string::String>,
/// The Cloud VPC network identifier.
pub network_name: std::option::Option<
crate::model::task::infrastructure_spec::vpc_network::NetworkName,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VpcNetwork {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [network_tags][crate::model::task::infrastructure_spec::VpcNetwork::network_tags].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::VpcNetwork;
/// let x = VpcNetwork::new().set_network_tags(["a", "b", "c"]);
/// ```
pub fn set_network_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.network_tags = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [network_name][crate::model::task::infrastructure_spec::VpcNetwork::network_name].
///
/// Note that all the setters affecting `network_name` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::VpcNetwork;
/// use google_cloud_dataplex_v1::model::task::infrastructure_spec::vpc_network::NetworkName;
/// let x = VpcNetwork::new().set_network_name(Some(NetworkName::Network("example".to_string())));
/// ```
pub fn set_network_name<
T: std::convert::Into<
std::option::Option<
crate::model::task::infrastructure_spec::vpc_network::NetworkName,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.network_name = v.into();
self
}
/// The value of [network_name][crate::model::task::infrastructure_spec::VpcNetwork::network_name]
/// if it holds a `Network`, `None` if the field is not set or
/// holds a different branch.
pub fn network(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.network_name.as_ref().and_then(|v| match v {
crate::model::task::infrastructure_spec::vpc_network::NetworkName::Network(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [network_name][crate::model::task::infrastructure_spec::VpcNetwork::network_name]
/// to hold a `Network`.
///
/// Note that all the setters affecting `network_name` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::VpcNetwork;
/// let x = VpcNetwork::new().set_network("example");
/// assert!(x.network().is_some());
/// assert!(x.sub_network().is_none());
/// ```
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network_name = std::option::Option::Some(
crate::model::task::infrastructure_spec::vpc_network::NetworkName::Network(
v.into(),
),
);
self
}
/// The value of [network_name][crate::model::task::infrastructure_spec::VpcNetwork::network_name]
/// if it holds a `SubNetwork`, `None` if the field is not set or
/// holds a different branch.
pub fn sub_network(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.network_name.as_ref().and_then(|v| match v {
crate::model::task::infrastructure_spec::vpc_network::NetworkName::SubNetwork(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
/// Sets the value of [network_name][crate::model::task::infrastructure_spec::VpcNetwork::network_name]
/// to hold a `SubNetwork`.
///
/// Note that all the setters affecting `network_name` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::infrastructure_spec::VpcNetwork;
/// let x = VpcNetwork::new().set_sub_network("example");
/// assert!(x.sub_network().is_some());
/// assert!(x.network().is_none());
/// ```
pub fn set_sub_network<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.network_name = std::option::Option::Some(
crate::model::task::infrastructure_spec::vpc_network::NetworkName::SubNetwork(
v.into(),
),
);
self
}
}
impl wkt::message::Message for VpcNetwork {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork"
}
}
/// Defines additional types related to [VpcNetwork].
pub mod vpc_network {
#[allow(unused_imports)]
use super::*;
/// The Cloud VPC network identifier.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NetworkName {
/// Optional. The Cloud VPC network in which the job is run. By default,
/// the Cloud VPC network named Default within the project is used.
Network(std::string::String),
/// Optional. The Cloud VPC sub-network in which the job is run.
SubNetwork(std::string::String),
}
}
/// Hardware config.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Resources {
/// Compute resources needed for a Task when using Dataproc Serverless.
Batch(std::boxed::Box<crate::model::task::infrastructure_spec::BatchComputeResources>),
}
/// Software config.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Runtime {
/// Container Image Runtime Configuration.
ContainerImage(
std::boxed::Box<crate::model::task::infrastructure_spec::ContainerImageRuntime>,
),
}
/// Networking config.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Network {
/// Vpc network.
VpcNetwork(std::boxed::Box<crate::model::task::infrastructure_spec::VpcNetwork>),
}
}
/// Task scheduling and trigger settings.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TriggerSpec {
/// Required. Immutable. Trigger type of the user-specified Task.
pub r#type: crate::model::task::trigger_spec::Type,
/// Optional. The first run of the task will be after this time.
/// If not specified, the task will run shortly after being submitted if
/// ON_DEMAND and based on the schedule if RECURRING.
pub start_time: std::option::Option<wkt::Timestamp>,
/// Optional. Prevent the task from executing.
/// This does not cancel already running tasks. It is intended to temporarily
/// disable RECURRING tasks.
pub disabled: bool,
/// Optional. Number of retry attempts before aborting.
/// Set to zero to never attempt to retry a failed task.
pub max_retries: i32,
/// Trigger only applies for RECURRING tasks.
pub trigger: std::option::Option<crate::model::task::trigger_spec::Trigger>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TriggerSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [r#type][crate::model::task::TriggerSpec::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// use google_cloud_dataplex_v1::model::task::trigger_spec::Type;
/// let x0 = TriggerSpec::new().set_type(Type::OnDemand);
/// let x1 = TriggerSpec::new().set_type(Type::Recurring);
/// ```
pub fn set_type<T: std::convert::Into<crate::model::task::trigger_spec::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [start_time][crate::model::task::TriggerSpec::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// use wkt::Timestamp;
/// let x = TriggerSpec::new().set_start_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::task::TriggerSpec::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// use wkt::Timestamp;
/// let x = TriggerSpec::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
/// let x = TriggerSpec::new().set_or_clear_start_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [disabled][crate::model::task::TriggerSpec::disabled].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// let x = TriggerSpec::new().set_disabled(true);
/// ```
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
/// Sets the value of [max_retries][crate::model::task::TriggerSpec::max_retries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// let x = TriggerSpec::new().set_max_retries(42);
/// ```
pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_retries = v.into();
self
}
/// Sets the value of [trigger][crate::model::task::TriggerSpec::trigger].
///
/// Note that all the setters affecting `trigger` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// use google_cloud_dataplex_v1::model::task::trigger_spec::Trigger;
/// let x = TriggerSpec::new().set_trigger(Some(Trigger::Schedule("example".to_string())));
/// ```
pub fn set_trigger<
T: std::convert::Into<std::option::Option<crate::model::task::trigger_spec::Trigger>>,
>(
mut self,
v: T,
) -> Self {
self.trigger = v.into();
self
}
/// The value of [trigger][crate::model::task::TriggerSpec::trigger]
/// if it holds a `Schedule`, `None` if the field is not set or
/// holds a different branch.
pub fn schedule(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.trigger.as_ref().and_then(|v| match v {
crate::model::task::trigger_spec::Trigger::Schedule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [trigger][crate::model::task::TriggerSpec::trigger]
/// to hold a `Schedule`.
///
/// Note that all the setters affecting `trigger` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::TriggerSpec;
/// let x = TriggerSpec::new().set_schedule("example");
/// assert!(x.schedule().is_some());
/// ```
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trigger = std::option::Option::Some(
crate::model::task::trigger_spec::Trigger::Schedule(v.into()),
);
self
}
}
impl wkt::message::Message for TriggerSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.TriggerSpec"
}
}
/// Defines additional types related to [TriggerSpec].
pub mod trigger_spec {
#[allow(unused_imports)]
use super::*;
/// Determines how often and when the job will run.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
/// Unspecified trigger type.
Unspecified,
/// The task runs one-time shortly after Task Creation.
OnDemand,
/// The task is scheduled to run periodically.
Recurring,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OnDemand => std::option::Option::Some(1),
Self::Recurring => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::Recurring => std::option::Option::Some("RECURRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OnDemand,
2 => Self::Recurring,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ON_DEMAND" => Self::OnDemand,
"RECURRING" => Self::Recurring,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::OnDemand => serializer.serialize_i32(1),
Self::Recurring => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataplex.v1.Task.TriggerSpec.Type",
))
}
}
/// Trigger only applies for RECURRING tasks.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Trigger {
/// Optional. Cron schedule (<https://en.wikipedia.org/wiki/Cron>) for
/// running tasks periodically. To explicitly set a timezone to the cron
/// tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or
/// "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid
/// string from IANA time zone database. For example,
/// `CRON_TZ=America/New_York 1 * * * *`, or `TZ=America/New_York 1 * * *
/// *`. This field is required for RECURRING tasks.
Schedule(std::string::String),
}
}
/// Execution related settings, like retry and service_account.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionSpec {
/// Optional. The arguments to pass to the task.
/// The args can use placeholders of the format ${placeholder} as
/// part of key/value string. These will be interpolated before passing the
/// args to the driver. Currently supported placeholders:
///
/// - ${task_id}
/// - ${job_time}
/// To pass positional args, set the key as TASK_ARGS. The value should be a
/// comma-separated string of all the positional arguments. To use a
/// delimiter other than comma, refer to
/// <https://cloud.google.com/sdk/gcloud/reference/topic/escaping>. In case of
/// other keys being present in the args, then TASK_ARGS will be passed as
/// the last argument.
pub args: std::collections::HashMap<std::string::String, std::string::String>,
/// Required. Service account to use to execute a task.
/// If not provided, the default Compute service account for the project is
/// used.
pub service_account: std::string::String,
/// Optional. The project in which jobs are run. By default, the project
/// containing the Lake is used. If a project is provided, the
/// [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account]
/// must belong to this project.
///
/// [google.cloud.dataplex.v1.Task.ExecutionSpec.service_account]: crate::model::task::ExecutionSpec::service_account
pub project: std::string::String,
/// Optional. The maximum duration after which the job execution is expired.
pub max_job_execution_lifetime: std::option::Option<wkt::Duration>,
/// Optional. The Cloud KMS key to use for encryption, of the form:
/// `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
pub kms_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionSpec {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [args][crate::model::task::ExecutionSpec::args].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = ExecutionSpec::new().set_args([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_args<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [service_account][crate::model::task::ExecutionSpec::service_account].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = ExecutionSpec::new().set_service_account("example");
/// ```
pub fn set_service_account<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_account = v.into();
self
}
/// Sets the value of [project][crate::model::task::ExecutionSpec::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = ExecutionSpec::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [max_job_execution_lifetime][crate::model::task::ExecutionSpec::max_job_execution_lifetime].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// use wkt::Duration;
/// let x = ExecutionSpec::new().set_max_job_execution_lifetime(Duration::default()/* use setters */);
/// ```
pub fn set_max_job_execution_lifetime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_job_execution_lifetime = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_job_execution_lifetime][crate::model::task::ExecutionSpec::max_job_execution_lifetime].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// use wkt::Duration;
/// let x = ExecutionSpec::new().set_or_clear_max_job_execution_lifetime(Some(Duration::default()/* use setters */));
/// let x = ExecutionSpec::new().set_or_clear_max_job_execution_lifetime(None::<Duration>);
/// ```
pub fn set_or_clear_max_job_execution_lifetime<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_job_execution_lifetime = v.map(|x| x.into());
self
}
/// Sets the value of [kms_key][crate::model::task::ExecutionSpec::kms_key].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = ExecutionSpec::new().set_kms_key("example");
/// ```
pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
}
impl wkt::message::Message for ExecutionSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.ExecutionSpec"
}
}
/// User-specified config for running a Spark task.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkTaskConfig {
/// Optional. Cloud Storage URIs of files to be placed in the working
/// directory of each executor.
pub file_uris: std::vec::Vec<std::string::String>,
/// Optional. Cloud Storage URIs of archives to be extracted into the working
/// directory of each executor. Supported file types: .jar, .tar, .tar.gz,
/// .tgz, and .zip.
pub archive_uris: std::vec::Vec<std::string::String>,
/// Optional. Infrastructure specification for the execution.
pub infrastructure_spec: std::option::Option<crate::model::task::InfrastructureSpec>,
/// Required. The specification of the main method to call to drive the
/// job. Specify either the jar file that contains the main class or the
/// main class name.
pub driver: std::option::Option<crate::model::task::spark_task_config::Driver>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkTaskConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [file_uris][crate::model::task::SparkTaskConfig::file_uris].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_file_uris(["a", "b", "c"]);
/// ```
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [archive_uris][crate::model::task::SparkTaskConfig::archive_uris].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_archive_uris(["a", "b", "c"]);
/// ```
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [infrastructure_spec][crate::model::task::SparkTaskConfig::infrastructure_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// let x = SparkTaskConfig::new().set_infrastructure_spec(InfrastructureSpec::default()/* use setters */);
/// ```
pub fn set_infrastructure_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::task::InfrastructureSpec>,
{
self.infrastructure_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [infrastructure_spec][crate::model::task::SparkTaskConfig::infrastructure_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// let x = SparkTaskConfig::new().set_or_clear_infrastructure_spec(Some(InfrastructureSpec::default()/* use setters */));
/// let x = SparkTaskConfig::new().set_or_clear_infrastructure_spec(None::<InfrastructureSpec>);
/// ```
pub fn set_or_clear_infrastructure_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::task::InfrastructureSpec>,
{
self.infrastructure_spec = v.map(|x| x.into());
self
}
/// Sets the value of [driver][crate::model::task::SparkTaskConfig::driver].
///
/// Note that all the setters affecting `driver` are mutually
/// exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// use google_cloud_dataplex_v1::model::task::spark_task_config::Driver;
/// let x = SparkTaskConfig::new().set_driver(Some(Driver::MainJarFileUri("example".to_string())));
/// ```
pub fn set_driver<
T: std::convert::Into<std::option::Option<crate::model::task::spark_task_config::Driver>>,
>(
mut self,
v: T,
) -> Self {
self.driver = v.into();
self
}
/// The value of [driver][crate::model::task::SparkTaskConfig::driver]
/// if it holds a `MainJarFileUri`, `None` if the field is not set or
/// holds a different branch.
pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::task::spark_task_config::Driver::MainJarFileUri(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [driver][crate::model::task::SparkTaskConfig::driver]
/// to hold a `MainJarFileUri`.
///
/// Note that all the setters affecting `driver` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_main_jar_file_uri("example");
/// assert!(x.main_jar_file_uri().is_some());
/// assert!(x.main_class().is_none());
/// assert!(x.python_script_file().is_none());
/// assert!(x.sql_script_file().is_none());
/// assert!(x.sql_script().is_none());
/// ```
pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver = std::option::Option::Some(
crate::model::task::spark_task_config::Driver::MainJarFileUri(v.into()),
);
self
}
/// The value of [driver][crate::model::task::SparkTaskConfig::driver]
/// if it holds a `MainClass`, `None` if the field is not set or
/// holds a different branch.
pub fn main_class(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::task::spark_task_config::Driver::MainClass(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [driver][crate::model::task::SparkTaskConfig::driver]
/// to hold a `MainClass`.
///
/// Note that all the setters affecting `driver` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_main_class("example");
/// assert!(x.main_class().is_some());
/// assert!(x.main_jar_file_uri().is_none());
/// assert!(x.python_script_file().is_none());
/// assert!(x.sql_script_file().is_none());
/// assert!(x.sql_script().is_none());
/// ```
pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.driver = std::option::Option::Some(
crate::model::task::spark_task_config::Driver::MainClass(v.into()),
);
self
}
/// The value of [driver][crate::model::task::SparkTaskConfig::driver]
/// if it holds a `PythonScriptFile`, `None` if the field is not set or
/// holds a different branch.
pub fn python_script_file(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::task::spark_task_config::Driver::PythonScriptFile(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [driver][crate::model::task::SparkTaskConfig::driver]
/// to hold a `PythonScriptFile`.
///
/// Note that all the setters affecting `driver` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_python_script_file("example");
/// assert!(x.python_script_file().is_some());
/// assert!(x.main_jar_file_uri().is_none());
/// assert!(x.main_class().is_none());
/// assert!(x.sql_script_file().is_none());
/// assert!(x.sql_script().is_none());
/// ```
pub fn set_python_script_file<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver = std::option::Option::Some(
crate::model::task::spark_task_config::Driver::PythonScriptFile(v.into()),
);
self
}
/// The value of [driver][crate::model::task::SparkTaskConfig::driver]
/// if it holds a `SqlScriptFile`, `None` if the field is not set or
/// holds a different branch.
pub fn sql_script_file(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::task::spark_task_config::Driver::SqlScriptFile(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [driver][crate::model::task::SparkTaskConfig::driver]
/// to hold a `SqlScriptFile`.
///
/// Note that all the setters affecting `driver` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_sql_script_file("example");
/// assert!(x.sql_script_file().is_some());
/// assert!(x.main_jar_file_uri().is_none());
/// assert!(x.main_class().is_none());
/// assert!(x.python_script_file().is_none());
/// assert!(x.sql_script().is_none());
/// ```
pub fn set_sql_script_file<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver = std::option::Option::Some(
crate::model::task::spark_task_config::Driver::SqlScriptFile(v.into()),
);
self
}
/// The value of [driver][crate::model::task::SparkTaskConfig::driver]
/// if it holds a `SqlScript`, `None` if the field is not set or
/// holds a different branch.
pub fn sql_script(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::task::spark_task_config::Driver::SqlScript(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
/// Sets the value of [driver][crate::model::task::SparkTaskConfig::driver]
/// to hold a `SqlScript`.
///
/// Note that all the setters affecting `driver` are
/// mutually exclusive.
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::SparkTaskConfig;
/// let x = SparkTaskConfig::new().set_sql_script("example");
/// assert!(x.sql_script().is_some());
/// assert!(x.main_jar_file_uri().is_none());
/// assert!(x.main_class().is_none());
/// assert!(x.python_script_file().is_none());
/// assert!(x.sql_script_file().is_none());
/// ```
pub fn set_sql_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.driver = std::option::Option::Some(
crate::model::task::spark_task_config::Driver::SqlScript(v.into()),
);
self
}
}
impl wkt::message::Message for SparkTaskConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.SparkTaskConfig"
}
}
/// Defines additional types related to [SparkTaskConfig].
pub mod spark_task_config {
#[allow(unused_imports)]
use super::*;
/// Required. The specification of the main method to call to drive the
/// job. Specify either the jar file that contains the main class or the
/// main class name.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Driver {
/// The Cloud Storage URI of the jar file that contains the main class.
/// The execution args are passed in as a sequence of named process
/// arguments (`--key=value`).
MainJarFileUri(std::string::String),
/// The name of the driver's main class. The jar file that contains the
/// class must be in the default CLASSPATH or specified in
/// `jar_file_uris`.
/// The execution args are passed in as a sequence of named process
/// arguments (`--key=value`).
MainClass(std::string::String),
/// The Gcloud Storage URI of the main Python file to use as the driver.
/// Must be a .py file. The execution args are passed in as a sequence of
/// named process arguments (`--key=value`).
PythonScriptFile(std::string::String),
/// A reference to a query file. This should be the Cloud Storage URI of
/// the query file. The execution args are used to declare a set of script
/// variables (`set key="value";`).
SqlScriptFile(std::string::String),
/// The query text.
/// The execution args are used to declare a set of script variables
/// (`set key="value";`).
SqlScript(std::string::String),
}
}
/// Config for running scheduled notebooks.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NotebookTaskConfig {
/// Required. Path to input notebook. This can be the Cloud Storage URI of
/// the notebook file or the path to a Notebook Content. The execution args
/// are accessible as environment variables
/// (`TASK_key=value`).
pub notebook: std::string::String,
/// Optional. Infrastructure specification for the execution.
pub infrastructure_spec: std::option::Option<crate::model::task::InfrastructureSpec>,
/// Optional. Cloud Storage URIs of files to be placed in the working
/// directory of each executor.
pub file_uris: std::vec::Vec<std::string::String>,
/// Optional. Cloud Storage URIs of archives to be extracted into the working
/// directory of each executor. Supported file types: .jar, .tar, .tar.gz,
/// .tgz, and .zip.
pub archive_uris: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NotebookTaskConfig {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [notebook][crate::model::task::NotebookTaskConfig::notebook].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::NotebookTaskConfig;
/// let x = NotebookTaskConfig::new().set_notebook("example");
/// ```
pub fn set_notebook<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.notebook = v.into();
self
}
/// Sets the value of [infrastructure_spec][crate::model::task::NotebookTaskConfig::infrastructure_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::NotebookTaskConfig;
/// use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// let x = NotebookTaskConfig::new().set_infrastructure_spec(InfrastructureSpec::default()/* use setters */);
/// ```
pub fn set_infrastructure_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::task::InfrastructureSpec>,
{
self.infrastructure_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [infrastructure_spec][crate::model::task::NotebookTaskConfig::infrastructure_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::NotebookTaskConfig;
/// use google_cloud_dataplex_v1::model::task::InfrastructureSpec;
/// let x = NotebookTaskConfig::new().set_or_clear_infrastructure_spec(Some(InfrastructureSpec::default()/* use setters */));
/// let x = NotebookTaskConfig::new().set_or_clear_infrastructure_spec(None::<InfrastructureSpec>);
/// ```
pub fn set_or_clear_infrastructure_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::task::InfrastructureSpec>,
{
self.infrastructure_spec = v.map(|x| x.into());
self
}
/// Sets the value of [file_uris][crate::model::task::NotebookTaskConfig::file_uris].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::NotebookTaskConfig;
/// let x = NotebookTaskConfig::new().set_file_uris(["a", "b", "c"]);
/// ```
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [archive_uris][crate::model::task::NotebookTaskConfig::archive_uris].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::NotebookTaskConfig;
/// let x = NotebookTaskConfig::new().set_archive_uris(["a", "b", "c"]);
/// ```
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NotebookTaskConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.NotebookTaskConfig"
}
}
/// Status of the task execution (e.g. Jobs).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionStatus {
/// Output only. Last update time of the status.
pub update_time: std::option::Option<wkt::Timestamp>,
/// Output only. latest job execution
pub latest_job: std::option::Option<crate::model::Job>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionStatus {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [update_time][crate::model::task::ExecutionStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_update_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_time][crate::model::task::ExecutionStatus::update_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionStatus;
/// use wkt::Timestamp;
/// let x = ExecutionStatus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
/// let x = ExecutionStatus::new().set_or_clear_update_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
/// Sets the value of [latest_job][crate::model::task::ExecutionStatus::latest_job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionStatus;
/// use google_cloud_dataplex_v1::model::Job;
/// let x = ExecutionStatus::new().set_latest_job(Job::default()/* use setters */);
/// ```
pub fn set_latest_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.latest_job = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [latest_job][crate::model::task::ExecutionStatus::latest_job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::task::ExecutionStatus;
/// use google_cloud_dataplex_v1::model::Job;
/// let x = ExecutionStatus::new().set_or_clear_latest_job(Some(Job::default()/* use setters */));
/// let x = ExecutionStatus::new().set_or_clear_latest_job(None::<Job>);
/// ```
pub fn set_or_clear_latest_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.latest_job = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecutionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Task.ExecutionStatus"
}
}
/// Task template specific user-specified config.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
/// Config related to running custom Spark tasks.
Spark(std::boxed::Box<crate::model::task::SparkTaskConfig>),
/// Config related to running scheduled Notebooks.
Notebook(std::boxed::Box<crate::model::task::NotebookTaskConfig>),
}
}
/// A job represents an instance of a task.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Job {
/// Output only. The relative resource name of the job, of the form:
/// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`.
pub name: std::string::String,
/// Output only. System generated globally unique ID for the job.
pub uid: std::string::String,
/// Output only. The time when the job was started.
pub start_time: std::option::Option<wkt::Timestamp>,
/// Output only. The time when the job ended.
pub end_time: std::option::Option<wkt::Timestamp>,
/// Output only. Execution state for the job.
pub state: crate::model::job::State,
/// Output only. The number of times the job has been retried (excluding the
/// initial attempt).
pub retry_count: u32,
/// Output only. The underlying service running a job.
pub service: crate::model::job::Service,
/// Output only. The full resource name for the job run under a particular
/// service.
pub service_job: std::string::String,
/// Output only. Additional information about the current state.
pub message: std::string::String,
/// Output only. User-defined labels for the task.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// Output only. Job execution trigger.
pub trigger: crate::model::job::Trigger,
/// Output only. Spec related to how a task is executed.
pub execution_spec: std::option::Option<crate::model::task::ExecutionSpec>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Job {
/// Creates a new default instance.
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [name][crate::model::Job::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// # let project_id = "project_id";
/// # let location_id = "location_id";
/// # let lake_id = "lake_id";
/// # let task_id = "task_id";
/// # let job_id = "job_id";
/// let x = Job::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}"));
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [uid][crate::model::Job::uid].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// let x = Job::new().set_uid("example");
/// ```
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
/// Sets the value of [start_time][crate::model::Job::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use wkt::Timestamp;
/// let x = Job::new().set_start_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::Job::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use wkt::Timestamp;
/// let x = Job::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
/// let x = Job::new().set_or_clear_start_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [end_time][crate::model::Job::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use wkt::Timestamp;
/// let x = Job::new().set_end_time(Timestamp::default()/* use setters */);
/// ```
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [end_time][crate::model::Job::end_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use wkt::Timestamp;
/// let x = Job::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
/// let x = Job::new().set_or_clear_end_time(None::<Timestamp>);
/// ```
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
/// Sets the value of [state][crate::model::Job::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use google_cloud_dataplex_v1::model::job::State;
/// let x0 = Job::new().set_state(State::Running);
/// let x1 = Job::new().set_state(State::Cancelling);
/// let x2 = Job::new().set_state(State::Cancelled);
/// ```
pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
/// Sets the value of [retry_count][crate::model::Job::retry_count].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// let x = Job::new().set_retry_count(42_u32);
/// ```
pub fn set_retry_count<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
self.retry_count = v.into();
self
}
/// Sets the value of [service][crate::model::Job::service].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use google_cloud_dataplex_v1::model::job::Service;
/// let x0 = Job::new().set_service(Service::Dataproc);
/// ```
pub fn set_service<T: std::convert::Into<crate::model::job::Service>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
/// Sets the value of [service_job][crate::model::Job::service_job].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// let x = Job::new().set_service_job("example");
/// ```
pub fn set_service_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_job = v.into();
self
}
/// Sets the value of [message][crate::model::Job::message].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// let x = Job::new().set_message("example");
/// ```
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
/// Sets the value of [labels][crate::model::Job::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// let x = Job::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [trigger][crate::model::Job::trigger].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use google_cloud_dataplex_v1::model::job::Trigger;
/// let x0 = Job::new().set_trigger(Trigger::TaskConfig);
/// let x1 = Job::new().set_trigger(Trigger::RunRequest);
/// ```
pub fn set_trigger<T: std::convert::Into<crate::model::job::Trigger>>(mut self, v: T) -> Self {
self.trigger = v.into();
self
}
/// Sets the value of [execution_spec][crate::model::Job::execution_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = Job::new().set_execution_spec(ExecutionSpec::default()/* use setters */);
/// ```
pub fn set_execution_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::task::ExecutionSpec>,
{
self.execution_spec = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [execution_spec][crate::model::Job::execution_spec].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dataplex_v1::model::Job;
/// use google_cloud_dataplex_v1::model::task::ExecutionSpec;
/// let x = Job::new().set_or_clear_execution_spec(Some(ExecutionSpec::default()/* use setters */));
/// let x = Job::new().set_or_clear_execution_spec(None::<ExecutionSpec>);
/// ```
pub fn set_or_clear_execution_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::task::ExecutionSpec>,
{
self.execution_spec = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Job {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataplex.v1.Job"
}
}
/// Defines additional types related to [Job].
pub mod job {
#[allow(unused_imports)]
use super::*;
/// Enum for [Service].
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Service {
/// Service used to run the job is unspecified.
Unspecified,
/// Dataproc service is used to run this job.
Dataproc,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Service::value] or
/// [Service::name].
UnknownValue(service::UnknownValue),
}
#[doc(hidden)]
pub mod service {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Service {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Dataproc => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SERVICE_UNSPECIFIED"),
Self::Dataproc => std::option::Option::Some("DATAPROC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Service {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Service {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Service {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Dataproc,
_ => Self::UnknownValue(service::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Service {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SERVICE_UNSPECIFIED" => Self::Unspecified,
"DATAPROC" => Self::Dataproc,
_ => Self::UnknownValue(service::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Service {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Dataproc => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Service {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Service>::new(
".google.cloud.dataplex.v1.Job.Service",
))
}
}
/// Enum for [State].
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// The job state is unknown.
Unspecified,
/// The job is running.
Running,
/// The job is cancelling.
Cancelling,
/// The job cancellation was successful.
Cancelled,
/// The job completed successfully.
Succeeded,
/// The job is no longer running due to an error.
Failed,
/// The job was cancelled outside of Dataplex Universal Catalog.
Aborted,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Running => std::option::Option::Some(1),
Self::Cancelling => std::option::Option::Some(2),
Self::Cancelled => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::Aborted => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Aborted => std::option::Option::Some("ABORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Running,
2 => Self::Cancelling,
3 => Self::Cancelled,
4 => Self::Succeeded,
5 => Self::Failed,
6 => Self::Aborted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"RUNNING" => Self::Running,
"CANCELLING" => Self::Cancelling,
"CANCELLED" => Self::Cancelled,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"ABORTED" => Self::Aborted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Running => serializer.serialize_i32(1),
Self::Cancelling => serializer.serialize_i32(2),
Self::Cancelled => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::Aborted => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.Job.State",
))
}
}
/// Job execution trigger.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Trigger {
/// The trigger is unspecified.
Unspecified,
/// The job was triggered by Dataplex Universal Catalog based on trigger spec
/// from task definition.
TaskConfig,
/// The job was triggered by the explicit call of Task API.
RunRequest,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Trigger::value] or
/// [Trigger::name].
UnknownValue(trigger::UnknownValue),
}
#[doc(hidden)]
pub mod trigger {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Trigger {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::TaskConfig => std::option::Option::Some(1),
Self::RunRequest => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
Self::TaskConfig => std::option::Option::Some("TASK_CONFIG"),
Self::RunRequest => std::option::Option::Some("RUN_REQUEST"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Trigger {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Trigger {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Trigger {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::TaskConfig,
2 => Self::RunRequest,
_ => Self::UnknownValue(trigger::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Trigger {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRIGGER_UNSPECIFIED" => Self::Unspecified,
"TASK_CONFIG" => Self::TaskConfig,
"RUN_REQUEST" => Self::RunRequest,
_ => Self::UnknownValue(trigger::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Trigger {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::TaskConfig => serializer.serialize_i32(1),
Self::RunRequest => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Trigger {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
".google.cloud.dataplex.v1.Job.Trigger",
))
}
}
}
/// View for controlling which parts of an entry are to be returned.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntryView {
/// Unspecified EntryView. Defaults to FULL.
Unspecified,
/// Returns entry only, without aspects.
Basic,
/// Returns all required aspects as well as the keys of all non-required
/// aspects.
Full,
/// Returns aspects matching custom fields in GetEntryRequest. If the number of
/// aspects exceeds 100, the first 100 will be returned.
Custom,
/// Returns all aspects. If the number of aspects exceeds 100, the first
/// 100 will be returned.
All,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [EntryView::value] or
/// [EntryView::name].
UnknownValue(entry_view::UnknownValue),
}
#[doc(hidden)]
pub mod entry_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntryView {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => std::option::Option::Some(2),
Self::Custom => std::option::Option::Some(3),
Self::All => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENTRY_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::Custom => std::option::Option::Some("CUSTOM"),
Self::All => std::option::Option::Some("ALL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntryView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntryView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EntryView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
3 => Self::Custom,
4 => Self::All,
_ => Self::UnknownValue(entry_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntryView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTRY_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
"CUSTOM" => Self::Custom,
"ALL" => Self::All,
_ => Self::UnknownValue(entry_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntryView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(2),
Self::Custom => serializer.serialize_i32(3),
Self::All => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntryView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntryView>::new(
".google.cloud.dataplex.v1.EntryView",
))
}
}
/// Denotes the transfer status of a resource. It is unspecified for resources
/// created from Dataplex API.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransferStatus {
/// The default value. It is set for resources that were not subject for
/// migration from Data Catalog service.
Unspecified,
/// Indicates that a resource was migrated from Data Catalog service but it
/// hasn't been transferred yet. In particular the resource cannot be updated
/// from Dataplex API.
Migrated,
/// Indicates that a resource was transferred from Data Catalog service. The
/// resource can only be updated from Dataplex API.
Transferred,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [TransferStatus::value] or
/// [TransferStatus::name].
UnknownValue(transfer_status::UnknownValue),
}
#[doc(hidden)]
pub mod transfer_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransferStatus {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Migrated => std::option::Option::Some(1),
Self::Transferred => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRANSFER_STATUS_UNSPECIFIED"),
Self::Migrated => std::option::Option::Some("TRANSFER_STATUS_MIGRATED"),
Self::Transferred => std::option::Option::Some("TRANSFER_STATUS_TRANSFERRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransferStatus {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransferStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TransferStatus {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Migrated,
2 => Self::Transferred,
_ => Self::UnknownValue(transfer_status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransferStatus {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSFER_STATUS_UNSPECIFIED" => Self::Unspecified,
"TRANSFER_STATUS_MIGRATED" => Self::Migrated,
"TRANSFER_STATUS_TRANSFERRED" => Self::Transferred,
_ => Self::UnknownValue(transfer_status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransferStatus {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Migrated => serializer.serialize_i32(1),
Self::Transferred => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransferStatus {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferStatus>::new(
".google.cloud.dataplex.v1.TransferStatus",
))
}
}
/// The type of data scan.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataScanType {
/// The data scan type is unspecified.
Unspecified,
/// Data quality scan.
DataQuality,
/// Data profile scan.
DataProfile,
/// Data discovery scan.
DataDiscovery,
/// Data documentation scan.
DataDocumentation,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [DataScanType::value] or
/// [DataScanType::name].
UnknownValue(data_scan_type::UnknownValue),
}
#[doc(hidden)]
pub mod data_scan_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataScanType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DataQuality => std::option::Option::Some(1),
Self::DataProfile => std::option::Option::Some(2),
Self::DataDiscovery => std::option::Option::Some(3),
Self::DataDocumentation => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_SCAN_TYPE_UNSPECIFIED"),
Self::DataQuality => std::option::Option::Some("DATA_QUALITY"),
Self::DataProfile => std::option::Option::Some("DATA_PROFILE"),
Self::DataDiscovery => std::option::Option::Some("DATA_DISCOVERY"),
Self::DataDocumentation => std::option::Option::Some("DATA_DOCUMENTATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataScanType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataScanType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DataScanType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DataQuality,
2 => Self::DataProfile,
3 => Self::DataDiscovery,
4 => Self::DataDocumentation,
_ => Self::UnknownValue(data_scan_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataScanType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_SCAN_TYPE_UNSPECIFIED" => Self::Unspecified,
"DATA_QUALITY" => Self::DataQuality,
"DATA_PROFILE" => Self::DataProfile,
"DATA_DISCOVERY" => Self::DataDiscovery,
"DATA_DOCUMENTATION" => Self::DataDocumentation,
_ => Self::UnknownValue(data_scan_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataScanType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DataQuality => serializer.serialize_i32(1),
Self::DataProfile => serializer.serialize_i32(2),
Self::DataDiscovery => serializer.serialize_i32(3),
Self::DataDocumentation => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataScanType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataScanType>::new(
".google.cloud.dataplex.v1.DataScanType",
))
}
}
/// Identifies the cloud system that manages the data storage.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StorageSystem {
/// Storage system unspecified.
Unspecified,
/// The entity data is contained within a Cloud Storage bucket.
CloudStorage,
/// The entity data is contained within a BigQuery dataset.
Bigquery,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [StorageSystem::value] or
/// [StorageSystem::name].
UnknownValue(storage_system::UnknownValue),
}
#[doc(hidden)]
pub mod storage_system {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl StorageSystem {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudStorage => std::option::Option::Some(1),
Self::Bigquery => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STORAGE_SYSTEM_UNSPECIFIED"),
Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
Self::Bigquery => std::option::Option::Some("BIGQUERY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for StorageSystem {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for StorageSystem {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for StorageSystem {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudStorage,
2 => Self::Bigquery,
_ => Self::UnknownValue(storage_system::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for StorageSystem {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STORAGE_SYSTEM_UNSPECIFIED" => Self::Unspecified,
"CLOUD_STORAGE" => Self::CloudStorage,
"BIGQUERY" => Self::Bigquery,
_ => Self::UnknownValue(storage_system::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for StorageSystem {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudStorage => serializer.serialize_i32(1),
Self::Bigquery => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for StorageSystem {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageSystem>::new(
".google.cloud.dataplex.v1.StorageSystem",
))
}
}
/// State of a resource.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// State is not specified.
Unspecified,
/// Resource is active, i.e., ready to use.
Active,
/// Resource is under creation.
Creating,
/// Resource is under deletion.
Deleting,
/// Resource is active but has unresolved actions.
ActionRequired,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::ActionRequired => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::ActionRequired => std::option::Option::Some("ACTION_REQUIRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Creating,
3 => Self::Deleting,
4 => Self::ActionRequired,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"ACTION_REQUIRED" => Self::ActionRequired,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::ActionRequired => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataplex.v1.State",
))
}
}