From aa52e632b866b51d455787a96bcd2f5a63b7ac89 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 19 Aug 2019 00:19:38 -0400 Subject: move ynab-api to its own repository --- src/apis/configuration.rs | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/apis/configuration.rs (limited to 'src/apis/configuration.rs') diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs new file mode 100644 index 0000000..4378dfa --- /dev/null +++ b/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, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + 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, + } + } +} -- cgit v1.2.3-54-g00ecf