aboutsummaryrefslogtreecommitdiffstats
path: root/src/apis/months_api.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-07 03:57:33 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-07 03:57:33 -0500
commita942c7c8e17eb829ef1581c0b556665784f19e33 (patch)
treeff391dc8d22860009bd06f77042cb74d6eb6c1f2 /src/apis/months_api.rs
parent4c94e5f9101c14bfc5c6989d11ea6c855c809f0b (diff)
downloadynab-api-a942c7c8e17eb829ef1581c0b556665784f19e33.tar.gz
ynab-api-a942c7c8e17eb829ef1581c0b556665784f19e33.zip
update openapi spec and regenerate with newer openapi-generator
the newer openapi-generator picks up fixes for optional parameters, among other things
Diffstat (limited to 'src/apis/months_api.rs')
-rw-r--r--src/apis/months_api.rs12
1 files changed, 8 insertions, 4 deletions
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<configuration::Configuration>) -> MonthsApiClient {
MonthsApiClient {
- configuration: configuration,
+ configuration,
}
}
}
pub trait MonthsApi {
fn get_budget_month(&self, budget_id: &str, month: String) -> Result<crate::models::MonthDetailResponse, Error>;
- fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: i64) -> Result<crate::models::MonthSummariesResponse, Error>;
+ fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: Option<i64>) -> Result<crate::models::MonthSummariesResponse, Error>;
}
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<crate::models::MonthSummariesResponse, Error> {
+ fn get_budget_months(&self, budget_id: &str, last_knowledge_of_server: Option<i64>) -> Result<crate::models::MonthSummariesResponse, Error> {
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());
}