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/months_api.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/apis/months_api.rs') 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()); } -- cgit v1.2.3-54-g00ecf