aboutsummaryrefslogtreecommitdiffstats
path: root/ynab-api/src/apis/configuration.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-08-09 02:06:22 -0400
committerJesse Luehrs <doy@tozt.net>2019-08-09 02:52:44 -0400
commitfaf9c8aa1e41df1889f8382e9c2183e2d5f85de1 (patch)
tree0e4218dd5c1d47735fd6324fb30a01c964aad781 /ynab-api/src/apis/configuration.rs
parentd54b8f01ea9c253a326a9601f58a423a64ba8b4a (diff)
downloadynab-reimbursements-faf9c8aa1e41df1889f8382e9c2183e2d5f85de1.tar.gz
ynab-reimbursements-faf9c8aa1e41df1889f8382e9c2183e2d5f85de1.zip
add openapi-generated api client
Diffstat (limited to 'ynab-api/src/apis/configuration.rs')
-rw-r--r--ynab-api/src/apis/configuration.rs50
1 files changed, 50 insertions, 0 deletions
diff --git a/ynab-api/src/apis/configuration.rs b/ynab-api/src/apis/configuration.rs
new file mode 100644
index 0000000..4378dfa
--- /dev/null
+++ b/ynab-api/src/apis/configuration.rs
@@ -0,0 +1,50 @@
+/*
+ * YNAB API Endpoints
+ *
+ * Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+
+use reqwest;
+
+pub struct Configuration {
+ pub base_path: String,
+ pub user_agent: Option<String>,
+ pub client: reqwest::Client,
+ pub basic_auth: Option<BasicAuth>,
+ pub oauth_access_token: Option<String>,
+ pub bearer_access_token: Option<String>,
+ pub api_key: Option<ApiKey>,
+ // TODO: take an oauth2 token source, similar to the go one
+}
+
+pub type BasicAuth = (String, Option<String>);
+
+pub struct ApiKey {
+ pub prefix: Option<String>,
+ pub key: String,
+}
+
+impl Configuration {
+ pub fn new() -> Configuration {
+ Configuration::default()
+ }
+}
+
+impl Default for Configuration {
+ fn default() -> Self {
+ Configuration {
+ base_path: "https://api.youneedabudget.com/v1".to_owned(),
+ user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
+ client: reqwest::Client::new(),
+ basic_auth: None,
+ oauth_access_token: None,
+ bearer_access_token: None,
+ api_key: None,
+ }
+ }
+}