Make yup-oauth2 optional

This commit is contained in:
philippeitis
2022-10-16 17:18:33 -07:00
parent 50dd53a877
commit 7ca7f1cafd
6 changed files with 15 additions and 13 deletions

View File

@@ -58,6 +58,8 @@ path = "../${api_name}"
version = "${util.crate_version()}"
% endif
## TODO: Make yup-oauth2 optional
# [features]
# default = ["yup-oauth2"]
% if not cargo.get("is_executable", False):
[features]
yup-oauth2 = ["google-apis-common/yup-oauth2"]
default = ["yup-oauth2"]
% endif

View File

@@ -31,7 +31,7 @@ use tokio::time::sleep;
use tower_service;
use serde::{Serialize, Deserialize};
use crate::{client, client::GetToken, client::oauth2, client::serde_with};
use crate::{client, client::GetToken, client::serde_with};
// ##############
// UTILITIES ###

View File

@@ -49,5 +49,8 @@ pub mod api;
// Re-export the hub type and some basic client structs
pub use api::${hub_type};
pub use client::{Result, Error, Delegate, FieldMask};
// Re-export the yup_oauth2 crate, that is required to call some methods of the hub and the client
pub use client::{Result, Error, Delegate, oauth2, FieldMask};
#[cfg(feature = "yup-oauth2")]
pub use client::oauth2;