#![deny(
missing_docs,
rustdoc::broken_intra_doc_links,
clippy::all,
unsafe_code,
unreachable_pub
)]
#![cfg_attr(not(test), deny(unused))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(extended_key_value_attributes), cfg_attr(docsrs, doc = include_str!("../README.md")))]
# services.
Use `RUSTDOCFLAGS=\"--cfg docsrs\"` to generate crate-level docs, or read the [readme](README.md)
"
)]
pub use ::hyper::client::connect::Connect;
pub(crate) type Auth<C> = yup_oauth2::authenticator::Authenticator<C>;
macro_rules! config_default {
(
$(#[$struct_attr:meta])*
$struct_vis:vis struct $struct_name:ident {
$(
$(#[$field_attr:meta])*
// Unfortunately there doesn't seem to be a way to pass
// `stringify!($struct_name::$field_name)` to `#[serde(default = "fn")]` because
@default($field_default:expr, $field_default_fn:literal)
$field_vis:vis $field_name:ident : $field_type:ty,
)*
}
) => {
$(#[$struct_attr])*
$struct_vis struct $struct_name {
$(
$(#[$field_attr])*
#[serde(default = $field_default_fn)]
#[cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!(
"<br>_Default value:_ `", stringify!($field_default), "`"
)))]
$field_vis $field_name : $field_type,
)*
}
impl $struct_name {
pub fn new() -> Self {
Self::default()
}
::paste::paste! {
$(
#[cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!(
"Set [`", stringify!($field_name), "`]",
"(#structfield.", stringify!($field_name), ") to the given value"
)
))]
#[cfg_attr(not(docsrs), doc = "Set this field to the given value")]
#[allow(deprecated)]
pub fn $field_name(mut self, $field_name: $field_type) -> Self {
self.$field_name = $field_name;
self
}
fn [<default_ $field_name>]() -> $field_type {
$field_default
}
)*
}
}
impl ::core::default::Default for $struct_name {
#[cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!(
"_Default value:_ `", stringify!($struct_name {
$(
$field_name: $field_default
),*
}), "`"
)))]
fn default() -> $struct_name {
#[allow(deprecated)]
$struct_name {
$(
$field_name: $field_default
),*
}
}
}
};
}
pub mod auth;
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(any(feature = "pubsub", feature = "grpc"))))]
pub mod grpc;
#[cfg(feature = "pubsub")]
#[cfg_attr(docsrs, doc(cfg(feature = "pubsub")))]
pub mod pubsub;
#[cfg(feature = "storage")]
#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
pub mod storage;
mod builder;
pub use builder::{
AuthFlow, ClientBuilder, ClientBuilderConfig, CreateBuilderError, DefaultConnector,
ServiceAccountAuth,
};
pub mod retry_policy;
pub use retry_policy::RetryPolicy;