diff --git a/gen/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index a26add6ed5..447bf4feec 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs +++ b/gen/adexchangebuyer1d3/src/lib.rs @@ -191,7 +191,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -219,6 +219,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -322,6 +323,8 @@ pub struct AdExchangeBuyer { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AdExchangeBuyer {} @@ -334,6 +337,8 @@ impl<'a, C, A> AdExchangeBuyer client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/adexchangebuyer/v1.3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -364,9 +369,23 @@ impl<'a, C, A> AdExchangeBuyer /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/adexchangebuyer/v1.3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1885,7 +1904,7 @@ impl<'a, C, A> BillingInfoGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2118,7 +2137,7 @@ impl<'a, C, A> BillingInfoListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2320,7 +2339,7 @@ impl<'a, C, A> DirectDealListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/directdeals".to_string(); + let mut url = self.hub._base_url.clone() + "directdeals"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2524,7 +2543,7 @@ impl<'a, C, A> DirectDealGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/directdeals/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "directdeals/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2768,7 +2787,7 @@ impl<'a, C, A> BudgetPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3046,7 +3065,7 @@ impl<'a, C, A> BudgetUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3317,7 +3336,7 @@ impl<'a, C, A> BudgetGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3567,7 +3586,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3822,7 +3841,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4065,7 +4084,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/creatives/{accountId}/{buyerCreativeId}".to_string(); + let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4317,7 +4336,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4583,7 +4602,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4840,7 +4859,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5044,7 +5063,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5293,7 +5312,7 @@ impl<'a, C, A> PerformanceReportListCall<'a, C, A> where C: BorrowMut PretargetingConfigDeleteCall<'a, C, A> where C: BorrowMut PretargetingConfigPatchCall<'a, C, A> where C: BorrowMut PretargetingConfigGetCall<'a, C, A> where C: BorrowMut PretargetingConfigInsertCall<'a, C, A> where C: BorrowMut PretargetingConfigListCall<'a, C, A> where C: BorrowMut PretargetingConfigUpdateCall<'a, C, A> where C: BorrowMut PretargetingConfigUpdateCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AdExchangeBuyer {} @@ -346,6 +349,8 @@ impl<'a, C, A> AdExchangeBuyer client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/adexchangebuyer/v1.4/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -391,9 +396,23 @@ impl<'a, C, A> AdExchangeBuyer /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/adexchangebuyer/v1.4/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -3772,7 +3791,7 @@ impl<'a, C, A> PubprofileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/publisher/{accountId}/profiles".to_string(); + let mut url = self.hub._base_url.clone() + "publisher/{accountId}/profiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4007,7 +4026,7 @@ impl<'a, C, A> BillingInfoGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4240,7 +4259,7 @@ impl<'a, C, A> BillingInfoListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4451,7 +4470,7 @@ impl<'a, C, A> MarketplacedealDeleteCall<'a, C, A> where C: BorrowMut MarketplacedealInsertCall<'a, C, A> where C: BorrowMut MarketplacedealUpdateCall<'a, C, A> where C: BorrowMut MarketplacedealListCall<'a, C, A> where C: BorrowMut MarketplaceprivateauctionUpdateproposalCall<'a, C, A> where C: Bo } - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/privateauction/{privateAuctionId}/updateproposal".to_string(); + let mut url = self.hub._base_url.clone() + "privateauction/{privateAuctionId}/updateproposal"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5747,7 +5766,7 @@ impl<'a, C, A> ProposalSearchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/search".to_string(); + let mut url = self.hub._base_url.clone() + "proposals/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5963,7 +5982,7 @@ impl<'a, C, A> ProposalInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/insert".to_string(); + let mut url = self.hub._base_url.clone() + "proposals/insert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -6202,7 +6221,7 @@ impl<'a, C, A> ProposalUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}".to_string(); + let mut url = self.hub._base_url.clone() + "proposals/{proposalId}/{revisionNumber}/{updateAction}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -6480,7 +6499,7 @@ impl<'a, C, A> ProposalSetupcompleteCall<'a, C, A> where C: BorrowMut ProposalPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}".to_string(); + let mut url = self.hub._base_url.clone() + "proposals/{proposalId}/{revisionNumber}/{updateAction}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -6995,7 +7014,7 @@ impl<'a, C, A> ProposalGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/{proposalId}".to_string(); + let mut url = self.hub._base_url.clone() + "proposals/{proposalId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -7239,7 +7258,7 @@ impl<'a, C, A> BudgetUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -7510,7 +7529,7 @@ impl<'a, C, A> BudgetGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -7764,7 +7783,7 @@ impl<'a, C, A> BudgetPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}".to_string(); + let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -8047,7 +8066,7 @@ impl<'a, C, A> PerformanceReportListCall<'a, C, A> where C: BorrowMut ProductSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/products/search".to_string(); + let mut url = self.hub._base_url.clone() + "products/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -8509,7 +8528,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/products/{productId}".to_string(); + let mut url = self.hub._base_url.clone() + "products/{productId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -8749,7 +8768,7 @@ impl<'a, C, A> MarketplacenoteListCall<'a, C, A> where C: BorrowMut MarketplacenoteInsertCall<'a, C, A> where C: BorrowMut AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -9533,7 +9552,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -9737,7 +9756,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -9984,7 +10003,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -10282,7 +10301,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -10533,7 +10552,7 @@ impl<'a, C, A> CreativeRemoveDealCall<'a, C, A> where C: BorrowMut CreativeAddDealCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}".to_string(); + let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11028,7 +11047,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}".to_string(); + let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11278,7 +11297,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11508,7 +11527,7 @@ impl<'a, C, A> CreativeListDealCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/listDeals".to_string(); + let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}/listDeals"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11760,7 +11779,7 @@ impl<'a, C, A> PretargetingConfigInsertCall<'a, C, A> where C: BorrowMut PretargetingConfigListCall<'a, C, A> where C: BorrowMut PretargetingConfigUpdateCall<'a, C, A> where C: BorrowMut PretargetingConfigPatchCall<'a, C, A> where C: BorrowMut PretargetingConfigDeleteCall<'a, C, A> where C: BorrowMut PretargetingConfigGetCall<'a, C, A> where C: BorrowMut PretargetingConfigGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AdExchangeSeller {} @@ -342,6 +345,8 @@ impl<'a, C, A> AdExchangeSeller client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/adexchangeseller/v2.0/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -354,9 +359,23 @@ impl<'a, C, A> AdExchangeSeller /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/adexchangeseller/v2.0/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1244,7 +1263,7 @@ impl<'a, C, A> AccountReportSavedGenerateCall<'a, C, A> where C: BorrowMut AccountMetadataMetricListCall<'a, C, A> where C: BorrowMut AccountReportGenerateCall<'a, C, A> where C: BorrowMut AccountUrlchannelListCall<'a, C, A> where C: BorrowMut AccountReportSavedListCall<'a, C, A> where C: BorrowMut AccountPreferreddealGetCall<'a, C, A> where C: BorrowMut AccountAdclientListCall<'a, C, A> where C: BorrowMut AccountMetadataDimensionListCall<'a, C, A> where C: BorrowMut AccountCustomchannelGetCall<'a, C, A> where C: BorrowMut AccountCustomchannelListCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangeseller/v2.0/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeSellerReadonly.as_ref().to_string(), ()); } @@ -4153,7 +4172,7 @@ impl<'a, C, A> AccountAlertListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangeseller/v2.0/accounts/{accountId}/alerts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/alerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeSellerReadonly.as_ref().to_string(), ()); } @@ -4395,7 +4414,7 @@ impl<'a, C, A> AccountPreferreddealListCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adexchangeseller/v2.0/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeSellerReadonly.as_ref().to_string(), ()); } @@ -4795,4 +4814,3 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/admin1_directory/src/lib.rs b/gen/admin1_directory/src/lib.rs index 845eeac78b..86ead9aab7 100644 --- a/gen/admin1_directory/src/lib.rs +++ b/gen/admin1_directory/src/lib.rs @@ -248,7 +248,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -276,6 +276,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -495,6 +496,8 @@ pub struct Directory { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Directory {} @@ -507,6 +510,8 @@ impl<'a, C, A> Directory client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/admin/directory/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -573,9 +578,23 @@ impl<'a, C, A> Directory /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/admin/directory/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -5040,7 +5059,7 @@ impl<'a, C, A> VerificationCodeGenerateCall<'a, C, A> where C: BorrowMut VerificationCodeInvalidateCall<'a, C, A> where C: BorrowMut VerificationCodeListCall<'a, C, A> where C: BorrowMut CustomerPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customers/{customerKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryCustomer.as_ref().to_string(), ()); } @@ -5990,7 +6009,7 @@ impl<'a, C, A> CustomerGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customers/{customerKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryCustomerReadonly.as_ref().to_string(), ()); } @@ -6232,7 +6251,7 @@ impl<'a, C, A> CustomerUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customers/{customerKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryCustomer.as_ref().to_string(), ()); } @@ -6501,7 +6520,7 @@ impl<'a, C, A> OrgunitListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunitReadonly.as_ref().to_string(), ()); } @@ -6757,7 +6776,7 @@ impl<'a, C, A> OrgunitInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -7029,7 +7048,7 @@ impl<'a, C, A> OrgunitUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -7304,7 +7323,7 @@ impl<'a, C, A> OrgunitDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -7546,7 +7565,7 @@ impl<'a, C, A> OrgunitGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunitReadonly.as_ref().to_string(), ()); } @@ -7805,7 +7824,7 @@ impl<'a, C, A> OrgunitPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -8082,7 +8101,7 @@ impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8350,7 +8369,7 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8628,7 +8647,7 @@ impl<'a, C, A> MemberUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8912,7 +8931,7 @@ impl<'a, C, A> MemberListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); } @@ -9170,7 +9189,7 @@ impl<'a, C, A> MemberGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); } @@ -9416,7 +9435,7 @@ impl<'a, C, A> MemberDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -9660,7 +9679,7 @@ impl<'a, C, A> RoleUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -9931,7 +9950,7 @@ impl<'a, C, A> RoleGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -10177,7 +10196,7 @@ impl<'a, C, A> RoleDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -10421,7 +10440,7 @@ impl<'a, C, A> RolePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -10697,7 +10716,7 @@ impl<'a, C, A> RoleInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -10966,7 +10985,7 @@ impl<'a, C, A> RoleListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -11230,7 +11249,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/notifications".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/notifications"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryNotification.as_ref().to_string(), ()); } @@ -11495,7 +11514,7 @@ impl<'a, C, A> NotificationUpdateCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/notifications/{notificationId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/notifications/{notificationId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryNotification.as_ref().to_string(), ()); } @@ -12256,7 +12275,7 @@ impl<'a, C, A> NotificationPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/notifications/{notificationId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/notifications/{notificationId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryNotification.as_ref().to_string(), ()); } @@ -12525,7 +12544,7 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/ALL/privileges".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/ALL/privileges"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -12764,7 +12783,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/admin/directory/v1//admin/directory_v1/channels/stop".to_string(); + let mut url = self.hub._base_url.clone() + "/admin/directory_v1/channels/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -12989,7 +13008,7 @@ impl<'a, C, A> MobiledeviceGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/devices/mobile/{resourceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDeviceMobileReadonly.as_ref().to_string(), ()); } @@ -13271,7 +13290,7 @@ impl<'a, C, A> MobiledeviceListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/devices/mobile".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/devices/mobile"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDeviceMobileReadonly.as_ref().to_string(), ()); } @@ -13549,7 +13568,7 @@ impl<'a, C, A> MobiledeviceDeleteCall<'a, C, A> where C: BorrowMut MobiledeviceActionCall<'a, C, A> where C: BorrowMut TokenGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/tokens/{clientId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/tokens/{clientId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -14298,7 +14317,7 @@ impl<'a, C, A> TokenListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/tokens".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/tokens"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -14534,7 +14553,7 @@ impl<'a, C, A> TokenDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/tokens/{clientId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/tokens/{clientId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -14776,7 +14795,7 @@ impl<'a, C, A> RoleAssignmentInsertCall<'a, C, A> where C: BorrowMut RoleAssignmentGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/roleassignments/{roleAssignmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -15283,7 +15302,7 @@ impl<'a, C, A> RoleAssignmentDeleteCall<'a, C, A> where C: BorrowMut RoleAssignmentListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdevicePatchCall<'a, C, A> where C: BorrowMut ChromeosdeviceUpdateCall<'a, C, A> where C: BorrowMut ChromeosdeviceGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/devices/chromeos/{deviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDeviceChromeoReadonly.as_ref().to_string(), ()); } @@ -16955,7 +16974,7 @@ impl<'a, C, A> ChromeosdeviceActionCall<'a, C, A> where C: BorrowMut GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -17461,7 +17480,7 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups".to_string(); + let mut url = self.hub._base_url.clone() + "groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); } @@ -17707,7 +17726,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -17971,7 +17990,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups".to_string(); + let mut url = self.hub._base_url.clone() + "groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -18206,7 +18225,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/aliases".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -18465,7 +18484,7 @@ impl<'a, C, A> GroupAliaseListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/aliases".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); } @@ -18700,7 +18719,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); } @@ -18942,7 +18961,7 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -19202,7 +19221,7 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/aliases/{alias}".to_string(); + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases/{alias}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -19439,7 +19458,7 @@ impl<'a, C, A> AspGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/asps/{codeId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/asps/{codeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -19685,7 +19704,7 @@ impl<'a, C, A> AspDeleteCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/asps/{codeId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/asps/{codeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -19920,7 +19939,7 @@ impl<'a, C, A> AspListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/asps".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/asps"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -20155,7 +20174,7 @@ impl<'a, C, A> DomainListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/domains"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -20392,7 +20411,7 @@ impl<'a, C, A> DomainGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains/{domainName}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/domains/{domainName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -20644,7 +20663,7 @@ impl<'a, C, A> DomainInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/domains"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomain.as_ref().to_string(), ()); } @@ -20904,7 +20923,7 @@ impl<'a, C, A> DomainDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains/{domainName}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/domains/{domainName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomain.as_ref().to_string(), ()); } @@ -21146,7 +21165,7 @@ impl<'a, C, A> DomainAliaseInsertCall<'a, C, A> where C: BorrowMut DomainAliaseGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases/{domainAliasName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -21657,7 +21676,7 @@ impl<'a, C, A> DomainAliaseListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domainaliases".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -21900,7 +21919,7 @@ impl<'a, C, A> DomainAliaseDeleteCall<'a, C, A> where C: BorrowMut SchemaGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschemaReadonly.as_ref().to_string(), ()); } @@ -22391,7 +22410,7 @@ impl<'a, C, A> SchemaUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -22660,7 +22679,7 @@ impl<'a, C, A> SchemaListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschemaReadonly.as_ref().to_string(), ()); } @@ -22904,7 +22923,7 @@ impl<'a, C, A> SchemaPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -23174,7 +23193,7 @@ impl<'a, C, A> SchemaDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -23416,7 +23435,7 @@ impl<'a, C, A> SchemaInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas".to_string(); + let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -23685,7 +23704,7 @@ impl<'a, C, A> ResourceCalendarListCall<'a, C, A> where C: BorrowMut ResourceCalendarGetCall<'a, C, A> where C: BorrowMut ResourceCalendarInsertCall<'a, C, A> where C: BorrowMut ResourceCalendarPatchCall<'a, C, A> where C: BorrowMut ResourceCalendarUpdateCall<'a, C, A> where C: BorrowMut ResourceCalendarDeleteCall<'a, C, A> where C: BorrowMut UserUndeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/undelete".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -25493,7 +25512,7 @@ impl<'a, C, A> UserPhotoDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -25725,7 +25744,7 @@ impl<'a, C, A> UserPhotoPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -25989,7 +26008,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users".to_string(); + let mut url = self.hub._base_url.clone() + "users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -26229,7 +26248,7 @@ impl<'a, C, A> UserAliaseWatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases/watch".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -26502,7 +26521,7 @@ impl<'a, C, A> UserPhotoUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -26826,7 +26845,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/watch".to_string(); + let mut url = self.hub._base_url.clone() + "users/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -27145,7 +27164,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -27404,7 +27423,7 @@ impl<'a, C, A> UserPhotoGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserReadonly.as_ref().to_string(), ()); } @@ -27697,7 +27716,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users".to_string(); + let mut url = self.hub._base_url.clone() + "users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserReadonly.as_ref().to_string(), ()); } @@ -28000,7 +28019,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserReadonly.as_ref().to_string(), ()); } @@ -28263,7 +28282,7 @@ impl<'a, C, A> UserAliaseInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -28527,7 +28546,7 @@ impl<'a, C, A> UserAliaseListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserAliaReadonly.as_ref().to_string(), ()); } @@ -28775,7 +28794,7 @@ impl<'a, C, A> UserMakeAdminCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/makeAdmin".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/makeAdmin"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29031,7 +29050,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29291,7 +29310,7 @@ impl<'a, C, A> UserAliaseDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases/{alias}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/{alias}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29525,7 +29544,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29680,4 +29699,3 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/admin1_reports/src/lib.rs b/gen/admin1_reports/src/lib.rs index c807e5f895..dc0b635f69 100644 --- a/gen/admin1_reports/src/lib.rs +++ b/gen/admin1_reports/src/lib.rs @@ -196,7 +196,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -224,6 +224,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -339,6 +340,8 @@ pub struct Reports { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Reports {} @@ -351,6 +354,8 @@ impl<'a, C, A> Reports client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/admin/reports/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -372,9 +377,23 @@ impl<'a, C, A> Reports /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/admin/reports/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1071,7 +1090,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/admin/reports/v1//admin/reports_v1/channels/stop".to_string(); + let mut url = self.hub._base_url.clone() + "/admin/reports_v1/channels/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); } @@ -1338,7 +1357,7 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch".to_string(); + let mut url = self.hub._base_url.clone() + "activity/users/{userKey}/applications/{applicationName}/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); } @@ -1705,7 +1724,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}".to_string(); + let mut url = self.hub._base_url.clone() + "activity/users/{userKey}/applications/{applicationName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); } @@ -2021,7 +2040,7 @@ impl<'a, C, A> CustomerUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AdSense {} @@ -370,6 +373,8 @@ impl<'a, C, A> AdSense client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/adsense/v1.4/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -409,9 +414,23 @@ impl<'a, C, A> AdSense /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/adsense/v1.4/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2436,7 +2455,7 @@ impl<'a, C, A> UrlchannelListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/urlchannels".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2697,7 +2716,7 @@ impl<'a, C, A> AdunitCustomchannelListCall<'a, C, A> where C: BorrowMut AdunitGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/adunits/{adUnitId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3218,7 +3237,7 @@ impl<'a, C, A> AdunitListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/adunits".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/adunits"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3476,7 +3495,7 @@ impl<'a, C, A> AdunitGetAdCodeCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/adcode".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/adunits/{adUnitId}/adcode"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3729,7 +3748,7 @@ impl<'a, C, A> AdclientListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients".to_string(); + let mut url = self.hub._base_url.clone() + "adclients"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3946,7 +3965,7 @@ impl<'a, C, A> AlertDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/adsense/v1.4/alerts/{alertId}".to_string(); + let mut url = self.hub._base_url.clone() + "alerts/{alertId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4174,7 +4193,7 @@ impl<'a, C, A> AlertListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/alerts".to_string(); + let mut url = self.hub._base_url.clone() + "alerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4393,7 +4412,7 @@ impl<'a, C, A> SavedadstyleListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/savedadstyles".to_string(); + let mut url = self.hub._base_url.clone() + "savedadstyles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4611,7 +4630,7 @@ impl<'a, C, A> SavedadstyleGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/savedadstyles/{savedAdStyleId}".to_string(); + let mut url = self.hub._base_url.clone() + "savedadstyles/{savedAdStyleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4854,7 +4873,7 @@ impl<'a, C, A> ReportSavedListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/reports/saved".to_string(); + let mut url = self.hub._base_url.clone() + "reports/saved"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5155,7 +5174,7 @@ impl<'a, C, A> ReportGenerateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/adsense/v1.4/reports".to_string(); + let mut url = self.hub._base_url.clone() + "reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5469,7 +5488,7 @@ impl<'a, C, A> ReportSavedGenerateCall<'a, C, A> where C: BorrowMut AccountAlertDeleteCall<'a, C, A> where C: BorrowMut AccountAlertListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/alerts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/alerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6225,7 +6244,7 @@ impl<'a, C, A> AccountReportSavedGenerateCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6717,7 +6736,7 @@ impl<'a, C, A> AccountPaymentListCall<'a, C, A> where C: BorrowMut AccountSavedadstyleGetCall<'a, C, A> where C: BorrowMut AccountAdunitGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7462,7 +7481,7 @@ impl<'a, C, A> AccountCustomchannelGetCall<'a, C, A> where C: BorrowMut AccountCustomchannelAdunitListCall<'a, C, A> where C: BorrowMut AccountReportSavedListCall<'a, C, A> where C: BorrowMut AccountUrlchannelListCall<'a, C, A> where C: BorrowMut AccountAdunitListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8903,7 +8922,7 @@ impl<'a, C, A> AccountReportGenerateCall<'a, C, A> where C: BorrowMut AccountAdclientListCall<'a, C, A> where C: BorrowMut AccountCustomchannelListCall<'a, C, A> where C: BorrowMut AccountSavedadstyleListCall<'a, C, A> where C: BorrowMut AccountAdunitGetAdCodeCall<'a, C, A> where C: BorrowMut AccountAdunitCustomchannelListCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10801,7 +10820,7 @@ impl<'a, C, A> PaymentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/payments".to_string(); + let mut url = self.hub._base_url.clone() + "payments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11003,7 +11022,7 @@ impl<'a, C, A> MetadataDimensionListCall<'a, C, A> where C: BorrowMut MetadataMetricListCall<'a, C, A> where C: BorrowMut CustomchannelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels/{customChannelId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11666,7 +11685,7 @@ impl<'a, C, A> CustomchannelListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/customchannels".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11932,7 +11951,7 @@ impl<'a, C, A> CustomchannelAdunitListCall<'a, C, A> where C: BorrowMut CustomchannelAdunitListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AdSenseHost {} @@ -342,6 +345,8 @@ impl<'a, C, A> AdSenseHost client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/adsensehost/v4.1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -369,9 +374,23 @@ impl<'a, C, A> AdSenseHost /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/adsensehost/v4.1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1757,7 +1776,7 @@ impl<'a, C, A> UrlchannelInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/urlchannels".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2018,7 +2037,7 @@ impl<'a, C, A> UrlchannelDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/urlchannels/{urlChannelId}".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels/{urlChannelId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2273,7 +2292,7 @@ impl<'a, C, A> UrlchannelListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/urlchannels".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2530,7 +2549,7 @@ impl<'a, C, A> AdclientListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients".to_string(); + let mut url = self.hub._base_url.clone() + "adclients"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2748,7 +2767,7 @@ impl<'a, C, A> AdclientGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2999,7 +3018,7 @@ impl<'a, C, A> AssociationsessionStartCall<'a, C, A> where C: BorrowMut AssociationsessionVerifyCall<'a, C, A> where C: BorrowMut ReportGenerateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/reports".to_string(); + let mut url = self.hub._base_url.clone() + "reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3791,7 +3810,7 @@ impl<'a, C, A> AccountAdunitListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4061,7 +4080,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4287,7 +4306,7 @@ impl<'a, C, A> AccountAdunitGetAdCodeCall<'a, C, A> where C: BorrowMut AccountReportGenerateCall<'a, C, A> where C: BorrowMut AccountAdunitDeleteCall<'a, C, A> where C: BorrowMut AccountAdclientListCall<'a, C, A> where C: BorrowMut AccountAdunitPatchCall<'a, C, A> where C: BorrowMut AccountAdclientGetCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6204,7 +6223,7 @@ impl<'a, C, A> AccountAdunitInsertCall<'a, C, A> where C: BorrowMut AccountAdunitGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6741,7 +6760,7 @@ impl<'a, C, A> AccountAdunitUpdateCall<'a, C, A> where C: BorrowMut CustomchannelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/customchannels/{customChannelId}".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels/{customChannelId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7259,7 +7278,7 @@ impl<'a, C, A> CustomchannelDeleteCall<'a, C, A> where C: BorrowMut CustomchannelUpdateCall<'a, C, A> where C: BorrowMut CustomchannelListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/customchannels".to_string(); + let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8038,7 +8057,7 @@ impl<'a, C, A> CustomchannelPatchCall<'a, C, A> where C: BorrowMut CustomchannelInsertCall<'a, C, A> where C: BorrowMut CustomchannelInsertCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Analytics {} @@ -354,6 +357,8 @@ impl<'a, C, A> Analytics client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/analytics/v3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -375,9 +380,23 @@ impl<'a, C, A> Analytics /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/analytics/v3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -5593,7 +5612,7 @@ impl<'a, C, A> ManagementWebpropertyInsertCall<'a, C, A> where C: BorrowMut ManagementProfileGetCall<'a, C, A> where C: BorrowMut ManagementAccountListCall<'a, C, A> where C: BorrowMut ManagementProfileFilterLinkPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -6642,7 +6661,7 @@ impl<'a, C, A> ManagementWebpropertyUserLinkDeleteCall<'a, C, A> where C: Borrow } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -6892,7 +6911,7 @@ impl<'a, C, A> ManagementProfileUserLinkDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -7160,7 +7179,7 @@ impl<'a, C, A> ManagementProfileUserLinkUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -7456,7 +7475,7 @@ impl<'a, C, A> ManagementFilterInsertCall<'a, C, A> where C: BorrowMut ManagementAccountUserLinkUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/entityUserLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -7999,7 +8018,7 @@ impl<'a, C, A> ManagementProfileFilterLinkGetCall<'a, C, A> where C: BorrowMut ManagementWebpropertyUserLinkUpdateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -8565,7 +8584,7 @@ impl<'a, C, A> ManagementUnsampledReportInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8849,7 +8868,7 @@ impl<'a, C, A> ManagementProfileFilterLinkDeleteCall<'a, C, A> where C: BorrowMu } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -9115,7 +9134,7 @@ impl<'a, C, A> ManagementRemarketingAudienceUpdateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -9398,7 +9417,7 @@ impl<'a, C, A> ManagementCustomMetricGetCall<'a, C, A> where C: BorrowMut ManagementUploadGetCall<'a, C, A> where C: BorrowMut ManagementExperimentPatchCall<'a, C, A> where C: BorrowMut ManagementWebpropertyUserLinkListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUserReadonly.as_ref().to_string(), ()); } @@ -10510,7 +10529,7 @@ impl<'a, C, A> ManagementProfileFilterLinkUpdateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -10805,7 +10824,7 @@ impl<'a, C, A> ManagementExperimentGetCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -11378,7 +11397,7 @@ impl<'a, C, A> ManagementUnsampledReportGetCall<'a, C, A> where C: BorrowMut ManagementProfileFilterLinkInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -11942,7 +11961,7 @@ impl<'a, C, A> ManagementFilterUpdateCall<'a, C, A> where C: BorrowMut ManagementUploadUploadDataCall<'a, C, A> where C: BorrowMut ManagementWebPropertyAdWordsLinkListCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12861,7 +12880,7 @@ impl<'a, C, A> ManagementExperimentInsertCall<'a, C, A> where C: BorrowMut ManagementSegmentListCall<'a, C, A> where C: BorrowMut ManagementProfileDeleteCall<'a, C, A> where C: BorrowMut ManagementGoalPatchCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionPatchCall<'a, C, A> where C: BorrowMut ManagementWebPropertyAdWordsLinkGetCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14491,7 +14510,7 @@ impl<'a, C, A> ManagementExperimentListCall<'a, C, A> where C: BorrowMut ManagementProfileListCall<'a, C, A> where C: BorrowMut ManagementGoalListCall<'a, C, A> where C: BorrowMut ManagementGoalInsertCall<'a, C, A> where C: BorrowMut ManagementCustomMetricPatchCall<'a, C, A> where C: BorrowMut ManagementProfileFilterLinkListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16196,7 +16215,7 @@ impl<'a, C, A> ManagementAccountUserLinkInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/entityUserLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/entityUserLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -16464,7 +16483,7 @@ impl<'a, C, A> ManagementWebpropertyUserLinkInsertCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -16742,7 +16761,7 @@ impl<'a, C, A> ManagementCustomMetricInsertCall<'a, C, A> where C: BorrowMut ManagementUnsampledReportDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -17282,7 +17301,7 @@ impl<'a, C, A> ManagementProfilePatchCall<'a, C, A> where C: BorrowMut ManagementFilterGetCall<'a, C, A> where C: BorrowMut ManagementAccountSummaryListCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionListCall<'a, C, A> where C: BorrowMut ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut ManagementUploadListCall<'a, C, A> where C: BorrowMut ManagementProfileUserLinkListCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudienceInsertCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -19430,7 +19449,7 @@ impl<'a, C, A> ManagementWebPropertyAdWordsLinkDeleteCall<'a, C, A> where C: Bor } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -19685,7 +19704,7 @@ impl<'a, C, A> ManagementUploadDeleteUploadDataCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19963,7 +19982,7 @@ impl<'a, C, A> ManagementWebPropertyAdWordsLinkInsertCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -20237,7 +20256,7 @@ impl<'a, C, A> ManagementExperimentDeleteCall<'a, C, A> where C: BorrowMut ManagementGoalUpdateCall<'a, C, A> where C: BorrowMut ManagementCustomDataSourceListCall<'a, C, A> where C: BorrowMut ManagementCustomMetricListCall<'a, C, A> where C: BorrowMut ManagementUnsampledReportListCall<'a, C, A> where C: BorrowMut ManagementWebpropertyGetCall<'a, C, A> where C: BorrowMut ManagementProfileUpdateCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionGetCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudienceGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -22677,7 +22696,7 @@ impl<'a, C, A> ManagementRemarketingAudienceDeleteCall<'a, C, A> where C: Borrow } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -22931,7 +22950,7 @@ impl<'a, C, A> ManagementWebpropertyUpdateCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -23479,7 +23498,7 @@ impl<'a, C, A> ManagementAccountUserLinkDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/entityUserLinks/{linkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -23725,7 +23744,7 @@ impl<'a, C, A> ManagementProfileUserLinkInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -24017,7 +24036,7 @@ impl<'a, C, A> ManagementExperimentUpdateCall<'a, C, A> where C: BorrowMut ManagementWebpropertyListCall<'a, C, A> where C: BorrowMut ManagementWebPropertyAdWordsLinkPatchCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -24861,7 +24880,7 @@ impl<'a, C, A> ManagementGoalGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -25142,7 +25161,7 @@ impl<'a, C, A> ManagementCustomMetricUpdateCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudiencePatchCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -25729,7 +25748,7 @@ impl<'a, C, A> ManagementWebPropertyAdWordsLinkUpdateCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -26017,7 +26036,7 @@ impl<'a, C, A> ManagementFilterPatchCall<'a, C, A> where C: BorrowMut ManagementFilterListCall<'a, C, A> where C: BorrowMut ManagementFilterDeleteCall<'a, C, A> where C: BorrowMut ManagementProfileInsertCall<'a, C, A> where C: BorrowMut ManagementAccountUserLinkListCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudienceListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences".to_string(); + let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -27647,7 +27666,7 @@ impl<'a, C, A> DataMcfGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/data/mcf".to_string(); + let mut url = self.hub._base_url.clone() + "data/mcf"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -27984,7 +28003,7 @@ impl<'a, C, A> DataGaGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/data/ga".to_string(); + let mut url = self.hub._base_url.clone() + "data/ga"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -28313,7 +28332,7 @@ impl<'a, C, A> DataRealtimeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/data/realtime".to_string(); + let mut url = self.hub._base_url.clone() + "data/realtime"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -28570,7 +28589,7 @@ impl<'a, C, A> ProvisioningCreateAccountTicketCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/analytics/v3/provisioning/createAccountTicket".to_string(); + let mut url = self.hub._base_url.clone() + "provisioning/createAccountTicket"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Provision.as_ref().to_string(), ()); } @@ -28798,7 +28817,7 @@ impl<'a, C, A> MetadataColumnListCall<'a, C, A> where C: BorrowMut MetadataColumnListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AndroidEnterprise {} @@ -350,6 +353,8 @@ impl<'a, C, A> AndroidEnterprise client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/androidenterprise/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -401,9 +406,23 @@ impl<'a, C, A> AndroidEnterprise /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/androidenterprise/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -4102,7 +4121,7 @@ impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageGetCall<'a, C, A> where C: BorrowMut StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut StorelayoutpageInsertCall<'a, C, A> where C: BorrowMut StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut UserRevokeTokenCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/token"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5889,7 +5908,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6160,7 +6179,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6406,7 +6425,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6645,7 +6664,7 @@ impl<'a, C, A> UserGenerateAuthenticationTokenCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/authenticationToken"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6892,7 +6911,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7148,7 +7167,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7427,7 +7446,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7690,7 +7709,7 @@ impl<'a, C, A> UserGenerateTokenCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/token"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7944,7 +7963,7 @@ impl<'a, C, A> UserSetAvailableProductSetCall<'a, C, A> where C: BorrowMut UserGetAvailableProductSetCall<'a, C, A> where C: BorrowMut InstallPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8768,7 +8787,7 @@ impl<'a, C, A> InstallGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9037,7 +9056,7 @@ impl<'a, C, A> InstallListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9297,7 +9316,7 @@ impl<'a, C, A> InstallDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9565,7 +9584,7 @@ impl<'a, C, A> InstallUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9856,7 +9875,7 @@ impl<'a, C, A> GrouplicenseGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10101,7 +10120,7 @@ impl<'a, C, A> GrouplicenseListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/groupLicenses"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10341,7 +10360,7 @@ impl<'a, C, A> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> where C: Borro } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10600,7 +10619,7 @@ impl<'a, C, A> ManagedconfigurationsfordeviceListCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10868,7 +10887,7 @@ impl<'a, C, A> ManagedconfigurationsfordeviceUpdateCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11163,7 +11182,7 @@ impl<'a, C, A> ManagedconfigurationsfordeviceGetCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11441,7 +11460,7 @@ impl<'a, C, A> ManagedconfigurationsfordevicePatchCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11741,7 +11760,7 @@ impl<'a, C, A> DeviceSetStateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12024,7 +12043,7 @@ impl<'a, C, A> DeviceGetStateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12281,7 +12300,7 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12530,7 +12549,7 @@ impl<'a, C, A> DeviceGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12787,7 +12806,7 @@ impl<'a, C, A> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> where C: Borro } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/acknowledgeNotificationSet".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/acknowledgeNotificationSet"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12987,7 +13006,7 @@ impl<'a, C, A> EnterpriseUnenrollCall<'a, C, A> where C: BorrowMut EnterpriseInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13457,7 +13476,7 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/sendTestPushNotification"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13692,7 +13711,7 @@ impl<'a, C, A> EnterpriseListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13906,7 +13925,7 @@ impl<'a, C, A> EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut EnterprisePullNotificationSetCall<'a, C, A> where C: BorrowMut EnterpriseEnrollCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/enroll".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/enroll"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15099,7 +15118,7 @@ impl<'a, C, A> EnterpriseGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15345,7 +15364,7 @@ impl<'a, C, A> EnterpriseGetServiceAccountCall<'a, C, A> where C: BorrowMut EnterpriseSetAccountCall<'a, C, A> where C: BorrowMut EnterpriseDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16080,7 +16099,7 @@ impl<'a, C, A> EnterpriseGenerateSignupUrlCall<'a, C, A> where C: BorrowMut EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut StorelayoutclusterDeleteCall<'a, C, A> where C: BorrowMut StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut StorelayoutclusterListCall<'a, C, A> where C: BorrowMut StorelayoutclusterUpdateCall<'a, C, A> where C: BorrowMut StorelayoutclusterGetCall<'a, C, A> where C: BorrowMut ProductGetPermissionCall<'a, C, A> where C: BorrowMut ProductUnapproveCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/unapprove"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18662,7 +18681,7 @@ impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut ProductGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19183,7 +19202,7 @@ impl<'a, C, A> ProductApproveCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/approve"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19449,7 +19468,7 @@ impl<'a, C, A> ProductGetAppRestrictionsSchemaCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19726,7 +19745,7 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20007,7 +20026,7 @@ impl<'a, C, A> ManagedconfigurationsforuserPatchCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20289,7 +20308,7 @@ impl<'a, C, A> ManagedconfigurationsforuserDeleteCall<'a, C, A> where C: BorrowM } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20536,7 +20555,7 @@ impl<'a, C, A> ManagedconfigurationsforuserListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20792,7 +20811,7 @@ impl<'a, C, A> ManagedconfigurationsforuserUpdateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21075,7 +21094,7 @@ impl<'a, C, A> ManagedconfigurationsforuserGetCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21332,7 +21351,7 @@ impl<'a, C, A> GrouplicenseuserListCall<'a, C, A> where C: BorrowMut EntitlementDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21841,7 +21860,7 @@ impl<'a, C, A> EntitlementUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22131,7 +22150,7 @@ impl<'a, C, A> EntitlementGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22388,7 +22407,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22649,7 +22668,7 @@ impl<'a, C, A> EntitlementPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22944,7 +22963,7 @@ impl<'a, C, A> ServiceaccountkeyInsertCall<'a, C, A> where C: BorrowMut ServiceaccountkeyListCall<'a, C, A> where C: BorrowMut ServiceaccountkeyDeleteCall<'a, C, A> where C: BorrowMut PermissionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidenterprise/v1/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23851,4 +23870,3 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/androidpublisher2/src/lib.rs b/gen/androidpublisher2/src/lib.rs index 5e128cf9d6..582df38857 100644 --- a/gen/androidpublisher2/src/lib.rs +++ b/gen/androidpublisher2/src/lib.rs @@ -195,7 +195,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -223,6 +223,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -327,6 +328,8 @@ pub struct AndroidPublisher { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AndroidPublisher {} @@ -339,6 +342,8 @@ impl<'a, C, A> AndroidPublisher client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/androidpublisher/v2/applications/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -363,9 +368,23 @@ impl<'a, C, A> AndroidPublisher /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/androidpublisher/v2/applications/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -3212,7 +3231,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/entitlements".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/entitlements"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3454,7 +3473,7 @@ impl<'a, C, A> PurchaseSubscriptionRevokeCall<'a, C, A> where C: BorrowMut PurchaseProductGetCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionGetCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionCancelCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionRefundCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionDeferCall<'a, C, A> where C: BorrowMut EditDeobfuscationfileUploadCall<'a, C, A> where C: BorrowMut EditImageUploadCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", "resumable") } else { unreachable!() }; @@ -6066,7 +6085,7 @@ impl<'a, C, A> EditExpansionfileUpdateCall<'a, C, A> where C: BorrowMut EditDetailGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/details".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/details"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6602,7 +6621,7 @@ impl<'a, C, A> EditListingDeleteallCall<'a, C, A> where C: BorrowMut EditApkAddexternallyhostedCall<'a, C, A> where C: BorrowMut EditApklistingDeleteallCall<'a, C, A> where C: BorrowMut EditDetailUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/details".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/details"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7645,7 +7664,7 @@ impl<'a, C, A> EditTrackGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks/{track}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7913,7 +7932,7 @@ impl<'a, C, A> EditExpansionfilePatchCall<'a, C, A> where C: BorrowMut EditImageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}/{imageType}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8482,7 +8501,7 @@ impl<'a, C, A> EditTrackUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks/{track}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8772,7 +8791,7 @@ impl<'a, C, A> EditListingPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9053,7 +9072,7 @@ impl<'a, C, A> EditGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9305,7 +9324,7 @@ impl<'a, C, A> EditImageDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9573,9 +9592,9 @@ impl<'a, C, A> EditApkUploadCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks", "resumable") } else { unreachable!() }; @@ -9936,7 +9955,7 @@ impl<'a, C, A> EditApklistingUpdateCall<'a, C, A> where C: BorrowMut EditApkListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/apks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10483,7 +10502,7 @@ impl<'a, C, A> EditApklistingPatchCall<'a, C, A> where C: BorrowMut EditListingGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11036,7 +11055,7 @@ impl<'a, C, A> EditApklistingDeleteCall<'a, C, A> where C: BorrowMut EditTesterGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/testers/{track}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11548,7 +11567,7 @@ impl<'a, C, A> EditDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11793,9 +11812,9 @@ impl<'a, C, A> EditExpansionfileUploadCall<'a, C, A> where C: BorrowMut EditInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12430,7 +12449,7 @@ impl<'a, C, A> EditListingListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12684,7 +12703,7 @@ impl<'a, C, A> EditTesterPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/testers/{track}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12964,7 +12983,7 @@ impl<'a, C, A> EditCommitCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}:commit".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}:commit"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13211,7 +13230,7 @@ impl<'a, C, A> EditTrackListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13458,7 +13477,7 @@ impl<'a, C, A> EditValidateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}:validate".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}:validate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13714,7 +13733,7 @@ impl<'a, C, A> EditListingUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13999,7 +14018,7 @@ impl<'a, C, A> EditExpansionfileGetCall<'a, C, A> where C: BorrowMut EditImageDeleteallCall<'a, C, A> where C: BorrowMut EditDetailPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/details".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/details"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14822,7 +14841,7 @@ impl<'a, C, A> EditTrackPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks/{track}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15104,7 +15123,7 @@ impl<'a, C, A> EditListingDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15355,7 +15374,7 @@ impl<'a, C, A> EditApklistingGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15629,7 +15648,7 @@ impl<'a, C, A> EditTesterUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/testers/{track}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15911,7 +15930,7 @@ impl<'a, C, A> EditApklistingListCall<'a, C, A> where C: BorrowMut ReviewReplyCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}:reply".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/reviews/{reviewId}:reply"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16450,7 +16469,7 @@ impl<'a, C, A> ReviewGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/reviews/{reviewId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16720,7 +16739,7 @@ impl<'a, C, A> ReviewListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/reviews".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/reviews"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16982,7 +17001,7 @@ impl<'a, C, A> InappproductBatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/inappproducts/batch".to_string(); + let mut url = self.hub._base_url.clone() + "inappproducts/batch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17225,7 +17244,7 @@ impl<'a, C, A> InappproductListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/inappproducts".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/inappproducts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17490,7 +17509,7 @@ impl<'a, C, A> InappproductInsertCall<'a, C, A> where C: BorrowMut InappproductDeleteCall<'a, C, A> where C: BorrowMut InappproductGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/inappproducts/{sku}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18252,7 +18271,7 @@ impl<'a, C, A> InappproductUpdateCall<'a, C, A> where C: BorrowMut InappproductPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}".to_string(); + let mut url = self.hub._base_url.clone() + "{packageName}/inappproducts/{sku}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18748,4 +18767,3 @@ impl<'a, C, A> InappproductPatchCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/appengine1/src/lib.rs b/gen/appengine1/src/lib.rs index 1d05dc5516..303b24690a 100644 --- a/gen/appengine1/src/lib.rs +++ b/gen/appengine1/src/lib.rs @@ -186,7 +186,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -214,6 +214,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -325,6 +326,8 @@ pub struct Appengine { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Appengine {} @@ -337,6 +340,8 @@ impl<'a, C, A> Appengine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://appengine.googleapis.com/".to_string(), + _root_url: "https://appengine.googleapis.com/".to_string(), } } @@ -349,9 +354,23 @@ impl<'a, C, A> Appengine /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://appengine.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://appengine.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1997,7 +2016,7 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppRepairCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}:repair".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}:repair"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2841,7 +2860,7 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -3403,7 +3422,7 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3681,7 +3700,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3972,7 +3991,7 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionListCall<'a, C, A> where C: BorrowMut AppOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/operations/{operationsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/operations/{operationsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4816,7 +4835,7 @@ impl<'a, C, A> AppServiceListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5086,7 +5105,7 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/locations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/locations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5354,7 +5373,7 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5906,7 +5925,7 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppLocationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/locations/{locationsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/locations/{locationsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6439,7 +6458,7 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6728,7 +6747,7 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6971,7 +6990,7 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7229,7 +7248,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1/apps".to_string(); + let mut url = self.hub._base_url.clone() + "v1/apps"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7472,7 +7491,7 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Appengine {} @@ -340,6 +343,8 @@ impl<'a, C, A> Appengine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://appengine.googleapis.com/".to_string(), + _root_url: "https://appengine.googleapis.com/".to_string(), } } @@ -352,9 +357,23 @@ impl<'a, C, A> Appengine /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://appengine.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://appengine.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1901,7 +1920,7 @@ impl<'a, C, A> AppModulePatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules/{modulesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules/{modulesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2192,7 +2211,7 @@ impl<'a, C, A> AppModuleGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules/{modulesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules/{modulesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -2449,7 +2468,7 @@ impl<'a, C, A> AppModuleVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppModuleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -2992,7 +3011,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3240,7 +3259,7 @@ impl<'a, C, A> AppModuleVersionInstanceListCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4355,7 +4374,7 @@ impl<'a, C, A> AppModuleDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules/{modulesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules/{modulesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4620,7 +4639,7 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4894,7 +4913,7 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/operations/{operationsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/operations/{operationsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5147,7 +5166,7 @@ impl<'a, C, A> AppLocationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/locations/{locationsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/locations/{locationsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5413,7 +5432,7 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/locations".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/locations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5695,7 +5714,7 @@ impl<'a, C, A> AppModuleVersionPatchCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6268,7 +6287,7 @@ impl<'a, C, A> AppModuleVersionDeleteCall<'a, C, A> where C: BorrowMut AppModuleVersionCreateCall<'a, C, A> where C: BorrowMut AppModuleVersionGetCall<'a, C, A> where C: BorrowMut AppModuleVersionListCall<'a, C, A> where C: BorrowMut AppModuleVersionListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Appengine {} @@ -336,6 +339,8 @@ impl<'a, C, A> Appengine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://appengine.googleapis.com/".to_string(), + _root_url: "https://appengine.googleapis.com/".to_string(), } } @@ -348,9 +353,23 @@ impl<'a, C, A> Appengine /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://appengine.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://appengine.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1890,7 +1909,7 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2748,7 +2767,7 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -3302,7 +3321,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3593,7 +3612,7 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionListCall<'a, C, A> where C: BorrowMut AppOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/operations/{operationsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/operations/{operationsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4437,7 +4456,7 @@ impl<'a, C, A> AppServiceListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4707,7 +4726,7 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/locations".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/locations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4975,7 +4994,7 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5527,7 +5546,7 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppLocationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/locations/{locationsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/locations/{locationsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6060,7 +6079,7 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6354,7 +6373,7 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6604,7 +6623,7 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6862,7 +6881,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://appengine.googleapis.com/v1beta5/apps".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta5/apps"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7105,7 +7124,7 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Appsactivity {} @@ -337,6 +340,8 @@ impl<'a, C, A> Appsactivity client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/appsactivity/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -349,9 +354,23 @@ impl<'a, C, A> Appsactivity /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/appsactivity/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -756,7 +775,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/appsactivity/v1/activities".to_string(); + let mut url = self.hub._base_url.clone() + "activities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveMetadataReadonly.as_ref().to_string(), ()); } @@ -940,4 +959,3 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/appstate1/src/lib.rs b/gen/appstate1/src/lib.rs index 81abef866e..6f2d6af1f8 100644 --- a/gen/appstate1/src/lib.rs +++ b/gen/appstate1/src/lib.rs @@ -178,7 +178,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -206,6 +206,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -310,6 +311,8 @@ pub struct AppState { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AppState {} @@ -322,6 +325,8 @@ impl<'a, C, A> AppState client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/appstate/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -334,9 +339,23 @@ impl<'a, C, A> AppState /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/appstate/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -644,7 +663,7 @@ impl<'a, C, A> StateDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}".to_string(); + let mut url = self.hub._base_url.clone() + "states/{stateKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -869,7 +888,7 @@ impl<'a, C, A> StateGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}".to_string(); + let mut url = self.hub._base_url.clone() + "states/{stateKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1109,7 +1128,7 @@ impl<'a, C, A> StateClearCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}/clear".to_string(); + let mut url = self.hub._base_url.clone() + "states/{stateKey}/clear"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1354,7 +1373,7 @@ impl<'a, C, A> StateListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/appstate/v1/states".to_string(); + let mut url = self.hub._base_url.clone() + "states"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1577,7 +1596,7 @@ impl<'a, C, A> StateUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}".to_string(); + let mut url = self.hub._base_url.clone() + "states/{stateKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1773,4 +1792,3 @@ impl<'a, C, A> StateUpdateCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/autoscaler1_beta2/src/lib.rs b/gen/autoscaler1_beta2/src/lib.rs index 242e4b3560..a6680d7384 100644 --- a/gen/autoscaler1_beta2/src/lib.rs +++ b/gen/autoscaler1_beta2/src/lib.rs @@ -182,7 +182,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -210,6 +210,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -314,6 +315,8 @@ pub struct AutoscalerHub { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for AutoscalerHub {} @@ -326,6 +329,8 @@ impl<'a, C, A> AutoscalerHub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/autoscaler/v1beta2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -344,9 +349,23 @@ impl<'a, C, A> AutoscalerHub /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/autoscaler/v1beta2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1209,7 +1228,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/{project}/zones".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -1478,7 +1497,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/{project}/zones/{zone}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -1742,7 +1761,7 @@ impl<'a, C, A> ZoneOperationDeleteCall<'a, C, A> where C: BorrowMut ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/{project}/zones/{zone}/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2257,7 +2276,7 @@ impl<'a, C, A> AutoscalerListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2531,7 +2550,7 @@ impl<'a, C, A> AutoscalerUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -2821,7 +2840,7 @@ impl<'a, C, A> AutoscalerPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -3104,7 +3123,7 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -3368,7 +3387,7 @@ impl<'a, C, A> AutoscalerInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -3641,7 +3660,7 @@ impl<'a, C, A> AutoscalerGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -3826,4 +3845,3 @@ impl<'a, C, A> AutoscalerGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/bigquery2/src/lib.rs b/gen/bigquery2/src/lib.rs index 9fde52b678..38e5e10041 100644 --- a/gen/bigquery2/src/lib.rs +++ b/gen/bigquery2/src/lib.rs @@ -193,7 +193,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -221,6 +221,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -348,6 +349,8 @@ pub struct Bigquery { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Bigquery {} @@ -360,6 +363,8 @@ impl<'a, C, A> Bigquery client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/bigquery/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -384,9 +389,23 @@ impl<'a, C, A> Bigquery /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/bigquery/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2707,7 +2726,7 @@ impl<'a, C, A> TableUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2995,7 +3014,7 @@ impl<'a, C, A> TableInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3276,7 +3295,7 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3538,7 +3557,7 @@ impl<'a, C, A> TableDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3792,7 +3811,7 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4065,7 +4084,7 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4353,7 +4372,7 @@ impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4624,7 +4643,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4889,7 +4908,7 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5161,7 +5180,7 @@ impl<'a, C, A> DatasetUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5436,7 +5455,7 @@ impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5685,7 +5704,7 @@ impl<'a, C, A> DatasetInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5946,7 +5965,7 @@ impl<'a, C, A> JobCancelCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/jobs/{jobId}/cancel".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}/cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6198,7 +6217,7 @@ impl<'a, C, A> JobQueryCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/queries".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/queries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6479,7 +6498,7 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/queries/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/queries/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6779,7 +6798,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7052,7 +7071,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/jobs/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7308,9 +7327,9 @@ impl<'a, C, A> JobInsertCall<'a, C, A> where C: BorrowMut, A: oau let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/bigquery/v2/projects/{projectId}/jobs".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/bigquery/v2/projects/{projectId}/jobs", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/bigquery/v2/projects/{projectId}/jobs".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/bigquery/v2/projects/{projectId}/jobs", "resumable") } else { unreachable!() }; @@ -7684,7 +7703,7 @@ impl<'a, C, A> TabledataInsertAllCall<'a, C, A> where C: BorrowMut TabledataListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8278,7 +8297,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/bigquery/v2/projects".to_string(); + let mut url = self.hub._base_url.clone() + "projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8426,4 +8445,3 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/blogger3/src/lib.rs b/gen/blogger3/src/lib.rs index f6fe1ee546..5759f04bf6 100644 --- a/gen/blogger3/src/lib.rs +++ b/gen/blogger3/src/lib.rs @@ -203,7 +203,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -231,6 +231,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -342,6 +343,8 @@ pub struct Blogger { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Blogger {} @@ -354,6 +357,8 @@ impl<'a, C, A> Blogger client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/blogger/v3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -387,9 +392,23 @@ impl<'a, C, A> Blogger /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/blogger/v3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2353,7 +2372,7 @@ impl<'a, C, A> PageViewGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pageviews".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pageviews"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2595,7 +2614,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2854,7 +2873,7 @@ impl<'a, C, A> BlogListByUserCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}/blogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3129,7 +3148,7 @@ impl<'a, C, A> BlogGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3383,7 +3402,7 @@ impl<'a, C, A> BlogGetByUrlCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/byurl".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/byurl"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3638,7 +3657,7 @@ impl<'a, C, A> PostUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3954,7 +3973,7 @@ impl<'a, C, A> PostGetByPathCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/bypath".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/bypath"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4235,7 +4254,7 @@ impl<'a, C, A> PostGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4530,7 +4549,7 @@ impl<'a, C, A> PostInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4817,7 +4836,7 @@ impl<'a, C, A> PostPublishCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/publish".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/publish"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5070,7 +5089,7 @@ impl<'a, C, A> PostDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5307,7 +5326,7 @@ impl<'a, C, A> PostRevertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/revert".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5564,7 +5583,7 @@ impl<'a, C, A> PostSearchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/search".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5857,7 +5876,7 @@ impl<'a, C, A> PostPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6213,7 +6232,7 @@ impl<'a, C, A> PostListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6528,7 +6547,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6794,7 +6813,7 @@ impl<'a, C, A> CommentRemoveContentCall<'a, C, A> where C: BorrowMut CommentListByBlogCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7362,7 +7381,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7656,7 +7675,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7954,7 +7973,7 @@ impl<'a, C, A> CommentApproveCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8212,7 +8231,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8466,7 +8485,7 @@ impl<'a, C, A> PostUserInfoGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs/{blogId}/posts/{postId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}/blogs/{blogId}/posts/{postId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8777,7 +8796,7 @@ impl<'a, C, A> PostUserInfoListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs/{blogId}/posts".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}/blogs/{blogId}/posts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9092,7 +9111,7 @@ impl<'a, C, A> BlogUserInfoGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs/{blogId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}/blogs/{blogId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9351,7 +9370,7 @@ impl<'a, C, A> PageGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9629,7 +9648,7 @@ impl<'a, C, A> PageListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9901,7 +9920,7 @@ impl<'a, C, A> PageRevertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}/revert".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}/revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10158,7 +10177,7 @@ impl<'a, C, A> PageInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10443,7 +10462,7 @@ impl<'a, C, A> PagePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10728,7 +10747,7 @@ impl<'a, C, A> PagePublishCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}/publish".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}/publish"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10992,7 +11011,7 @@ impl<'a, C, A> PageUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11276,7 +11295,7 @@ impl<'a, C, A> PageDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); + let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11441,4 +11460,3 @@ impl<'a, C, A> PageDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/books1/src/lib.rs b/gen/books1/src/lib.rs index ff70dda1ce..86bbea7d90 100644 --- a/gen/books1/src/lib.rs +++ b/gen/books1/src/lib.rs @@ -212,7 +212,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -240,6 +240,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -350,6 +351,8 @@ pub struct Books { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Books {} @@ -362,6 +365,8 @@ impl<'a, C, A> Books client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/books/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -407,9 +412,23 @@ impl<'a, C, A> Books /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/books/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -4041,7 +4060,7 @@ impl<'a, C, A> LayerAnnotationDataGetCall<'a, C, A> where C: BorrowMut LayerVolumeAnnotationGetCall<'a, C, A> where C: BorrowMut LayerListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/volumes/{volumeId}/layersummary".to_string(); + let mut url = self.hub._base_url.clone() + "volumes/{volumeId}/layersummary"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4926,7 +4945,7 @@ impl<'a, C, A> LayerGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/volumes/{volumeId}/layersummary/{summaryId}".to_string(); + let mut url = self.hub._base_url.clone() + "volumes/{volumeId}/layersummary/{summaryId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5249,7 +5268,7 @@ impl<'a, C, A> LayerVolumeAnnotationListCall<'a, C, A> where C: BorrowMut LayerAnnotationDataListCall<'a, C, A> where C: BorrowMut VolumeRecommendedRateCall<'a, C, A> where C: BorrowMut VolumeGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/volumes/{volumeId}".to_string(); + let mut url = self.hub._base_url.clone() + "volumes/{volumeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6563,7 +6582,7 @@ impl<'a, C, A> VolumeMybookListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/volumes/mybooks".to_string(); + let mut url = self.hub._base_url.clone() + "volumes/mybooks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6883,7 +6902,7 @@ impl<'a, C, A> VolumeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/volumes".to_string(); + let mut url = self.hub._base_url.clone() + "volumes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7220,7 +7239,7 @@ impl<'a, C, A> VolumeUseruploadedListCall<'a, C, A> where C: BorrowMut VolumeAssociatedListCall<'a, C, A> where C: BorrowMut VolumeRecommendedListCall<'a, C, A> where C: BorrowMut DictionaryListOfflineMetadataCall<'a, C, A> where C: BorrowMut SeryGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/series/get".to_string(); + let mut url = self.hub._base_url.clone() + "series/get"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8432,7 +8451,7 @@ impl<'a, C, A> SeryMembershipGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/series/membership/get".to_string(); + let mut url = self.hub._base_url.clone() + "series/membership/get"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8682,7 +8701,7 @@ impl<'a, C, A> BookshelveVolumeListCall<'a, C, A> where C: BorrowMut BookshelveListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/users/{userId}/bookshelves".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}/bookshelves"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9209,7 +9228,7 @@ impl<'a, C, A> BookshelveGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/users/{userId}/bookshelves/{shelf}".to_string(); + let mut url = self.hub._base_url.clone() + "users/{userId}/bookshelves/{shelf}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9498,7 +9517,7 @@ impl<'a, C, A> PromoofferAcceptCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/books/v1/promooffer/accept".to_string(); + let mut url = self.hub._base_url.clone() + "promooffer/accept"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9779,7 +9798,7 @@ impl<'a, C, A> PromoofferDismisCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/books/v1/promooffer/dismiss".to_string(); + let mut url = self.hub._base_url.clone() + "promooffer/dismiss"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10050,7 +10069,7 @@ impl<'a, C, A> PromoofferGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/promooffer/get".to_string(); + let mut url = self.hub._base_url.clone() + "promooffer/get"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10309,7 +10328,7 @@ impl<'a, C, A> PersonalizedstreamGetCall<'a, C, A> where C: BorrowMut OnboardingListCategoryCall<'a, C, A> where C: BorrowMut OnboardingListCategoryVolumeCall<'a, C, A> where C: BorrowMut MyconfigRequestAccesCall<'a, C, A> where C: BorrowMut MyconfigReleaseDownloadAccesCall<'a, C, A> where C: BorrowMut MyconfigSyncVolumeLicenseCall<'a, C, A> where C: BorrowMut MyconfigGetUserSettingCall<'a, C, A> where C: BorrowMut MyconfigUpdateUserSettingCall<'a, C, A> where C: BorrowMut MylibraryBookshelveClearVolumeCall<'a, C, A> where C: BorrowMut MylibraryBookshelveMoveVolumeCall<'a, C, A> where C: BorrowMut MylibraryBookshelveVolumeListCall<'a, C, A> where C: BorrowMut MylibraryAnnotationSummaryCall<'a, C, A> where C: BorrowMut MylibraryAnnotationDeleteCall<'a, C, A> where C: BorrowMut MylibraryBookshelveAddVolumeCall<'a, C, A> where C: BorrowMut MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut MylibraryBookshelveRemoveVolumeCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/books/v1/mylibrary/bookshelves/{shelf}/removeVolume".to_string(); + let mut url = self.hub._base_url.clone() + "mylibrary/bookshelves/{shelf}/removeVolume"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14414,7 +14433,7 @@ impl<'a, C, A> MylibraryAnnotationListCall<'a, C, A> where C: BorrowMut MylibraryAnnotationUpdateCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionSetPositionCall<'a, C, A> where C: Borrow } - let mut url = "https://www.googleapis.com/books/v1/mylibrary/readingpositions/{volumeId}/setPosition".to_string(); + let mut url = self.hub._base_url.clone() + "mylibrary/readingpositions/{volumeId}/setPosition"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15268,7 +15287,7 @@ impl<'a, C, A> MylibraryBookshelveGetCall<'a, C, A> where C: BorrowMut MylibraryBookshelveListCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionGetCall<'a, C, A> where C: BorrowMut NotificationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/books/v1/notification/get".to_string(); + let mut url = self.hub._base_url.clone() + "notification/get"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16239,7 +16258,7 @@ impl<'a, C, A> CloudloadingAddBookCall<'a, C, A> where C: BorrowMut CloudloadingUpdateBookCall<'a, C, A> where C: BorrowMut CloudloadingDeleteBookCall<'a, C, A> where C: BorrowMut CloudloadingDeleteBookCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CalendarHub {} @@ -393,6 +396,8 @@ impl<'a, C, A> CalendarHub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/calendar/v3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -426,9 +431,23 @@ impl<'a, C, A> CalendarHub /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/calendar/v3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2546,7 +2565,7 @@ impl<'a, C, A> FreebusyQueryCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/freeBusy".to_string(); + let mut url = self.hub._base_url.clone() + "freeBusy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2787,7 +2806,7 @@ impl<'a, C, A> SettingListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/settings".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/settings"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3035,7 +3054,7 @@ impl<'a, C, A> SettingWatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/settings/watch".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/settings/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3287,7 +3306,7 @@ impl<'a, C, A> SettingGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/settings/{setting}".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/settings/{setting}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3534,7 +3553,7 @@ impl<'a, C, A> CalendarListUpdateCall<'a, C, A> where C: BorrowMut CalendarListDeleteCall<'a, C, A> where C: BorrowMut CalendarListGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList/{calendarId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/calendarList/{calendarId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4287,7 +4306,7 @@ impl<'a, C, A> CalendarListListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/calendarList"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4547,7 +4566,7 @@ impl<'a, C, A> CalendarListInsertCall<'a, C, A> where C: BorrowMut CalendarListPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList/{calendarId}".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/calendarList/{calendarId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5095,7 +5114,7 @@ impl<'a, C, A> CalendarListWatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList/watch".to_string(); + let mut url = self.hub._base_url.clone() + "users/me/calendarList/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5376,7 +5395,7 @@ impl<'a, C, A> CalendarPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5634,7 +5653,7 @@ impl<'a, C, A> CalendarDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5859,7 +5878,7 @@ impl<'a, C, A> CalendarGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6093,7 +6112,7 @@ impl<'a, C, A> CalendarClearCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/clear".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/clear"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6323,7 +6342,7 @@ impl<'a, C, A> CalendarInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars".to_string(); + let mut url = self.hub._base_url.clone() + "calendars"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6558,7 +6577,7 @@ impl<'a, C, A> CalendarUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6844,7 +6863,7 @@ impl<'a, C, A> AclWatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/watch".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7141,7 +7160,7 @@ impl<'a, C, A> AclInsertCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7409,7 +7428,7 @@ impl<'a, C, A> AclUpdateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7687,7 +7706,7 @@ impl<'a, C, A> AclPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7976,7 +7995,7 @@ impl<'a, C, A> AclListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8243,7 +8262,7 @@ impl<'a, C, A> AclDeleteCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8480,7 +8499,7 @@ impl<'a, C, A> AclGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8729,7 +8748,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/calendar/v3/channels/stop".to_string(); + let mut url = self.hub._base_url.clone() + "channels/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8945,7 +8964,7 @@ impl<'a, C, A> ColorGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/colors".to_string(); + let mut url = self.hub._base_url.clone() + "colors"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9155,7 +9174,7 @@ impl<'a, C, A> EventDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9419,7 +9438,7 @@ impl<'a, C, A> EventInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9711,7 +9730,7 @@ impl<'a, C, A> EventImportCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/import".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/import"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10024,7 +10043,7 @@ impl<'a, C, A> EventInstanceCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}/instances".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}/instances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10349,7 +10368,7 @@ impl<'a, C, A> EventGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10704,7 +10723,7 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11102,7 +11121,7 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11408,7 +11427,7 @@ impl<'a, C, A> EventMoveCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}/move".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}/move"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11699,7 +11718,7 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12092,7 +12111,7 @@ impl<'a, C, A> EventWatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/watch".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12492,7 +12511,7 @@ impl<'a, C, A> EventQuickAddCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/quickAdd".to_string(); + let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/quickAdd"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12674,4 +12693,3 @@ impl<'a, C, A> EventQuickAddCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/classroom1/src/lib.rs b/gen/classroom1/src/lib.rs index ed2cd94b81..011dfa5348 100644 --- a/gen/classroom1/src/lib.rs +++ b/gen/classroom1/src/lib.rs @@ -207,7 +207,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -235,6 +235,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -381,6 +382,8 @@ pub struct Classroom { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Classroom {} @@ -393,6 +396,8 @@ impl<'a, C, A> Classroom client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://classroom.googleapis.com/".to_string(), + _root_url: "https://classroom.googleapis.com/".to_string(), } } @@ -411,9 +416,23 @@ impl<'a, C, A> Classroom /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://classroom.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://classroom.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -3402,7 +3421,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -3744,7 +3763,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); } @@ -4059,7 +4078,7 @@ impl<'a, C, A> CourseGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseReadonly.as_ref().to_string(), ()); } @@ -4317,7 +4336,7 @@ impl<'a, C, A> CourseUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -4593,7 +4612,7 @@ impl<'a, C, A> CourseStudentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/students/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/students/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -4860,7 +4879,7 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/teachers/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/teachers/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -5150,7 +5169,7 @@ impl<'a, C, A> CourseCourseWorkListCall<'a, C, A> where C: BorrowMut CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -6044,7 +6063,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -6347,7 +6366,7 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/teachers".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/teachers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -6644,7 +6663,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkStudent.as_ref().to_string(), ()); } @@ -6947,7 +6966,7 @@ impl<'a, C, A> CourseAliaseListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/aliases".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/aliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseReadonly.as_ref().to_string(), ()); } @@ -7237,7 +7256,7 @@ impl<'a, C, A> CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseReadonly.as_ref().to_string(), ()); } @@ -7833,7 +7852,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -8137,7 +8156,7 @@ impl<'a, C, A> CourseAliaseCreateCall<'a, C, A> where C: BorrowMut CourseStudentCreateCall<'a, C, A> where C: BorrowMut CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut CourseCourseWorkDeleteCall<'a, C, A> where C: BorrowMut CourseCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -9509,7 +9528,7 @@ impl<'a, C, A> CourseStudentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/students".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/students"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -9780,7 +9799,7 @@ impl<'a, C, A> CourseDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -10056,7 +10075,7 @@ impl<'a, C, A> CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut CoursePatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -10673,7 +10692,7 @@ impl<'a, C, A> CourseStudentDeleteCall<'a, C, A> where C: BorrowMut CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut CourseTeacherCreateCall<'a, C, A> where C: BorrowMut CourseCourseWorkStudentSubmissionGetCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); } @@ -11777,7 +11796,7 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -12296,7 +12315,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/userProfiles/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/userProfiles/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -12572,7 +12591,7 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -12855,7 +12874,7 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -13118,7 +13137,7 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -13699,7 +13718,7 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut InvitationDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/invitations/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/invitations/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } @@ -14196,7 +14215,7 @@ impl<'a, C, A> InvitationCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/invitations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/invitations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } @@ -14456,7 +14475,7 @@ impl<'a, C, A> InvitationListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/invitations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/invitations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -14714,7 +14733,7 @@ impl<'a, C, A> InvitationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/invitations/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/invitations/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -14968,7 +14987,7 @@ impl<'a, C, A> InvitationAcceptCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://classroom.googleapis.com/v1/invitations/{id}:accept".to_string(); + let mut url = self.hub._base_url.clone() + "v1/invitations/{id}:accept"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } @@ -15139,4 +15158,3 @@ impl<'a, C, A> InvitationAcceptCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/cloudbilling1/src/lib.rs b/gen/cloudbilling1/src/lib.rs index cac0dee8cc..4be72b7fd5 100644 --- a/gen/cloudbilling1/src/lib.rs +++ b/gen/cloudbilling1/src/lib.rs @@ -176,7 +176,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -204,6 +204,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -303,6 +304,8 @@ pub struct Cloudbilling { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Cloudbilling {} @@ -315,6 +318,8 @@ impl<'a, C, A> Cloudbilling client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://cloudbilling.googleapis.com/".to_string(), + _root_url: "https://cloudbilling.googleapis.com/".to_string(), } } @@ -330,9 +335,23 @@ impl<'a, C, A> Cloudbilling /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudbilling.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudbilling.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -757,7 +776,7 @@ impl<'a, C, A> BillingAccountGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://cloudbilling.googleapis.com/v1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1011,7 +1030,7 @@ impl<'a, C, A> BillingAccountListCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> where C: BorrowMut ProjectGetBillingInfoCall<'a, C, A> where C: BorrowMut ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudDebugger {} @@ -327,6 +330,8 @@ impl<'a, C, A> CloudDebugger client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://clouddebugger.googleapis.com/".to_string(), + _root_url: "https://clouddebugger.googleapis.com/".to_string(), } } @@ -342,9 +347,23 @@ impl<'a, C, A> CloudDebugger /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://clouddebugger.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://clouddebugger.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1525,7 +1544,7 @@ impl<'a, C, A> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://clouddebugger.googleapis.com/v2/controller/debuggees/{debuggeeId}/breakpoints/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1814,7 +1833,7 @@ impl<'a, C, A> ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut ControllerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://clouddebugger.googleapis.com/v2/controller/debuggees/{debuggeeId}/breakpoints".to_string(); + let mut url = self.hub._base_url.clone() + "v2/controller/debuggees/{debuggeeId}/breakpoints"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2339,7 +2358,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://clouddebugger.googleapis.com/v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2877,7 +2896,7 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudKMS {} @@ -325,6 +328,8 @@ impl<'a, C, A> CloudKMS client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://cloudkms.googleapis.com/".to_string(), + _root_url: "https://cloudkms.googleapis.com/".to_string(), } } @@ -337,9 +342,23 @@ impl<'a, C, A> CloudKMS /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudkms.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudkms.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1810,7 +1829,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2099,7 +2118,7 @@ impl<'a, C, A> ProjectLocationKeyRingCreateCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingListCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:destroy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:destroy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2945,7 +2964,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:encrypt".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:encrypt"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3218,7 +3237,7 @@ impl<'a, C, A> ProjectLocationKeyRingGetCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3724,7 +3743,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:testIamPermissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4275,7 +4294,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> where C params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:getIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4528,7 +4547,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:updatePrimaryVersion".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:updatePrimaryVersion"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4809,7 +4828,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5093,7 +5112,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:decrypt".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:decrypt"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5365,7 +5384,7 @@ impl<'a, C, A> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:getIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5619,7 +5638,7 @@ impl<'a, C, A> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:setIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5889,7 +5908,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> wh params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:testIamPermissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6427,7 +6446,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeyVersions".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/cryptoKeyVersions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6702,7 +6721,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeys".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/cryptoKeys"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6977,7 +6996,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeyVersions".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/cryptoKeyVersions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7247,7 +7266,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7500,7 +7519,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> where C params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:setIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7783,7 +7802,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:restore".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:restore"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8066,7 +8085,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeys".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/cryptoKeys"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8273,4 +8292,3 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> where C: Borr } - diff --git a/gen/cloudlatencytest2/src/lib.rs b/gen/cloudlatencytest2/src/lib.rs index d86ce216b0..e49bf2d093 100644 --- a/gen/cloudlatencytest2/src/lib.rs +++ b/gen/cloudlatencytest2/src/lib.rs @@ -173,7 +173,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -201,6 +201,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -304,6 +305,8 @@ pub struct Cloudlatencytest { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Cloudlatencytest {} @@ -316,6 +319,8 @@ impl<'a, C, A> Cloudlatencytest client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/".to_string(), + _root_url: "https://cloudlatencytest-pa.googleapis.com/".to_string(), } } @@ -328,9 +333,23 @@ impl<'a, C, A> Cloudlatencytest /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudlatencytest-pa.googleapis.com/v2/statscollection/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudlatencytest-pa.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -627,7 +646,7 @@ impl<'a, C, A> StatscollectionUpdateaggregatedstatCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/updateaggregatedstats".to_string(); + let mut url = self.hub._base_url.clone() + "updateaggregatedstats"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MonitoringReadonly.as_ref().to_string(), ()); } @@ -860,7 +879,7 @@ impl<'a, C, A> StatscollectionUpdatestatCall<'a, C, A> where C: BorrowMut StatscollectionUpdatestatCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudMonitoring {} @@ -335,6 +338,8 @@ impl<'a, C, A> CloudMonitoring client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -353,9 +358,23 @@ impl<'a, C, A> CloudMonitoring /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/cloudmonitoring/v2beta2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1159,7 +1178,7 @@ impl<'a, C, A> TimeseriesDescriptorListCall<'a, C, A> where C: BorrowMut TimeseryWriteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/{project}/timeseries:write".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/timeseries:write"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1818,7 +1837,7 @@ impl<'a, C, A> TimeseryListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/{project}/timeseries/{metric}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/timeseries/{metric}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2185,7 +2204,7 @@ impl<'a, C, A> MetricDescriptorListCall<'a, C, A> where C: BorrowMut MetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut MetricDescriptorCreateCall<'a, C, A> where C: BorrowMut MetricDescriptorCreateCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudResourceManager {} @@ -340,6 +343,8 @@ impl<'a, C, A> CloudResourceManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), + _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } } @@ -364,9 +369,23 @@ impl<'a, C, A> CloudResourceManager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudresourcemanager.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudresourcemanager.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2905,7 +2924,7 @@ impl<'a, C, A> FolderGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut FolderClearOrgPolicyCall<'a, C, A> where C: BorrowMut FolderListAvailableOrgPolicyConstraintCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listAvailableOrgPolicyConstraints".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:listAvailableOrgPolicyConstraints"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3738,7 +3757,7 @@ impl<'a, C, A> FolderGetOrgPolicyCall<'a, C, A> where C: BorrowMut FolderSetOrgPolicyCall<'a, C, A> where C: BorrowMut FolderListOrgPolicyCall<'a, C, A> where C: BorrowMut OrganizationClearOrgPolicyCall<'a, C, A> where C: BorrowMut OrganizationGetOrgPolicyCall<'a, C, A> where C: BorrowMut OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> where params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listAvailableOrgPolicyConstraints".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:listAvailableOrgPolicyConstraints"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5403,7 +5422,7 @@ impl<'a, C, A> OrganizationListOrgPolicyCall<'a, C, A> where C: BorrowMut OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6205,7 +6224,7 @@ impl<'a, C, A> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getEffectiveOrgPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:getEffectiveOrgPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6481,7 +6500,7 @@ impl<'a, C, A> OrganizationSearchCall<'a, C, A> where C: BorrowMut OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationTestIamPermissionCall<'a, C, A> where C: BorrowMut OrganizationSetOrgPolicyCall<'a, C, A> where C: BorrowMut LienCreateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/liens".to_string(); + let mut url = self.hub._base_url.clone() + "v1/liens"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7803,7 +7822,7 @@ impl<'a, C, A> LienDeleteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8064,7 +8083,7 @@ impl<'a, C, A> LienListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/liens".to_string(); + let mut url = self.hub._base_url.clone() + "v1/liens"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8319,7 +8338,7 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8570,7 +8589,7 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9095,7 +9114,7 @@ impl<'a, C, A> ProjectGetOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectSetOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectClearOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectUndeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}:undelete".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}:undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10207,7 +10226,7 @@ impl<'a, C, A> ProjectListOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listAvailableOrgPolicyConstraints".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:listAvailableOrgPolicyConstraints"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11027,7 +11046,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11285,7 +11304,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11587,7 +11606,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetAncestryCall<'a, C, A> where C: BorrowMut ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12417,7 +12436,7 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12862,4 +12881,3 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs b/gen/cloudresourcemanager1_beta1/src/lib.rs index 3cc428f1e9..20096b9b2c 100644 --- a/gen/cloudresourcemanager1_beta1/src/lib.rs +++ b/gen/cloudresourcemanager1_beta1/src/lib.rs @@ -184,7 +184,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -212,6 +212,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -316,6 +317,8 @@ pub struct CloudResourceManager { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudResourceManager {} @@ -328,6 +331,8 @@ impl<'a, C, A> CloudResourceManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), + _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } } @@ -343,9 +348,23 @@ impl<'a, C, A> CloudResourceManager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudresourcemanager.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudresourcemanager.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1554,7 +1573,7 @@ impl<'a, C, A> OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationTestIamPermissionCall<'a, C, A> where C: BorrowMut OrganizationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2647,7 +2666,7 @@ impl<'a, C, A> OrganizationUpdateCall<'a, C, A> where C: BorrowMut OrganizationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/organizations".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/organizations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3185,7 +3204,7 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectUndeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}:undelete".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}:undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3748,7 +3767,7 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4032,7 +4051,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4554,7 +4573,7 @@ impl<'a, C, A> ProjectGetAncestryCall<'a, C, A> where C: BorrowMut ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5106,7 +5125,7 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5653,7 +5672,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5841,4 +5860,3 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/clouduseraccountsvm_beta/src/lib.rs b/gen/clouduseraccountsvm_beta/src/lib.rs index 646c614a0b..003ab25e5a 100644 --- a/gen/clouduseraccountsvm_beta/src/lib.rs +++ b/gen/clouduseraccountsvm_beta/src/lib.rs @@ -190,7 +190,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -218,6 +218,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -333,6 +334,8 @@ pub struct CloudUserAccounts { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudUserAccounts {} @@ -345,6 +348,8 @@ impl<'a, C, A> CloudUserAccounts client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -366,9 +371,23 @@ impl<'a, C, A> CloudUserAccounts /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/clouduseraccounts/vm_beta/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1463,7 +1482,7 @@ impl<'a, C, A> GlobalAccountsOperationDeleteCall<'a, C, A> where C: BorrowMut GlobalAccountsOperationListCall<'a, C, A> where C: BorrowMut GlobalAccountsOperationGetCall<'a, C, A> where C: BorrowMut UserAddPublicKeyCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users/{user}/addPublicKey".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/users/{user}/addPublicKey"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2538,7 +2557,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -2820,7 +2839,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3081,7 +3100,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users/{user}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/users/{user}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -3330,7 +3349,7 @@ impl<'a, C, A> UserRemovePublicKeyCall<'a, C, A> where C: BorrowMut UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users/{user}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/users/{user}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3834,7 +3853,7 @@ impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4081,7 +4100,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -4335,7 +4354,7 @@ impl<'a, C, A> GroupAddMemberCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}/addMember".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}/addMember"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4611,7 +4630,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4890,7 +4909,7 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -5174,7 +5193,7 @@ impl<'a, C, A> GroupRemoveMemberCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}/removeMember".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}/removeMember"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5467,7 +5486,7 @@ impl<'a, C, A> LinuxGetLinuxAccountViewCall<'a, C, A> where C: BorrowMut LinuxGetAuthorizedKeysViewCall<'a, C, A> where C: BorrowMut LinuxGetAuthorizedKeysViewCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Container {} @@ -331,6 +334,8 @@ impl<'a, C, A> Container client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://container.googleapis.com/".to_string(), + _root_url: "https://container.googleapis.com/".to_string(), } } @@ -343,9 +348,23 @@ impl<'a, C, A> Container /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://container.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://container.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1922,7 +1941,7 @@ impl<'a, C, A> ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut ProjectZoneGetServerconfigCall<'a, C, A> where C: BorrowMut ProjectZoneOperationCancelCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterSetMasterAuthCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3320,7 +3339,7 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3889,7 +3908,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4486,7 +4505,7 @@ impl<'a, C, A> ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4785,7 +4804,7 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5086,7 +5105,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5395,7 +5414,7 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6252,7 +6271,7 @@ impl<'a, C, A> ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7570,4 +7589,3 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/content2/src/lib.rs b/gen/content2/src/lib.rs index 5626b2d62f..e146b394bc 100644 --- a/gen/content2/src/lib.rs +++ b/gen/content2/src/lib.rs @@ -209,7 +209,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -237,6 +237,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -341,6 +342,8 @@ pub struct ShoppingContent { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for ShoppingContent {} @@ -353,6 +356,8 @@ impl<'a, C, A> ShoppingContent client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/content/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -392,9 +397,23 @@ impl<'a, C, A> ShoppingContent /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/content/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -5796,7 +5815,7 @@ impl<'a, C, A> AccounttaxCustombatchCall<'a, C, A> where C: BorrowMut AccounttaxPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6331,7 +6350,7 @@ impl<'a, C, A> AccounttaxListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6594,7 +6613,7 @@ impl<'a, C, A> AccounttaxUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6872,7 +6891,7 @@ impl<'a, C, A> AccounttaxGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7131,7 +7150,7 @@ impl<'a, C, A> ShippingsettingPatchCall<'a, C, A> where C: BorrowMut ShippingsettingGetsupportedcarrierCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/supportedCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/supportedCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7652,7 +7671,7 @@ impl<'a, C, A> ShippingsettingListCall<'a, C, A> where C: BorrowMut ShippingsettingCustombatchCall<'a, C, A> where C: BorrowMut ShippingsettingUpdateCall<'a, C, A> where C: BorrowMut ShippingsettingGetCall<'a, C, A> where C: BorrowMut DatafeedCustombatchCall<'a, C, A> where C: BorrowMut DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9185,7 +9204,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9465,7 +9484,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9717,7 +9736,7 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9992,7 +10011,7 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10255,7 +10274,7 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10531,7 +10550,7 @@ impl<'a, C, A> AccountstatuseGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accountstatuses/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accountstatuses/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10779,7 +10798,7 @@ impl<'a, C, A> AccountstatuseCustombatchCall<'a, C, A> where C: BorrowMut AccountstatuseListCall<'a, C, A> where C: BorrowMut AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11554,7 +11573,7 @@ impl<'a, C, A> AccountAuthinfoCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/accounts/authinfo".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/authinfo"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11772,7 +11791,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12055,7 +12074,7 @@ impl<'a, C, A> AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12572,7 +12591,7 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12824,7 +12843,7 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13318,7 +13337,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13594,7 +13613,7 @@ impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut InventorySetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/inventory/{storeCode}/products/{productId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/inventory/{storeCode}/products/{productId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14138,7 +14157,7 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/productstatuses/{productId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/productstatuses/{productId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14410,7 +14429,7 @@ impl<'a, C, A> ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/products"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15191,7 +15210,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products/{productId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/products/{productId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15442,7 +15461,7 @@ impl<'a, C, A> ProductDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products/{productId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/products/{productId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15694,7 +15713,7 @@ impl<'a, C, A> ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/products"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16209,7 +16228,7 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseListCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17268,7 +17287,7 @@ impl<'a, C, A> OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17769,7 +17788,7 @@ impl<'a, C, A> OrderRefundCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/refund".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/refund"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18047,7 +18066,7 @@ impl<'a, C, A> OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/acknowledge".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/acknowledge"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18325,7 +18344,7 @@ impl<'a, C, A> OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut OrderCustombatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/orders/batch".to_string(); + let mut url = self.hub._base_url.clone() + "orders/batch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19627,7 +19646,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderShiplineitemCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/shipLineItems".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/shipLineItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20183,7 +20202,7 @@ impl<'a, C, A> OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderCancelCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/cancel".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20907,4 +20926,3 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/content2_sandbox/src/lib.rs b/gen/content2_sandbox/src/lib.rs index 5d6d275d4d..35cfa7fc55 100644 --- a/gen/content2_sandbox/src/lib.rs +++ b/gen/content2_sandbox/src/lib.rs @@ -191,7 +191,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -219,6 +219,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -323,6 +324,8 @@ pub struct ShoppingContent { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for ShoppingContent {} @@ -335,6 +338,8 @@ impl<'a, C, A> ShoppingContent client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/content/v2sandbox/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -347,9 +352,23 @@ impl<'a, C, A> ShoppingContent /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/content/v2sandbox/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2234,7 +2253,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2516,7 +2535,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2812,7 +2831,7 @@ impl<'a, C, A> OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderRefundCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/refund".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/refund"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4680,7 +4699,7 @@ impl<'a, C, A> OrderCustombatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/orders/batch".to_string(); + let mut url = self.hub._base_url.clone() + "orders/batch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4917,7 +4936,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/acknowledge".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/acknowledge"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5720,7 +5739,7 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/cancel".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5998,7 +6017,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/shipLineItems".to_string(); + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/shipLineItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6197,4 +6216,3 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/coordinate1/src/lib.rs b/gen/coordinate1/src/lib.rs index 73c5957f84..f81bcf3e5f 100644 --- a/gen/coordinate1/src/lib.rs +++ b/gen/coordinate1/src/lib.rs @@ -200,7 +200,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -228,6 +228,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -345,6 +346,8 @@ pub struct Coordinate { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Coordinate {} @@ -357,6 +360,8 @@ impl<'a, C, A> Coordinate client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/coordinate/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -384,9 +389,23 @@ impl<'a, C, A> Coordinate /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/coordinate/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1391,7 +1410,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -1697,7 +1716,7 @@ impl<'a, C, A> JobUpdateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2098,7 +2117,7 @@ impl<'a, C, A> JobPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2458,7 +2477,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2763,7 +2782,7 @@ impl<'a, C, A> JobInsertCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3127,7 +3146,7 @@ impl<'a, C, A> ScheduleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}/schedule".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}/schedule"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3453,7 +3472,7 @@ impl<'a, C, A> SchedulePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}/schedule".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}/schedule"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3752,7 +3771,7 @@ impl<'a, C, A> ScheduleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}/schedule".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}/schedule"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3997,7 +4016,7 @@ impl<'a, C, A> WorkerListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/workers".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/workers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4246,7 +4265,7 @@ impl<'a, C, A> LocationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/workers/{workerEmail}/locations".to_string(); + let mut url = self.hub._base_url.clone() + "teams/{teamId}/workers/{workerEmail}/locations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4528,7 +4547,7 @@ impl<'a, C, A> TeamListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/coordinate/v1/teams".to_string(); + let mut url = self.hub._base_url.clone() + "teams"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4753,7 +4772,7 @@ impl<'a, C, A> CustomFieldDefListCall<'a, C, A> where C: BorrowMut CustomFieldDefListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Customsearch {} @@ -347,6 +350,8 @@ impl<'a, C, A> Customsearch client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/customsearch/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -359,9 +364,23 @@ impl<'a, C, A> Customsearch /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/customsearch/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1089,7 +1108,7 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/customsearch/v1".to_string(); + let mut url = self.hub._base_url.clone() + "v1"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1429,4 +1448,3 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth } - diff --git a/gen/dataproc1/src/lib.rs b/gen/dataproc1/src/lib.rs index 788c87617b..021f5e00ea 100644 --- a/gen/dataproc1/src/lib.rs +++ b/gen/dataproc1/src/lib.rs @@ -181,7 +181,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -209,6 +209,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -313,6 +314,8 @@ pub struct Dataproc { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dataproc {} @@ -325,6 +328,8 @@ impl<'a, C, A> Dataproc client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://dataproc.googleapis.com/".to_string(), + _root_url: "https://dataproc.googleapis.com/".to_string(), } } @@ -337,9 +342,23 @@ impl<'a, C, A> Dataproc /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://dataproc.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://dataproc.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1651,7 +1670,7 @@ impl<'a, C, A> ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionOperationCancelCall<'a, C, A> where C: BorrowMut ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut ProjectRegionJobPatchCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for DeploymentManager {} @@ -355,6 +358,8 @@ impl<'a, C, A> DeploymentManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/deploymentmanager/v2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -379,9 +384,23 @@ impl<'a, C, A> DeploymentManager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/deploymentmanager/v2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1990,7 +2009,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2255,7 +2274,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2552,7 +2571,7 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2841,7 +2860,7 @@ impl<'a, C, A> ManifestGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests/{manifest}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3116,7 +3135,7 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/types".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/types"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3395,7 +3414,7 @@ impl<'a, C, A> ResourceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources/{resource}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3672,7 +3691,7 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3981,7 +4000,7 @@ impl<'a, C, A> DeploymentUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4273,7 +4292,7 @@ impl<'a, C, A> DeploymentGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -4530,7 +4549,7 @@ impl<'a, C, A> DeploymentInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4805,7 +4824,7 @@ impl<'a, C, A> DeploymentTestIamPermissionCall<'a, C, A> where C: BorrowMut DeploymentGetIamPolicyCall<'a, C, A> where C: BorrowMut DeploymentCancelPreviewCall<'a, C, A> where C: BorrowMut DeploymentListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -5918,7 +5937,7 @@ impl<'a, C, A> DeploymentPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6217,7 +6236,7 @@ impl<'a, C, A> DeploymentStopCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6495,7 +6514,7 @@ impl<'a, C, A> DeploymentSetIamPolicyCall<'a, C, A> where C: BorrowMut DeploymentDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6953,4 +6972,3 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/deploymentmanager2_beta2/src/lib.rs b/gen/deploymentmanager2_beta2/src/lib.rs index 6384fd6a7a..4c66e5993c 100644 --- a/gen/deploymentmanager2_beta2/src/lib.rs +++ b/gen/deploymentmanager2_beta2/src/lib.rs @@ -192,7 +192,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -220,6 +220,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -338,6 +339,8 @@ pub struct DeploymentManager { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for DeploymentManager {} @@ -350,6 +353,8 @@ impl<'a, C, A> DeploymentManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/deploymentmanager/v2beta2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -374,9 +379,23 @@ impl<'a, C, A> DeploymentManager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/deploymentmanager/v2beta2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1422,7 +1441,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1682,7 +1701,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1963,7 +1982,7 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/manifests".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2241,7 +2260,7 @@ impl<'a, C, A> ManifestGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests/{manifest}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2500,7 +2519,7 @@ impl<'a, C, A> ResourceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/resources/{resource}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources/{resource}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2772,7 +2791,7 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/resources".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3061,7 +3080,7 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/types".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/types"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3349,7 +3368,7 @@ impl<'a, C, A> DeploymentUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3641,7 +3660,7 @@ impl<'a, C, A> DeploymentGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3893,7 +3912,7 @@ impl<'a, C, A> DeploymentInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4167,7 +4186,7 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -4455,7 +4474,7 @@ impl<'a, C, A> DeploymentPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4747,7 +4766,7 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4922,4 +4941,3 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/dfareporting2d1/src/lib.rs b/gen/dfareporting2d1/src/lib.rs index 74e3dcfebe..52ba5ddee5 100644 --- a/gen/dfareporting2d1/src/lib.rs +++ b/gen/dfareporting2d1/src/lib.rs @@ -301,7 +301,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -329,6 +329,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -435,6 +436,8 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -447,6 +450,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -621,9 +626,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -13233,7 +13252,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13960,7 +13979,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14206,7 +14225,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16462,7 +16481,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16951,7 +16970,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17756,7 +17775,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18008,7 +18027,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18268,7 +18287,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18512,7 +18531,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18823,7 +18842,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19117,7 +19136,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19865,7 +19884,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20136,7 +20155,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20390,7 +20409,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20670,7 +20689,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20952,7 +20971,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21210,9 +21229,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21884,7 +21903,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22206,7 +22225,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22516,7 +22535,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22763,7 +22782,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23820,7 +23839,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24111,7 +24130,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24391,7 +24410,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24659,7 +24678,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24935,7 +24954,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25466,7 +25485,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25722,7 +25741,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25982,7 +26001,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26259,7 +26278,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26527,7 +26546,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26862,7 +26881,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27191,7 +27210,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27452,7 +27471,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27714,7 +27733,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29902,7 +29921,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30202,7 +30221,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30459,7 +30478,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31231,7 +31250,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31475,7 +31494,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31751,7 +31770,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32150,7 +32169,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32565,7 +32584,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32817,7 +32836,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33078,7 +33097,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34042,7 +34061,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35911,7 +35930,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36237,7 +36256,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36587,7 +36606,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36855,7 +36874,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37126,7 +37145,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39303,7 +39322,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39816,7 +39835,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40421,7 +40440,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41541,7 +41560,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41832,7 +41851,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42117,7 +42136,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42378,7 +42397,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42625,7 +42644,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42870,7 +42889,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43107,7 +43126,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44946,7 +44965,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.1/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45282,7 +45301,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46418,7 +46437,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47043,7 +47062,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47300,7 +47319,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50153,7 +50172,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50414,7 +50433,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50751,7 +50770,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51113,7 +51132,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51384,7 +51403,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51640,7 +51659,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51928,7 +51947,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52204,7 +52223,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52536,7 +52555,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52867,7 +52886,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53156,7 +53175,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53470,7 +53489,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53738,7 +53757,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54014,7 +54033,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54275,7 +54294,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54522,7 +54541,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56207,7 +56226,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58130,7 +58149,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58382,7 +58401,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59037,7 +59056,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59289,7 +59308,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59570,7 +59589,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59836,7 +59855,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60083,7 +60102,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61968,7 +61987,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62217,7 +62236,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62525,7 +62544,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62838,7 +62857,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63083,7 +63102,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63318,7 +63337,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63555,7 +63574,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63837,7 +63856,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64129,7 +64148,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64397,7 +64416,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64675,7 +64694,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65056,7 +65075,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65435,7 +65454,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65701,7 +65720,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65979,7 +65998,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66414,4 +66433,3 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/dfareporting2d2/src/lib.rs b/gen/dfareporting2d2/src/lib.rs index daf8551a59..5d0b739101 100644 --- a/gen/dfareporting2d2/src/lib.rs +++ b/gen/dfareporting2d2/src/lib.rs @@ -301,7 +301,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -329,6 +329,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -435,6 +436,8 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -447,6 +450,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -621,9 +626,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -13253,7 +13272,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13980,7 +13999,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14226,7 +14245,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16482,7 +16501,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16971,7 +16990,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17776,7 +17795,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18028,7 +18047,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18288,7 +18307,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18532,7 +18551,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18843,7 +18862,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19137,7 +19156,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19885,7 +19904,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20156,7 +20175,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20410,7 +20429,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20690,7 +20709,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20972,7 +20991,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21230,9 +21249,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21904,7 +21923,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22226,7 +22245,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22536,7 +22555,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22783,7 +22802,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23840,7 +23859,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24131,7 +24150,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24411,7 +24430,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24679,7 +24698,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24955,7 +24974,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25486,7 +25505,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25742,7 +25761,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26002,7 +26021,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26279,7 +26298,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26547,7 +26566,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26882,7 +26901,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27211,7 +27230,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27472,7 +27491,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27734,7 +27753,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29922,7 +29941,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30222,7 +30241,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30479,7 +30498,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31251,7 +31270,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31495,7 +31514,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31771,7 +31790,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32170,7 +32189,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32585,7 +32604,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32837,7 +32856,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33098,7 +33117,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34062,7 +34081,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35931,7 +35950,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36257,7 +36276,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36607,7 +36626,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36875,7 +36894,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37146,7 +37165,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39323,7 +39342,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39836,7 +39855,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40441,7 +40460,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41561,7 +41580,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41852,7 +41871,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42137,7 +42156,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42398,7 +42417,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42645,7 +42664,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42890,7 +42909,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43127,7 +43146,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44966,7 +44985,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.2/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45322,7 +45341,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46486,7 +46505,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47111,7 +47130,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47368,7 +47387,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50221,7 +50240,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50482,7 +50501,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50819,7 +50838,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51181,7 +51200,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51452,7 +51471,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51708,7 +51727,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51996,7 +52015,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52272,7 +52291,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52604,7 +52623,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52935,7 +52954,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53224,7 +53243,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53538,7 +53557,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53806,7 +53825,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54082,7 +54101,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54343,7 +54362,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54590,7 +54609,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56275,7 +56294,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58198,7 +58217,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58450,7 +58469,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59105,7 +59124,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59357,7 +59376,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59638,7 +59657,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59904,7 +59923,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60151,7 +60170,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62036,7 +62055,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62285,7 +62304,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62593,7 +62612,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62906,7 +62925,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63151,7 +63170,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63386,7 +63405,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63623,7 +63642,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63905,7 +63924,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64197,7 +64216,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64465,7 +64484,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64743,7 +64762,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65144,7 +65163,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65551,7 +65570,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65817,7 +65836,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66095,7 +66114,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66530,4 +66549,3 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/dfareporting2d3/src/lib.rs b/gen/dfareporting2d3/src/lib.rs index 650d35113b..fca46e900c 100644 --- a/gen/dfareporting2d3/src/lib.rs +++ b/gen/dfareporting2d3/src/lib.rs @@ -301,7 +301,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -329,6 +329,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -435,6 +436,8 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -447,6 +450,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -621,9 +626,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -13239,7 +13258,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13966,7 +13985,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14212,7 +14231,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16468,7 +16487,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16957,7 +16976,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17762,7 +17781,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18014,7 +18033,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18274,7 +18293,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18518,7 +18537,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18829,7 +18848,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19123,7 +19142,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19871,7 +19890,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20142,7 +20161,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20396,7 +20415,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20676,7 +20695,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20958,7 +20977,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21216,9 +21235,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21890,7 +21909,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22212,7 +22231,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22522,7 +22541,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22769,7 +22788,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23826,7 +23845,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24117,7 +24136,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24397,7 +24416,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24665,7 +24684,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24941,7 +24960,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25472,7 +25491,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25728,7 +25747,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25988,7 +26007,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26265,7 +26284,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26533,7 +26552,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26868,7 +26887,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27197,7 +27216,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27458,7 +27477,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27720,7 +27739,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29672,7 +29691,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29972,7 +29991,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30229,7 +30248,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31001,7 +31020,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31245,7 +31264,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31521,7 +31540,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31920,7 +31939,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32335,7 +32354,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32587,7 +32606,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32848,7 +32867,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33812,7 +33831,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35681,7 +35700,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36007,7 +36026,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36357,7 +36376,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36625,7 +36644,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36896,7 +36915,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39073,7 +39092,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39586,7 +39605,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40191,7 +40210,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41311,7 +41330,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41602,7 +41621,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41887,7 +41906,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42148,7 +42167,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42395,7 +42414,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42640,7 +42659,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42877,7 +42896,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44716,7 +44735,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.3/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45072,7 +45091,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46236,7 +46255,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46861,7 +46880,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47118,7 +47137,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -49971,7 +49990,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50232,7 +50251,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50569,7 +50588,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50931,7 +50950,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51202,7 +51221,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51458,7 +51477,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51746,7 +51765,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52022,7 +52041,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52354,7 +52373,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52685,7 +52704,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52974,7 +52993,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53288,7 +53307,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53556,7 +53575,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53832,7 +53851,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54093,7 +54112,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54340,7 +54359,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56025,7 +56044,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57948,7 +57967,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58200,7 +58219,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58855,7 +58874,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59107,7 +59126,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59388,7 +59407,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59654,7 +59673,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59901,7 +59920,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61786,7 +61805,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62035,7 +62054,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62343,7 +62362,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62656,7 +62675,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62901,7 +62920,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63136,7 +63155,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63373,7 +63392,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63655,7 +63674,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63947,7 +63966,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64215,7 +64234,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64493,7 +64512,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64894,7 +64913,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65301,7 +65320,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65567,7 +65586,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65845,7 +65864,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66280,4 +66299,3 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/dfareporting2d4/src/lib.rs b/gen/dfareporting2d4/src/lib.rs index 3162e59831..131edfb696 100644 --- a/gen/dfareporting2d4/src/lib.rs +++ b/gen/dfareporting2d4/src/lib.rs @@ -301,7 +301,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -329,6 +329,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -435,6 +436,8 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -447,6 +450,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.4/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -621,9 +626,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.4/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -13243,7 +13262,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13970,7 +13989,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14216,7 +14235,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16472,7 +16491,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16961,7 +16980,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17766,7 +17785,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18018,7 +18037,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18278,7 +18297,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18522,7 +18541,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18833,7 +18852,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19127,7 +19146,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19875,7 +19894,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20146,7 +20165,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20400,7 +20419,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20680,7 +20699,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20962,7 +20981,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21220,9 +21239,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21894,7 +21913,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22216,7 +22235,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22526,7 +22545,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22773,7 +22792,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23830,7 +23849,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24121,7 +24140,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24401,7 +24420,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24669,7 +24688,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24945,7 +24964,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25476,7 +25495,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25732,7 +25751,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25992,7 +26011,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26269,7 +26288,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26537,7 +26556,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26872,7 +26891,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27201,7 +27220,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27462,7 +27481,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27724,7 +27743,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29676,7 +29695,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29976,7 +29995,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30233,7 +30252,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31005,7 +31024,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31249,7 +31268,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31525,7 +31544,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31924,7 +31943,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32339,7 +32358,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32591,7 +32610,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32852,7 +32871,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33816,7 +33835,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35685,7 +35704,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36011,7 +36030,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36361,7 +36380,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36629,7 +36648,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36900,7 +36919,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39077,7 +39096,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39590,7 +39609,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40195,7 +40214,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41315,7 +41334,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41606,7 +41625,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41891,7 +41910,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42152,7 +42171,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42399,7 +42418,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42644,7 +42663,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42881,7 +42900,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44720,7 +44739,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.4/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45076,7 +45095,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46240,7 +46259,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46877,7 +46896,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47134,7 +47153,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -49987,7 +50006,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50248,7 +50267,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50585,7 +50604,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50947,7 +50966,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51218,7 +51237,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51474,7 +51493,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51762,7 +51781,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52038,7 +52057,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52370,7 +52389,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52701,7 +52720,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52990,7 +53009,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53304,7 +53323,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53572,7 +53591,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53848,7 +53867,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54109,7 +54128,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54356,7 +54375,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56041,7 +56060,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57964,7 +57983,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58216,7 +58235,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58871,7 +58890,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59123,7 +59142,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59404,7 +59423,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59670,7 +59689,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59917,7 +59936,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61802,7 +61821,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62051,7 +62070,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62359,7 +62378,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62672,7 +62691,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62917,7 +62936,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63152,7 +63171,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63389,7 +63408,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63671,7 +63690,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63963,7 +63982,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64231,7 +64250,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64509,7 +64528,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64910,7 +64929,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65317,7 +65336,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65583,7 +65602,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65861,7 +65880,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66296,4 +66315,3 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/dfareporting2d5/src/lib.rs b/gen/dfareporting2d5/src/lib.rs index ea5bb7af78..fd6865681f 100644 --- a/gen/dfareporting2d5/src/lib.rs +++ b/gen/dfareporting2d5/src/lib.rs @@ -305,7 +305,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -333,6 +333,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -443,6 +444,8 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -455,6 +458,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.5/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -635,9 +640,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.5/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -13646,7 +13665,7 @@ impl<'a, C, A> ConversionBatchinsertCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14634,7 +14653,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14880,7 +14899,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17136,7 +17155,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17625,7 +17644,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18430,7 +18449,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18682,7 +18701,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18942,7 +18961,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19186,7 +19205,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19497,7 +19516,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19791,7 +19810,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20539,7 +20558,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20810,7 +20829,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21064,7 +21083,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21344,7 +21363,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21626,7 +21645,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21884,9 +21903,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22558,7 +22577,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22880,7 +22899,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -23190,7 +23209,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -23437,7 +23456,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24494,7 +24513,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24785,7 +24804,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25065,7 +25084,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25333,7 +25352,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25609,7 +25628,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26140,7 +26159,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26396,7 +26415,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26656,7 +26675,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26933,7 +26952,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27201,7 +27220,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27536,7 +27555,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27865,7 +27884,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -28126,7 +28145,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -28388,7 +28407,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30340,7 +30359,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30640,7 +30659,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30897,7 +30916,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31669,7 +31688,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31913,7 +31932,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32189,7 +32208,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32588,7 +32607,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33003,7 +33022,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33255,7 +33274,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33516,7 +33535,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34480,7 +34499,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36349,7 +36368,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36675,7 +36694,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37025,7 +37044,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37293,7 +37312,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37564,7 +37583,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39741,7 +39760,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40254,7 +40273,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40859,7 +40878,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41979,7 +41998,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42245,7 +42264,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42536,7 +42555,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42816,7 +42835,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43063,7 +43082,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43308,7 +43327,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43545,7 +43564,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45384,7 +45403,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.5/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45740,7 +45759,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46904,7 +46923,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47541,7 +47560,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47798,7 +47817,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50651,7 +50670,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50912,7 +50931,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51249,7 +51268,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51611,7 +51630,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51882,7 +51901,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52138,7 +52157,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52426,7 +52445,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52702,7 +52721,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53034,7 +53053,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53365,7 +53384,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53654,7 +53673,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53968,7 +53987,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54236,7 +54255,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54512,7 +54531,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54773,7 +54792,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55020,7 +55039,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56705,7 +56724,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58628,7 +58647,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58880,7 +58899,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59535,7 +59554,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59785,7 +59804,7 @@ impl<'a, C, A> DynamicTargetingKeyDeleteCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyListCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyInsertCall<'a, C, A> where C: BorrowMut SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60880,7 +60899,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61146,7 +61165,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61393,7 +61412,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63278,7 +63297,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63527,7 +63546,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63835,7 +63854,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64148,7 +64167,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64393,7 +64412,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64628,7 +64647,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64865,7 +64884,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65147,7 +65166,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65439,7 +65458,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65707,7 +65726,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65985,7 +66004,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66386,7 +66405,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66793,7 +66812,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67059,7 +67078,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67337,7 +67356,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67772,4 +67791,3 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/dfareporting2d6/src/lib.rs b/gen/dfareporting2d6/src/lib.rs index 415faa6943..f7d9863bb3 100644 --- a/gen/dfareporting2d6/src/lib.rs +++ b/gen/dfareporting2d6/src/lib.rs @@ -309,7 +309,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -337,6 +337,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -447,6 +448,8 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -459,6 +462,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.6/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -645,9 +650,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.6/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -14059,7 +14078,7 @@ impl<'a, C, A> ConversionBatchinsertCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15047,7 +15066,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15286,7 +15305,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15594,7 +15613,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15912,7 +15931,7 @@ impl<'a, C, A> CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16497,7 +16516,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16986,7 +17005,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17791,7 +17810,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18043,7 +18062,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18303,7 +18322,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18547,7 +18566,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18858,7 +18877,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19152,7 +19171,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19900,7 +19919,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20171,7 +20190,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20425,7 +20444,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20705,7 +20724,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20987,7 +21006,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21245,9 +21264,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21919,7 +21938,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22241,7 +22260,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22551,7 +22570,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22798,7 +22817,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23855,7 +23874,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24146,7 +24165,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24426,7 +24445,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24694,7 +24713,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24970,7 +24989,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25501,7 +25520,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25757,7 +25776,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26017,7 +26036,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26294,7 +26313,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26562,7 +26581,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26897,7 +26916,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27226,7 +27245,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27487,7 +27506,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27749,7 +27768,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29701,7 +29720,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30001,7 +30020,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30256,7 +30275,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/languages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/languages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30493,7 +30512,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31265,7 +31284,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31509,7 +31528,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31785,7 +31804,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32184,7 +32203,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32599,7 +32618,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32851,7 +32870,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33112,7 +33131,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34106,7 +34125,7 @@ impl<'a, C, A> TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36511,7 +36530,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36837,7 +36856,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37187,7 +37206,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37455,7 +37474,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37726,7 +37745,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39903,7 +39922,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40416,7 +40435,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41021,7 +41040,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetingTemplatePatchCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> where C: BorrowMut TargetingTemplateGetCall<'a, C, A> where C: BorrowMut TargetingTemplateInsertCall<'a, C, A> where C: BorrowMut TargetingTemplateUpdateCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42954,7 +42973,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43220,7 +43239,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43511,7 +43530,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43791,7 +43810,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44038,7 +44057,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44283,7 +44302,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44520,7 +44539,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46359,7 +46378,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.6/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46715,7 +46734,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47879,7 +47898,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48516,7 +48535,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48773,7 +48792,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51626,7 +51645,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51887,7 +51906,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52224,7 +52243,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52586,7 +52605,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52857,7 +52876,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53113,7 +53132,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53401,7 +53420,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53677,7 +53696,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54009,7 +54028,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54340,7 +54359,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54629,7 +54648,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54943,7 +54962,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55211,7 +55230,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55487,7 +55506,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55748,7 +55767,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55995,7 +56014,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57680,7 +57699,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59603,7 +59622,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59855,7 +59874,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60510,7 +60529,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60760,7 +60779,7 @@ impl<'a, C, A> DynamicTargetingKeyDeleteCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyListCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyInsertCall<'a, C, A> where C: BorrowMut SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61855,7 +61874,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62121,7 +62140,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62368,7 +62387,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64253,7 +64272,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64509,7 +64528,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66420,7 +66439,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66655,7 +66674,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66892,7 +66911,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67174,7 +67193,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67466,7 +67485,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67734,7 +67753,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68012,7 +68031,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68413,7 +68432,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68815,7 +68834,7 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69067,7 +69086,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69333,7 +69352,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69611,7 +69630,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGeneratetagCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -461,6 +464,8 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.7/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -650,9 +655,23 @@ impl<'a, C, A> Dfareporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.7/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -14307,7 +14326,7 @@ impl<'a, C, A> ConversionBatchinsertCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/platformTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15295,7 +15314,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/platformTypes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15534,7 +15553,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15842,7 +15861,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16160,7 +16179,7 @@ impl<'a, C, A> CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeFields".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16745,7 +16764,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeFields/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17234,7 +17253,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18039,7 +18058,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18291,7 +18310,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18551,7 +18570,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18795,7 +18814,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19106,7 +19125,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19400,7 +19419,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20148,7 +20167,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20419,7 +20438,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20673,7 +20692,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20953,7 +20972,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21235,7 +21254,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21493,9 +21512,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22167,7 +22186,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22489,7 +22508,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/changeLogs".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22799,7 +22818,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/changeLogs/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -23046,7 +23065,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}/run".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24103,7 +24122,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24394,7 +24413,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24674,7 +24693,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24940,7 +24959,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25471,7 +25490,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25727,7 +25746,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25971,7 +25990,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26265,7 +26284,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26542,7 +26561,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26810,7 +26829,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27145,7 +27164,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27474,7 +27493,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27735,7 +27754,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27997,7 +28016,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/metros".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29949,7 +29968,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30249,7 +30268,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30504,7 +30523,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/languages".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/languages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30741,7 +30760,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31513,7 +31532,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31757,7 +31776,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32033,7 +32052,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32427,7 +32446,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32835,7 +32854,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33087,7 +33106,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33348,7 +33367,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/connectionTypes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34342,7 +34361,7 @@ impl<'a, C, A> TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36747,7 +36766,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37073,7 +37092,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37423,7 +37442,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37691,7 +37710,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37962,7 +37981,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/regions".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40139,7 +40158,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40652,7 +40671,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeGroups".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41257,7 +41276,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetingTemplatePatchCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> where C: BorrowMut TargetingTemplateGetCall<'a, C, A> where C: BorrowMut TargetingTemplateInsertCall<'a, C, A> where C: BorrowMut TargetingTemplateUpdateCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43190,7 +43209,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43456,7 +43475,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43747,7 +43766,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44027,7 +44046,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44274,7 +44293,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44519,7 +44538,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/mobileCarriers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44756,7 +44775,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/files".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46595,7 +46614,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/dfareporting/v2.7/reports/{reportId}/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46951,7 +46970,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placementGroups/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48115,7 +48134,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48752,7 +48771,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -49009,7 +49028,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51862,7 +51881,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52123,7 +52142,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52460,7 +52479,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52822,7 +52841,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53093,7 +53112,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53349,7 +53368,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53637,7 +53656,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53913,7 +53932,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54245,7 +54264,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54576,7 +54595,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54865,7 +54884,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55179,7 +55198,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55447,7 +55466,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55723,7 +55742,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55984,7 +56003,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56231,7 +56250,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/cities".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57916,7 +57935,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59839,7 +59858,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60091,7 +60110,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/directorySites".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60746,7 +60765,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/directorySites/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60993,7 +61012,7 @@ impl<'a, C, A> VideoFormatGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/videoFormats/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/videoFormats/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61238,7 +61257,7 @@ impl<'a, C, A> VideoFormatListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/videoFormats".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/videoFormats"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61478,7 +61497,7 @@ impl<'a, C, A> DynamicTargetingKeyDeleteCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyListCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyInsertCall<'a, C, A> where C: BorrowMut SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62573,7 +62592,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sizes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62839,7 +62858,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sizes/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63086,7 +63105,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/countries".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64971,7 +64990,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/countries/{dartId}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65227,7 +65246,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/postalCodes/{code}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67138,7 +67157,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/postalCodes".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67373,7 +67392,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/browsers".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67610,7 +67629,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67892,7 +67911,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68184,7 +68203,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68452,7 +68471,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68730,7 +68749,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69131,7 +69150,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69533,7 +69552,7 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69785,7 +69804,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -70051,7 +70070,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -70329,7 +70348,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGeneratetagCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Discovery {} @@ -285,6 +288,8 @@ impl<'a, C, A> Discovery client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/discovery/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -297,9 +302,23 @@ impl<'a, C, A> Discovery /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/discovery/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -953,7 +972,7 @@ impl<'a, C, A> ApiGetRestCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/discovery/v1/apis/{api}/{version}/rest".to_string(); + let mut url = self.hub._base_url.clone() + "apis/{api}/{version}/rest"; for &(find_this, param_name) in [("{api}", "api"), ("{version}", "version")].iter() { let mut replace_with: Option<&str> = None; @@ -1172,7 +1191,7 @@ impl<'a, C, A> ApiListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/discovery/v1/apis".to_string(); + let mut url = self.hub._base_url.clone() + "apis"; if params.len() > 0 { @@ -1287,4 +1306,3 @@ impl<'a, C, A> ApiListCall<'a, C, A> where C: BorrowMut, A: oauth } - diff --git a/gen/dns1/src/lib.rs b/gen/dns1/src/lib.rs index f7bac7f808..9bc33f8e2a 100644 --- a/gen/dns1/src/lib.rs +++ b/gen/dns1/src/lib.rs @@ -182,7 +182,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -210,6 +210,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -322,6 +323,8 @@ pub struct Dns { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Dns {} @@ -334,6 +337,8 @@ impl<'a, C, A> Dns client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/dns/v1/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -355,9 +360,23 @@ impl<'a, C, A> Dns /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dns/v1/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1034,7 +1053,7 @@ impl<'a, C, A> ChangeCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}/changes".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/changes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1325,7 +1344,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}/changes".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/changes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -1602,7 +1621,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}/changes/{changeId}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/changes/{changeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -1864,7 +1883,7 @@ impl<'a, C, A> ManagedZoneCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2124,7 +2143,7 @@ impl<'a, C, A> ManagedZoneDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2361,7 +2380,7 @@ impl<'a, C, A> ManagedZoneGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -2621,7 +2640,7 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/managedZones"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -2899,7 +2918,7 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/dns/v1/projects/{project}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -3337,4 +3356,3 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/doubleclickbidmanager1/src/lib.rs b/gen/doubleclickbidmanager1/src/lib.rs index 1eaa4f6463..e4d9b04007 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs +++ b/gen/doubleclickbidmanager1/src/lib.rs @@ -177,7 +177,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -205,6 +205,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -302,6 +303,8 @@ pub struct DoubleClickBidManager { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for DoubleClickBidManager {} @@ -314,6 +317,8 @@ impl<'a, C, A> DoubleClickBidManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/doubleclickbidmanager/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -335,9 +340,23 @@ impl<'a, C, A> DoubleClickBidManager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/doubleclickbidmanager/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1235,7 +1254,7 @@ impl<'a, C, A> SdfDownloadCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/sdf/download".to_string(); + let mut url = self.hub._base_url.clone() + "sdf/download"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1468,7 +1487,7 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut ReportListreportCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/queries/{queryId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "queries/{queryId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2162,7 +2181,7 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/queries".to_string(); + let mut url = self.hub._base_url.clone() + "queries"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2366,7 +2385,7 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query/{queryId}".to_string(); + let mut url = self.hub._base_url.clone() + "query/{queryId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2606,7 +2625,7 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query".to_string(); + let mut url = self.hub._base_url.clone() + "query"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2833,7 +2852,7 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query/{queryId}".to_string(); + let mut url = self.hub._base_url.clone() + "query/{queryId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3064,7 +3083,7 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query/{queryId}".to_string(); + let mut url = self.hub._base_url.clone() + "query/{queryId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3243,4 +3262,3 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/doubleclicksearch2/src/lib.rs b/gen/doubleclicksearch2/src/lib.rs index 47598f682c..4c62ec10c9 100644 --- a/gen/doubleclicksearch2/src/lib.rs +++ b/gen/doubleclicksearch2/src/lib.rs @@ -181,7 +181,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -209,6 +209,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -306,6 +307,8 @@ pub struct Doubleclicksearch { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Doubleclicksearch {} @@ -318,6 +321,8 @@ impl<'a, C, A> Doubleclicksearch client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/doubleclicksearch/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -336,9 +341,23 @@ impl<'a, C, A> Doubleclicksearch /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/doubleclicksearch/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1295,7 +1314,7 @@ impl<'a, C, A> ConversionInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/conversion".to_string(); + let mut url = self.hub._base_url.clone() + "conversion"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1555,7 +1574,7 @@ impl<'a, C, A> ConversionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion".to_string(); + let mut url = self.hub._base_url.clone() + "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1883,7 +1902,7 @@ impl<'a, C, A> ConversionUpdateAvailabilityCall<'a, C, A> where C: BorrowMut ConversionPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/conversion".to_string(); + let mut url = self.hub._base_url.clone() + "conversion"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2433,7 +2452,7 @@ impl<'a, C, A> ConversionUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/conversion".to_string(); + let mut url = self.hub._base_url.clone() + "conversion"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2663,7 +2682,7 @@ impl<'a, C, A> SavedColumnListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns".to_string(); + let mut url = self.hub._base_url.clone() + "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2912,7 +2931,7 @@ impl<'a, C, A> ReportGetFileCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{reportFragment}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3152,7 +3171,7 @@ impl<'a, C, A> ReportGenerateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports/generate".to_string(); + let mut url = self.hub._base_url.clone() + "reports/generate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3380,7 +3399,7 @@ impl<'a, C, A> ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3620,7 +3639,7 @@ impl<'a, C, A> ReportRequestCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports".to_string(); + let mut url = self.hub._base_url.clone() + "reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3778,4 +3797,3 @@ impl<'a, C, A> ReportRequestCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/drive2/src/lib.rs b/gen/drive2/src/lib.rs index c45605c4b7..fa47254c07 100644 --- a/gen/drive2/src/lib.rs +++ b/gen/drive2/src/lib.rs @@ -250,7 +250,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -278,6 +278,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -427,6 +428,8 @@ pub struct Drive { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Drive {} @@ -439,6 +442,8 @@ impl<'a, C, A> Drive client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/drive/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -490,9 +495,23 @@ impl<'a, C, A> Drive /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/drive/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -4350,7 +4369,7 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/watch".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4698,9 +4717,9 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/drive/v2/files".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/drive/v2/files", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/drive/v2/files".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/drive/v2/files", "resumable") } else { unreachable!() }; @@ -5104,7 +5123,7 @@ impl<'a, C, A> FileUntrashCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/untrash".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/untrash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5393,7 +5412,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/copy".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/copy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5713,7 +5732,7 @@ impl<'a, C, A> FileTrashCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/trash".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/trash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5959,7 +5978,7 @@ impl<'a, C, A> FileExportCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/export".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/export"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6191,7 +6210,7 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/drive/v2/files/trash".to_string(); + let mut url = self.hub._base_url.clone() + "files/trash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6438,7 +6457,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files".to_string(); + let mut url = self.hub._base_url.clone() + "files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -6724,7 +6743,7 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/touch".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/touch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6974,7 +6993,7 @@ impl<'a, C, A> FileGenerateIdCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/generateIds".to_string(); + let mut url = self.hub._base_url.clone() + "files/generateIds"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7273,9 +7292,9 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/drive/v2/files/{fileId}".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/drive/v2/files/{fileId}", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/drive/v2/files/{fileId}".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/drive/v2/files/{fileId}", "resumable") } else { unreachable!() }; @@ -7744,7 +7763,7 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8053,7 +8072,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8456,7 +8475,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -8733,7 +8752,7 @@ impl<'a, C, A> TeamdriveInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/teamdrives".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8971,7 +8990,7 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/teamdrives/{teamDriveId}".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives/{teamDriveId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9214,7 +9233,7 @@ impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/teamdrives".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9431,7 +9450,7 @@ impl<'a, C, A> TeamdriveDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/drive/v2/teamdrives/{teamDriveId}".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives/{teamDriveId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9663,7 +9682,7 @@ impl<'a, C, A> TeamdriveUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/teamdrives/{teamDriveId}".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives/{teamDriveId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9930,9 +9949,9 @@ impl<'a, C, A> RealtimeUpdateCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/drive/v2/files/{fileId}/realtime".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/drive/v2/files/{fileId}/realtime", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/drive/v2/files/{fileId}/realtime".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/drive/v2/files/{fileId}/realtime", "resumable") } else { unreachable!() }; @@ -10274,7 +10293,7 @@ impl<'a, C, A> RealtimeGetCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/realtime".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/realtime"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10506,7 +10525,7 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/apps/{appId}".to_string(); + let mut url = self.hub._base_url.clone() + "apps/{appId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -10754,7 +10773,7 @@ impl<'a, C, A> AppListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/apps".to_string(); + let mut url = self.hub._base_url.clone() + "apps"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -10992,7 +11011,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/about".to_string(); + let mut url = self.hub._base_url.clone() + "about"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -11218,7 +11237,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11460,7 +11479,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11719,7 +11738,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11987,7 +12006,7 @@ impl<'a, C, A> CommentPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12265,7 +12284,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12554,7 +12573,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12837,7 +12856,7 @@ impl<'a, C, A> ChildrenListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children".to_string(); + let mut url = self.hub._base_url.clone() + "files/{folderId}/children"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -13102,7 +13121,7 @@ impl<'a, C, A> ChildrenGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children/{childId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{folderId}/children/{childId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -13348,7 +13367,7 @@ impl<'a, C, A> ChildrenDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children/{childId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{folderId}/children/{childId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13595,7 +13614,7 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children".to_string(); + let mut url = self.hub._base_url.clone() + "files/{folderId}/children"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13865,7 +13884,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/drive/v2/channels/stop".to_string(); + let mut url = self.hub._base_url.clone() + "channels/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14083,7 +14102,7 @@ impl<'a, C, A> ParentListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/parents"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -14319,7 +14338,7 @@ impl<'a, C, A> ParentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/parents/{parentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14566,7 +14585,7 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/parents"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14834,7 +14853,7 @@ impl<'a, C, A> ParentGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/parents/{parentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -15090,7 +15109,7 @@ impl<'a, C, A> ReplyPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15386,7 +15405,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15661,7 +15680,7 @@ impl<'a, C, A> ReplyGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15932,7 +15951,7 @@ impl<'a, C, A> ReplyInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16204,7 +16223,7 @@ impl<'a, C, A> ReplyDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16460,7 +16479,7 @@ impl<'a, C, A> ReplyUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16745,7 +16764,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17009,7 +17028,7 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17313,7 +17332,7 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17618,7 +17637,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -17898,7 +17917,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18195,7 +18214,7 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -18447,7 +18466,7 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/changes/watch".to_string(); + let mut url = self.hub._base_url.clone() + "changes/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19309,7 +19328,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/changes".to_string(); + let mut url = self.hub._base_url.clone() + "changes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -19593,7 +19612,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/changes/{changeId}".to_string(); + let mut url = self.hub._base_url.clone() + "changes/{changeId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -19856,7 +19875,7 @@ impl<'a, C, A> PropertyPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20138,7 +20157,7 @@ impl<'a, C, A> PropertyDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20387,7 +20406,7 @@ impl<'a, C, A> PropertyInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20646,7 +20665,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -20895,7 +20914,7 @@ impl<'a, C, A> PropertyUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21178,7 +21197,7 @@ impl<'a, C, A> PropertyGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -21432,7 +21451,7 @@ impl<'a, C, A> RevisionGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -21686,7 +21705,7 @@ impl<'a, C, A> RevisionPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21956,7 +21975,7 @@ impl<'a, C, A> RevisionDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22200,7 +22219,7 @@ impl<'a, C, A> RevisionUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22479,7 +22498,7 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -22658,4 +22677,3 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/drive3/src/lib.rs b/gen/drive3/src/lib.rs index 55bc87dd22..7fdae13b1d 100644 --- a/gen/drive3/src/lib.rs +++ b/gen/drive3/src/lib.rs @@ -225,7 +225,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -253,6 +253,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -388,6 +389,8 @@ pub struct Drive { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Drive {} @@ -400,6 +403,8 @@ impl<'a, C, A> Drive client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/drive/v3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -436,9 +441,23 @@ impl<'a, C, A> Drive /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/drive/v3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2856,7 +2875,7 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/watch".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3170,9 +3189,9 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/drive/v3/files/{fileId}".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/drive/v3/files/{fileId}", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/drive/v3/files/{fileId}".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/drive/v3/files/{fileId}", "resumable") } else { unreachable!() }; @@ -3585,7 +3604,7 @@ impl<'a, C, A> FileExportCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/export".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/export"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3847,7 +3866,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/copy".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/copy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4131,7 +4150,7 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/drive/v3/files/trash".to_string(); + let mut url = self.hub._base_url.clone() + "files/trash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4373,7 +4392,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files".to_string(); + let mut url = self.hub._base_url.clone() + "files"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -4655,7 +4674,7 @@ impl<'a, C, A> FileGenerateIdCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/generateIds".to_string(); + let mut url = self.hub._base_url.clone() + "files/generateIds"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4907,9 +4926,9 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/drive/v3/files".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/drive/v3/files", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/drive/v3/files".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/drive/v3/files", "resumable") } else { unreachable!() }; @@ -5284,7 +5303,7 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5547,7 +5566,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -5796,7 +5815,7 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/teamdrives/{teamDriveId}".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives/{teamDriveId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6038,7 +6057,7 @@ impl<'a, C, A> TeamdriveCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/teamdrives".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6284,7 +6303,7 @@ impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/teamdrives".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6501,7 +6520,7 @@ impl<'a, C, A> TeamdriveDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/drive/v3/teamdrives/{teamDriveId}".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives/{teamDriveId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6733,7 +6752,7 @@ impl<'a, C, A> TeamdriveUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/teamdrives/{teamDriveId}".to_string(); + let mut url = self.hub._base_url.clone() + "teamdrives/{teamDriveId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6990,7 +7009,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/about".to_string(); + let mut url = self.hub._base_url.clone() + "about"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -7195,7 +7214,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7437,7 +7456,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7698,7 +7717,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7974,7 +7993,7 @@ impl<'a, C, A> CommentCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8253,7 +8272,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8520,7 +8539,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/drive/v3/channels/stop".to_string(); + let mut url = self.hub._base_url.clone() + "channels/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8747,7 +8766,7 @@ impl<'a, C, A> ReplyCreateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9033,7 +9052,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9308,7 +9327,7 @@ impl<'a, C, A> ReplyGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9573,7 +9592,7 @@ impl<'a, C, A> ReplyDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9829,7 +9848,7 @@ impl<'a, C, A> ReplyUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10117,7 +10136,7 @@ impl<'a, C, A> RevisionUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10414,7 +10433,7 @@ impl<'a, C, A> RevisionGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -10667,7 +10686,7 @@ impl<'a, C, A> RevisionDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10912,7 +10931,7 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -11201,7 +11220,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/changes".to_string(); + let mut url = self.hub._base_url.clone() + "changes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -11479,7 +11498,7 @@ impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/changes/watch".to_string(); + let mut url = self.hub._base_url.clone() + "changes/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12044,7 +12063,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12310,7 +12329,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12615,7 +12634,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -12878,7 +12897,7 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -13157,7 +13176,7 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions".to_string(); + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13374,4 +13393,3 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/firebasedynamiclinks1/src/lib.rs b/gen/firebasedynamiclinks1/src/lib.rs index 1e2ac15cd1..ad142bcf5e 100644 --- a/gen/firebasedynamiclinks1/src/lib.rs +++ b/gen/firebasedynamiclinks1/src/lib.rs @@ -176,7 +176,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -204,6 +204,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -307,6 +308,8 @@ pub struct FirebaseDynamicLinks { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for FirebaseDynamicLinks {} @@ -319,6 +322,8 @@ impl<'a, C, A> FirebaseDynamicLinks client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), + _root_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), } } @@ -331,9 +336,23 @@ impl<'a, C, A> FirebaseDynamicLinks /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://firebasedynamiclinks.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://firebasedynamiclinks.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -790,7 +809,7 @@ impl<'a, C, A> ShortLinkCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks".to_string(); + let mut url = self.hub._base_url.clone() + "v1/shortLinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Firebase.as_ref().to_string(), ()); } @@ -954,4 +973,3 @@ impl<'a, C, A> ShortLinkCreateCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index 712f79cc97..b223cde8bf 100644 --- a/gen/fitness1/src/lib.rs +++ b/gen/fitness1/src/lib.rs @@ -180,7 +180,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -208,6 +208,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -379,6 +380,8 @@ pub struct Fitness { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Fitness {} @@ -391,6 +394,8 @@ impl<'a, C, A> Fitness client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/fitness/v1/users/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -403,9 +408,23 @@ impl<'a, C, A> Fitness /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/fitness/v1/users/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1339,7 +1358,7 @@ impl<'a, C, A> UserDatasetAggregateCall<'a, C, A> where C: BorrowMut UserDataSourceDeleteCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetGetCall<'a, C, A> where C: BorrowMut UserDataSourceCreateCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetDeleteCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetPatchCall<'a, C, A> where C: BorrowMut UserSessionDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/sessions/{sessionId}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/sessions/{sessionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityWrite.as_ref().to_string(), ()); } @@ -3218,7 +3237,7 @@ impl<'a, C, A> UserDataSourceGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/dataSources/{dataSourceId}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/dataSources/{dataSourceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityRead.as_ref().to_string(), ()); } @@ -3474,7 +3493,7 @@ impl<'a, C, A> UserDataSourceUpdateCall<'a, C, A> where C: BorrowMut UserSessionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/sessions".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/sessions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityRead.as_ref().to_string(), ()); } @@ -4040,7 +4059,7 @@ impl<'a, C, A> UserSessionUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/sessions/{sessionId}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/sessions/{sessionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityWrite.as_ref().to_string(), ()); } @@ -4327,7 +4346,7 @@ impl<'a, C, A> UserDataSourcePatchCall<'a, C, A> where C: BorrowMut UserDataSourceListCall<'a, C, A> where C: BorrowMut UserDataSourceListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Fusiontables {} @@ -343,6 +346,8 @@ impl<'a, C, A> Fusiontables client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/fusiontables/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -370,9 +375,23 @@ impl<'a, C, A> Fusiontables /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/fusiontables/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1931,7 +1950,7 @@ impl<'a, C, A> StyleListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2189,7 +2208,7 @@ impl<'a, C, A> StyleUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2465,7 +2484,7 @@ impl<'a, C, A> StyleInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2726,7 +2745,7 @@ impl<'a, C, A> StyleGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2972,7 +2991,7 @@ impl<'a, C, A> StyleDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3216,7 +3235,7 @@ impl<'a, C, A> StylePatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3500,7 +3519,7 @@ impl<'a, C, A> TaskListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/tasks".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/tasks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3757,7 +3776,7 @@ impl<'a, C, A> TaskDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/tasks/{taskId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/tasks/{taskId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3994,7 +4013,7 @@ impl<'a, C, A> TaskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/tasks/{taskId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/tasks/{taskId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4246,7 +4265,7 @@ impl<'a, C, A> ColumnInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4514,7 +4533,7 @@ impl<'a, C, A> ColumnUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4793,7 +4812,7 @@ impl<'a, C, A> ColumnListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5051,7 +5070,7 @@ impl<'a, C, A> ColumnPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5321,7 +5340,7 @@ impl<'a, C, A> ColumnDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5558,7 +5577,7 @@ impl<'a, C, A> ColumnGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5812,7 +5831,7 @@ impl<'a, C, A> TemplateUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6091,7 +6110,7 @@ impl<'a, C, A> TemplateListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6341,7 +6360,7 @@ impl<'a, C, A> TemplateDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6583,7 +6602,7 @@ impl<'a, C, A> TemplateInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6851,7 +6870,7 @@ impl<'a, C, A> TemplatePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7122,7 +7141,7 @@ impl<'a, C, A> TemplateGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7401,7 +7420,7 @@ impl<'a, C, A> QuerySqlGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/fusiontables/v2/query".to_string(); + let mut url = self.hub._base_url.clone() + "query"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7670,7 +7689,7 @@ impl<'a, C, A> QuerySqlCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/fusiontables/v2/query".to_string(); + let mut url = self.hub._base_url.clone() + "query"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7917,7 +7936,7 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8212,9 +8231,9 @@ impl<'a, C, A> TableReplaceRowCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/fusiontables/v2/tables/{tableId}/replace".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/fusiontables/v2/tables/{tableId}/replace", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/fusiontables/v2/tables/{tableId}/replace".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/fusiontables/v2/tables/{tableId}/replace", "resumable") } else { unreachable!() }; @@ -8599,7 +8618,7 @@ impl<'a, C, A> TableUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8864,7 +8883,7 @@ impl<'a, C, A> TableDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9094,7 +9113,7 @@ impl<'a, C, A> TableInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables".to_string(); + let mut url = self.hub._base_url.clone() + "tables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9322,7 +9341,7 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9565,7 +9584,7 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables".to_string(); + let mut url = self.hub._base_url.clone() + "tables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9812,9 +9831,9 @@ impl<'a, C, A> TableImportRowCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/fusiontables/v2/tables/{tableId}/import".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/fusiontables/v2/tables/{tableId}/import", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/fusiontables/v2/tables/{tableId}/import".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/fusiontables/v2/tables/{tableId}/import", "resumable") } else { unreachable!() }; @@ -10201,9 +10220,9 @@ impl<'a, C, A> TableImportTableCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/fusiontables/v2/tables/import".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/fusiontables/v2/tables/import", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/fusiontables/v2/tables/import".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/fusiontables/v2/tables/import", "resumable") } else { unreachable!() }; @@ -10539,7 +10558,7 @@ impl<'a, C, A> TableCopyCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/copy".to_string(); + let mut url = self.hub._base_url.clone() + "tables/{tableId}/copy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10711,4 +10730,3 @@ impl<'a, C, A> TableCopyCall<'a, C, A> where C: BorrowMut, A: oau } - diff --git a/gen/games1/src/lib.rs b/gen/games1/src/lib.rs index 317fb39e16..e3dcfb9bf7 100644 --- a/gen/games1/src/lib.rs +++ b/gen/games1/src/lib.rs @@ -208,7 +208,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -236,6 +236,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -344,6 +345,8 @@ pub struct Games { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Games {} @@ -356,6 +359,8 @@ impl<'a, C, A> Games client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/games/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -410,9 +415,23 @@ impl<'a, C, A> Games /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/games/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -4918,7 +4937,7 @@ impl<'a, C, A> AchievementListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/achievements".to_string(); + let mut url = self.hub._base_url.clone() + "players/{playerId}/achievements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5200,7 +5219,7 @@ impl<'a, C, A> AchievementIncrementCall<'a, C, A> where C: BorrowMut AchievementSetStepsAtLeastCall<'a, C, A> where C: BorrowMut AchievementUpdateMultipleCall<'a, C, A> where C: BorrowMut AchievementRevealCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/achievements/{achievementId}/reveal".to_string(); + let mut url = self.hub._base_url.clone() + "achievements/{achievementId}/reveal"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6215,7 +6234,7 @@ impl<'a, C, A> AchievementUnlockCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/achievements/{achievementId}/unlock".to_string(); + let mut url = self.hub._base_url.clone() + "achievements/{achievementId}/unlock"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6467,7 +6486,7 @@ impl<'a, C, A> LeaderboardGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}".to_string(); + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6734,7 +6753,7 @@ impl<'a, C, A> LeaderboardListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/leaderboards".to_string(); + let mut url = self.hub._base_url.clone() + "leaderboards"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6988,7 +7007,7 @@ impl<'a, C, A> MetagameListCategoriesByPlayerCall<'a, C, A> where C: BorrowMut MetagameGetMetagameConfigCall<'a, C, A> where C: BorrowMut PlayerListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/players/me/players/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "players/me/players/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7768,7 +7787,7 @@ impl<'a, C, A> PlayerGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/players/{playerId}".to_string(); + let mut url = self.hub._base_url.clone() + "players/{playerId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8027,7 +8046,7 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/quests/{questId}/accept".to_string(); + let mut url = self.hub._base_url.clone() + "quests/{questId}/accept"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8296,7 +8315,7 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/quests".to_string(); + let mut url = self.hub._base_url.clone() + "players/{playerId}/quests"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8569,7 +8588,7 @@ impl<'a, C, A> SnapshotGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/snapshots/{snapshotId}".to_string(); + let mut url = self.hub._base_url.clone() + "snapshots/{snapshotId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveAppdata.as_ref().to_string(), ()); } @@ -8838,7 +8857,7 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/snapshots".to_string(); + let mut url = self.hub._base_url.clone() + "players/{playerId}/snapshots"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveAppdata.as_ref().to_string(), ()); } @@ -9105,7 +9124,7 @@ impl<'a, C, A> TurnBasedMatcheDismisCall<'a, C, A> where C: BorrowMut TurnBasedMatcheSyncCall<'a, C, A> where C: BorrowMut TurnBasedMatcheDeclineCall<'a, C, A> where C: BorrowMut TurnBasedMatcheGetCall<'a, C, A> where C: BorrowMut TurnBasedMatcheCreateCall<'a, C, A> where C: BorrowMut TurnBasedMatcheJoinCall<'a, C, A> where C: BorrowMut TurnBasedMatcheLeaveTurnCall<'a, C, A> where C: BorrowMut TurnBasedMatcheCancelCall<'a, C, A> where C: BorrowMut TurnBasedMatcheFinishCall<'a, C, A> where C: BorrowMut TurnBasedMatcheLeaveCall<'a, C, A> where C: BorrowMut TurnBasedMatcheListCall<'a, C, A> where C: BorrowMut TurnBasedMatcheTakeTurnCall<'a, C, A> where C: BorrowMut TurnBasedMatcheRematchCall<'a, C, A> where C: BorrowMut ApplicationVerifyCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/applications/{applicationId}/verify".to_string(); + let mut url = self.hub._base_url.clone() + "applications/{applicationId}/verify"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12822,7 +12841,7 @@ impl<'a, C, A> ApplicationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/applications/{applicationId}".to_string(); + let mut url = self.hub._base_url.clone() + "applications/{applicationId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13080,7 +13099,7 @@ impl<'a, C, A> ApplicationPlayedCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/games/v1/applications/played".to_string(); + let mut url = self.hub._base_url.clone() + "applications/played"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13291,7 +13310,7 @@ impl<'a, C, A> RoomGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/{roomId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13557,7 +13576,7 @@ impl<'a, C, A> RoomLeaveCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/leave".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/{roomId}/leave"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13848,7 +13867,7 @@ impl<'a, C, A> RoomListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms".to_string(); + let mut url = self.hub._base_url.clone() + "rooms"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14097,7 +14116,7 @@ impl<'a, C, A> RoomReportStatuCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/reportstatus".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/{roomId}/reportstatus"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14385,7 +14404,7 @@ impl<'a, C, A> RoomCreateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms/create".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/create"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14637,7 +14656,7 @@ impl<'a, C, A> RoomDeclineCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/decline".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/{roomId}/decline"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14890,7 +14909,7 @@ impl<'a, C, A> RoomDismisCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/dismiss".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/{roomId}/dismiss"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15139,7 +15158,7 @@ impl<'a, C, A> RoomJoinCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/join".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/{roomId}/join"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15429,7 +15448,7 @@ impl<'a, C, A> ScoreSubmitCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores".to_string(); + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15719,7 +15738,7 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16032,7 +16051,7 @@ impl<'a, C, A> ScoreGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}".to_string(); + let mut url = self.hub._base_url.clone() + "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16337,7 +16356,7 @@ impl<'a, C, A> ScoreSubmitMultipleCall<'a, C, A> where C: BorrowMut ScoreListWindowCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}/window/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/window/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16919,7 +16938,7 @@ impl<'a, C, A> PushtokenRemoveCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/games/v1/pushtokens/remove".to_string(); + let mut url = self.hub._base_url.clone() + "pushtokens/remove"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17153,7 +17172,7 @@ impl<'a, C, A> PushtokenUpdateCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/games/v1/pushtokens".to_string(); + let mut url = self.hub._base_url.clone() + "pushtokens"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17383,7 +17402,7 @@ impl<'a, C, A> RevisionCheckCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/revisions/check".to_string(); + let mut url = self.hub._base_url.clone() + "revisions/check"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17627,7 +17646,7 @@ impl<'a, C, A> EventListDefinitionCall<'a, C, A> where C: BorrowMut EventRecordCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/events".to_string(); + let mut url = self.hub._base_url.clone() + "events"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18134,7 +18153,7 @@ impl<'a, C, A> EventListByPlayerCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1/events".to_string(); + let mut url = self.hub._base_url.clone() + "events"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18374,7 +18393,7 @@ impl<'a, C, A> QuestMilestoneClaimCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for GamesConfiguration {} @@ -324,6 +327,8 @@ impl<'a, C, A> GamesConfiguration client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/games/v1configuration/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -342,9 +347,23 @@ impl<'a, C, A> GamesConfiguration /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/games/v1configuration/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1099,9 +1118,9 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut AchievementConfigurationListCall<'a, C, A> where C: BorrowMut AchievementConfigurationUpdateCall<'a, C, A> where C: BorrowMut AchievementConfigurationInsertCall<'a, C, A> where C: BorrowMut AchievementConfigurationGetCall<'a, C, A> where C: BorrowMut AchievementConfigurationPatchCall<'a, C, A> where C: BorrowMut AchievementConfigurationDeleteCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationInsertCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationPatchCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationUpdateCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationListCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationDeleteCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationDeleteCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for GamesManagement {} @@ -326,6 +329,8 @@ impl<'a, C, A> GamesManagement client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/games/v1management/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -359,9 +364,23 @@ impl<'a, C, A> GamesManagement /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/games/v1management/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1543,7 +1562,7 @@ impl<'a, C, A> AchievementResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/games/v1management/achievements/resetAllForAllPlayers".to_string(); + let mut url = self.hub._base_url.clone() + "achievements/resetAllForAllPlayers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -1736,7 +1755,7 @@ impl<'a, C, A> AchievementResetForAllPlayerCall<'a, C, A> where C: BorrowMut AchievementResetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1management/achievements/{achievementId}/reset".to_string(); + let mut url = self.hub._base_url.clone() + "achievements/{achievementId}/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -2200,7 +2219,7 @@ impl<'a, C, A> AchievementResetMultipleForAllPlayerCall<'a, C, A> where C: Borro } - let mut url = "https://www.googleapis.com/games/v1management/achievements/resetMultipleForAllPlayers".to_string(); + let mut url = self.hub._base_url.clone() + "achievements/resetMultipleForAllPlayers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -2416,7 +2435,7 @@ impl<'a, C, A> AchievementResetAllCall<'a, C, A> where C: BorrowMut PlayerHideCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/games/v1management/applications/{applicationId}/players/hidden/{playerId}".to_string(); + let mut url = self.hub._base_url.clone() + "applications/{applicationId}/players/hidden/{playerId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -2857,7 +2876,7 @@ impl<'a, C, A> PlayerUnhideCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/games/v1management/applications/{applicationId}/players/hidden/{playerId}".to_string(); + let mut url = self.hub._base_url.clone() + "applications/{applicationId}/players/hidden/{playerId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -3096,7 +3115,7 @@ impl<'a, C, A> ScoreResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut ScoreResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut ScoreResetAllCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1management/scores/reset".to_string(); + let mut url = self.hub._base_url.clone() + "scores/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -3706,7 +3725,7 @@ impl<'a, C, A> ScoreResetForAllPlayerCall<'a, C, A> where C: BorrowMut ScoreResetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/games/v1management/leaderboards/{leaderboardId}/scores/reset".to_string(); + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -4163,7 +4182,7 @@ impl<'a, C, A> TurnBasedMatcheResetCall<'a, C, A> where C: BorrowMut TurnBasedMatcheResetForAllPlayerCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/games/v1management/turnbasedmatches/resetForAllPlayers".to_string(); + let mut url = self.hub._base_url.clone() + "turnbasedmatches/resetForAllPlayers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -4558,7 +4577,7 @@ impl<'a, C, A> ApplicationListHiddenCall<'a, C, A> where C: BorrowMut RoomResetForAllPlayerCall<'a, C, A> where C: BorrowMut RoomResetCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = "https://www.googleapis.com/games/v1management/rooms/reset".to_string(); + let mut url = self.hub._base_url.clone() + "rooms/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -5186,7 +5205,7 @@ impl<'a, C, A> QuestResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut QuestResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut QuestResetAllCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/games/v1management/quests/reset".to_string(); + let mut url = self.hub._base_url.clone() + "quests/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -5792,7 +5811,7 @@ impl<'a, C, A> QuestResetForAllPlayerCall<'a, C, A> where C: BorrowMut QuestResetCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/games/v1management/quests/{questId}/reset".to_string(); + let mut url = self.hub._base_url.clone() + "quests/{questId}/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -6238,7 +6257,7 @@ impl<'a, C, A> EventResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/games/v1management/events/{eventId}/reset".to_string(); + let mut url = self.hub._base_url.clone() + "events/{eventId}/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -6653,7 +6672,7 @@ impl<'a, C, A> EventResetAllCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/games/v1management/events/reset".to_string(); + let mut url = self.hub._base_url.clone() + "events/reset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -6851,7 +6870,7 @@ impl<'a, C, A> EventResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetForAllPlayerCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Gan {} @@ -323,6 +326,8 @@ impl<'a, C, A> Gan client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/gan/v1beta1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -350,9 +355,23 @@ impl<'a, C, A> Gan /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/gan/v1beta1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1726,7 +1745,7 @@ impl<'a, C, A> PublisherListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/publishers".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/publishers"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2005,7 +2024,7 @@ impl<'a, C, A> PublisherGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/publisher".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/publisher"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2244,7 +2263,7 @@ impl<'a, C, A> LinkInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/link".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/link"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2495,7 +2514,7 @@ impl<'a, C, A> LinkGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/link/{linkId}".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/link/{linkId}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2801,7 +2820,7 @@ impl<'a, C, A> LinkListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/links".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/links"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3185,7 +3204,7 @@ impl<'a, C, A> ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/report/{reportType}".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/report/{reportType}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3511,7 +3530,7 @@ impl<'a, C, A> CcOfferListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/publishers/{publisher}/ccOffers".to_string(); + let mut url = self.hub._base_url.clone() + "publishers/{publisher}/ccOffers"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3746,7 +3765,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/advertiser".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/advertiser"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4013,7 +4032,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/advertisers".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/advertisers"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4367,7 +4386,7 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/events".to_string(); + let mut url = self.hub._base_url.clone() + "{role}/{roleId}/events"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4633,4 +4652,3 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau } - diff --git a/gen/genomics1/src/lib.rs b/gen/genomics1/src/lib.rs index e1a493ecb5..ced68cd19c 100644 --- a/gen/genomics1/src/lib.rs +++ b/gen/genomics1/src/lib.rs @@ -205,7 +205,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -233,6 +233,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -353,6 +354,8 @@ pub struct Genomics { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Genomics {} @@ -365,6 +368,8 @@ impl<'a, C, A> Genomics client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://genomics.googleapis.com/".to_string(), + _root_url: "https://genomics.googleapis.com/".to_string(), } } @@ -407,9 +412,23 @@ impl<'a, C, A> Genomics /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://genomics.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://genomics.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -4749,7 +4768,7 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/{+name}:cancel".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5020,7 +5039,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5280,7 +5299,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5572,7 +5591,7 @@ impl<'a, C, A> DatasetCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/datasets".to_string(); + let mut url = self.hub._base_url.clone() + "v1/datasets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5815,7 +5834,7 @@ impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6069,7 +6088,7 @@ impl<'a, C, A> DatasetUndeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}:undelete".to_string(); + let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}:undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6350,7 +6369,7 @@ impl<'a, C, A> DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7164,7 +7183,7 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/datasets".to_string(); + let mut url = self.hub._base_url.clone() + "v1/datasets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7414,7 +7433,7 @@ impl<'a, C, A> DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut DatasetPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7988,7 +8007,7 @@ impl<'a, C, A> ReferencesetSearchCall<'a, C, A> where C: BorrowMut ReferencesetGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/referencesets/{referenceSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/referencesets/{referenceSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8482,7 +8501,7 @@ impl<'a, C, A> CallsetSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/callsets/search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/callsets/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8734,7 +8753,7 @@ impl<'a, C, A> CallsetPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/callsets/{callSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9018,7 +9037,7 @@ impl<'a, C, A> CallsetCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/callsets".to_string(); + let mut url = self.hub._base_url.clone() + "v1/callsets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9256,7 +9275,7 @@ impl<'a, C, A> CallsetDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/callsets/{callSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9501,7 +9520,7 @@ impl<'a, C, A> CallsetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/callsets/{callSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9770,7 +9789,7 @@ impl<'a, C, A> ReadSearchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/reads/search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/reads/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10020,7 +10039,7 @@ impl<'a, C, A> ReadgroupsetExportCall<'a, C, A> where C: BorrowMut ReadgroupsetImportCall<'a, C, A> where C: BorrowMut ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/readgroupsets/{readGroupSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10843,7 +10862,7 @@ impl<'a, C, A> ReadgroupsetGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/readgroupsets/{readGroupSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11126,7 +11145,7 @@ impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut ReferenceBaseListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/references/{referenceId}/bases".to_string(); + let mut url = self.hub._base_url.clone() + "v1/references/{referenceId}/bases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12227,7 +12246,7 @@ impl<'a, C, A> ReferenceSearchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/references/search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/references/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12468,7 +12487,7 @@ impl<'a, C, A> ReferenceGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/references/{referenceId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/references/{referenceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12721,7 +12740,7 @@ impl<'a, C, A> VariantSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants/search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12959,7 +12978,7 @@ impl<'a, C, A> VariantDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants/{variantId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13204,7 +13223,7 @@ impl<'a, C, A> VariantGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants/{variantId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13540,7 +13559,7 @@ impl<'a, C, A> VariantMergeCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants:merge".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants:merge"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13783,7 +13802,7 @@ impl<'a, C, A> VariantCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14039,7 +14058,7 @@ impl<'a, C, A> VariantImportCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants:import".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants:import"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14292,7 +14311,7 @@ impl<'a, C, A> VariantPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variants/{variantId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14580,7 +14599,7 @@ impl<'a, C, A> AnnotationUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/annotations/{annotationId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/annotations/{annotationId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14858,7 +14877,7 @@ impl<'a, C, A> AnnotationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/annotations/{annotationId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/annotations/{annotationId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15110,7 +15129,7 @@ impl<'a, C, A> AnnotationSearchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/annotations/search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/annotations/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -15345,7 +15364,7 @@ impl<'a, C, A> AnnotationDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/annotations/{annotationId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/annotations/{annotationId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -15612,7 +15631,7 @@ impl<'a, C, A> AnnotationCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/annotations".to_string(); + let mut url = self.hub._base_url.clone() + "v1/annotations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -15864,7 +15883,7 @@ impl<'a, C, A> AnnotationBatchCreateCall<'a, C, A> where C: BorrowMut AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut AnnotationsetSearchCall<'a, C, A> where C: BorrowMut AnnotationsetCreateCall<'a, C, A> where C: BorrowMut AnnotationsetDeleteCall<'a, C, A> where C: BorrowMut AnnotationsetGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/annotationsets/{annotationSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/annotationsets/{annotationSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -17376,7 +17395,7 @@ impl<'a, C, A> VariantsetCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variantsets".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variantsets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -17615,7 +17634,7 @@ impl<'a, C, A> VariantsetDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -17867,7 +17886,7 @@ impl<'a, C, A> VariantsetExportCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}:export".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}:export"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); } @@ -18149,7 +18168,7 @@ impl<'a, C, A> VariantsetPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -18440,7 +18459,7 @@ impl<'a, C, A> VariantsetSearchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variantsets/search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variantsets/search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -18678,7 +18697,7 @@ impl<'a, C, A> VariantsetGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -18849,4 +18868,3 @@ impl<'a, C, A> VariantsetGetCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/gmail1/src/lib.rs b/gen/gmail1/src/lib.rs index 39c7644965..d1dfc434da 100644 --- a/gen/gmail1/src/lib.rs +++ b/gen/gmail1/src/lib.rs @@ -197,7 +197,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -225,6 +225,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -369,6 +370,8 @@ pub struct Gmail { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Gmail {} @@ -381,6 +384,8 @@ impl<'a, C, A> Gmail client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/gmail/v1/users/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -393,9 +398,23 @@ impl<'a, C, A> Gmail /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/gmail/v1/users/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2720,7 +2739,7 @@ impl<'a, C, A> UserSettingUpdateVacationCall<'a, C, A> where C: BorrowMut UserSettingSendASmimeInfoGetCall<'a, C, A> where C: BorrowMut UserSettingSendAListCall<'a, C, A> where C: BorrowMut UserSettingGetImapCall<'a, C, A> where C: BorrowMut UserMessageImportCall<'a, C, A> where C: BorrowMut let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages/import".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/messages/import", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/messages/import".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/messages/import", "resumable") } else { unreachable!() }; @@ -4136,7 +4155,7 @@ impl<'a, C, A> UserSettingFilterListCall<'a, C, A> where C: BorrowMut UserSettingForwardingAddresseGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses/{forwardingEmail}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4645,7 +4664,7 @@ impl<'a, C, A> UserHistoryListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/history".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/history"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4927,9 +4946,9 @@ impl<'a, C, A> UserDraftCreateCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/drafts".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/drafts", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/drafts".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/drafts", "resumable") } else { unreachable!() }; @@ -5298,7 +5317,7 @@ impl<'a, C, A> UserSettingSendAGetCall<'a, C, A> where C: BorrowMut UserLabelDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -5781,7 +5800,7 @@ impl<'a, C, A> UserLabelGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6026,7 +6045,7 @@ impl<'a, C, A> UserLabelListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/labels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6272,9 +6291,9 @@ impl<'a, C, A> UserDraftSendCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/drafts/send".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/drafts/send", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/drafts/send".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/drafts/send", "resumable") } else { unreachable!() }; @@ -6643,7 +6662,7 @@ impl<'a, C, A> UserMessageUntrashCall<'a, C, A> where C: BorrowMut UserSettingGetPopCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/pop".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/pop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7130,7 +7149,7 @@ impl<'a, C, A> UserSettingUpdatePopCall<'a, C, A> where C: BorrowMut UserSettingGetVacationCall<'a, C, A> where C: BorrowMut UserMessageBatchDeleteCall<'a, C, A> where C: BorrowMut UserMessageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -8122,7 +8141,7 @@ impl<'a, C, A> UserDraftGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/drafts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/drafts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8387,9 +8406,9 @@ impl<'a, C, A> UserDraftUpdateCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/drafts/{id}".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/drafts/{id}", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/drafts/{id}".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/drafts/{id}", "resumable") } else { unreachable!() }; @@ -8767,7 +8786,7 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut UserThreadListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/threads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9302,7 +9321,7 @@ impl<'a, C, A> UserSettingFilterGetCall<'a, C, A> where C: BorrowMut UserMessageBatchModifyCall<'a, C, A> where C: BorrowMut UserLabelPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -10089,7 +10108,7 @@ impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -10359,7 +10378,7 @@ impl<'a, C, A> UserDraftDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/drafts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/drafts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -10603,7 +10622,7 @@ impl<'a, C, A> UserSettingSendACreateCall<'a, C, A> where C: BorrowMut UserSettingUpdateAutoForwardingCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/autoForwarding".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/autoForwarding"; if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingSharing.as_ref().to_string(), ()); } @@ -11137,7 +11156,7 @@ impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/labels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -11398,7 +11417,7 @@ impl<'a, C, A> UserThreadUntrashCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}/untrash".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}/untrash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -11645,7 +11664,7 @@ impl<'a, C, A> UserSettingSendASmimeInfoListCall<'a, C, A> where C: BorrowMut UserSettingSendAPatchCall<'a, C, A> where C: BorrowMut UserThreadModifyCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}/modify".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}/modify"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -12449,7 +12468,7 @@ impl<'a, C, A> UserThreadDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -12693,7 +12712,7 @@ impl<'a, C, A> UserSettingSendASmimeInfoInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/sendAs/{sendAsEmail}/smimeInfo"; if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); } @@ -12966,7 +12985,7 @@ impl<'a, C, A> UserMessageAttachmentGetCall<'a, C, A> where C: BorrowMut UserMessageModifyCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}/modify".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}/modify"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -13513,7 +13532,7 @@ impl<'a, C, A> UserMessageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13780,7 +13799,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/watch".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -14048,7 +14067,7 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses"; if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingSharing.as_ref().to_string(), ()); } @@ -14327,7 +14346,7 @@ impl<'a, C, A> UserDraftListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/drafts".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/drafts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14597,7 +14616,7 @@ impl<'a, C, A> UserSettingUpdateImapCall<'a, C, A> where C: BorrowMut UserMessageSendCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages/send".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/messages/send", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/messages/send".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/messages/send", "resumable") } else { unreachable!() }; @@ -15238,7 +15257,7 @@ impl<'a, C, A> UserThreadTrashCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}/trash".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}/trash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -15482,7 +15501,7 @@ impl<'a, C, A> UserStopCall<'a, C, A> where C: BorrowMut, A: oaut } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/stop".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -15710,7 +15729,7 @@ impl<'a, C, A> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> where C: Borrow } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault"; if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); } @@ -15982,7 +16001,7 @@ impl<'a, C, A> UserMessageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/messages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16264,7 +16283,7 @@ impl<'a, C, A> UserSettingSendAUpdateCall<'a, C, A> where C: BorrowMut UserSettingFilterCreateCall<'a, C, A> where C: BorrowMut UserSettingSendASmimeInfoDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); } @@ -17049,7 +17068,7 @@ impl<'a, C, A> UserMessageTrashCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}/trash".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}/trash"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -17294,7 +17313,7 @@ impl<'a, C, A> UserGetProfileCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/profile".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/profile"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -17543,7 +17562,7 @@ impl<'a, C, A> UserThreadGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -17806,7 +17825,7 @@ impl<'a, C, A> UserSettingSendAVerifyCall<'a, C, A> where C: BorrowMut UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -18297,9 +18316,9 @@ impl<'a, C, A> UserMessageInsertCall<'a, C, A> where C: BorrowMut let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/messages", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/messages".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/messages", "resumable") } else { unreachable!() }; @@ -18680,7 +18699,7 @@ impl<'a, C, A> UserSettingGetAutoForwardingCall<'a, C, A> where C: BorrowMut UserSettingSendADeleteCall<'a, C, A> where C: BorrowMut UserSettingForwardingAddresseDeleteCall<'a, C, A> where C: Borrow } - let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}".to_string(); + let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses/{forwardingEmail}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingSharing.as_ref().to_string(), ()); } @@ -19321,4 +19340,3 @@ impl<'a, C, A> UserSettingForwardingAddresseDeleteCall<'a, C, A> where C: Borrow } - diff --git a/gen/groupsmigration1/src/lib.rs b/gen/groupsmigration1/src/lib.rs index 3779bed6ea..21963b1b6a 100644 --- a/gen/groupsmigration1/src/lib.rs +++ b/gen/groupsmigration1/src/lib.rs @@ -175,7 +175,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -203,6 +203,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -301,6 +302,8 @@ pub struct GroupsMigration { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for GroupsMigration {} @@ -313,6 +316,8 @@ impl<'a, C, A> GroupsMigration client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/groups/v1/groups/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -325,9 +330,23 @@ impl<'a, C, A> GroupsMigration /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/groups/v1/groups/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -499,9 +518,9 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/groups/v1/groups/{groupId}/archive".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/groups/v1/groups/{groupId}/archive", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/groups/v1/groups/{groupId}/archive".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/groups/v1/groups/{groupId}/archive", "resumable") } else { unreachable!() }; @@ -769,4 +788,3 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/groupssettings1/src/lib.rs b/gen/groupssettings1/src/lib.rs index 2c0b4dfc61..e86dbddfb1 100644 --- a/gen/groupssettings1/src/lib.rs +++ b/gen/groupssettings1/src/lib.rs @@ -178,7 +178,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -206,6 +206,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -309,6 +310,8 @@ pub struct Groupssettings { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Groupssettings {} @@ -321,6 +324,8 @@ impl<'a, C, A> Groupssettings client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/groups/v1/groups/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -333,9 +338,23 @@ impl<'a, C, A> Groupssettings /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/groups/v1/groups/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -635,7 +654,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/groups/v1/groups/{groupUniqueId}".to_string(); + let mut url = self.hub._base_url.clone() + "{groupUniqueId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppGroupSetting.as_ref().to_string(), ()); } @@ -901,7 +920,7 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/groups/v1/groups/{groupUniqueId}".to_string(); + let mut url = self.hub._base_url.clone() + "{groupUniqueId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppGroupSetting.as_ref().to_string(), ()); } @@ -1160,7 +1179,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/groups/v1/groups/{groupUniqueId}".to_string(); + let mut url = self.hub._base_url.clone() + "{groupUniqueId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppGroupSetting.as_ref().to_string(), ()); } @@ -1325,4 +1344,3 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut } - diff --git a/gen/iam1/src/lib.rs b/gen/iam1/src/lib.rs index 29a62ace7b..ab746aa129 100644 --- a/gen/iam1/src/lib.rs +++ b/gen/iam1/src/lib.rs @@ -180,7 +180,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -208,6 +208,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -311,6 +312,8 @@ pub struct Iam { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Iam {} @@ -323,6 +326,8 @@ impl<'a, C, A> Iam client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://iam.googleapis.com/".to_string(), + _root_url: "https://iam.googleapis.com/".to_string(), } } @@ -338,9 +343,23 @@ impl<'a, C, A> Iam /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://iam.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://iam.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1419,7 +1438,7 @@ impl<'a, C, A> RoleQueryGrantableRoleCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSetIamPolicyCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://iam.googleapis.com/v1/{+resource}:setIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2199,7 +2218,7 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetIamPolicyCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://iam.googleapis.com/v1/{+resource}:getIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4339,7 +4358,7 @@ impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://iam.googleapis.com/v1/{+resource}:testIamPermissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4617,7 +4636,7 @@ impl<'a, C, A> ProjectServiceAccountCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for IdentityToolkit {} @@ -323,6 +326,8 @@ impl<'a, C, A> IdentityToolkit client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -335,9 +340,23 @@ impl<'a, C, A> IdentityToolkit /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/identitytoolkit/v3/relyingparty/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2096,7 +2115,7 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/getOobConfirmationCode".to_string(); + let mut url = self.hub._base_url.clone() + "getOobConfirmationCode"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2329,7 +2348,7 @@ impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut RelyingpartySignOutUserCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyAssertionCall<'a, C, A> where C: BorrowMut RelyingpartyUploadAccountCall<'a, C, A> where C: BorrowMut RelyingpartyGetAccountInfoCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyCustomTokenCall<'a, C, A> where C: BorrowMut RelyingpartyResetPasswordCall<'a, C, A> where C: BorrowMut RelyingpartyDownloadAccountCall<'a, C, A> where C: BorrowMut RelyingpartySetAccountInfoCall<'a, C, A> where C: BorrowMut RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyPasswordCall<'a, C, A> where C: BorrowMut RelyingpartySetProjectConfigCall<'a, C, A> where C: BorrowMut RelyingpartyGetProjectConfigCall<'a, C, A> where C: BorrowMut RelyingpartyGetProjectConfigCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Kgsearch {} @@ -299,6 +302,8 @@ impl<'a, C, A> Kgsearch client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://kgsearch.googleapis.com/".to_string(), + _root_url: "https://kgsearch.googleapis.com/".to_string(), } } @@ -311,9 +316,23 @@ impl<'a, C, A> Kgsearch /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://kgsearch.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://kgsearch.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -528,7 +547,7 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://kgsearch.googleapis.com/v1/entities:search".to_string(); + let mut url = self.hub._base_url.clone() + "v1/entities:search"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -704,4 +723,3 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/licensing1/src/lib.rs b/gen/licensing1/src/lib.rs index 8f39fc54ce..3270b8d503 100644 --- a/gen/licensing1/src/lib.rs +++ b/gen/licensing1/src/lib.rs @@ -178,7 +178,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -206,6 +206,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -305,6 +306,8 @@ pub struct Licensing { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Licensing {} @@ -317,6 +320,8 @@ impl<'a, C, A> Licensing client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/apps/licensing/v1/product/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -329,9 +334,23 @@ impl<'a, C, A> Licensing /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/apps/licensing/v1/product/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -708,7 +727,7 @@ impl<'a, C, A> LicenseAssignmentDeleteCall<'a, C, A> where C: BorrowMut LicenseAssignmentListForProductCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/licensing/v1/product/{productId}/users".to_string(); + let mut url = self.hub._base_url.clone() + "{productId}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppLicensing.as_ref().to_string(), ()); } @@ -1228,7 +1247,7 @@ impl<'a, C, A> LicenseAssignmentGetCall<'a, C, A> where C: BorrowMut LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/licensing/v1/product/{productId}/sku/{skuId}/users".to_string(); + let mut url = self.hub._base_url.clone() + "{productId}/sku/{skuId}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppLicensing.as_ref().to_string(), ()); } @@ -1777,7 +1796,7 @@ impl<'a, C, A> LicenseAssignmentUpdateCall<'a, C, A> where C: BorrowMut LicenseAssignmentPatchCall<'a, C, A> where C: BorrowMut LicenseAssignmentInsertCall<'a, C, A> where C: BorrowMut LicenseAssignmentInsertCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Logging {} @@ -358,6 +361,8 @@ impl<'a, C, A> Logging client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://logging.googleapis.com/".to_string(), + _root_url: "https://logging.googleapis.com/".to_string(), } } @@ -385,9 +390,23 @@ impl<'a, C, A> Logging /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://logging.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://logging.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2059,7 +2078,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2335,7 +2354,7 @@ impl<'a, C, A> FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2619,7 +2638,7 @@ impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2881,7 +2900,7 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3162,7 +3181,7 @@ impl<'a, C, A> FolderSinkDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3422,7 +3441,7 @@ impl<'a, C, A> FolderLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/logs".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3686,7 +3705,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+logName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+logName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3946,7 +3965,7 @@ impl<'a, C, A> OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkGetCall<'a, C, A> where C: BorrowMut OrganizationSinkListCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/entries:write".to_string(); + let mut url = self.hub._base_url.clone() + "v2/entries:write"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6066,7 +6085,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/entries:list".to_string(); + let mut url = self.hub._base_url.clone() + "v2/entries:list"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6313,7 +6332,7 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountSinkListCall<'a, C, A> where C: BorrowMut BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/monitoredResourceDescriptors".to_string(); + let mut url = self.hub._base_url.clone() + "v2/monitoredResourceDescriptors"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8420,7 +8439,7 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+logName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+logName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8670,7 +8689,7 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+metricName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+metricName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8927,7 +8946,7 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/logs".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9198,7 +9217,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/metrics".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/metrics"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9752,7 +9771,7 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10046,7 +10065,7 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10310,7 +10329,7 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10560,7 +10579,7 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10822,7 +10841,7 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11110,7 +11129,7 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Logging {} @@ -335,6 +338,8 @@ impl<'a, C, A> Logging client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://logging.googleapis.com/".to_string(), + _root_url: "https://logging.googleapis.com/".to_string(), } } @@ -359,9 +364,23 @@ impl<'a, C, A> Logging /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://logging.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://logging.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1565,7 +1584,7 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/monitoredResourceDescriptors".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/monitoredResourceDescriptors"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2845,7 +2864,7 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+metricName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+metricName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3092,7 +3111,7 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+logName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+logName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3352,7 +3371,7 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/sinks".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3616,7 +3635,7 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3873,7 +3892,7 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4450,7 +4469,7 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/logs".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/logs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4714,7 +4733,7 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectSinkCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/sinks".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5261,7 +5280,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/metrics".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/metrics"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5803,7 +5822,7 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/{+sinkName}".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6057,7 +6076,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/entries:list".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/entries:list"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6296,7 +6315,7 @@ impl<'a, C, A> EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://logging.googleapis.com/v2beta1/entries:write".to_string(); + let mut url = self.hub._base_url.clone() + "v2beta1/entries:write"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6460,4 +6479,3 @@ impl<'a, C, A> EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/manager1_beta2/src/lib.rs b/gen/manager1_beta2/src/lib.rs index 5b18170ef5..1719b50e2b 100644 --- a/gen/manager1_beta2/src/lib.rs +++ b/gen/manager1_beta2/src/lib.rs @@ -177,7 +177,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -205,6 +205,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -328,6 +329,8 @@ pub struct Manager { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Manager {} @@ -340,6 +343,8 @@ impl<'a, C, A> Manager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/manager/v1beta2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -355,9 +360,23 @@ impl<'a, C, A> Manager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/manager/v1beta2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1446,7 +1465,7 @@ impl<'a, C, A> TemplateListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/templates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1695,7 +1714,7 @@ impl<'a, C, A> TemplateDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates/{templateName}".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/templates/{templateName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1935,7 +1954,7 @@ impl<'a, C, A> TemplateInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/templates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2195,7 +2214,7 @@ impl<'a, C, A> TemplateGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates/{templateName}".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/templates/{templateName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2447,7 +2466,7 @@ impl<'a, C, A> DeploymentInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppengineAdmin.as_ref().to_string(), ()); } @@ -2718,7 +2737,7 @@ impl<'a, C, A> DeploymentGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments/{deploymentName}".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments/{deploymentName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2982,7 +3001,7 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3242,7 +3261,7 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments/{deploymentName}".to_string(); + let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments/{deploymentName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3414,4 +3433,3 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/manufacturers1/src/lib.rs b/gen/manufacturers1/src/lib.rs index b8d9e365c2..eaec210553 100644 --- a/gen/manufacturers1/src/lib.rs +++ b/gen/manufacturers1/src/lib.rs @@ -170,7 +170,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -198,6 +198,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -295,6 +296,8 @@ pub struct ManufacturerCenter { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for ManufacturerCenter {} @@ -307,6 +310,8 @@ impl<'a, C, A> ManufacturerCenter client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://manufacturers.googleapis.com/".to_string(), + _root_url: "https://manufacturers.googleapis.com/".to_string(), } } @@ -319,9 +324,23 @@ impl<'a, C, A> ManufacturerCenter /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://manufacturers.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://manufacturers.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -860,7 +879,7 @@ impl<'a, C, A> AccountProductListCall<'a, C, A> where C: BorrowMut AccountProductGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://manufacturers.googleapis.com/v1/{+parent}/products/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string(), ()); } @@ -1320,4 +1339,3 @@ impl<'a, C, A> AccountProductGetCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/mirror1/src/lib.rs b/gen/mirror1/src/lib.rs index f9785a597d..7e1c6a8f20 100644 --- a/gen/mirror1/src/lib.rs +++ b/gen/mirror1/src/lib.rs @@ -201,7 +201,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -229,6 +229,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -336,6 +337,8 @@ pub struct Mirror { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Mirror {} @@ -348,6 +351,8 @@ impl<'a, C, A> Mirror client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/mirror/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -375,9 +380,23 @@ impl<'a, C, A> Mirror /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/mirror/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1758,7 +1777,7 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionUpdateCall<'a, C, A> where C: BorrowMut SubscriptionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/subscriptions".to_string(); + let mut url = self.hub._base_url.clone() + "subscriptions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -2678,7 +2697,7 @@ impl<'a, C, A> TimelineAttachmentListCall<'a, C, A> where C: BorrowMut TimelineInsertCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/mirror/v1/timeline".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/mirror/v1/timeline", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/mirror/v1/timeline".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/mirror/v1/timeline", "resumable") } else { unreachable!() }; @@ -3267,7 +3286,7 @@ impl<'a, C, A> TimelinePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/timeline/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "timeline/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -3559,7 +3578,7 @@ impl<'a, C, A> TimelineListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/timeline".to_string(); + let mut url = self.hub._base_url.clone() + "timeline"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -3816,9 +3835,9 @@ impl<'a, C, A> TimelineAttachmentInsertCall<'a, C, A> where C: BorrowMut TimelineAttachmentDeleteCall<'a, C, A> where C: BorrowMut TimelineDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/mirror/v1/timeline/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "timeline/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -4627,9 +4646,9 @@ impl<'a, C, A> TimelineUpdateCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/mirror/v1/timeline/{id}".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/mirror/v1/timeline/{id}", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/mirror/v1/timeline/{id}".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/mirror/v1/timeline/{id}", "resumable") } else { unreachable!() }; @@ -5019,7 +5038,7 @@ impl<'a, C, A> TimelineAttachmentGetCall<'a, C, A> where C: BorrowMut TimelineGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/timeline/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "timeline/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -5499,7 +5518,7 @@ impl<'a, C, A> SettingGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/settings/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "settings/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -5736,7 +5755,7 @@ impl<'a, C, A> LocationGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/locations/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "locations/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -5969,7 +5988,7 @@ impl<'a, C, A> LocationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/locations".to_string(); + let mut url = self.hub._base_url.clone() + "locations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -6183,7 +6202,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/accounts/{userToken}/{accountType}/{accountName}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{userToken}/{accountType}/{accountName}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -6441,7 +6460,7 @@ impl<'a, C, A> ContactGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "contacts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -6675,7 +6694,7 @@ impl<'a, C, A> ContactDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "contacts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -6905,7 +6924,7 @@ impl<'a, C, A> ContactInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/contacts".to_string(); + let mut url = self.hub._base_url.clone() + "contacts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7140,7 +7159,7 @@ impl<'a, C, A> ContactPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "contacts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7397,7 +7416,7 @@ impl<'a, C, A> ContactListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/contacts".to_string(); + let mut url = self.hub._base_url.clone() + "contacts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7608,7 +7627,7 @@ impl<'a, C, A> ContactUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "contacts/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7797,4 +7816,3 @@ impl<'a, C, A> ContactUpdateCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/ml1_beta1/src/lib.rs b/gen/ml1_beta1/src/lib.rs index 88b888395c..ffe5696775 100644 --- a/gen/ml1_beta1/src/lib.rs +++ b/gen/ml1_beta1/src/lib.rs @@ -179,7 +179,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -207,6 +207,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -310,6 +311,8 @@ pub struct CloudMachineLearningEngine { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for CloudMachineLearningEngine {} @@ -322,6 +325,8 @@ impl<'a, C, A> CloudMachineLearningEngine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://ml.googleapis.com/".to_string(), + _root_url: "https://ml.googleapis.com/".to_string(), } } @@ -334,9 +339,23 @@ impl<'a, C, A> CloudMachineLearningEngine /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://ml.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://ml.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1989,7 +2008,7 @@ impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut ProjectOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectModelVersionCreateCall<'a, C, A> where C: BorrowMut ProjectModelVersionListCall<'a, C, A> where C: BorrowMut ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut ProjectJobCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+parent}/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3854,7 +3873,7 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectPredictCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+name}:predict".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:predict"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4386,7 +4405,7 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectGetConfigCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+name}:getConfig".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:getConfig"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4883,7 +4902,7 @@ impl<'a, C, A> ProjectJobGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5139,7 +5158,7 @@ impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut ProjectModelCreateCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectJobListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+parent}/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6250,7 +6269,7 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+name}:cancel".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6523,7 +6542,7 @@ impl<'a, C, A> ProjectModelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6783,7 +6802,7 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://ml.googleapis.com/v1beta1/{+parent}/models".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/models"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6980,4 +6999,3 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/monitoring3/src/lib.rs b/gen/monitoring3/src/lib.rs index 6ed85cf5c7..e56516b6e0 100644 --- a/gen/monitoring3/src/lib.rs +++ b/gen/monitoring3/src/lib.rs @@ -179,7 +179,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -207,6 +207,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -322,6 +323,8 @@ pub struct Monitoring { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Monitoring {} @@ -334,6 +337,8 @@ impl<'a, C, A> Monitoring client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://monitoring.googleapis.com/".to_string(), + _root_url: "https://monitoring.googleapis.com/".to_string(), } } @@ -346,9 +351,23 @@ impl<'a, C, A> Monitoring /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://monitoring.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://monitoring.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1390,7 +1409,7 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut ProjectGroupCreateCall<'a, C, A> where C: BorrowMut ProjectGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://monitoring.googleapis.com/v3/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v3/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2168,7 +2187,7 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = "https://monitoring.googleapis.com/v3/{+name}/monitoredResourceDescriptors".to_string(); + let mut url = self.hub._base_url.clone() + "v3/{+name}/monitoredResourceDescriptors"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3286,7 +3305,7 @@ impl<'a, C, A> ProjectTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut ProjectGroupListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://monitoring.googleapis.com/v3/{+name}/groups".to_string(); + let mut url = self.hub._base_url.clone() + "v3/{+name}/groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4151,7 +4170,7 @@ impl<'a, C, A> ProjectMetricDescriptorListCall<'a, C, A> where C: BorrowMut ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = "https://monitoring.googleapis.com/v3/{+name}".to_string(); + let mut url = self.hub._base_url.clone() + "v3/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4676,7 +4695,7 @@ impl<'a, C, A> ProjectGroupUpdateCall<'a, C, A> where C: BorrowMut ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Pagespeedonline {} @@ -295,6 +298,8 @@ impl<'a, C, A> Pagespeedonline client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/pagespeedonline/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -307,9 +312,23 @@ impl<'a, C, A> Pagespeedonline /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/pagespeedonline/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -803,7 +822,7 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Partners {} @@ -335,6 +338,8 @@ impl<'a, C, A> Partners client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://partners.googleapis.com/".to_string(), + _root_url: "https://partners.googleapis.com/".to_string(), } } @@ -374,9 +379,23 @@ impl<'a, C, A> Partners /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://partners.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://partners.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2775,7 +2794,7 @@ impl<'a, C, A> MethodUpdateCompanyCall<'a, C, A> where C: BorrowMut MethodGetPartnersstatuCall<'a, C, A> where C: BorrowMut MethodUpdateLeadCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/leads".to_string(); + let mut url = self.hub._base_url.clone() + "v2/leads"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3654,7 +3673,7 @@ impl<'a, C, A> UserEventLogCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/userEvents:log".to_string(); + let mut url = self.hub._base_url.clone() + "v2/userEvents:log"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3873,7 +3892,7 @@ impl<'a, C, A> ClientMessageLogCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/clientMessages:log".to_string(); + let mut url = self.hub._base_url.clone() + "v2/clientMessages:log"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4142,7 +4161,7 @@ impl<'a, C, A> CompanyGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/companies/{companyId}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/companies/{companyId}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4457,7 +4476,7 @@ impl<'a, C, A> CompanyLeadCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/companies/{companyId}/leads".to_string(); + let mut url = self.hub._base_url.clone() + "v2/companies/{companyId}/leads"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4835,7 +4854,7 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/companies".to_string(); + let mut url = self.hub._base_url.clone() + "v2/companies"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -5288,7 +5307,7 @@ impl<'a, C, A> LeadListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/leads".to_string(); + let mut url = self.hub._base_url.clone() + "v2/leads"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -5602,7 +5621,7 @@ impl<'a, C, A> AnalyticListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/analytics".to_string(); + let mut url = self.hub._base_url.clone() + "v2/analytics"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -5925,7 +5944,7 @@ impl<'a, C, A> OfferHistoryListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/offers/history".to_string(); + let mut url = self.hub._base_url.clone() + "v2/offers/history"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -6234,7 +6253,7 @@ impl<'a, C, A> OfferListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/offers".to_string(); + let mut url = self.hub._base_url.clone() + "v2/offers"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -6513,7 +6532,7 @@ impl<'a, C, A> ExamGetTokenCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/exams/{examType}/token".to_string(); + let mut url = self.hub._base_url.clone() + "v2/exams/{examType}/token"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -6821,7 +6840,7 @@ impl<'a, C, A> UserStateListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/userStates".to_string(); + let mut url = self.hub._base_url.clone() + "v2/userStates"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -7106,7 +7125,7 @@ impl<'a, C, A> UserUpdateProfileCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/users/profile".to_string(); + let mut url = self.hub._base_url.clone() + "v2/users/profile"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -7416,7 +7435,7 @@ impl<'a, C, A> UserCreateCompanyRelationCall<'a, C, A> where C: BorrowMut UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://partners.googleapis.com/v2/users/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "v2/users/{userId}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -8074,7 +8093,7 @@ impl<'a, C, A> UserDeleteCompanyRelationCall<'a, C, A> where C: BorrowMut UserDeleteCompanyRelationCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for PeopleService {} @@ -341,6 +344,8 @@ impl<'a, C, A> PeopleService client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://people.googleapis.com/".to_string(), + _root_url: "https://people.googleapis.com/".to_string(), } } @@ -353,9 +358,23 @@ impl<'a, C, A> PeopleService /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://people.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://people.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1633,7 +1652,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://people.googleapis.com/v1/{+resourceName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resourceName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ContactReadonly.as_ref().to_string(), ()); } @@ -1926,7 +1945,7 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://people.googleapis.com/v1/people:batchGet".to_string(); + let mut url = self.hub._base_url.clone() + "v1/people:batchGet"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ContactReadonly.as_ref().to_string(), ()); } @@ -2396,4 +2415,3 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/playmoviespartner1/src/lib.rs b/gen/playmoviespartner1/src/lib.rs index d175636f92..bea5c10bad 100644 --- a/gen/playmoviespartner1/src/lib.rs +++ b/gen/playmoviespartner1/src/lib.rs @@ -170,7 +170,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -198,6 +198,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -295,6 +296,8 @@ pub struct PlayMovies { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for PlayMovies {} @@ -307,6 +310,8 @@ impl<'a, C, A> PlayMovies client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://playmoviespartner.googleapis.com/".to_string(), + _root_url: "https://playmoviespartner.googleapis.com/".to_string(), } } @@ -319,9 +324,23 @@ impl<'a, C, A> PlayMovies /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://playmoviespartner.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://playmoviespartner.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1144,7 +1163,7 @@ impl<'a, C, A> AccountOrderListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/orders".to_string(); + let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/orders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -1453,7 +1472,7 @@ impl<'a, C, A> AccountStoreInfoCountryGetCall<'a, C, A> where C: BorrowMut AccountOrderGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/orders/{orderId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/orders/{orderId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -1972,7 +1991,7 @@ impl<'a, C, A> AccountAvailGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/avails/{availId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/avails/{availId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -2281,7 +2300,7 @@ impl<'a, C, A> AccountAvailListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/avails".to_string(); + let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/avails"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -2661,7 +2680,7 @@ impl<'a, C, A> AccountStoreInfoListCall<'a, C, A> where C: BorrowMut AccountStoreInfoListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Plus {} @@ -331,6 +334,8 @@ impl<'a, C, A> Plus client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/plus/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -349,9 +354,23 @@ impl<'a, C, A> Plus /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/plus/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1949,7 +1968,7 @@ impl<'a, C, A> ActivitySearchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/activities".to_string(); + let mut url = self.hub._base_url.clone() + "activities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2191,7 +2210,7 @@ impl<'a, C, A> ActivityGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/activities/{activityId}".to_string(); + let mut url = self.hub._base_url.clone() + "activities/{activityId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2438,7 +2457,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/people/{userId}/activities/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/activities/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2712,7 +2731,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/activities/{activityId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2968,7 +2987,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -3218,7 +3237,7 @@ impl<'a, C, A> PeopleSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/people".to_string(); + let mut url = self.hub._base_url.clone() + "people"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -3465,7 +3484,7 @@ impl<'a, C, A> PeopleListByActivityCall<'a, C, A> where C: BorrowMut PeopleListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/people/{userId}/people/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/people/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -4007,7 +4026,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plus/v1/people/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -4172,4 +4191,3 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau } - diff --git a/gen/plusdomains1/src/lib.rs b/gen/plusdomains1/src/lib.rs index 363e306112..b253a2c581 100644 --- a/gen/plusdomains1/src/lib.rs +++ b/gen/plusdomains1/src/lib.rs @@ -193,7 +193,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -221,6 +221,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -356,6 +357,8 @@ pub struct PlusDomains { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for PlusDomains {} @@ -368,6 +371,8 @@ impl<'a, C, A> PlusDomains client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/plusDomains/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -395,9 +400,23 @@ impl<'a, C, A> PlusDomains /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/plusDomains/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2627,7 +2646,7 @@ impl<'a, C, A> CircleRemovePeopleCall<'a, C, A> where C: BorrowMut CircleInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/circles".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/circles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -3148,7 +3167,7 @@ impl<'a, C, A> CircleAddPeopleCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}/people".to_string(); + let mut url = self.hub._base_url.clone() + "circles/{circleId}/people"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -3399,7 +3418,7 @@ impl<'a, C, A> CircleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); + let mut url = self.hub._base_url.clone() + "circles/{circleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -3644,7 +3663,7 @@ impl<'a, C, A> CircleListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/circles".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/circles"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -3900,7 +3919,7 @@ impl<'a, C, A> CircleUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); + let mut url = self.hub._base_url.clone() + "circles/{circleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -4166,7 +4185,7 @@ impl<'a, C, A> CirclePatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); + let mut url = self.hub._base_url.clone() + "circles/{circleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -4424,7 +4443,7 @@ impl<'a, C, A> CircleRemoveCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); + let mut url = self.hub._base_url.clone() + "circles/{circleId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -4661,7 +4680,7 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/activities".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/activities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -4927,7 +4946,7 @@ impl<'a, C, A> ActivityGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/activities/{activityId}".to_string(); + let mut url = self.hub._base_url.clone() + "activities/{activityId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -5174,7 +5193,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/activities/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/activities/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -5443,7 +5462,7 @@ impl<'a, C, A> PeopleListByCircleCall<'a, C, A> where C: BorrowMut PeopleListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/people/{collection}".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/people/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -5975,7 +5994,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -6222,7 +6241,7 @@ impl<'a, C, A> PeopleListByActivityCall<'a, C, A> where C: BorrowMut MediaInsertCall<'a, C, A> where C: BorrowMut, A: o let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/plusDomains/v1/people/{userId}/media/{collection}".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/plusDomains/v1/people/{userId}/media/{collection}", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/plusDomains/v1/people/{userId}/media/{collection}".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/plusDomains/v1/people/{userId}/media/{collection}", "resumable") } else { unreachable!() }; @@ -6875,7 +6894,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/activities/{activityId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -7149,7 +7168,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/activities/{activityId}/comments".to_string(); + let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -7405,7 +7424,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/comments/{commentId}".to_string(); + let mut url = self.hub._base_url.clone() + "comments/{commentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -7650,7 +7669,7 @@ impl<'a, C, A> AudienceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/audiences".to_string(); + let mut url = self.hub._base_url.clone() + "people/{userId}/audiences"; if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -7829,4 +7848,3 @@ impl<'a, C, A> AudienceListCall<'a, C, A> where C: BorrowMut, A: } - diff --git a/gen/prediction1d6/src/lib.rs b/gen/prediction1d6/src/lib.rs index 9c37164ef4..fb9c3d6335 100644 --- a/gen/prediction1d6/src/lib.rs +++ b/gen/prediction1d6/src/lib.rs @@ -180,7 +180,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -208,6 +208,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -327,6 +328,8 @@ pub struct Prediction { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Prediction {} @@ -339,6 +342,8 @@ impl<'a, C, A> Prediction client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/prediction/v1.6/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -354,9 +359,23 @@ impl<'a, C, A> Prediction /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/prediction/v1.6/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1152,7 +1171,7 @@ impl<'a, C, A> TrainedmodelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/prediction/v1.6/projects/{project}/trainedmodels/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/trainedmodels/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1406,7 +1425,7 @@ impl<'a, C, A> TrainedmodelUpdateCall<'a, C, A> where C: BorrowMut TrainedmodelListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/prediction/v1.6/projects/{project}/trainedmodels/list".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/trainedmodels/list"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1935,7 +1954,7 @@ impl<'a, C, A> TrainedmodelDeleteCall<'a, C, A> where C: BorrowMut TrainedmodelInsertCall<'a, C, A> where C: BorrowMut TrainedmodelAnalyzeCall<'a, C, A> where C: BorrowMut TrainedmodelPredictCall<'a, C, A> where C: BorrowMut HostedmodelPredictCall<'a, C, A> where C: BorrowMut HostedmodelPredictCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Proximitybeacon {} @@ -334,6 +337,8 @@ impl<'a, C, A> Proximitybeacon client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://proximitybeacon.googleapis.com/".to_string(), + _root_url: "https://proximitybeacon.googleapis.com/".to_string(), } } @@ -355,9 +360,23 @@ impl<'a, C, A> Proximitybeacon /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://proximitybeacon.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://proximitybeacon.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1761,7 +1780,7 @@ impl<'a, C, A> BeaconAttachmentListCall<'a, C, A> where C: BorrowMut BeaconGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -2336,7 +2355,7 @@ impl<'a, C, A> BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut BeaconDecommissionCall<'a, C, A> where C: BorrowMut BeaconActivateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}:activate".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}:activate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -3190,7 +3209,7 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/beacons".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/beacons"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -3520,7 +3539,7 @@ impl<'a, C, A> BeaconUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -3818,7 +3837,7 @@ impl<'a, C, A> BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut BeaconDeactivateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}:deactivate".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}:deactivate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -4364,7 +4383,7 @@ impl<'a, C, A> BeaconRegisterCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/beacons:register".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/beacons:register"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -4620,7 +4639,7 @@ impl<'a, C, A> BeaconDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -4906,7 +4925,7 @@ impl<'a, C, A> BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut BeaconinfoGetforobservedCall<'a, C, A> where C: BorrowMut MethodGetEidparamCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/eidparams".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/eidparams"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -5919,7 +5938,7 @@ impl<'a, C, A> NamespaceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/namespaces".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/namespaces"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -6151,7 +6170,7 @@ impl<'a, C, A> NamespaceUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+namespaceName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta1/{+namespaceName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -6360,4 +6379,3 @@ impl<'a, C, A> NamespaceUpdateCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/pubsub1/src/lib.rs b/gen/pubsub1/src/lib.rs index 891ca52054..2ee7fe5cbb 100644 --- a/gen/pubsub1/src/lib.rs +++ b/gen/pubsub1/src/lib.rs @@ -181,7 +181,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -209,6 +209,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -316,6 +317,8 @@ pub struct Pubsub { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Pubsub {} @@ -328,6 +331,8 @@ impl<'a, C, A> Pubsub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://pubsub.googleapis.com/".to_string(), + _root_url: "https://pubsub.googleapis.com/".to_string(), } } @@ -340,9 +345,23 @@ impl<'a, C, A> Pubsub /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://pubsub.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://pubsub.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1592,7 +1611,7 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+resource}:testIamPermissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2714,7 +2733,7 @@ impl<'a, C, A> ProjectSnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+resource}:testIamPermissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2994,7 +3013,7 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+subscription}:modifyPushConfig".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+subscription}:modifyPushConfig"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3548,7 +3567,7 @@ impl<'a, C, A> ProjectSnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+subscription}:modifyAckDeadline".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+subscription}:modifyAckDeadline"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4077,7 +4096,7 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+resource}:getIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5114,7 +5133,7 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+project}/topics".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+project}/topics"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5385,7 +5404,7 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut ProjectTopicGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+topic}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+topic}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5909,7 +5928,7 @@ impl<'a, C, A> ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSnapshotSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1/{+resource}:setIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7722,4 +7741,3 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< } - diff --git a/gen/pubsub1_beta2/src/lib.rs b/gen/pubsub1_beta2/src/lib.rs index 78c7887f6e..22b583dd91 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_beta2/src/lib.rs @@ -180,7 +180,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -208,6 +208,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -315,6 +316,8 @@ pub struct Pubsub { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Pubsub {} @@ -327,6 +330,8 @@ impl<'a, C, A> Pubsub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://pubsub.googleapis.com/".to_string(), + _root_url: "https://pubsub.googleapis.com/".to_string(), } } @@ -339,9 +344,23 @@ impl<'a, C, A> Pubsub /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://pubsub.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://pubsub.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1505,7 +1524,7 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+project}/topics".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+project}/topics"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1776,7 +1795,7 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+subscription}:modifyPushConfig".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+subscription}:modifyPushConfig"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2899,7 +2918,7 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut ProjectTopicGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+topic}".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+topic}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3415,7 +3434,7 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+subscription}:modifyAckDeadline".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+subscription}:modifyAckDeadline"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3945,7 +3964,7 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+resource}:getIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+resource}:getIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5298,7 +5317,7 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+resource}:testIamPermissions".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5572,7 +5591,7 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://pubsub.googleapis.com/v1beta2/{+resource}:setIamPolicy".to_string(); + let mut url = self.hub._base_url.clone() + "v1beta2/{+resource}:setIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6811,4 +6830,3 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< } - diff --git a/gen/qpxexpress1/src/lib.rs b/gen/qpxexpress1/src/lib.rs index 13b7f14447..fec2f6d70f 100644 --- a/gen/qpxexpress1/src/lib.rs +++ b/gen/qpxexpress1/src/lib.rs @@ -176,7 +176,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -204,6 +204,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -285,6 +286,8 @@ pub struct QPXExpress { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for QPXExpress {} @@ -297,6 +300,8 @@ impl<'a, C, A> QPXExpress client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/qpxExpress/v1/trips/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -309,9 +314,23 @@ impl<'a, C, A> QPXExpress /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/qpxExpress/v1/trips/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1057,7 +1076,7 @@ impl<'a, C, A> TripSearchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/qpxExpress/v1/trips/search".to_string(); + let mut url = self.hub._base_url.clone() + "search"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1194,4 +1213,3 @@ impl<'a, C, A> TripSearchCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/replicapool1_beta2/src/lib.rs b/gen/replicapool1_beta2/src/lib.rs index ff7a31de19..2a697512e5 100644 --- a/gen/replicapool1_beta2/src/lib.rs +++ b/gen/replicapool1_beta2/src/lib.rs @@ -184,7 +184,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -212,6 +212,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -324,6 +325,8 @@ pub struct Replicapool { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Replicapool {} @@ -336,6 +339,8 @@ impl<'a, C, A> Replicapool client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/replicapool/v1beta2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -351,9 +356,23 @@ impl<'a, C, A> Replicapool /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/replicapool/v1beta2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1189,7 +1208,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1459,7 +1478,7 @@ impl<'a, C, A> ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1725,7 +1744,7 @@ impl<'a, C, A> InstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2021,7 +2040,7 @@ impl<'a, C, A> InstanceGroupManagerListCall<'a, C, A> where C: BorrowMut InstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut InstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut InstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3137,7 +3156,7 @@ impl<'a, C, A> InstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3420,7 +3439,7 @@ impl<'a, C, A> InstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3971,7 +3990,7 @@ impl<'a, C, A> InstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4456,4 +4475,3 @@ impl<'a, C, A> InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowM } - diff --git a/gen/replicapoolupdater1_beta1/src/lib.rs b/gen/replicapoolupdater1_beta1/src/lib.rs index 5568244376..24b00a06c0 100644 --- a/gen/replicapoolupdater1_beta1/src/lib.rs +++ b/gen/replicapoolupdater1_beta1/src/lib.rs @@ -182,7 +182,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -210,6 +210,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -322,6 +323,8 @@ pub struct Replicapoolupdater { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Replicapoolupdater {} @@ -334,6 +337,8 @@ impl<'a, C, A> Replicapoolupdater client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -349,9 +354,23 @@ impl<'a, C, A> Replicapoolupdater /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/replicapoolupdater/v1beta1/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1150,7 +1169,7 @@ impl<'a, C, A> RollingUpdatePauseCall<'a, C, A> where C: BorrowMut RollingUpdateRollbackCall<'a, C, A> where C: BorrowMut RollingUpdateGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ReplicapoolReadonly.as_ref().to_string(), ()); } @@ -1927,7 +1946,7 @@ impl<'a, C, A> RollingUpdateResumeCall<'a, C, A> where C: BorrowMut RollingUpdateListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/rollingUpdates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ReplicapoolReadonly.as_ref().to_string(), ()); } @@ -2474,7 +2493,7 @@ impl<'a, C, A> RollingUpdateInsertCall<'a, C, A> where C: BorrowMut RollingUpdateListInstanceUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ReplicapoolReadonly.as_ref().to_string(), ()); } @@ -3042,7 +3061,7 @@ impl<'a, C, A> RollingUpdateCancelCall<'a, C, A> where C: BorrowMut ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3573,7 +3592,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3769,4 +3788,3 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/reseller1_sandbox/src/lib.rs b/gen/reseller1_sandbox/src/lib.rs index 7ef97292a5..6c63f235ed 100644 --- a/gen/reseller1_sandbox/src/lib.rs +++ b/gen/reseller1_sandbox/src/lib.rs @@ -186,7 +186,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -214,6 +214,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -320,6 +321,8 @@ pub struct Reseller { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Reseller {} @@ -332,6 +335,8 @@ impl<'a, C, A> Reseller client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/apps/reseller/v1sandbox/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -347,9 +352,23 @@ impl<'a, C, A> Reseller /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/apps/reseller/v1sandbox/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1133,7 +1152,7 @@ impl<'a, C, A> CustomerUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -1402,7 +1421,7 @@ impl<'a, C, A> CustomerInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers".to_string(); + let mut url = self.hub._base_url.clone() + "customers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -1644,7 +1663,7 @@ impl<'a, C, A> CustomerPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -1903,7 +1922,7 @@ impl<'a, C, A> CustomerGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrderReadonly.as_ref().to_string(), ()); } @@ -2150,7 +2169,7 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}/subscriptions/{subscriptionId}".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerId}/subscriptions/{subscriptionId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrderReadonly.as_ref().to_string(), ()); } @@ -2934,7 +2953,7 @@ impl<'a, C, A> SubscriptionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/subscriptions".to_string(); + let mut url = self.hub._base_url.clone() + "subscriptions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrderReadonly.as_ref().to_string(), ()); } @@ -3182,7 +3201,7 @@ impl<'a, C, A> SubscriptionChangeRenewalSettingCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings".to_string(); + let mut url = self.hub._base_url.clone() + "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings"; if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -3453,7 +3472,7 @@ impl<'a, C, A> SubscriptionStartPaidServiceCall<'a, C, A> where C: BorrowMut SubscriptionChangeSeatCall<'a, C, A> where C: BorrowMut SubscriptionSuspendCall<'a, C, A> where C: BorrowMut SubscriptionActivateCall<'a, C, A> where C: BorrowMut SubscriptionChangePlanCall<'a, C, A> where C: BorrowMut SubscriptionChangePlanCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Resourceviews {} @@ -346,6 +349,8 @@ impl<'a, C, A> Resourceviews client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/resourceviews/v1beta2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -361,9 +366,23 @@ impl<'a, C, A> Resourceviews /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/resourceviews/v1beta2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1177,7 +1196,7 @@ impl<'a, C, A> ZoneViewRemoveResourceCall<'a, C, A> where C: BorrowMut ZoneViewAddResourceCall<'a, C, A> where C: BorrowMut ZoneViewListResourceCall<'a, C, A> where C: BorrowMut ZoneViewGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews/{resourceView}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2336,7 +2355,7 @@ impl<'a, C, A> ZoneViewListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2604,7 +2623,7 @@ impl<'a, C, A> ZoneViewInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2877,7 +2896,7 @@ impl<'a, C, A> ZoneViewDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews/{resourceView}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3143,7 +3162,7 @@ impl<'a, C, A> ZoneViewSetServiceCall<'a, C, A> where C: BorrowMut ZoneViewGetServiceCall<'a, C, A> where C: BorrowMut ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -3969,7 +3988,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -4165,4 +4184,3 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/safebrowsing4/src/lib.rs b/gen/safebrowsing4/src/lib.rs index d6cd0774ba..f6ce5416ca 100644 --- a/gen/safebrowsing4/src/lib.rs +++ b/gen/safebrowsing4/src/lib.rs @@ -183,7 +183,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -211,6 +211,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -288,6 +289,8 @@ pub struct Safebrowsing { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Safebrowsing {} @@ -300,6 +303,8 @@ impl<'a, C, A> Safebrowsing client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://safebrowsing.googleapis.com/".to_string(), + _root_url: "https://safebrowsing.googleapis.com/".to_string(), } } @@ -327,9 +332,23 @@ impl<'a, C, A> Safebrowsing /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://safebrowsing.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://safebrowsing.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1279,7 +1298,7 @@ impl<'a, C, A> EncodedFullHasheGetCall<'a, C, A> where C: BorrowMut FullHasheFindCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://safebrowsing.googleapis.com/v4/fullHashes:find".to_string(); + let mut url = self.hub._base_url.clone() + "v4/fullHashes:find"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1736,7 +1755,7 @@ impl<'a, C, A> ThreatListUpdateFetchCall<'a, C, A> where C: BorrowMut EncodedUpdateGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://safebrowsing.googleapis.com/v4/encodedUpdates/{encodedRequest}".to_string(); + let mut url = self.hub._base_url.clone() + "v4/encodedUpdates/{encodedRequest}"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2190,7 +2209,7 @@ impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://safebrowsing.googleapis.com/v4/threatLists".to_string(); + let mut url = self.hub._base_url.clone() + "v4/threatLists"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2383,7 +2402,7 @@ impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://safebrowsing.googleapis.com/v4/threatMatches:find".to_string(); + let mut url = self.hub._base_url.clone() + "v4/threatMatches:find"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2526,4 +2545,3 @@ impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/searchconsole1/src/lib.rs b/gen/searchconsole1/src/lib.rs index 22bd76214f..d0a355be57 100644 --- a/gen/searchconsole1/src/lib.rs +++ b/gen/searchconsole1/src/lib.rs @@ -176,7 +176,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -204,6 +204,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -285,6 +286,8 @@ pub struct SearchConsole { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for SearchConsole {} @@ -297,6 +300,8 @@ impl<'a, C, A> SearchConsole client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://searchconsole.googleapis.com/".to_string(), + _root_url: "https://searchconsole.googleapis.com/".to_string(), } } @@ -309,9 +314,23 @@ impl<'a, C, A> SearchConsole /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://searchconsole.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://searchconsole.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -585,7 +604,7 @@ impl<'a, C, A> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = "https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run".to_string(); + let mut url = self.hub._base_url.clone() + "v1/urlTestingTools/mobileFriendlyTest:run"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -728,4 +747,3 @@ impl<'a, C, A> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> where C: Borrow } - diff --git a/gen/serviceregistryalpha/src/lib.rs b/gen/serviceregistryalpha/src/lib.rs index 4cb12ff05c..33dbfe9b63 100644 --- a/gen/serviceregistryalpha/src/lib.rs +++ b/gen/serviceregistryalpha/src/lib.rs @@ -181,7 +181,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -209,6 +209,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -322,6 +323,8 @@ pub struct ServiceRegistry { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for ServiceRegistry {} @@ -334,6 +337,8 @@ impl<'a, C, A> ServiceRegistry client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/serviceregistry/alpha/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -349,9 +354,23 @@ impl<'a, C, A> ServiceRegistry /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/serviceregistry/alpha/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -932,7 +951,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1197,7 +1216,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/operations".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1479,7 +1498,7 @@ impl<'a, C, A> EndpointInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/endpoints"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1740,7 +1759,7 @@ impl<'a, C, A> EndpointDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1994,7 +2013,7 @@ impl<'a, C, A> EndpointUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2272,7 +2291,7 @@ impl<'a, C, A> EndpointPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2561,7 +2580,7 @@ impl<'a, C, A> EndpointListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/endpoints"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2838,7 +2857,7 @@ impl<'a, C, A> EndpointGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3013,4 +3032,3 @@ impl<'a, C, A> EndpointGetCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/siteverification1/src/lib.rs b/gen/siteverification1/src/lib.rs index 75331c198c..8ea5e9b146 100644 --- a/gen/siteverification1/src/lib.rs +++ b/gen/siteverification1/src/lib.rs @@ -179,7 +179,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -207,6 +207,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -314,6 +315,8 @@ pub struct SiteVerification { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for SiteVerification {} @@ -326,6 +329,8 @@ impl<'a, C, A> SiteVerification client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/siteVerification/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -338,9 +343,23 @@ impl<'a, C, A> SiteVerification /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/siteVerification/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -709,7 +728,7 @@ impl<'a, C, A> WebResourceGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "webResource/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -951,7 +970,7 @@ impl<'a, C, A> WebResourcePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "webResource/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1208,7 +1227,7 @@ impl<'a, C, A> WebResourceListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/siteVerification/v1/webResource".to_string(); + let mut url = self.hub._base_url.clone() + "webResource"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1411,7 +1430,7 @@ impl<'a, C, A> WebResourceDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "webResource/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1641,7 +1660,7 @@ impl<'a, C, A> WebResourceGetTokenCall<'a, C, A> where C: BorrowMut WebResourceUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "webResource/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2142,7 +2161,7 @@ impl<'a, C, A> WebResourceInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/siteVerification/v1/webResource".to_string(); + let mut url = self.hub._base_url.clone() + "webResource"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2310,4 +2329,3 @@ impl<'a, C, A> WebResourceInsertCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/spectrum1_explorer/src/lib.rs b/gen/spectrum1_explorer/src/lib.rs index 09ee4159a7..d5b4c0211c 100644 --- a/gen/spectrum1_explorer/src/lib.rs +++ b/gen/spectrum1_explorer/src/lib.rs @@ -176,7 +176,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -204,6 +204,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -285,6 +286,8 @@ pub struct Spectrum { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Spectrum {} @@ -297,6 +300,8 @@ impl<'a, C, A> Spectrum client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/spectrum/v1explorer/paws/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -309,9 +314,23 @@ impl<'a, C, A> Spectrum /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/spectrum/v1explorer/paws/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1381,7 +1400,7 @@ impl<'a, C, A> PawNotifySpectrumUseCall<'a, C, A> where C: BorrowMut PawRegisterCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/register".to_string(); + let mut url = self.hub._base_url.clone() + "register"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1803,7 +1822,7 @@ impl<'a, C, A> PawGetSpectrumCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/getSpectrum".to_string(); + let mut url = self.hub._base_url.clone() + "getSpectrum"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2014,7 +2033,7 @@ impl<'a, C, A> PawInitCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/init".to_string(); + let mut url = self.hub._base_url.clone() + "init"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2225,7 +2244,7 @@ impl<'a, C, A> PawGetSpectrumBatchCall<'a, C, A> where C: BorrowMut PawVerifyDeviceCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/verifyDevice".to_string(); + let mut url = self.hub._base_url.clone() + "verifyDevice"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2573,4 +2592,3 @@ impl<'a, C, A> PawVerifyDeviceCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/sqladmin1_beta4/src/lib.rs b/gen/sqladmin1_beta4/src/lib.rs index 4be9ceb541..6e9a3399ec 100644 --- a/gen/sqladmin1_beta4/src/lib.rs +++ b/gen/sqladmin1_beta4/src/lib.rs @@ -216,7 +216,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -244,6 +244,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -351,6 +352,8 @@ pub struct SQLAdmin { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for SQLAdmin {} @@ -363,6 +366,8 @@ impl<'a, C, A> SQLAdmin client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/sql/v1beta4/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -396,9 +401,23 @@ impl<'a, C, A> SQLAdmin /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/sql/v1beta4/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2956,7 +2975,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/operations".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3217,7 +3236,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/operations/{operation}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3462,7 +3481,7 @@ impl<'a, C, A> TierListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/tiers".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/tiers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3699,7 +3718,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3950,7 +3969,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4228,7 +4247,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4526,7 +4545,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4804,7 +4823,7 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceFailoverCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/failover".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/failover"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5353,7 +5372,7 @@ impl<'a, C, A> InstanceResetSslConfigCall<'a, C, A> where C: BorrowMut InstancePromoteReplicaCall<'a, C, A> where C: BorrowMut InstanceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6101,7 +6120,7 @@ impl<'a, C, A> InstancePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6379,7 +6398,7 @@ impl<'a, C, A> InstanceCloneCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/clone".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/clone"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6650,7 +6669,7 @@ impl<'a, C, A> InstanceDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6897,7 +6916,7 @@ impl<'a, C, A> InstanceStopReplicaCall<'a, C, A> where C: BorrowMut InstanceStartReplicaCall<'a, C, A> where C: BorrowMut InstanceInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7670,7 +7689,7 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7935,7 +7954,7 @@ impl<'a, C, A> InstanceImportCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/import".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/import"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8213,7 +8232,7 @@ impl<'a, C, A> InstanceUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8484,7 +8503,7 @@ impl<'a, C, A> InstanceRestartCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/restart".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/restart"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8738,7 +8757,7 @@ impl<'a, C, A> InstanceExportCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/export".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/export"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9016,7 +9035,7 @@ impl<'a, C, A> InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut FlagListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/flags".to_string(); + let mut url = self.hub._base_url.clone() + "flags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9503,7 +9522,7 @@ impl<'a, C, A> DatabaseDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9769,7 +9788,7 @@ impl<'a, C, A> DatabasePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10050,7 +10069,7 @@ impl<'a, C, A> DatabaseListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10304,7 +10323,7 @@ impl<'a, C, A> DatabaseInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10577,7 +10596,7 @@ impl<'a, C, A> DatabaseGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10843,7 +10862,7 @@ impl<'a, C, A> DatabaseUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11131,7 +11150,7 @@ impl<'a, C, A> SslCertInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11404,7 +11423,7 @@ impl<'a, C, A> SslCertDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11663,7 +11682,7 @@ impl<'a, C, A> SslCertGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11927,7 +11946,7 @@ impl<'a, C, A> SslCertCreateEphemeralCall<'a, C, A> where C: BorrowMut SslCertListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12455,7 +12474,7 @@ impl<'a, C, A> BackupRunListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12718,7 +12737,7 @@ impl<'a, C, A> BackupRunGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12977,7 +12996,7 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13241,7 +13260,7 @@ impl<'a, C, A> BackupRunInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns".to_string(); + let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13440,4 +13459,3 @@ impl<'a, C, A> BackupRunInsertCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/storage1/src/lib.rs b/gen/storage1/src/lib.rs index 176e10af77..e0ef10b140 100644 --- a/gen/storage1/src/lib.rs +++ b/gen/storage1/src/lib.rs @@ -233,7 +233,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -261,6 +261,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -394,6 +395,8 @@ pub struct Storage { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Storage {} @@ -406,6 +409,8 @@ impl<'a, C, A> Storage client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/storage/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -439,9 +444,23 @@ impl<'a, C, A> Storage /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/storage/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2857,7 +2876,7 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3138,7 +3157,7 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl/{entity}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl/{entity}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3690,7 +3709,7 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl/{entity}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl/{entity}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3946,7 +3965,7 @@ impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl/{entity}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl/{entity}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4229,7 +4248,7 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut BucketAccessControlListCall<'a, C, A> where C: BorrowMut ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/storage/v1/channels/stop".to_string(); + let mut url = self.hub._base_url.clone() + "channels/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6327,7 +6346,7 @@ impl<'a, C, A> NotificationInsertCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/notificationConfigs/{notification}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/notificationConfigs/{notification}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7105,7 +7124,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/notificationConfigs".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/notificationConfigs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7430,7 +7449,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7875,7 +7894,7 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8211,7 +8230,7 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/watch".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/o/watch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8538,7 +8557,7 @@ impl<'a, C, A> ObjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9564,9 +9583,9 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/storage/v1/b/{bucket}/o".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/storage/v1/b/{bucket}/o", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/storage/v1/b/{bucket}/o".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/storage/v1/b/{bucket}/o", "resumable") } else { unreachable!() }; @@ -10042,7 +10061,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/storage/v1/b/{destinationBucket}/o/{destinationObject}/compose".to_string(); + let mut url = self.hub._base_url.clone() + "b/{destinationBucket}/o/{destinationObject}/compose"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10370,7 +10389,7 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10682,7 +10701,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/o"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10984,7 +11003,7 @@ impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11770,7 +11789,7 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12109,7 +12128,7 @@ impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14226,7 +14245,7 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14547,7 +14566,7 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14824,7 +14843,7 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); + let mut url = self.hub._base_url.clone() + "b/{bucket}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -15092,7 +15111,7 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b".to_string(); + let mut url = self.hub._base_url.clone() + "b"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -15362,7 +15381,7 @@ impl<'a, C, A> BucketTestIamPermissionCall<'a, C, A> where C: BorrowMut BucketSetIamPolicyCall<'a, C, A> where C: BorrowMut BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut BucketListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/storage/v1/b".to_string(); + let mut url = self.hub._base_url.clone() + "b"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -16402,7 +16421,7 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Storagetransfer {} @@ -322,6 +325,8 @@ impl<'a, C, A> Storagetransfer client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://storagetransfer.googleapis.com/".to_string(), + _root_url: "https://storagetransfer.googleapis.com/".to_string(), } } @@ -340,9 +345,23 @@ impl<'a, C, A> Storagetransfer /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://storagetransfer.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://storagetransfer.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1563,7 +1582,7 @@ impl<'a, C, A> TransferOperationPauseCall<'a, C, A> where C: BorrowMut TransferOperationResumeCall<'a, C, A> where C: BorrowMut TransferOperationDeleteCall<'a, C, A> where C: BorrowMut TransferOperationGetCall<'a, C, A> where C: BorrowMut TransferOperationListCall<'a, C, A> where C: BorrowMut TransferOperationCancelCall<'a, C, A> where C: BorrowMut GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut TransferJobListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://storagetransfer.googleapis.com/v1/transferJobs".to_string(); + let mut url = self.hub._base_url.clone() + "v1/transferJobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3642,7 +3661,7 @@ impl<'a, C, A> TransferJobPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://storagetransfer.googleapis.com/v1/{+jobName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+jobName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3917,7 +3936,7 @@ impl<'a, C, A> TransferJobGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://storagetransfer.googleapis.com/v1/{+jobName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/{+jobName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4175,7 +4194,7 @@ impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://storagetransfer.googleapis.com/v1/transferJobs".to_string(); + let mut url = self.hub._base_url.clone() + "v1/transferJobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4339,4 +4358,3 @@ impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut } - diff --git a/gen/surveys2/src/lib.rs b/gen/surveys2/src/lib.rs index 10ac7242c2..1247ff414e 100644 --- a/gen/surveys2/src/lib.rs +++ b/gen/surveys2/src/lib.rs @@ -184,7 +184,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -212,6 +212,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -320,6 +321,8 @@ pub struct Surveys { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Surveys {} @@ -332,6 +335,8 @@ impl<'a, C, A> Surveys client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/surveys/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -350,9 +355,23 @@ impl<'a, C, A> Surveys /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/surveys/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1221,7 +1240,7 @@ impl<'a, C, A> SurveyStopCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys/{resourceId}/stop".to_string(); + let mut url = self.hub._base_url.clone() + "surveys/{resourceId}/stop"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1460,7 +1479,7 @@ impl<'a, C, A> SurveyInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys".to_string(); + let mut url = self.hub._base_url.clone() + "surveys"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1688,7 +1707,7 @@ impl<'a, C, A> SurveyDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}".to_string(); + let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1936,7 +1955,7 @@ impl<'a, C, A> SurveyListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys".to_string(); + let mut url = self.hub._base_url.clone() + "surveys"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2165,7 +2184,7 @@ impl<'a, C, A> SurveyUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}".to_string(); + let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2431,7 +2450,7 @@ impl<'a, C, A> SurveyStartCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys/{resourceId}/start".to_string(); + let mut url = self.hub._base_url.clone() + "surveys/{resourceId}/start"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2689,7 +2708,7 @@ impl<'a, C, A> SurveyGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}".to_string(); + let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2952,7 +2971,7 @@ impl<'a, C, A> ResultGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}/results".to_string(); + let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}/results"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3224,7 +3243,7 @@ impl<'a, C, A> MobileapppanelListCall<'a, C, A> where C: BorrowMut MobileapppanelGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/surveys/v2/mobileAppPanels/{panelId}".to_string(); + let mut url = self.hub._base_url.clone() + "mobileAppPanels/{panelId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3688,7 +3707,7 @@ impl<'a, C, A> MobileapppanelUpdateCall<'a, C, A> where C: BorrowMut MobileapppanelUpdateCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for TagManager {} @@ -398,6 +401,8 @@ impl<'a, C, A> TagManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/tagmanager/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -410,9 +415,23 @@ impl<'a, C, A> TagManager /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/tagmanager/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -2554,7 +2573,7 @@ impl<'a, C, A> AccountContainerListCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3309,7 +3328,7 @@ impl<'a, C, A> AccountPermissionCreateCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu } - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3817,7 +3836,7 @@ impl<'a, C, A> AccountPermissionDeleteCall<'a, C, A> where C: BorrowMut AccountContainerGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -4613,7 +4632,7 @@ impl<'a, C, A> AccountContainerVersionListCall<'a, C, A> where C: BorrowMut AccountContainerTriggerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerGetCall<'a, C, A> where C: BorrowMut AccountContainerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerFolderDeleteCall<'a, C, A> where C: BorrowMut AccountContainerCreateCall<'a, C, A> where C: BorrowMut AccountContainerTagDeleteCall<'a, C, A> where C: BorrowMut AccountContainerFolderEntityListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6694,7 +6713,7 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); } @@ -6951,7 +6970,7 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7198,7 +7217,7 @@ impl<'a, C, A> AccountContainerTagListCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerFolderGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut AccountContainerTagCreateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerListCall<'a, C, A> where C: BorrowMut AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageAccount.as_ref().to_string(), ()); } @@ -9292,7 +9311,7 @@ impl<'a, C, A> AccountContainerVersionCreateCall<'a, C, A> where C: BorrowMut AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountContainerMoveFolderUpdateCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/move_folders/{folderId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -10136,7 +10155,7 @@ impl<'a, C, A> AccountContainerVersionRestoreCall<'a, C, A> where C: BorrowMut AccountContainerVariableCreateCall<'a, C, A> where C: BorrowMut AccountContainerVariableListCall<'a, C, A> where C: BorrowMut AccountContainerTagGetCall<'a, C, A> where C: BorrowMut AccountContainerVariableGetCall<'a, C, A> where C: BorrowMut AccountContainerTriggerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerTriggerCreateCall<'a, C, A> where C: BorrowMut AccountContainerFolderUpdateCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts".to_string(); + let mut url = self.hub._base_url.clone() + "accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12473,7 +12492,7 @@ impl<'a, C, A> AccountPermissionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVariableDeleteCall<'a, C, A> where C: BorrowMut AccountContainerReauthorizeEnvironmentUpdateCall<'a, C, A> where params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Publish.as_ref().to_string(), ()); } @@ -13280,7 +13299,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13529,7 +13548,7 @@ impl<'a, C, A> AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTagUpdateCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}".to_string(); + let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -14418,7 +14437,7 @@ impl<'a, C, A> AccountContainerFolderCreateCall<'a, C, A> where C: BorrowMut AccountContainerFolderListCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVariableUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Taskqueue {} @@ -323,6 +326,8 @@ impl<'a, C, A> Taskqueue client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/taskqueue/v1beta2/projects/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -338,9 +343,23 @@ impl<'a, C, A> Taskqueue /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/taskqueue/v1beta2/projects/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -852,7 +871,7 @@ impl<'a, C, A> TaskqueueGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1120,7 +1139,7 @@ impl<'a, C, A> TaskLeaseCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/lease".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/lease"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1408,7 +1427,7 @@ impl<'a, C, A> TaskInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1680,7 +1699,7 @@ impl<'a, C, A> TaskDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1938,7 +1957,7 @@ impl<'a, C, A> TaskPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2227,7 +2246,7 @@ impl<'a, C, A> TaskListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2476,7 +2495,7 @@ impl<'a, C, A> TaskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2744,7 +2763,7 @@ impl<'a, C, A> TaskUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2961,4 +2980,3 @@ impl<'a, C, A> TaskUpdateCall<'a, C, A> where C: BorrowMut, A: oa } - diff --git a/gen/tasks1/src/lib.rs b/gen/tasks1/src/lib.rs index 62d08226c1..ba94937c66 100644 --- a/gen/tasks1/src/lib.rs +++ b/gen/tasks1/src/lib.rs @@ -189,7 +189,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -217,6 +217,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -328,6 +329,8 @@ pub struct TasksHub { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for TasksHub {} @@ -340,6 +343,8 @@ impl<'a, C, A> TasksHub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/tasks/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -355,9 +360,23 @@ impl<'a, C, A> TasksHub /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/tasks/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1006,7 +1025,7 @@ impl<'a, C, A> TaskListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -1320,7 +1339,7 @@ impl<'a, C, A> TaskUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1598,7 +1617,7 @@ impl<'a, C, A> TaskPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1866,7 +1885,7 @@ impl<'a, C, A> TaskClearCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/clear".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/clear"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2103,7 +2122,7 @@ impl<'a, C, A> TaskMoveCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}/move".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}/move"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2363,7 +2382,7 @@ impl<'a, C, A> TaskDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2600,7 +2619,7 @@ impl<'a, C, A> TaskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2862,7 +2881,7 @@ impl<'a, C, A> TaskInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks".to_string(); + let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3143,7 +3162,7 @@ impl<'a, C, A> TasklistListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists".to_string(); + let mut url = self.hub._base_url.clone() + "users/@me/lists"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3368,7 +3387,7 @@ impl<'a, C, A> TasklistUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); + let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3626,7 +3645,7 @@ impl<'a, C, A> TasklistDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); + let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3858,7 +3877,7 @@ impl<'a, C, A> TasklistPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); + let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4122,7 +4141,7 @@ impl<'a, C, A> TasklistInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists".to_string(); + let mut url = self.hub._base_url.clone() + "users/@me/lists"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4350,7 +4369,7 @@ impl<'a, C, A> TasklistGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); + let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4515,4 +4534,3 @@ impl<'a, C, A> TasklistGetCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/translate2/src/lib.rs b/gen/translate2/src/lib.rs index 238a1cbef5..2519bf4cd1 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -174,7 +174,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -202,6 +202,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -277,6 +278,8 @@ pub struct Translate { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Translate {} @@ -289,6 +292,8 @@ impl<'a, C, A> Translate client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/language/translate/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -307,9 +312,23 @@ impl<'a, C, A> Translate /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/language/translate/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -697,7 +716,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/language/translate/v2/languages".to_string(); + let mut url = self.hub._base_url.clone() + "v2/languages"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -890,7 +909,7 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/language/translate/v2/detect".to_string(); + let mut url = self.hub._base_url.clone() + "v2/detect"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1106,7 +1125,7 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/language/translate/v2".to_string(); + let mut url = self.hub._base_url.clone() + "v2"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1262,4 +1281,3 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, } - diff --git a/gen/urlshortener1/src/lib.rs b/gen/urlshortener1/src/lib.rs index 5849b21886..28a5cb7ae7 100644 --- a/gen/urlshortener1/src/lib.rs +++ b/gen/urlshortener1/src/lib.rs @@ -172,7 +172,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -200,6 +200,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -298,6 +299,8 @@ pub struct Urlshortener { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Urlshortener {} @@ -310,6 +313,8 @@ impl<'a, C, A> Urlshortener client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/urlshortener/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -322,9 +327,23 @@ impl<'a, C, A> Urlshortener /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/urlshortener/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -631,7 +650,7 @@ impl<'a, C, A> UrlInsertCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/urlshortener/v1/url".to_string(); + let mut url = self.hub._base_url.clone() + "url"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -864,7 +883,7 @@ impl<'a, C, A> UrlGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/urlshortener/v1/url".to_string(); + let mut url = self.hub._base_url.clone() + "url"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1093,7 +1112,7 @@ impl<'a, C, A> UrlListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/urlshortener/v1/url/history".to_string(); + let mut url = self.hub._base_url.clone() + "url/history"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1241,4 +1260,3 @@ impl<'a, C, A> UrlListCall<'a, C, A> where C: BorrowMut, A: oauth } - diff --git a/gen/webfonts1/src/lib.rs b/gen/webfonts1/src/lib.rs index 0026f20599..888c7478a4 100644 --- a/gen/webfonts1/src/lib.rs +++ b/gen/webfonts1/src/lib.rs @@ -171,7 +171,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -199,6 +199,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -275,6 +276,8 @@ pub struct Webfonts { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Webfonts {} @@ -287,6 +290,8 @@ impl<'a, C, A> Webfonts client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/webfonts/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -299,9 +304,23 @@ impl<'a, C, A> Webfonts /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/webfonts/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -498,7 +517,7 @@ impl<'a, C, A> WebfontListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/webfonts/v1/webfonts".to_string(); + let mut url = self.hub._base_url.clone() + "webfonts"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -618,4 +637,3 @@ impl<'a, C, A> WebfontListCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/webmasters3/src/lib.rs b/gen/webmasters3/src/lib.rs index 941cd647ab..ff7f522aea 100644 --- a/gen/webmasters3/src/lib.rs +++ b/gen/webmasters3/src/lib.rs @@ -178,7 +178,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -206,6 +206,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -307,6 +308,8 @@ pub struct Webmasters { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for Webmasters {} @@ -319,6 +322,8 @@ impl<'a, C, A> Webmasters client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/webmasters/v3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -343,9 +348,23 @@ impl<'a, C, A> Webmasters /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/webmasters/v3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -1237,7 +1256,7 @@ impl<'a, C, A> SitemapDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps/{feedpath}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1473,7 +1492,7 @@ impl<'a, C, A> SitemapSubmitCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps/{feedpath}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1710,7 +1729,7 @@ impl<'a, C, A> SitemapGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps/{feedpath}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -1960,7 +1979,7 @@ impl<'a, C, A> SitemapListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2202,7 +2221,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2436,7 +2455,7 @@ impl<'a, C, A> SiteAddCall<'a, C, A> where C: BorrowMut, A: oauth } - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2659,7 +2678,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/webmasters/v3/sites".to_string(); + let mut url = self.hub._base_url.clone() + "sites"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2862,7 +2881,7 @@ impl<'a, C, A> SiteDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3096,7 +3115,7 @@ impl<'a, C, A> SearchanalyticQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorscountQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleGetCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleListCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< } - let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples/{url}".to_string(); + let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/urlCrawlErrorsSamples/{url}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4346,4 +4365,3 @@ impl<'a, C, A> UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< } - diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 17042aebcb..71a7383536 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -257,7 +257,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -285,6 +285,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -414,6 +415,8 @@ pub struct YouTube { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for YouTube {} @@ -426,6 +429,8 @@ impl<'a, C, A> YouTube client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/youtube/v3/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -516,9 +521,23 @@ impl<'a, C, A> YouTube /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/youtube/v3/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -8800,7 +8819,7 @@ impl<'a, C, A> ChannelSectionListCall<'a, C, A> where C: BorrowMut ChannelSectionInsertCall<'a, C, A> where C: BorrowMut ChannelSectionDeleteCall<'a, C, A> where C: BorrowMut ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut PlaylistInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); + let mut url = self.hub._base_url.clone() + "playlists"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10201,7 +10220,7 @@ impl<'a, C, A> PlaylistListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); + let mut url = self.hub._base_url.clone() + "playlists"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10483,7 +10502,7 @@ impl<'a, C, A> PlaylistDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); + let mut url = self.hub._base_url.clone() + "playlists"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10711,7 +10730,7 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); + let mut url = self.hub._base_url.clone() + "playlists"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10972,7 +10991,7 @@ impl<'a, C, A> VideoReportAbuseCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/youtube/v3/videos/reportAbuse".to_string(); + let mut url = self.hub._base_url.clone() + "videos/reportAbuse"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11259,7 +11278,7 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/videos".to_string(); + let mut url = self.hub._base_url.clone() + "videos"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11568,7 +11587,7 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = "https://www.googleapis.com/youtube/v3/videos/rate".to_string(); + let mut url = self.hub._base_url.clone() + "videos/rate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11787,7 +11806,7 @@ impl<'a, C, A> VideoGetRatingCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/videos/getRating".to_string(); + let mut url = self.hub._base_url.clone() + "videos/getRating"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12014,7 +12033,7 @@ impl<'a, C, A> VideoDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/youtube/v3/videos".to_string(); + let mut url = self.hub._base_url.clone() + "videos"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12242,7 +12261,7 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/videos".to_string(); + let mut url = self.hub._base_url.clone() + "videos"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12535,9 +12554,9 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/youtube/v3/videos".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/youtube/v3/videos", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/youtube/v3/videos".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/videos", "resumable") } else { unreachable!() }; @@ -12969,7 +12988,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/activities".to_string(); + let mut url = self.hub._base_url.clone() + "activities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13253,7 +13272,7 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/activities".to_string(); + let mut url = self.hub._base_url.clone() + "activities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13534,7 +13553,7 @@ impl<'a, C, A> LiveStreamUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); + let mut url = self.hub._base_url.clone() + "liveStreams"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13822,7 +13841,7 @@ impl<'a, C, A> LiveStreamDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); + let mut url = self.hub._base_url.clone() + "liveStreams"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14093,7 +14112,7 @@ impl<'a, C, A> LiveStreamListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); + let mut url = self.hub._base_url.clone() + "liveStreams"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14402,7 +14421,7 @@ impl<'a, C, A> LiveStreamInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); + let mut url = self.hub._base_url.clone() + "liveStreams"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14694,7 +14713,7 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/channels".to_string(); + let mut url = self.hub._base_url.clone() + "channels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14996,7 +15015,7 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/channels".to_string(); + let mut url = self.hub._base_url.clone() + "channels"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15301,9 +15320,9 @@ impl<'a, C, A> WatermarkSetCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/youtube/v3/watermarks/set".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/youtube/v3/watermarks/set", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/youtube/v3/watermarks/set".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/watermarks/set", "resumable") } else { unreachable!() }; @@ -15652,7 +15671,7 @@ impl<'a, C, A> WatermarkUnsetCall<'a, C, A> where C: BorrowMut, A } - let mut url = "https://www.googleapis.com/youtube/v3/watermarks/unset".to_string(); + let mut url = self.hub._base_url.clone() + "watermarks/unset"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15875,7 +15894,7 @@ impl<'a, C, A> LiveChatModeratorInsertCall<'a, C, A> where C: BorrowMut LiveChatModeratorListCall<'a, C, A> where C: BorrowMut LiveChatModeratorDeleteCall<'a, C, A> where C: BorrowMut CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/youtube/v3/captions".to_string(); + let mut url = self.hub._base_url.clone() + "captions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -16847,9 +16866,9 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/youtube/v3/captions".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/youtube/v3/captions", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/youtube/v3/captions".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/captions", "resumable") } else { unreachable!() }; @@ -17254,7 +17273,7 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/captions".to_string(); + let mut url = self.hub._base_url.clone() + "captions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -17528,7 +17547,7 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/youtube/v3/captions/{id}".to_string(); + let mut url = self.hub._base_url.clone() + "captions/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -17812,9 +17831,9 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/youtube/v3/captions".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/youtube/v3/captions", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/youtube/v3/captions".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/captions", "resumable") } else { unreachable!() }; @@ -18193,7 +18212,7 @@ impl<'a, C, A> I18nLanguageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/i18nLanguages".to_string(); + let mut url = self.hub._base_url.clone() + "i18nLanguages"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -18429,7 +18448,7 @@ impl<'a, C, A> GuideCategoryListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/guideCategories".to_string(); + let mut url = self.hub._base_url.clone() + "guideCategories"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -18714,7 +18733,7 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/commentThreads".to_string(); + let mut url = self.hub._base_url.clone() + "commentThreads"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -19018,7 +19037,7 @@ impl<'a, C, A> CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadInsertCall<'a, C, A> where C: BorrowMut CommentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); + let mut url = self.hub._base_url.clone() + "comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -19767,7 +19786,7 @@ impl<'a, C, A> CommentSetModerationStatuCall<'a, C, A> where C: BorrowMut CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); + let mut url = self.hub._base_url.clone() + "comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20218,7 +20237,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); + let mut url = self.hub._base_url.clone() + "comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20483,7 +20502,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); + let mut url = self.hub._base_url.clone() + "comments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20723,7 +20742,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/youtube/v3/comments/markAsSpam".to_string(); + let mut url = self.hub._base_url.clone() + "comments/markAsSpam"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20942,7 +20961,7 @@ impl<'a, C, A> PlaylistItemInsertCall<'a, C, A> where C: BorrowMut PlaylistItemDeleteCall<'a, C, A> where C: BorrowMut PlaylistItemListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/playlistItems".to_string(); + let mut url = self.hub._base_url.clone() + "playlistItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -21714,7 +21733,7 @@ impl<'a, C, A> PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut LiveChatMessageListCall<'a, C, A> where C: BorrowMut LiveChatMessageDeleteCall<'a, C, A> where C: BorrowMut LiveChatMessageInsertCall<'a, C, A> where C: BorrowMut VideoCategoryListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/videoCategories".to_string(); + let mut url = self.hub._base_url.clone() + "videoCategories"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -22971,7 +22990,7 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/i18nRegions".to_string(); + let mut url = self.hub._base_url.clone() + "i18nRegions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -23202,7 +23221,7 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/subscriptions".to_string(); + let mut url = self.hub._base_url.clone() + "subscriptions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -24010,7 +24029,7 @@ impl<'a, C, A> LiveChatBanInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/liveChat/bans".to_string(); + let mut url = self.hub._base_url.clone() + "liveChat/bans"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24250,7 +24269,7 @@ impl<'a, C, A> LiveChatBanDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = "https://www.googleapis.com/youtube/v3/liveChat/bans".to_string(); + let mut url = self.hub._base_url.clone() + "liveChat/bans"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24484,7 +24503,7 @@ impl<'a, C, A> SponsorListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/sponsors".to_string(); + let mut url = self.hub._base_url.clone() + "sponsors"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -24744,7 +24763,7 @@ impl<'a, C, A> VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut LiveBroadcastControlCall<'a, C, A> where C: BorrowMut LiveBroadcastUpdateCall<'a, C, A> where C: BorrowMut LiveBroadcastBindCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/liveBroadcasts/bind".to_string(); + let mut url = self.hub._base_url.clone() + "liveBroadcasts/bind"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25929,7 +25948,7 @@ impl<'a, C, A> LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut LiveBroadcastInsertCall<'a, C, A> where C: BorrowMut LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut LiveBroadcastListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/liveBroadcasts".to_string(); + let mut url = self.hub._base_url.clone() + "liveBroadcasts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -27098,9 +27117,9 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut SearchListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/v3/search".to_string(); + let mut url = self.hub._base_url.clone() + "search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -28063,7 +28082,7 @@ impl<'a, C, A> SuperChatEventListCall<'a, C, A> where C: BorrowMut ThumbnailSetCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - ("https://www.googleapis.com/upload/youtube/v3/thumbnails/set".to_string(), "multipart") + (self.hub._root_url.clone() + "/upload/youtube/v3/thumbnails/set", "multipart") } else if protocol == "resumable" { - ("https://www.googleapis.com/resumable/upload/youtube/v3/thumbnails/set".to_string(), "resumable") + (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/thumbnails/set", "resumable") } else { unreachable!() }; @@ -28672,7 +28691,7 @@ impl<'a, C, A> FanFundingEventListCall<'a, C, A> where C: BorrowMut FanFundingEventListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for YouTubeAnalytics {} @@ -338,6 +341,8 @@ impl<'a, C, A> YouTubeAnalytics client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://www.googleapis.com/youtube/analytics/v1/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), } } @@ -356,9 +361,23 @@ impl<'a, C, A> YouTubeAnalytics /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/youtube/analytics/v1/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -971,7 +990,7 @@ impl<'a, C, A> ReportQueryCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/analytics/v1/reports".to_string(); + let mut url = self.hub._base_url.clone() + "reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YoutubeReadonly.as_ref().to_string(), ()); } @@ -1276,7 +1295,7 @@ impl<'a, C, A> GroupItemInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groupItems".to_string(); + let mut url = self.hub._base_url.clone() + "groupItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -1518,7 +1537,7 @@ impl<'a, C, A> GroupItemListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groupItems".to_string(); + let mut url = self.hub._base_url.clone() + "groupItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YoutubeReadonly.as_ref().to_string(), ()); } @@ -1745,7 +1764,7 @@ impl<'a, C, A> GroupItemDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groupItems".to_string(); + let mut url = self.hub._base_url.clone() + "groupItems"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -1962,7 +1981,7 @@ impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); + let mut url = self.hub._base_url.clone() + "groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -2185,7 +2204,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); + let mut url = self.hub._base_url.clone() + "groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -2440,7 +2459,7 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); + let mut url = self.hub._base_url.clone() + "groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YoutubeReadonly.as_ref().to_string(), ()); } @@ -2684,7 +2703,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); + let mut url = self.hub._base_url.clone() + "groups"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -2851,4 +2870,3 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o } - diff --git a/gen/youtubereporting1/src/lib.rs b/gen/youtubereporting1/src/lib.rs index 3ebc39429c..eb427eff12 100644 --- a/gen/youtubereporting1/src/lib.rs +++ b/gen/youtubereporting1/src/lib.rs @@ -189,7 +189,7 @@ // Unused attributes happen thanks to defined, but unused structures // We don't warn about this, as depending on the API, some data structures or facilities are never used. -// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut, dead_code)] @@ -217,6 +217,7 @@ use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; +use std::mem; use std::thread::sleep; use std::time::Duration; @@ -324,6 +325,8 @@ pub struct YouTubeReporting { client: RefCell, auth: RefCell, _user_agent: String, + _base_url: String, + _root_url: String, } impl<'a, C, A> Hub for YouTubeReporting {} @@ -336,6 +339,8 @@ impl<'a, C, A> YouTubeReporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), + _base_url: "https://youtubereporting.googleapis.com/".to_string(), + _root_url: "https://youtubereporting.googleapis.com/".to_string(), } } @@ -354,9 +359,23 @@ impl<'a, C, A> YouTubeReporting /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { - let prev = self._user_agent.clone(); - self._user_agent = agent_name; - prev + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://youtubereporting.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://youtubereporting.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) } } @@ -967,7 +986,7 @@ impl<'a, C, A> MediaDownloadCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = "https://youtubereporting.googleapis.com/v1/media/{+resourceName}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/media/{+resourceName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1230,7 +1249,7 @@ impl<'a, C, A> ReportTypeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/reportTypes".to_string(); + let mut url = self.hub._base_url.clone() + "v1/reportTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1480,7 +1499,7 @@ impl<'a, C, A> JobDeleteCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1736,7 +1755,7 @@ impl<'a, C, A> JobReportGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}/reports/{reportId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}/reports/{reportId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2000,7 +2019,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}".to_string(); + let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2280,7 +2299,7 @@ impl<'a, C, A> JobReportListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}/reports".to_string(); + let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}/reports"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2588,7 +2607,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "v1/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2843,7 +2862,7 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://youtubereporting.googleapis.com/v1/jobs".to_string(); + let mut url = self.hub._base_url.clone() + "v1/jobs"; if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -3015,4 +3034,3 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau } -