#![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_location;
extern crate google_cloud_rpc;
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;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataSourceParameter {
pub param_id: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub r#type: crate::model::data_source_parameter::Type,
pub required: bool,
pub repeated: bool,
pub validation_regex: std::string::String,
pub allowed_values: std::vec::Vec<std::string::String>,
pub min_value: std::option::Option<wkt::DoubleValue>,
pub max_value: std::option::Option<wkt::DoubleValue>,
pub fields: std::vec::Vec<crate::model::DataSourceParameter>,
pub validation_description: std::string::String,
pub validation_help_url: std::string::String,
pub immutable: bool,
pub recurse: bool,
pub deprecated: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataSourceParameter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_param_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.param_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::data_source_parameter::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.required = v.into();
self
}
pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.repeated = v.into();
self
}
pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.validation_regex = v.into();
self
}
pub fn set_allowed_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.allowed_values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_min_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::DoubleValue>,
{
self.min_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::DoubleValue>,
{
self.min_value = v.map(|x| x.into());
self
}
pub fn set_max_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::DoubleValue>,
{
self.max_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::DoubleValue>,
{
self.max_value = v.map(|x| x.into());
self
}
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataSourceParameter>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_validation_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.validation_description = v.into();
self
}
pub fn set_validation_help_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.validation_help_url = v.into();
self
}
pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.immutable = v.into();
self
}
pub fn set_recurse<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.recurse = v.into();
self
}
pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.deprecated = v.into();
self
}
}
impl wkt::message::Message for DataSourceParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
}
}
pub mod data_source_parameter {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
String,
Integer,
Double,
Boolean,
Record,
PlusPage,
List,
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 {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::String => std::option::Option::Some(1),
Self::Integer => std::option::Option::Some(2),
Self::Double => std::option::Option::Some(3),
Self::Boolean => std::option::Option::Some(4),
Self::Record => std::option::Option::Some(5),
Self::PlusPage => std::option::Option::Some(6),
Self::List => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::String => std::option::Option::Some("STRING"),
Self::Integer => std::option::Option::Some("INTEGER"),
Self::Double => std::option::Option::Some("DOUBLE"),
Self::Boolean => std::option::Option::Some("BOOLEAN"),
Self::Record => std::option::Option::Some("RECORD"),
Self::PlusPage => std::option::Option::Some("PLUS_PAGE"),
Self::List => std::option::Option::Some("LIST"),
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::String,
2 => Self::Integer,
3 => Self::Double,
4 => Self::Boolean,
5 => Self::Record,
6 => Self::PlusPage,
7 => Self::List,
_ => 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,
"STRING" => Self::String,
"INTEGER" => Self::Integer,
"DOUBLE" => Self::Double,
"BOOLEAN" => Self::Boolean,
"RECORD" => Self::Record,
"PLUS_PAGE" => Self::PlusPage,
"LIST" => Self::List,
_ => 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::String => serializer.serialize_i32(1),
Self::Integer => serializer.serialize_i32(2),
Self::Double => serializer.serialize_i32(3),
Self::Boolean => serializer.serialize_i32(4),
Self::Record => serializer.serialize_i32(5),
Self::PlusPage => serializer.serialize_i32(6),
Self::List => serializer.serialize_i32(7),
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.bigquery.datatransfer.v1.DataSourceParameter.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataSource {
pub name: std::string::String,
pub data_source_id: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub client_id: std::string::String,
pub scopes: std::vec::Vec<std::string::String>,
#[deprecated]
pub transfer_type: crate::model::TransferType,
#[deprecated]
pub supports_multiple_transfers: bool,
pub update_deadline_seconds: i32,
pub default_schedule: std::string::String,
pub supports_custom_schedule: bool,
pub parameters: std::vec::Vec<crate::model::DataSourceParameter>,
pub help_url: std::string::String,
pub authorization_type: crate::model::data_source::AuthorizationType,
pub data_refresh_type: crate::model::data_source::DataRefreshType,
pub default_data_refresh_window_days: i32,
pub manual_runs_disabled: bool,
pub minimum_schedule_interval: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_source_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_id = v.into();
self
}
pub fn set_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.scopes = v.into_iter().map(|i| i.into()).collect();
self
}
#[deprecated]
pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
mut self,
v: T,
) -> Self {
self.transfer_type = v.into();
self
}
#[deprecated]
pub fn set_supports_multiple_transfers<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.supports_multiple_transfers = v.into();
self
}
pub fn set_update_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.update_deadline_seconds = v.into();
self
}
pub fn set_default_schedule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_schedule = v.into();
self
}
pub fn set_supports_custom_schedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.supports_custom_schedule = v.into();
self
}
pub fn set_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataSourceParameter>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_help_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.help_url = v.into();
self
}
pub fn set_authorization_type<
T: std::convert::Into<crate::model::data_source::AuthorizationType>,
>(
mut self,
v: T,
) -> Self {
self.authorization_type = v.into();
self
}
pub fn set_data_refresh_type<
T: std::convert::Into<crate::model::data_source::DataRefreshType>,
>(
mut self,
v: T,
) -> Self {
self.data_refresh_type = v.into();
self
}
pub fn set_default_data_refresh_window_days<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.default_data_refresh_window_days = v.into();
self
}
pub fn set_manual_runs_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.manual_runs_disabled = v.into();
self
}
pub fn set_minimum_schedule_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.minimum_schedule_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_minimum_schedule_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.minimum_schedule_interval = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSource"
}
}
pub mod data_source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthorizationType {
Unspecified,
AuthorizationCode,
GooglePlusAuthorizationCode,
FirstPartyOauth,
UnknownValue(authorization_type::UnknownValue),
}
#[doc(hidden)]
pub mod authorization_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AuthorizationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AuthorizationCode => std::option::Option::Some(1),
Self::GooglePlusAuthorizationCode => std::option::Option::Some(2),
Self::FirstPartyOauth => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("AUTHORIZATION_TYPE_UNSPECIFIED"),
Self::AuthorizationCode => std::option::Option::Some("AUTHORIZATION_CODE"),
Self::GooglePlusAuthorizationCode => {
std::option::Option::Some("GOOGLE_PLUS_AUTHORIZATION_CODE")
}
Self::FirstPartyOauth => std::option::Option::Some("FIRST_PARTY_OAUTH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AuthorizationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AuthorizationType {
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 AuthorizationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AuthorizationCode,
2 => Self::GooglePlusAuthorizationCode,
3 => Self::FirstPartyOauth,
_ => Self::UnknownValue(authorization_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AuthorizationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"AUTHORIZATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"AUTHORIZATION_CODE" => Self::AuthorizationCode,
"GOOGLE_PLUS_AUTHORIZATION_CODE" => Self::GooglePlusAuthorizationCode,
"FIRST_PARTY_OAUTH" => Self::FirstPartyOauth,
_ => Self::UnknownValue(authorization_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AuthorizationType {
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::AuthorizationCode => serializer.serialize_i32(1),
Self::GooglePlusAuthorizationCode => serializer.serialize_i32(2),
Self::FirstPartyOauth => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AuthorizationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthorizationType>::new(
".google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataRefreshType {
Unspecified,
SlidingWindow,
CustomSlidingWindow,
UnknownValue(data_refresh_type::UnknownValue),
}
#[doc(hidden)]
pub mod data_refresh_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataRefreshType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SlidingWindow => std::option::Option::Some(1),
Self::CustomSlidingWindow => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_REFRESH_TYPE_UNSPECIFIED"),
Self::SlidingWindow => std::option::Option::Some("SLIDING_WINDOW"),
Self::CustomSlidingWindow => std::option::Option::Some("CUSTOM_SLIDING_WINDOW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataRefreshType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataRefreshType {
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 DataRefreshType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SlidingWindow,
2 => Self::CustomSlidingWindow,
_ => Self::UnknownValue(data_refresh_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataRefreshType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_REFRESH_TYPE_UNSPECIFIED" => Self::Unspecified,
"SLIDING_WINDOW" => Self::SlidingWindow,
"CUSTOM_SLIDING_WINDOW" => Self::CustomSlidingWindow,
_ => Self::UnknownValue(data_refresh_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataRefreshType {
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::SlidingWindow => serializer.serialize_i32(1),
Self::CustomSlidingWindow => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataRefreshType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataRefreshType>::new(
".google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataSourceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataSourceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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 GetDataSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataSourcesRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataSourcesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListDataSourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataSourcesResponse {
pub data_sources: std::vec::Vec<crate::model::DataSource>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataSourcesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataSource>,
{
use std::iter::Iterator;
self.data_sources = v.into_iter().map(|i| i.into()).collect();
self
}
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 ListDataSourcesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataSourcesResponse {
type PageItem = crate::model::DataSource;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_sources
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTransferConfigRequest {
pub parent: std::string::String,
pub transfer_config: std::option::Option<crate::model::TransferConfig>,
#[deprecated]
pub authorization_code: std::string::String,
pub version_info: std::string::String,
pub service_account_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_transfer_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferConfig>,
{
self.transfer_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transfer_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferConfig>,
{
self.transfer_config = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.authorization_code = v.into();
self
}
pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version_info = v.into();
self
}
pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_account_name = v.into();
self
}
}
impl wkt::message::Message for CreateTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTransferConfigRequest {
pub transfer_config: std::option::Option<crate::model::TransferConfig>,
#[deprecated]
pub authorization_code: std::string::String,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub version_info: std::string::String,
pub service_account_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transfer_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferConfig>,
{
self.transfer_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transfer_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferConfig>,
{
self.transfer_config = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.authorization_code = v.into();
self
}
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
}
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
}
pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version_info = v.into();
self
}
pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_account_name = v.into();
self
}
}
impl wkt::message::Message for UpdateTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTransferConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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 GetTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTransferConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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 DeleteTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTransferRunRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTransferRunRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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 GetTransferRunRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTransferRunRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTransferRunRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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 DeleteTransferRunRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTransferConfigsRequest {
pub parent: std::string::String,
pub data_source_ids: std::vec::Vec<std::string::String>,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTransferConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_data_source_ids<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_source_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListTransferConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTransferConfigsResponse {
pub transfer_configs: std::vec::Vec<crate::model::TransferConfig>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTransferConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transfer_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferConfig>,
{
use std::iter::Iterator;
self.transfer_configs = v.into_iter().map(|i| i.into()).collect();
self
}
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 ListTransferConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTransferConfigsResponse {
type PageItem = crate::model::TransferConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.transfer_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTransferRunsRequest {
pub parent: std::string::String,
pub states: std::vec::Vec<crate::model::TransferState>,
pub page_token: std::string::String,
pub page_size: i32,
pub run_attempt: crate::model::list_transfer_runs_request::RunAttempt,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTransferRunsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_states<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferState>,
{
use std::iter::Iterator;
self.states = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_run_attempt<
T: std::convert::Into<crate::model::list_transfer_runs_request::RunAttempt>,
>(
mut self,
v: T,
) -> Self {
self.run_attempt = v.into();
self
}
}
impl wkt::message::Message for ListTransferRunsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"
}
}
pub mod list_transfer_runs_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RunAttempt {
Unspecified,
Latest,
UnknownValue(run_attempt::UnknownValue),
}
#[doc(hidden)]
pub mod run_attempt {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RunAttempt {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Latest => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RUN_ATTEMPT_UNSPECIFIED"),
Self::Latest => std::option::Option::Some("LATEST"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RunAttempt {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RunAttempt {
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 RunAttempt {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Latest,
_ => Self::UnknownValue(run_attempt::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RunAttempt {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RUN_ATTEMPT_UNSPECIFIED" => Self::Unspecified,
"LATEST" => Self::Latest,
_ => Self::UnknownValue(run_attempt::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RunAttempt {
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::Latest => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RunAttempt {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RunAttempt>::new(
".google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTransferRunsResponse {
pub transfer_runs: std::vec::Vec<crate::model::TransferRun>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTransferRunsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transfer_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferRun>,
{
use std::iter::Iterator;
self.transfer_runs = v.into_iter().map(|i| i.into()).collect();
self
}
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 ListTransferRunsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTransferRunsResponse {
type PageItem = crate::model::TransferRun;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.transfer_runs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTransferLogsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub message_types: std::vec::Vec<crate::model::transfer_message::MessageSeverity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTransferLogsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_message_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
{
use std::iter::Iterator;
self.message_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListTransferLogsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTransferLogsResponse {
pub transfer_messages: std::vec::Vec<crate::model::TransferMessage>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTransferLogsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transfer_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferMessage>,
{
use std::iter::Iterator;
self.transfer_messages = v.into_iter().map(|i| i.into()).collect();
self
}
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 ListTransferLogsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTransferLogsResponse {
type PageItem = crate::model::TransferMessage;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.transfer_messages
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckValidCredsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckValidCredsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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 CheckValidCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckValidCredsResponse {
pub has_valid_creds: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckValidCredsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_has_valid_creds<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.has_valid_creds = v.into();
self
}
}
impl wkt::message::Message for CheckValidCredsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScheduleTransferRunsRequest {
pub parent: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScheduleTransferRunsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
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
}
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
}
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
}
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
}
}
impl wkt::message::Message for ScheduleTransferRunsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScheduleTransferRunsResponse {
pub runs: std::vec::Vec<crate::model::TransferRun>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScheduleTransferRunsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferRun>,
{
use std::iter::Iterator;
self.runs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ScheduleTransferRunsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartManualTransferRunsRequest {
pub parent: std::string::String,
pub time: std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartManualTransferRunsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_time<
T: std::convert::Into<
std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
>,
>(
mut self,
v: T,
) -> Self {
self.time = v.into();
self
}
pub fn requested_time_range(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
> {
#[allow(unreachable_patterns)]
self.time.as_ref().and_then(|v| match v {
crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_requested_time_range<
T: std::convert::Into<
std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
>,
>(
mut self,
v: T,
) -> Self {
self.time = std::option::Option::Some(
crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v.into()),
);
self
}
pub fn requested_run_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.time.as_ref().and_then(|v| match v {
crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_requested_run_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.time = std::option::Option::Some(
crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v.into()),
);
self
}
}
impl wkt::message::Message for StartManualTransferRunsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"
}
}
pub mod start_manual_transfer_runs_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimeRange {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimeRange {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
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
}
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
}
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
}
}
impl wkt::message::Message for TimeRange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Time {
RequestedTimeRange(
std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
),
RequestedRunTime(std::boxed::Box<wkt::Timestamp>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartManualTransferRunsResponse {
pub runs: std::vec::Vec<crate::model::TransferRun>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartManualTransferRunsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferRun>,
{
use std::iter::Iterator;
self.runs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for StartManualTransferRunsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnrollDataSourcesRequest {
pub name: std::string::String,
pub data_source_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnrollDataSourcesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_data_source_ids<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_source_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for EnrollDataSourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UnenrollDataSourcesRequest {
pub name: std::string::String,
pub data_source_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UnenrollDataSourcesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_data_source_ids<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_source_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UnenrollDataSourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UnenrollDataSourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EmailPreferences {
pub enable_failure_email: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EmailPreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_failure_email<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_failure_email = v.into();
self
}
}
impl wkt::message::Message for EmailPreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EmailPreferences"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScheduleOptions {
pub disable_auto_scheduling: bool,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScheduleOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disable_auto_scheduling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_auto_scheduling = v.into();
self
}
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
}
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
}
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
}
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
}
}
impl wkt::message::Message for ScheduleOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScheduleOptionsV2 {
pub schedule: std::option::Option<crate::model::schedule_options_v_2::Schedule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScheduleOptionsV2 {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_schedule<
T: std::convert::Into<std::option::Option<crate::model::schedule_options_v_2::Schedule>>,
>(
mut self,
v: T,
) -> Self {
self.schedule = v.into();
self
}
pub fn time_based_schedule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TimeBasedSchedule>> {
#[allow(unreachable_patterns)]
self.schedule.as_ref().and_then(|v| match v {
crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_time_based_schedule<
T: std::convert::Into<std::boxed::Box<crate::model::TimeBasedSchedule>>,
>(
mut self,
v: T,
) -> Self {
self.schedule = std::option::Option::Some(
crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v.into()),
);
self
}
pub fn manual_schedule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ManualSchedule>> {
#[allow(unreachable_patterns)]
self.schedule.as_ref().and_then(|v| match v {
crate::model::schedule_options_v_2::Schedule::ManualSchedule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_manual_schedule<
T: std::convert::Into<std::boxed::Box<crate::model::ManualSchedule>>,
>(
mut self,
v: T,
) -> Self {
self.schedule = std::option::Option::Some(
crate::model::schedule_options_v_2::Schedule::ManualSchedule(v.into()),
);
self
}
pub fn event_driven_schedule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::EventDrivenSchedule>> {
#[allow(unreachable_patterns)]
self.schedule.as_ref().and_then(|v| match v {
crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_event_driven_schedule<
T: std::convert::Into<std::boxed::Box<crate::model::EventDrivenSchedule>>,
>(
mut self,
v: T,
) -> Self {
self.schedule = std::option::Option::Some(
crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v.into()),
);
self
}
}
impl wkt::message::Message for ScheduleOptionsV2 {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2"
}
}
pub mod schedule_options_v_2 {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Schedule {
TimeBasedSchedule(std::boxed::Box<crate::model::TimeBasedSchedule>),
ManualSchedule(std::boxed::Box<crate::model::ManualSchedule>),
EventDrivenSchedule(std::boxed::Box<crate::model::EventDrivenSchedule>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimeBasedSchedule {
pub schedule: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimeBasedSchedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.schedule = v.into();
self
}
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
}
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
}
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
}
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
}
}
impl wkt::message::Message for TimeBasedSchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManualSchedule {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManualSchedule {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ManualSchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ManualSchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EventDrivenSchedule {
pub pubsub_subscription: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EventDrivenSchedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pubsub_subscription<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.pubsub_subscription = v.into();
self
}
}
impl wkt::message::Message for EventDrivenSchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserInfo {
pub email: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_email<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.email = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_email<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.email = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UserInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UserInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferConfig {
pub name: std::string::String,
pub display_name: std::string::String,
pub data_source_id: std::string::String,
pub params: std::option::Option<wkt::Struct>,
pub schedule: std::string::String,
pub schedule_options: std::option::Option<crate::model::ScheduleOptions>,
pub schedule_options_v2: std::option::Option<crate::model::ScheduleOptionsV2>,
pub data_refresh_window_days: i32,
pub disabled: bool,
pub update_time: std::option::Option<wkt::Timestamp>,
pub next_run_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::TransferState,
pub user_id: i64,
pub dataset_region: std::string::String,
pub notification_pubsub_topic: std::string::String,
pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
pub owner_info: std::option::Option<crate::model::UserInfo>,
pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub destination: std::option::Option<crate::model::transfer_config::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_source_id = v.into();
self
}
pub fn set_params<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.params = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_params<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.params = v.map(|x| x.into());
self
}
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.schedule = v.into();
self
}
pub fn set_schedule_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ScheduleOptions>,
{
self.schedule_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schedule_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ScheduleOptions>,
{
self.schedule_options = v.map(|x| x.into());
self
}
pub fn set_schedule_options_v2<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ScheduleOptionsV2>,
{
self.schedule_options_v2 = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schedule_options_v2<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ScheduleOptionsV2>,
{
self.schedule_options_v2 = v.map(|x| x.into());
self
}
pub fn set_data_refresh_window_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.data_refresh_window_days = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
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
}
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
}
pub fn set_next_run_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.next_run_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_run_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.next_run_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.user_id = v.into();
self
}
pub fn set_dataset_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dataset_region = v.into();
self
}
pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.notification_pubsub_topic = v.into();
self
}
pub fn set_email_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EmailPreferences>,
{
self.email_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_email_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EmailPreferences>,
{
self.email_preferences = v.map(|x| x.into());
self
}
pub fn set_owner_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UserInfo>,
{
self.owner_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_owner_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UserInfo>,
{
self.owner_info = v.map(|x| x.into());
self
}
pub fn set_encryption_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfiguration>,
{
self.encryption_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfiguration>,
{
self.encryption_configuration = v.map(|x| x.into());
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_destination<
T: std::convert::Into<std::option::Option<crate::model::transfer_config::Destination>>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::transfer_config::Destination::DestinationDatasetId(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::transfer_config::Destination::DestinationDatasetId(v.into()),
);
self
}
}
impl wkt::message::Message for TransferConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferConfig"
}
}
pub mod transfer_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
DestinationDatasetId(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfiguration {
pub kms_key_name: std::option::Option<wkt::StringValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::StringValue>,
{
self.kms_key_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kms_key_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::StringValue>,
{
self.kms_key_name = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EncryptionConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferRun {
pub name: std::string::String,
pub schedule_time: std::option::Option<wkt::Timestamp>,
pub run_time: std::option::Option<wkt::Timestamp>,
pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub params: std::option::Option<wkt::Struct>,
pub data_source_id: std::string::String,
pub state: crate::model::TransferState,
pub user_id: i64,
pub schedule: std::string::String,
pub notification_pubsub_topic: std::string::String,
pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
pub destination: std::option::Option<crate::model::transfer_run::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_schedule_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.schedule_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.schedule_time = v.map(|x| x.into());
self
}
pub fn set_run_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.run_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_run_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.run_time = v.map(|x| x.into());
self
}
pub fn set_error_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error_status = v.map(|x| x.into());
self
}
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
}
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
}
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
}
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
}
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
}
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
}
pub fn set_params<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.params = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_params<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.params = v.map(|x| x.into());
self
}
pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_source_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.user_id = v.into();
self
}
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.schedule = v.into();
self
}
pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.notification_pubsub_topic = v.into();
self
}
pub fn set_email_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EmailPreferences>,
{
self.email_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_email_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EmailPreferences>,
{
self.email_preferences = v.map(|x| x.into());
self
}
pub fn set_destination<
T: std::convert::Into<std::option::Option<crate::model::transfer_run::Destination>>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::transfer_run::Destination::DestinationDatasetId(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::transfer_run::Destination::DestinationDatasetId(v.into()),
);
self
}
}
impl wkt::message::Message for TransferRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferRun"
}
}
pub mod transfer_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
DestinationDatasetId(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferMessage {
pub message_time: std::option::Option<wkt::Timestamp>,
pub severity: crate::model::transfer_message::MessageSeverity,
pub message_text: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferMessage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.message_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.message_time = v.map(|x| x.into());
self
}
pub fn set_severity<T: std::convert::Into<crate::model::transfer_message::MessageSeverity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_message_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message_text = v.into();
self
}
}
impl wkt::message::Message for TransferMessage {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferMessage"
}
}
pub mod transfer_message {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MessageSeverity {
Unspecified,
Info,
Warning,
Error,
UnknownValue(message_severity::UnknownValue),
}
#[doc(hidden)]
pub mod message_severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MessageSeverity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Info => std::option::Option::Some(1),
Self::Warning => std::option::Option::Some(2),
Self::Error => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MESSAGE_SEVERITY_UNSPECIFIED"),
Self::Info => std::option::Option::Some("INFO"),
Self::Warning => std::option::Option::Some("WARNING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MessageSeverity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MessageSeverity {
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 MessageSeverity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Info,
2 => Self::Warning,
3 => Self::Error,
_ => Self::UnknownValue(message_severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MessageSeverity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MESSAGE_SEVERITY_UNSPECIFIED" => Self::Unspecified,
"INFO" => Self::Info,
"WARNING" => Self::Warning,
"ERROR" => Self::Error,
_ => Self::UnknownValue(message_severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MessageSeverity {
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::Info => serializer.serialize_i32(1),
Self::Warning => serializer.serialize_i32(2),
Self::Error => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MessageSeverity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageSeverity>::new(
".google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub enum TransferType {
Unspecified,
Batch,
Streaming,
UnknownValue(transfer_type::UnknownValue),
}
#[doc(hidden)]
pub mod transfer_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransferType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Batch => std::option::Option::Some(1),
Self::Streaming => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
Self::Batch => std::option::Option::Some("BATCH"),
Self::Streaming => std::option::Option::Some("STREAMING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransferType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransferType {
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 TransferType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Batch,
2 => Self::Streaming,
_ => Self::UnknownValue(transfer_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransferType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
"BATCH" => Self::Batch,
"STREAMING" => Self::Streaming,
_ => Self::UnknownValue(transfer_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransferType {
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::Batch => serializer.serialize_i32(1),
Self::Streaming => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransferType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
".google.cloud.bigquery.datatransfer.v1.TransferType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransferState {
Unspecified,
Pending,
Running,
Succeeded,
Failed,
Cancelled,
UnknownValue(transfer_state::UnknownValue),
}
#[doc(hidden)]
pub mod transfer_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransferState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(2),
Self::Running => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::Cancelled => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRANSFER_STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransferState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransferState {
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 TransferState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Pending,
3 => Self::Running,
4 => Self::Succeeded,
5 => Self::Failed,
6 => Self::Cancelled,
_ => Self::UnknownValue(transfer_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransferState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSFER_STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"CANCELLED" => Self::Cancelled,
_ => Self::UnknownValue(transfer_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransferState {
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::Pending => serializer.serialize_i32(2),
Self::Running => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::Cancelled => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransferState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferState>::new(
".google.cloud.bigquery.datatransfer.v1.TransferState",
))
}
}