1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
use std::rc::Rc;
use std::borrow::Borrow;
use reqwest;
use super::{Error, configuration};
pub struct PayeeLocationsApiClient {
configuration: Rc<configuration::Configuration>,
}
impl PayeeLocationsApiClient {
pub fn new(configuration: Rc<configuration::Configuration>) -> PayeeLocationsApiClient {
PayeeLocationsApiClient {
configuration: configuration,
}
}
}
pub trait PayeeLocationsApi {
fn get_payee_location_by_id(&self, budget_id: &str, payee_location_id: &str) -> Result<crate::models::PayeeLocationResponse, Error>;
fn get_payee_locations(&self, budget_id: &str) -> Result<crate::models::PayeeLocationsResponse, Error>;
fn get_payee_locations_by_payee(&self, budget_id: &str, payee_id: &str) -> Result<crate::models::PayeeLocationsResponse, Error>;
}
impl PayeeLocationsApi for PayeeLocationsApiClient {
fn get_payee_location_by_id(&self, budget_id: &str, payee_location_id: &str) -> Result<crate::models::PayeeLocationResponse, Error> {
let configuration: &configuration::Configuration = self.configuration.borrow();
let client = &configuration.client;
let uri_str = format!("{}/budgets/{budget_id}/payee_locations/{payee_location_id}", configuration.base_path, budget_id=crate::apis::urlencode(budget_id), payee_location_id=crate::apis::urlencode(payee_location_id));
let mut req_builder = client.get(uri_str.as_str());
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let val = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", val);
};
let req = req_builder.build()?;
Ok(client.execute(req)?.error_for_status()?.json()?)
}
fn get_payee_locations(&self, budget_id: &str) -> Result<crate::models::PayeeLocationsResponse, Error> {
let configuration: &configuration::Configuration = self.configuration.borrow();
let client = &configuration.client;
let uri_str = format!("{}/budgets/{budget_id}/payee_locations", configuration.base_path, budget_id=crate::apis::urlencode(budget_id));
let mut req_builder = client.get(uri_str.as_str());
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let val = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", val);
};
let req = req_builder.build()?;
Ok(client.execute(req)?.error_for_status()?.json()?)
}
fn get_payee_locations_by_payee(&self, budget_id: &str, payee_id: &str) -> Result<crate::models::PayeeLocationsResponse, Error> {
let configuration: &configuration::Configuration = self.configuration.borrow();
let client = &configuration.client;
let uri_str = format!("{}/budgets/{budget_id}/payees/{payee_id}/payee_locations", 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());
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let val = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", val);
};
let req = req_builder.build()?;
Ok(client.execute(req)?.error_for_status()?.json()?)
}
}