From a942c7c8e17eb829ef1581c0b556665784f19e33 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 7 Nov 2019 03:57:33 -0500 Subject: update openapi spec and regenerate with newer openapi-generator the newer openapi-generator picks up fixes for optional parameters, among other things --- src/apis/accounts_api.rs | 12 ++++-- src/apis/budgets_api.rs | 12 ++++-- src/apis/categories_api.rs | 12 ++++-- src/apis/client.rs | 40 ++++++++++---------- src/apis/deprecated_api.rs | 4 +- src/apis/months_api.rs | 12 ++++-- src/apis/payee_locations_api.rs | 4 +- src/apis/payees_api.rs | 12 ++++-- src/apis/scheduled_transactions_api.rs | 12 ++++-- src/apis/transactions_api.rs | 68 +++++++++++++++++++++++----------- src/apis/user_api.rs | 4 +- 11 files changed, 124 insertions(+), 68 deletions(-) (limited to 'src/apis') diff --git a/src/apis/accounts_api.rs b/src/apis/accounts_api.rs index b536e89..b0c0bf9 100644 --- a/src/apis/accounts_api.rs +++ b/src/apis/accounts_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,14 +24,14 @@ pub struct AccountsApiClient { impl AccountsApiClient { pub fn new(configuration: Rc) -> AccountsApiClient { AccountsApiClient { - configuration: configuration, + configuration, } } } pub trait AccountsApi { fn get_account_by_id(&self, budget_id: &str, account_id: &str) -> Result; - fn get_accounts(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result; + fn get_accounts(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result; } impl AccountsApi for AccountsApiClient { @@ -58,14 +60,16 @@ impl AccountsApi for AccountsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_accounts(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result { + fn get_accounts(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/accounts", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/budgets_api.rs b/src/apis/budgets_api.rs index e1002ed..9ddfd9d 100644 --- a/src/apis/budgets_api.rs +++ b/src/apis/budgets_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,26 +24,28 @@ pub struct BudgetsApiClient { impl BudgetsApiClient { pub fn new(configuration: Rc) -> BudgetsApiClient { BudgetsApiClient { - configuration: configuration, + configuration, } } } pub trait BudgetsApi { - fn get_budget_by_id(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result; + fn get_budget_by_id(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result; fn get_budget_settings_by_id(&self, budget_id: &str) -> Result; fn get_budgets(&self, ) -> Result; } impl BudgetsApi for BudgetsApiClient { - fn get_budget_by_id(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result { + fn get_budget_by_id(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/categories_api.rs b/src/apis/categories_api.rs index f57d38b..b6624b9 100644 --- a/src/apis/categories_api.rs +++ b/src/apis/categories_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,27 +24,29 @@ pub struct CategoriesApiClient { impl CategoriesApiClient { pub fn new(configuration: Rc) -> CategoriesApiClient { CategoriesApiClient { - configuration: configuration, + configuration, } } } pub trait CategoriesApi { - fn get_categories(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result; + fn get_categories(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result; fn get_category_by_id(&self, budget_id: &str, category_id: &str) -> Result; fn get_month_category_by_id(&self, budget_id: &str, month: String, category_id: &str) -> Result; fn update_month_category(&self, budget_id: &str, month: String, category_id: &str, data: crate::models::SaveMonthCategoryWrapper) -> Result; } impl CategoriesApi for CategoriesApiClient { - fn get_categories(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result { + fn get_categories(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/categories", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/client.rs b/src/apis/client.rs index 387df63..d7558a7 100644 --- a/src/apis/client.rs +++ b/src/apis/client.rs @@ -3,16 +3,16 @@ use std::rc::Rc; use super::configuration::Configuration; pub struct APIClient { - accounts_api: Box, - budgets_api: Box, - categories_api: Box, - deprecated_api: Box, - months_api: Box, - payee_locations_api: Box, - payees_api: Box, - scheduled_transactions_api: Box, - transactions_api: Box, - user_api: Box, + accounts_api: Box, + budgets_api: Box, + categories_api: Box, + deprecated_api: Box, + months_api: Box, + payee_locations_api: Box, + payees_api: Box, + scheduled_transactions_api: Box, + transactions_api: Box, + user_api: Box, } impl APIClient { @@ -33,43 +33,43 @@ impl APIClient { } } - pub fn accounts_api(&self) -> &crate::apis::AccountsApi{ + pub fn accounts_api(&self) -> &dyn crate::apis::AccountsApi{ self.accounts_api.as_ref() } - pub fn budgets_api(&self) -> &crate::apis::BudgetsApi{ + pub fn budgets_api(&self) -> &dyn crate::apis::BudgetsApi{ self.budgets_api.as_ref() } - pub fn categories_api(&self) -> &crate::apis::CategoriesApi{ + pub fn categories_api(&self) -> &dyn crate::apis::CategoriesApi{ self.categories_api.as_ref() } - pub fn deprecated_api(&self) -> &crate::apis::DeprecatedApi{ + pub fn deprecated_api(&self) -> &dyn crate::apis::DeprecatedApi{ self.deprecated_api.as_ref() } - pub fn months_api(&self) -> &crate::apis::MonthsApi{ + pub fn months_api(&self) -> &dyn crate::apis::MonthsApi{ self.months_api.as_ref() } - pub fn payee_locations_api(&self) -> &crate::apis::PayeeLocationsApi{ + pub fn payee_locations_api(&self) -> &dyn crate::apis::PayeeLocationsApi{ self.payee_locations_api.as_ref() } - pub fn payees_api(&self) -> &crate::apis::PayeesApi{ + pub fn payees_api(&self) -> &dyn crate::apis::PayeesApi{ self.payees_api.as_ref() } - pub fn scheduled_transactions_api(&self) -> &crate::apis::ScheduledTransactionsApi{ + pub fn scheduled_transactions_api(&self) -> &dyn crate::apis::ScheduledTransactionsApi{ self.scheduled_transactions_api.as_ref() } - pub fn transactions_api(&self) -> &crate::apis::TransactionsApi{ + pub fn transactions_api(&self) -> &dyn crate::apis::TransactionsApi{ self.transactions_api.as_ref() } - pub fn user_api(&self) -> &crate::apis::UserApi{ + pub fn user_api(&self) -> &dyn crate::apis::UserApi{ self.user_api.as_ref() } diff --git a/src/apis/deprecated_api.rs b/src/apis/deprecated_api.rs index aab34ff..0d4fe6b 100644 --- a/src/apis/deprecated_api.rs +++ b/src/apis/deprecated_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,7 +24,7 @@ pub struct DeprecatedApiClient { impl DeprecatedApiClient { pub fn new(configuration: Rc) -> DeprecatedApiClient { DeprecatedApiClient { - configuration: configuration, + configuration, } } } diff --git a/src/apis/months_api.rs b/src/apis/months_api.rs index 48d586b..03c6a29 100644 --- a/src/apis/months_api.rs +++ b/src/apis/months_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,14 +24,14 @@ pub struct MonthsApiClient { impl MonthsApiClient { pub fn new(configuration: Rc) -> MonthsApiClient { MonthsApiClient { - configuration: configuration, + configuration, } } } pub trait MonthsApi { fn get_budget_month(&self, budget_id: &str, month: String) -> Result; - fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result; + fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result; } impl MonthsApi for MonthsApiClient { @@ -58,14 +60,16 @@ impl MonthsApi for MonthsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result { + fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/months", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/payee_locations_api.rs b/src/apis/payee_locations_api.rs index 823dea4..1a1e35d 100644 --- a/src/apis/payee_locations_api.rs +++ b/src/apis/payee_locations_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,7 +24,7 @@ pub struct PayeeLocationsApiClient { impl PayeeLocationsApiClient { pub fn new(configuration: Rc) -> PayeeLocationsApiClient { PayeeLocationsApiClient { - configuration: configuration, + configuration, } } } diff --git a/src/apis/payees_api.rs b/src/apis/payees_api.rs index 890920c..71f4125 100644 --- a/src/apis/payees_api.rs +++ b/src/apis/payees_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,14 +24,14 @@ pub struct PayeesApiClient { impl PayeesApiClient { pub fn new(configuration: Rc) -> PayeesApiClient { PayeesApiClient { - configuration: configuration, + configuration, } } } pub trait PayeesApi { fn get_payee_by_id(&self, budget_id: &str, payee_id: &str) -> Result; - fn get_payees(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result; + fn get_payees(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result; } impl PayeesApi for PayeesApiClient { @@ -58,14 +60,16 @@ impl PayeesApi for PayeesApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_payees(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result { + fn get_payees(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/payees", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/scheduled_transactions_api.rs b/src/apis/scheduled_transactions_api.rs index fe8c959..f44d782 100644 --- a/src/apis/scheduled_transactions_api.rs +++ b/src/apis/scheduled_transactions_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,14 +24,14 @@ pub struct ScheduledTransactionsApiClient { impl ScheduledTransactionsApiClient { pub fn new(configuration: Rc) -> ScheduledTransactionsApiClient { ScheduledTransactionsApiClient { - configuration: configuration, + configuration, } } } pub trait ScheduledTransactionsApi { fn get_scheduled_transaction_by_id(&self, budget_id: &str, scheduled_transaction_id: &str) -> Result; - fn get_scheduled_transactions(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result; + fn get_scheduled_transactions(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result; } impl ScheduledTransactionsApi for ScheduledTransactionsApiClient { @@ -58,14 +60,16 @@ impl ScheduledTransactionsApi for ScheduledTransactionsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_scheduled_transactions(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result { + fn get_scheduled_transactions(&self, budget_id: &str, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/scheduled_transactions", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/transactions_api.rs b/src/apis/transactions_api.rs index 9b3fcb4..138fa4d 100644 --- a/src/apis/transactions_api.rs +++ b/src/apis/transactions_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,7 +24,7 @@ pub struct TransactionsApiClient { impl TransactionsApiClient { pub fn new(configuration: Rc) -> TransactionsApiClient { TransactionsApiClient { - configuration: configuration, + configuration, } } } @@ -30,10 +32,10 @@ impl TransactionsApiClient { pub trait TransactionsApi { fn create_transaction(&self, budget_id: &str, data: crate::models::SaveTransactionsWrapper) -> Result; fn get_transaction_by_id(&self, budget_id: &str, transaction_id: &str) -> Result; - fn get_transactions(&self, budget_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result; - fn get_transactions_by_account(&self, budget_id: &str, account_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result; - fn get_transactions_by_category(&self, budget_id: &str, category_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result; - fn get_transactions_by_payee(&self, budget_id: &str, payee_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result; + fn get_transactions(&self, budget_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result; + fn get_transactions_by_account(&self, budget_id: &str, account_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result; + fn get_transactions_by_category(&self, budget_id: &str, category_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result; + fn get_transactions_by_payee(&self, budget_id: &str, payee_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result; fn update_transaction(&self, budget_id: &str, transaction_id: &str, data: crate::models::SaveTransactionWrapper) -> Result; fn update_transactions(&self, budget_id: &str, data: crate::models::UpdateTransactionsWrapper) -> Result; } @@ -90,16 +92,22 @@ impl TransactionsApi for TransactionsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_transactions(&self, budget_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result { + fn get_transactions(&self, budget_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/transactions", configuration.base_path, budget_id=crate::apis::urlencode(budget_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("since_date", &since_date.to_string())]); - req_builder = req_builder.query(&[("type", &_type.to_string())]); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = since_date { + req_builder = req_builder.query(&[("since_date", &s.to_string())]); + } + if let Some(ref s) = _type { + req_builder = req_builder.query(&[("type", &s.to_string())]); + } + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -118,16 +126,22 @@ impl TransactionsApi for TransactionsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_transactions_by_account(&self, budget_id: &str, account_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result { + fn get_transactions_by_account(&self, budget_id: &str, account_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/accounts/{account_id}/transactions", configuration.base_path, budget_id=crate::apis::urlencode(budget_id), account_id=crate::apis::urlencode(account_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("since_date", &since_date.to_string())]); - req_builder = req_builder.query(&[("type", &_type.to_string())]); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = since_date { + req_builder = req_builder.query(&[("since_date", &s.to_string())]); + } + if let Some(ref s) = _type { + req_builder = req_builder.query(&[("type", &s.to_string())]); + } + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -146,16 +160,22 @@ impl TransactionsApi for TransactionsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_transactions_by_category(&self, budget_id: &str, category_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result { + fn get_transactions_by_category(&self, budget_id: &str, category_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/categories/{category_id}/transactions", configuration.base_path, budget_id=crate::apis::urlencode(budget_id), category_id=crate::apis::urlencode(category_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("since_date", &since_date.to_string())]); - req_builder = req_builder.query(&[("type", &_type.to_string())]); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = since_date { + req_builder = req_builder.query(&[("since_date", &s.to_string())]); + } + if let Some(ref s) = _type { + req_builder = req_builder.query(&[("type", &s.to_string())]); + } + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -174,16 +194,22 @@ impl TransactionsApi for TransactionsApiClient { Ok(client.execute(req)?.error_for_status()?.json()?) } - fn get_transactions_by_payee(&self, budget_id: &str, payee_id: &str, since_date: String, _type: &str, last_knowledge_of_server: i64) -> Result { + fn get_transactions_by_payee(&self, budget_id: &str, payee_id: &str, since_date: Option, _type: Option<&str>, last_knowledge_of_server: Option) -> Result { let configuration: &configuration::Configuration = self.configuration.borrow(); let client = &configuration.client; let uri_str = format!("{}/budgets/{budget_id}/payees/{payee_id}/transactions", configuration.base_path, budget_id=crate::apis::urlencode(budget_id), payee_id=crate::apis::urlencode(payee_id)); let mut req_builder = client.get(uri_str.as_str()); - req_builder = req_builder.query(&[("since_date", &since_date.to_string())]); - req_builder = req_builder.query(&[("type", &_type.to_string())]); - req_builder = req_builder.query(&[("last_knowledge_of_server", &last_knowledge_of_server.to_string())]); + if let Some(ref s) = since_date { + req_builder = req_builder.query(&[("since_date", &s.to_string())]); + } + if let Some(ref s) = _type { + req_builder = req_builder.query(&[("type", &s.to_string())]); + } + if let Some(ref s) = last_knowledge_of_server { + req_builder = req_builder.query(&[("last_knowledge_of_server", &s.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/src/apis/user_api.rs b/src/apis/user_api.rs index 870ecc4..652fb55 100644 --- a/src/apis/user_api.rs +++ b/src/apis/user_api.rs @@ -10,6 +10,8 @@ use std::rc::Rc; use std::borrow::Borrow; +#[allow(unused_imports)] +use std::option::Option; use reqwest; @@ -22,7 +24,7 @@ pub struct UserApiClient { impl UserApiClient { pub fn new(configuration: Rc) -> UserApiClient { UserApiClient { - configuration: configuration, + configuration, } } } -- cgit v1.2.3-54-g00ecf