Initial commit

This is definitely not functional yet.

Signed-off-by: Jacob Kiers <code@kiers.eu>
This commit is contained in:
2024-10-04 20:27:23 +02:00
commit f0b8df90b9
582 changed files with 43994 additions and 0 deletions

View File

@@ -0,0 +1,204 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`retrieve_account_balances`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAccountBalancesError {
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
Status400(models::ErrorResponse),
Status500(models::ErrorResponse),
Status409(models::ErrorResponse),
Status503(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_account_details`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAccountDetailsError {
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
Status400(models::ErrorResponse),
Status500(models::ErrorResponse),
Status409(models::ErrorResponse),
Status503(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_account_metadata`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAccountMetadataError {
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_account_transactions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAccountTransactionsError {
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
Status400(models::ErrorResponse),
Status500(models::ErrorResponse),
Status409(models::ErrorResponse),
Status503(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// Access account balances. Balances will be returned in Berlin Group PSD2 format.
pub async fn retrieve_account_balances(configuration: &configuration::Configuration, id: &str) -> Result<models::AccountBalance, Error<RetrieveAccountBalancesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/accounts/{id}/balances/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAccountBalancesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Access account details. Account details will be returned in Berlin Group PSD2 format.
pub async fn retrieve_account_details(configuration: &configuration::Configuration, id: &str) -> Result<models::AccountDetail, Error<RetrieveAccountDetailsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/accounts/{id}/details/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAccountDetailsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Access account metadata. Information about the account record, such as the processing status and IBAN. Account status is recalculated based on the error count in the latest req.
pub async fn retrieve_account_metadata(configuration: &configuration::Configuration, id: &str) -> Result<models::Account, Error<RetrieveAccountMetadataError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/accounts/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAccountMetadataError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Access account transactions. Transactions will be returned in Berlin Group PSD2 format.
pub async fn retrieve_account_transactions(configuration: &configuration::Configuration, id: &str, date_from: Option<String>, date_to: Option<String>) -> Result<models::BankTransaction, Error<RetrieveAccountTransactionsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/accounts/{id}/transactions/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = date_from {
local_var_req_builder = local_var_req_builder.query(&[("date_from", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = date_to {
local_var_req_builder = local_var_req_builder.query(&[("date_to", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAccountTransactionsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}

View File

@@ -0,0 +1,241 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`accept_eua`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AcceptEuaError {
Status405(models::ErrorResponse),
Status403(models::ErrorResponse),
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_eua`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateEuaError {
Status400(models::ErrorResponse),
Status429(models::ErrorResponse),
Status402(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_eua_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteEuaByIdError {
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_all_euas_for_an_end_user`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAllEuasForAnEndUserError {
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_eua_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveEuaByIdError {
Status404(models::ErrorResponse),
Status400(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// Accept an end-user agreement via the API
pub async fn accept_eua(configuration: &configuration::Configuration, id: &str, enduser_acceptance_details_request: models::EnduserAcceptanceDetailsRequest) -> Result<models::EndUserAgreement, Error<AcceptEuaError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/agreements/enduser/{id}/accept/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&enduser_acceptance_details_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<AcceptEuaError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// API endpoints related to end-user agreements.
pub async fn create_eua(configuration: &configuration::Configuration, end_user_agreement_request: models::EndUserAgreementRequest) -> Result<models::EndUserAgreement, Error<CreateEuaError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/agreements/enduser/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&end_user_agreement_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<CreateEuaError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Delete an end user agreement
pub async fn delete_eua_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteEuaByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/agreements/enduser/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DeleteEuaByIdError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// API endpoints related to end-user agreements.
pub async fn retrieve_all_euas_for_an_end_user(configuration: &configuration::Configuration, limit: Option<i32>, offset: Option<i32>) -> Result<models::PaginatedEndUserAgreementList, Error<RetrieveAllEuasForAnEndUserError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/agreements/enduser/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = limit {
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = offset {
local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAllEuasForAnEndUserError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Retrieve end user agreement by ID
pub async fn retrieve_eua_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::EndUserAgreement, Error<RetrieveEuaByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/agreements/enduser/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveEuaByIdError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}

View File

@@ -0,0 +1,53 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Debug, Clone)]
pub struct Configuration {
pub base_path: String,
pub user_agent: Option<String>,
pub client: reqwest_middleware::ClientWithMiddleware,
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>);
#[derive(Debug, Clone)]
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://bankaccountdata.gocardless.com".to_owned(),
user_agent: Some("OpenAPI-Generator/2.0 (v2)/rust".to_owned()),
client: reqwest_middleware::ClientBuilder::new(reqwest::Client::new()).build(),
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: None,
}
}
}

View File

@@ -0,0 +1,142 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`retrieve_all_supported_institutions_in_a_given_country`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAllSupportedInstitutionsInAGivenCountryError {
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_institution`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveInstitutionError {
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// List all available institutions
pub async fn retrieve_all_supported_institutions_in_a_given_country(configuration: &configuration::Configuration, access_scopes_supported: Option<&str>, account_selection_supported: Option<&str>, business_accounts_supported: Option<&str>, card_accounts_supported: Option<&str>, corporate_accounts_supported: Option<&str>, country: Option<&str>, payment_submission_supported: Option<&str>, payments_enabled: Option<&str>, pending_transactions_supported: Option<&str>, private_accounts_supported: Option<&str>, read_debtor_account_supported: Option<&str>, read_refund_account_supported: Option<&str>, ssn_verification_supported: Option<&str>) -> Result<Vec<models::Integration>, Error<RetrieveAllSupportedInstitutionsInAGivenCountryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/institutions/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = access_scopes_supported {
local_var_req_builder = local_var_req_builder.query(&[("access_scopes_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = account_selection_supported {
local_var_req_builder = local_var_req_builder.query(&[("account_selection_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = business_accounts_supported {
local_var_req_builder = local_var_req_builder.query(&[("business_accounts_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = card_accounts_supported {
local_var_req_builder = local_var_req_builder.query(&[("card_accounts_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = corporate_accounts_supported {
local_var_req_builder = local_var_req_builder.query(&[("corporate_accounts_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = country {
local_var_req_builder = local_var_req_builder.query(&[("country", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = payment_submission_supported {
local_var_req_builder = local_var_req_builder.query(&[("payment_submission_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = payments_enabled {
local_var_req_builder = local_var_req_builder.query(&[("payments_enabled", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pending_transactions_supported {
local_var_req_builder = local_var_req_builder.query(&[("pending_transactions_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = private_accounts_supported {
local_var_req_builder = local_var_req_builder.query(&[("private_accounts_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = read_debtor_account_supported {
local_var_req_builder = local_var_req_builder.query(&[("read_debtor_account_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = read_refund_account_supported {
local_var_req_builder = local_var_req_builder.query(&[("read_refund_account_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = ssn_verification_supported {
local_var_req_builder = local_var_req_builder.query(&[("ssn_verification_supported", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAllSupportedInstitutionsInAGivenCountryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Get details about a specific Institution and its supported features
pub async fn retrieve_institution(configuration: &configuration::Configuration, id: &str) -> Result<models::IntegrationRetrieve, Error<RetrieveInstitutionError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/institutions/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveInstitutionError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}

View File

@@ -0,0 +1,108 @@
use std::error;
use std::fmt;
#[derive(Debug, Clone)]
pub struct ResponseContent<T> {
pub status: reqwest::StatusCode,
pub content: String,
pub entity: Option<T>,
}
#[derive(Debug)]
pub enum Error<T> {
Reqwest(reqwest::Error),
ReqwestMiddleware(reqwest_middleware::Error),
Serde(serde_json::Error),
Io(std::io::Error),
ResponseError(ResponseContent<T>),
}
impl <T> fmt::Display for Error<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let (module, e) = match self {
Error::Reqwest(e) => ("reqwest", e.to_string()),
Error::ReqwestMiddleware(e) => ("reqwest-middleware", e.to_string()),
Error::Serde(e) => ("serde", e.to_string()),
Error::Io(e) => ("IO", e.to_string()),
Error::ResponseError(e) => ("response", format!("status code {}", e.status)),
};
write!(f, "error in {}: {}", module, e)
}
}
impl <T: fmt::Debug> error::Error for Error<T> {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
Some(match self {
Error::Reqwest(e) => e,
Error::ReqwestMiddleware(e) => e,
Error::Serde(e) => e,
Error::Io(e) => e,
Error::ResponseError(_) => return None,
})
}
}
impl <T> From<reqwest::Error> for Error<T> {
fn from(e: reqwest::Error) -> Self {
Error::Reqwest(e)
}
}
impl<T> From<reqwest_middleware::Error> for Error<T> {
fn from(e: reqwest_middleware::Error) -> Self {
Error::ReqwestMiddleware(e)
}
}
impl <T> From<serde_json::Error> for Error<T> {
fn from(e: serde_json::Error) -> Self {
Error::Serde(e)
}
}
impl <T> From<std::io::Error> for Error<T> {
fn from(e: std::io::Error) -> Self {
Error::Io(e)
}
}
pub fn urlencode<T: AsRef<str>>(s: T) -> String {
::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect()
}
pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> {
if let serde_json::Value::Object(object) = value {
let mut params = vec![];
for (key, value) in object {
match value {
serde_json::Value::Object(_) => params.append(&mut parse_deep_object(
&format!("{}[{}]", prefix, key),
value,
)),
serde_json::Value::Array(array) => {
for (i, value) in array.iter().enumerate() {
params.append(&mut parse_deep_object(
&format!("{}[{}][{}]", prefix, key, i),
value,
));
}
},
serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())),
_ => params.push((format!("{}[{}]", prefix, key), value.to_string())),
}
}
return params;
}
unimplemented!("Only objects are supported with style=deepObject")
}
pub mod accounts_api;
pub mod agreements_api;
pub mod institutions_api;
pub mod requisitions_api;
pub mod token_api;
pub mod configuration;

View File

@@ -0,0 +1,198 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`create_requisition`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateRequisitionError {
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status402(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_requisition_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteRequisitionByIdError {
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`requisition_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RequisitionByIdError {
Status404(models::ErrorResponse),
Status400(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retrieve_all_requisitions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveAllRequisitionsError {
Status404(models::ErrorResponse),
Status400(models::ErrorResponse),
Status429(models::ErrorResponse),
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// Create a new requisition
pub async fn create_requisition(configuration: &configuration::Configuration, requisition_request: models::RequisitionRequest) -> Result<models::SpectacularRequisition, Error<CreateRequisitionError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/requisitions/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&requisition_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<CreateRequisitionError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Delete requisition and its end user agreement
pub async fn delete_requisition_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteRequisitionByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/requisitions/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DeleteRequisitionByIdError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Retrieve a requisition by ID
pub async fn requisition_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::Requisition, Error<RequisitionByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/requisitions/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RequisitionByIdError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Retrieve all requisitions belonging to the company
pub async fn retrieve_all_requisitions(configuration: &configuration::Configuration, limit: Option<i32>, offset: Option<i32>) -> Result<models::PaginatedRequisitionList, Error<RetrieveAllRequisitionsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/requisitions/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = limit {
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = offset {
local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<RetrieveAllRequisitionsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}

View File

@@ -0,0 +1,102 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`get_a_new_access_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetANewAccessTokenError {
Status403(models::ErrorResponse),
Status401(models::ErrorResponse),
Status429(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`obtain_new_access_slash_refresh_token_pair`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ObtainNewAccessSlashRefreshTokenPairError {
Status401(models::ErrorResponse),
Status403(models::ErrorResponse),
Status429(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
/// Refresh access token
pub async fn get_a_new_access_token(configuration: &configuration::Configuration, jwt_refresh_request: models::JwtRefreshRequest) -> Result<models::SpectacularJwtRefresh, Error<GetANewAccessTokenError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/token/refresh/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&jwt_refresh_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<GetANewAccessTokenError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Obtain JWT pair
pub async fn obtain_new_access_slash_refresh_token_pair(configuration: &configuration::Configuration, jwt_obtain_pair_request: models::JwtObtainPairRequest) -> Result<models::SpectacularJwtObtain, Error<ObtainNewAccessSlashRefreshTokenPairError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/api/v2/token/new/", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&jwt_obtain_pair_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ObtainNewAccessSlashRefreshTokenPairError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}

View File

@@ -0,0 +1,11 @@
#![allow(unused_imports)]
#![allow(clippy::too_many_arguments)]
extern crate serde_repr;
extern crate serde;
extern crate serde_json;
extern crate url;
extern crate reqwest;
pub mod apis;
pub mod models;

View File

@@ -0,0 +1,54 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Account : AccountSerializer.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Account {
/// The ID of this Account, used to refer to this account in other API calls.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
/// The date & time at which the account object was created.
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
/// The date & time at which the account object was last accessed.
#[serde(rename = "last_accessed", skip_serializing_if = "Option::is_none")]
pub last_accessed: Option<String>,
/// The Account IBAN
#[serde(rename = "iban", skip_serializing_if = "Option::is_none")]
pub iban: Option<String>,
/// The processing status of this account.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// The ASPSP associated with this account.
#[serde(rename = "institution_id", skip_serializing_if = "Option::is_none")]
pub institution_id: Option<String>,
/// The name of the account owner.
#[serde(rename = "owner_name", skip_serializing_if = "Option::is_none")]
pub owner_name: Option<String>,
}
impl Account {
/// AccountSerializer.
pub fn new() -> Account {
Account {
id: None,
created: None,
last_accessed: None,
iban: None,
status: None,
institution_id: None,
owner_name: None,
}
}
}

View File

@@ -0,0 +1,29 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AccountBalance : AccountBalanceSerializer.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountBalance {
#[serde(rename = "balances", skip_serializing_if = "Option::is_none")]
pub balances: Option<Vec<models::BalanceSchema>>,
}
impl AccountBalance {
/// AccountBalanceSerializer.
pub fn new() -> AccountBalance {
AccountBalance {
balances: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AccountDetail : AccountDetailSerializer.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountDetail {
/// account
#[serde(rename = "account")]
pub account: models::DetailSchema,
}
impl AccountDetail {
/// AccountDetailSerializer.
pub fn new(account: models::DetailSchema) -> AccountDetail {
AccountDetail {
account,
}
}
}

View File

@@ -0,0 +1,50 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AccountSchema : AccountSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountSchema {
/// iban
#[serde(rename = "iban", skip_serializing_if = "Option::is_none")]
pub iban: Option<String>,
/// bban
#[serde(rename = "bban", skip_serializing_if = "Option::is_none")]
pub bban: Option<String>,
/// pan
#[serde(rename = "pan", skip_serializing_if = "Option::is_none")]
pub pan: Option<String>,
/// maskedPan
#[serde(rename = "maskedPan", skip_serializing_if = "Option::is_none")]
pub masked_pan: Option<String>,
/// msisdn
#[serde(rename = "msisdn", skip_serializing_if = "Option::is_none")]
pub msisdn: Option<String>,
/// currency
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
}
impl AccountSchema {
/// AccountSchema.
pub fn new() -> AccountSchema {
AccountSchema {
iban: None,
bban: None,
pan: None,
masked_pan: None,
msisdn: None,
currency: None,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BalanceAmountSchema : BalanceAmountSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BalanceAmountSchema {
/// amount
#[serde(rename = "amount")]
pub amount: String,
/// currency
#[serde(rename = "currency")]
pub currency: String,
}
impl BalanceAmountSchema {
/// BalanceAmountSchema.
pub fn new(amount: String, currency: String) -> BalanceAmountSchema {
BalanceAmountSchema {
amount,
currency,
}
}
}

View File

@@ -0,0 +1,50 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BalanceSchema : BalanceSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BalanceSchema {
/// balanceAmount
#[serde(rename = "balanceAmount")]
pub balance_amount: models::BalanceAmountSchema,
/// balanceType
#[serde(rename = "balanceType")]
pub balance_type: String,
/// creditLimitIncluded
#[serde(rename = "creditLimitIncluded", skip_serializing_if = "Option::is_none")]
pub credit_limit_included: Option<bool>,
/// lastChangeDateTime
#[serde(rename = "lastChangeDateTime", skip_serializing_if = "Option::is_none")]
pub last_change_date_time: Option<String>,
/// referenceDate
#[serde(rename = "referenceDate", skip_serializing_if = "Option::is_none")]
pub reference_date: Option<String>,
/// lastCommittedTransaction
#[serde(rename = "lastCommittedTransaction", skip_serializing_if = "Option::is_none")]
pub last_committed_transaction: Option<String>,
}
impl BalanceSchema {
/// BalanceSchema.
pub fn new(balance_amount: models::BalanceAmountSchema, balance_type: String) -> BalanceSchema {
BalanceSchema {
balance_amount,
balance_type,
credit_limit_included: None,
last_change_date_time: None,
reference_date: None,
last_committed_transaction: None,
}
}
}

View File

@@ -0,0 +1,32 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BankTransaction : BankTransactionSerializer.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BankTransaction {
#[serde(rename = "booked")]
pub booked: Vec<models::TransactionSchema>,
#[serde(rename = "pending", skip_serializing_if = "Option::is_none")]
pub pending: Option<Vec<models::TransactionSchema>>,
}
impl BankTransaction {
/// BankTransactionSerializer.
pub fn new(booked: Vec<models::TransactionSchema>) -> BankTransaction {
BankTransaction {
booked,
pending: None,
}
}
}

View File

@@ -0,0 +1,50 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CurrencyExchangeSchema : CurrencyExchangeSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CurrencyExchangeSchema {
/// sourceCurrency
#[serde(rename = "sourceCurrency", skip_serializing_if = "Option::is_none")]
pub source_currency: Option<String>,
/// exchangeRate
#[serde(rename = "exchangeRate", skip_serializing_if = "Option::is_none")]
pub exchange_rate: Option<String>,
/// unitCurrency
#[serde(rename = "unitCurrency", skip_serializing_if = "Option::is_none")]
pub unit_currency: Option<String>,
/// targetCurrency
#[serde(rename = "targetCurrency", skip_serializing_if = "Option::is_none")]
pub target_currency: Option<String>,
/// quotationDate
#[serde(rename = "quotationDate", skip_serializing_if = "Option::is_none")]
pub quotation_date: Option<String>,
/// contractIdentification
#[serde(rename = "contractIdentification", skip_serializing_if = "Option::is_none")]
pub contract_identification: Option<String>,
}
impl CurrencyExchangeSchema {
/// CurrencyExchangeSchema.
pub fn new() -> CurrencyExchangeSchema {
CurrencyExchangeSchema {
source_currency: None,
exchange_rate: None,
unit_currency: None,
target_currency: None,
quotation_date: None,
contract_identification: None,
}
}
}

View File

@@ -0,0 +1,98 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// DetailSchema : DetailSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DetailSchema {
/// resourceId
#[serde(rename = "resourceId", skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
/// iban
#[serde(rename = "iban", skip_serializing_if = "Option::is_none")]
pub iban: Option<String>,
/// bban
#[serde(rename = "bban", skip_serializing_if = "Option::is_none")]
pub bban: Option<String>,
/// msisdn
#[serde(rename = "msisdn", skip_serializing_if = "Option::is_none")]
pub msisdn: Option<String>,
/// currency
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
/// ownerName
#[serde(rename = "ownerName", skip_serializing_if = "Option::is_none")]
pub owner_name: Option<String>,
/// name
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// displayName
#[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
/// product
#[serde(rename = "product", skip_serializing_if = "Option::is_none")]
pub product: Option<String>,
/// cashAccountType
#[serde(rename = "cashAccountType", skip_serializing_if = "Option::is_none")]
pub cash_account_type: Option<String>,
/// status
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// bic
#[serde(rename = "bic", skip_serializing_if = "Option::is_none")]
pub bic: Option<String>,
/// linkedAccounts
#[serde(rename = "linkedAccounts", skip_serializing_if = "Option::is_none")]
pub linked_accounts: Option<String>,
/// maskedPan
#[serde(rename = "maskedPan", skip_serializing_if = "Option::is_none")]
pub masked_pan: Option<String>,
/// usage
#[serde(rename = "usage", skip_serializing_if = "Option::is_none")]
pub usage: Option<String>,
/// details
#[serde(rename = "details", skip_serializing_if = "Option::is_none")]
pub details: Option<String>,
/// ownerAddressUnstructured
#[serde(rename = "ownerAddressUnstructured", skip_serializing_if = "Option::is_none")]
pub owner_address_unstructured: Option<Vec<String>>,
/// ownerAddressStructured
#[serde(rename = "ownerAddressStructured", skip_serializing_if = "Option::is_none")]
pub owner_address_structured: Option<models::OwnerAddressStructuredSchema>,
}
impl DetailSchema {
/// DetailSchema.
pub fn new() -> DetailSchema {
DetailSchema {
resource_id: None,
iban: None,
bban: None,
msisdn: None,
currency: None,
owner_name: None,
name: None,
display_name: None,
product: None,
cash_account_type: None,
status: None,
bic: None,
linked_accounts: None,
masked_pan: None,
usage: None,
details: None,
owner_address_unstructured: None,
owner_address_structured: None,
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EndUserAgreement : Represents an end-user agreement.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EndUserAgreement {
/// The ID of this End User Agreement, used to refer to this end user agreement in other API calls.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
/// The date & time at which the end user agreement was created.
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
/// an Institution ID for this EUA
#[serde(rename = "institution_id")]
pub institution_id: String,
/// Maximum number of days of transaction data to retrieve.
#[serde(rename = "max_historical_days", skip_serializing_if = "Option::is_none")]
pub max_historical_days: Option<i32>,
/// Number of days from acceptance that the access can be used.
#[serde(rename = "access_valid_for_days", skip_serializing_if = "Option::is_none")]
pub access_valid_for_days: Option<i32>,
/// Array containing one or several values of ['balances', 'details', 'transactions']
#[serde(rename = "access_scope", skip_serializing_if = "Option::is_none")]
pub access_scope: Option<Vec<serde_json::Value>>,
/// The date & time at which the end user accepted the agreement.
#[serde(rename = "accepted", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub accepted: Option<Option<String>>,
}
impl EndUserAgreement {
/// Represents an end-user agreement.
pub fn new(institution_id: String) -> EndUserAgreement {
EndUserAgreement {
id: None,
created: None,
institution_id,
max_historical_days: None,
access_valid_for_days: None,
access_scope: None,
accepted: None,
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EndUserAgreementRequest : Represents an end-user agreement.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EndUserAgreementRequest {
/// an Institution ID for this EUA
#[serde(rename = "institution_id")]
pub institution_id: String,
/// Maximum number of days of transaction data to retrieve.
#[serde(rename = "max_historical_days", skip_serializing_if = "Option::is_none")]
pub max_historical_days: Option<i32>,
/// Number of days from acceptance that the access can be used.
#[serde(rename = "access_valid_for_days", skip_serializing_if = "Option::is_none")]
pub access_valid_for_days: Option<i32>,
/// Array containing one or several values of ['balances', 'details', 'transactions']
#[serde(rename = "access_scope", skip_serializing_if = "Option::is_none")]
pub access_scope: Option<Vec<serde_json::Value>>,
}
impl EndUserAgreementRequest {
/// Represents an end-user agreement.
pub fn new(institution_id: String) -> EndUserAgreementRequest {
EndUserAgreementRequest {
institution_id,
max_historical_days: None,
access_valid_for_days: None,
access_scope: None,
}
}
}

View File

@@ -0,0 +1,32 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EnduserAcceptanceDetailsRequest : Represents end-user details.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EnduserAcceptanceDetailsRequest {
#[serde(rename = "user_agent")]
pub user_agent: String,
#[serde(rename = "ip_address")]
pub ip_address: String,
}
impl EnduserAcceptanceDetailsRequest {
/// Represents end-user details.
pub fn new(user_agent: String, ip_address: String) -> EnduserAcceptanceDetailsRequest {
EnduserAcceptanceDetailsRequest {
user_agent,
ip_address,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorResponse {
#[serde(rename = "summary")]
pub summary: String,
#[serde(rename = "detail")]
pub detail: String,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(rename = "status_code")]
pub status_code: i32,
}
impl ErrorResponse {
pub fn new(summary: String, detail: String, status_code: i32) -> ErrorResponse {
ErrorResponse {
summary,
detail,
r#type: None,
status_code,
}
}
}

View File

@@ -0,0 +1,44 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Integration : Represents an Integration.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Integration {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "bic", skip_serializing_if = "Option::is_none")]
pub bic: Option<String>,
#[serde(rename = "transaction_total_days", skip_serializing_if = "Option::is_none")]
pub transaction_total_days: Option<String>,
#[serde(rename = "countries")]
pub countries: Vec<String>,
#[serde(rename = "logo")]
pub logo: String,
}
impl Integration {
/// Represents an Integration.
pub fn new(id: String, name: String, countries: Vec<String>, logo: String) -> Integration {
Integration {
id,
name,
bic: None,
transaction_total_days: None,
countries,
logo,
}
}
}

View File

@@ -0,0 +1,53 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// IntegrationRetrieve : IntegrationSerializer for Retrieve endpoint.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IntegrationRetrieve {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "bic", skip_serializing_if = "Option::is_none")]
pub bic: Option<String>,
#[serde(rename = "transaction_total_days", skip_serializing_if = "Option::is_none")]
pub transaction_total_days: Option<String>,
#[serde(rename = "countries")]
pub countries: Vec<String>,
#[serde(rename = "logo")]
pub logo: String,
#[serde(rename = "supported_payments")]
pub supported_payments: std::collections::HashMap<String, serde_json::Value>,
#[serde(rename = "supported_features")]
pub supported_features: Vec<serde_json::Value>,
#[serde(rename = "identification_codes")]
pub identification_codes: Vec<serde_json::Value>,
}
impl IntegrationRetrieve {
/// IntegrationSerializer for Retrieve endpoint.
pub fn new(id: String, name: String, countries: Vec<String>, logo: String, supported_payments: std::collections::HashMap<String, serde_json::Value>, supported_features: Vec<serde_json::Value>, identification_codes: Vec<serde_json::Value>) -> IntegrationRetrieve {
IntegrationRetrieve {
id,
name,
bic: None,
transaction_total_days: None,
countries,
logo,
supported_payments,
supported_features,
identification_codes,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// JwtObtainPairRequest : Obtain JWT pair.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JwtObtainPairRequest {
/// Secret id from /user-secrets/
#[serde(rename = "secret_id")]
pub secret_id: String,
/// Secret key from /user-secrets/
#[serde(rename = "secret_key")]
pub secret_key: String,
}
impl JwtObtainPairRequest {
/// Obtain JWT pair.
pub fn new(secret_id: String, secret_key: String) -> JwtObtainPairRequest {
JwtObtainPairRequest {
secret_id,
secret_key,
}
}
}

View File

@@ -0,0 +1,29 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// JwtRefreshRequest : Refresh access token.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JwtRefreshRequest {
#[serde(rename = "refresh")]
pub refresh: String,
}
impl JwtRefreshRequest {
/// Refresh access token.
pub fn new(refresh: String) -> JwtRefreshRequest {
JwtRefreshRequest {
refresh,
}
}
}

View File

@@ -0,0 +1,56 @@
pub mod account;
pub use self::account::Account;
pub mod account_balance;
pub use self::account_balance::AccountBalance;
pub mod account_detail;
pub use self::account_detail::AccountDetail;
pub mod account_schema;
pub use self::account_schema::AccountSchema;
pub mod balance_amount_schema;
pub use self::balance_amount_schema::BalanceAmountSchema;
pub mod balance_schema;
pub use self::balance_schema::BalanceSchema;
pub mod bank_transaction;
pub use self::bank_transaction::BankTransaction;
pub mod currency_exchange_schema;
pub use self::currency_exchange_schema::CurrencyExchangeSchema;
pub mod detail_schema;
pub use self::detail_schema::DetailSchema;
pub mod end_user_agreement;
pub use self::end_user_agreement::EndUserAgreement;
pub mod end_user_agreement_request;
pub use self::end_user_agreement_request::EndUserAgreementRequest;
pub mod enduser_acceptance_details_request;
pub use self::enduser_acceptance_details_request::EnduserAcceptanceDetailsRequest;
pub mod error_response;
pub use self::error_response::ErrorResponse;
pub mod integration;
pub use self::integration::Integration;
pub mod integration_retrieve;
pub use self::integration_retrieve::IntegrationRetrieve;
pub mod jwt_obtain_pair_request;
pub use self::jwt_obtain_pair_request::JwtObtainPairRequest;
pub mod jwt_refresh_request;
pub use self::jwt_refresh_request::JwtRefreshRequest;
pub mod owner_address_structured_schema;
pub use self::owner_address_structured_schema::OwnerAddressStructuredSchema;
pub mod paginated_end_user_agreement_list;
pub use self::paginated_end_user_agreement_list::PaginatedEndUserAgreementList;
pub mod paginated_requisition_list;
pub use self::paginated_requisition_list::PaginatedRequisitionList;
pub mod requisition;
pub use self::requisition::Requisition;
pub mod requisition_request;
pub use self::requisition_request::RequisitionRequest;
pub mod spectacular_jwt_obtain;
pub use self::spectacular_jwt_obtain::SpectacularJwtObtain;
pub mod spectacular_jwt_refresh;
pub use self::spectacular_jwt_refresh::SpectacularJwtRefresh;
pub mod spectacular_requisition;
pub use self::spectacular_requisition::SpectacularRequisition;
pub mod status_enum;
pub use self::status_enum::StatusEnum;
pub mod transaction_amount_schema;
pub use self::transaction_amount_schema::TransactionAmountSchema;
pub mod transaction_schema;
pub use self::transaction_schema::TransactionSchema;

View File

@@ -0,0 +1,46 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// OwnerAddressStructuredSchema : OwnerAddressStructuredSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OwnerAddressStructuredSchema {
/// streetName
#[serde(rename = "streetName", skip_serializing_if = "Option::is_none")]
pub street_name: Option<String>,
/// buildingNumber
#[serde(rename = "buildingNumber", skip_serializing_if = "Option::is_none")]
pub building_number: Option<String>,
/// townName
#[serde(rename = "townName", skip_serializing_if = "Option::is_none")]
pub town_name: Option<String>,
/// postCode
#[serde(rename = "postCode", skip_serializing_if = "Option::is_none")]
pub post_code: Option<String>,
/// country
#[serde(rename = "country", skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
}
impl OwnerAddressStructuredSchema {
/// OwnerAddressStructuredSchema.
pub fn new() -> OwnerAddressStructuredSchema {
OwnerAddressStructuredSchema {
street_name: None,
building_number: None,
town_name: None,
post_code: None,
country: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PaginatedEndUserAgreementList {
#[serde(rename = "count")]
pub count: i32,
#[serde(rename = "next", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub next: Option<Option<String>>,
#[serde(rename = "previous", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub previous: Option<Option<String>>,
#[serde(rename = "results")]
pub results: Vec<models::EndUserAgreement>,
}
impl PaginatedEndUserAgreementList {
pub fn new(count: i32, results: Vec<models::EndUserAgreement>) -> PaginatedEndUserAgreementList {
PaginatedEndUserAgreementList {
count,
next: None,
previous: None,
results,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PaginatedRequisitionList {
#[serde(rename = "count")]
pub count: i32,
#[serde(rename = "next", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub next: Option<Option<String>>,
#[serde(rename = "previous", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub previous: Option<Option<String>>,
#[serde(rename = "results")]
pub results: Vec<models::Requisition>,
}
impl PaginatedRequisitionList {
pub fn new(count: i32, results: Vec<models::Requisition>) -> PaginatedRequisitionList {
PaginatedRequisitionList {
count,
next: None,
previous: None,
results,
}
}
}

View File

@@ -0,0 +1,77 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Requisition : RequisitionSerializer.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Requisition {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
/// The date & time at which the requisition was created.
#[serde(rename = "created", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub created: Option<Option<String>>,
/// redirect URL to your application after end-user authorization with ASPSP
#[serde(rename = "redirect", deserialize_with = "Option::deserialize")]
pub redirect: Option<String>,
/// status of this requisition
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<models::StatusEnum>,
/// an Institution ID for this Requisition
#[serde(rename = "institution_id")]
pub institution_id: String,
/// EUA associated with this requisition
#[serde(rename = "agreement", skip_serializing_if = "Option::is_none")]
pub agreement: Option<uuid::Uuid>,
/// additional ID to identify the end user
#[serde(rename = "reference", skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
/// array of account IDs retrieved within a scope of this requisition
#[serde(rename = "accounts", skip_serializing_if = "Option::is_none")]
pub accounts: Option<Vec<uuid::Uuid>>,
/// A two-letter country code (ISO 639-1)
#[serde(rename = "user_language", skip_serializing_if = "Option::is_none")]
pub user_language: Option<String>,
/// link to initiate authorization with Institution
#[serde(rename = "link", skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
/// optional SSN field to verify ownership of the account
#[serde(rename = "ssn", skip_serializing_if = "Option::is_none")]
pub ssn: Option<String>,
/// option to enable account selection view for the end user
#[serde(rename = "account_selection", skip_serializing_if = "Option::is_none")]
pub account_selection: Option<bool>,
/// enable redirect back to the client after account list received
#[serde(rename = "redirect_immediate", skip_serializing_if = "Option::is_none")]
pub redirect_immediate: Option<bool>,
}
impl Requisition {
/// RequisitionSerializer.
pub fn new(redirect: Option<String>, institution_id: String) -> Requisition {
Requisition {
id: None,
created: None,
redirect,
status: None,
institution_id,
agreement: None,
reference: None,
accounts: None,
user_language: None,
link: None,
ssn: None,
account_selection: None,
redirect_immediate: None,
}
}
}

View File

@@ -0,0 +1,58 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// RequisitionRequest : RequisitionSerializer.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequisitionRequest {
/// redirect URL to your application after end-user authorization with ASPSP
#[serde(rename = "redirect", deserialize_with = "Option::deserialize")]
pub redirect: Option<String>,
/// an Institution ID for this Requisition
#[serde(rename = "institution_id")]
pub institution_id: String,
/// EUA associated with this requisition
#[serde(rename = "agreement", skip_serializing_if = "Option::is_none")]
pub agreement: Option<uuid::Uuid>,
/// additional ID to identify the end user
#[serde(rename = "reference", skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
/// A two-letter country code (ISO 639-1)
#[serde(rename = "user_language", skip_serializing_if = "Option::is_none")]
pub user_language: Option<String>,
/// optional SSN field to verify ownership of the account
#[serde(rename = "ssn", skip_serializing_if = "Option::is_none")]
pub ssn: Option<String>,
/// option to enable account selection view for the end user
#[serde(rename = "account_selection", skip_serializing_if = "Option::is_none")]
pub account_selection: Option<bool>,
/// enable redirect back to the client after account list received
#[serde(rename = "redirect_immediate", skip_serializing_if = "Option::is_none")]
pub redirect_immediate: Option<bool>,
}
impl RequisitionRequest {
/// RequisitionSerializer.
pub fn new(redirect: Option<String>, institution_id: String) -> RequisitionRequest {
RequisitionRequest {
redirect,
institution_id,
agreement: None,
reference: None,
user_language: None,
ssn: None,
account_selection: None,
redirect_immediate: None,
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// SpectacularJwtObtain : Obtain new JWT pair.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SpectacularJwtObtain {
/// Your access token
#[serde(rename = "access", skip_serializing_if = "Option::is_none")]
pub access: Option<String>,
/// Access token expires in seconds
#[serde(rename = "access_expires", skip_serializing_if = "Option::is_none")]
pub access_expires: Option<i32>,
/// Your refresh token
#[serde(rename = "refresh", skip_serializing_if = "Option::is_none")]
pub refresh: Option<String>,
/// Refresh token expires in seconds
#[serde(rename = "refresh_expires", skip_serializing_if = "Option::is_none")]
pub refresh_expires: Option<i32>,
}
impl SpectacularJwtObtain {
/// Obtain new JWT pair.
pub fn new() -> SpectacularJwtObtain {
SpectacularJwtObtain {
access: None,
access_expires: None,
refresh: None,
refresh_expires: None,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// SpectacularJwtRefresh : Refresh Access token.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SpectacularJwtRefresh {
/// Your access token
#[serde(rename = "access", skip_serializing_if = "Option::is_none")]
pub access: Option<String>,
/// Access token expires in seconds
#[serde(rename = "access_expires", skip_serializing_if = "Option::is_none")]
pub access_expires: Option<i32>,
}
impl SpectacularJwtRefresh {
/// Refresh Access token.
pub fn new() -> SpectacularJwtRefresh {
SpectacularJwtRefresh {
access: None,
access_expires: None,
}
}
}

View File

@@ -0,0 +1,77 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// SpectacularRequisition : Create requisition.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SpectacularRequisition {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
/// The date & time at which the requisition was created.
#[serde(rename = "created", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub created: Option<Option<String>>,
/// redirect URL to your application after end-user authorization with ASPSP
#[serde(rename = "redirect", deserialize_with = "Option::deserialize")]
pub redirect: Option<String>,
/// status of this requisition
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<models::StatusEnum>,
/// an Institution ID for this Requisition
#[serde(rename = "institution_id")]
pub institution_id: String,
/// EUA associated with this requisition
#[serde(rename = "agreement", skip_serializing_if = "Option::is_none")]
pub agreement: Option<uuid::Uuid>,
/// additional ID to identify the end user
#[serde(rename = "reference", skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
/// array of account IDs retrieved within a scope of this requisition
#[serde(rename = "accounts", skip_serializing_if = "Option::is_none")]
pub accounts: Option<Vec<serde_json::Value>>,
/// A two-letter country code (ISO 639-1)
#[serde(rename = "user_language", skip_serializing_if = "Option::is_none")]
pub user_language: Option<String>,
/// link to initiate authorization with Institution
#[serde(rename = "link", skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
/// optional SSN field to verify ownership of the account
#[serde(rename = "ssn", skip_serializing_if = "Option::is_none")]
pub ssn: Option<String>,
/// option to enable account selection view for the end user
#[serde(rename = "account_selection", skip_serializing_if = "Option::is_none")]
pub account_selection: Option<bool>,
/// enable redirect back to the client after account list received
#[serde(rename = "redirect_immediate", skip_serializing_if = "Option::is_none")]
pub redirect_immediate: Option<bool>,
}
impl SpectacularRequisition {
/// Create requisition.
pub fn new(redirect: Option<String>, institution_id: String) -> SpectacularRequisition {
SpectacularRequisition {
id: None,
created: None,
redirect,
status: None,
institution_id,
agreement: None,
reference: None,
accounts: None,
user_language: None,
link: None,
ssn: None,
account_selection: None,
redirect_immediate: None,
}
}
}

View File

@@ -0,0 +1,65 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StatusEnum {
#[serde(rename = "CR")]
Cr,
#[serde(rename = "ID")]
Id,
#[serde(rename = "LN")]
Ln,
#[serde(rename = "RJ")]
Rj,
#[serde(rename = "ER")]
Er,
#[serde(rename = "SU")]
Su,
#[serde(rename = "EX")]
Ex,
#[serde(rename = "GC")]
Gc,
#[serde(rename = "UA")]
Ua,
#[serde(rename = "GA")]
Ga,
#[serde(rename = "SA")]
Sa,
}
impl std::fmt::Display for StatusEnum {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Cr => write!(f, "CR"),
Self::Id => write!(f, "ID"),
Self::Ln => write!(f, "LN"),
Self::Rj => write!(f, "RJ"),
Self::Er => write!(f, "ER"),
Self::Su => write!(f, "SU"),
Self::Ex => write!(f, "EX"),
Self::Gc => write!(f, "GC"),
Self::Ua => write!(f, "UA"),
Self::Ga => write!(f, "GA"),
Self::Sa => write!(f, "SA"),
}
}
}
impl Default for StatusEnum {
fn default() -> StatusEnum {
Self::Cr
}
}

View File

@@ -0,0 +1,34 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// TransactionAmountSchema : TransactionAmountSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionAmountSchema {
/// amount
#[serde(rename = "amount")]
pub amount: String,
/// currency
#[serde(rename = "currency")]
pub currency: String,
}
impl TransactionAmountSchema {
/// TransactionAmountSchema.
pub fn new(amount: String, currency: String) -> TransactionAmountSchema {
TransactionAmountSchema {
amount,
currency,
}
}
}

View File

@@ -0,0 +1,133 @@
/*
* GoCardless Bank Account Data API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0 (v2)
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// TransactionSchema : TransactionSchema.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionSchema {
/// transactionId
#[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
/// entryReference
#[serde(rename = "entryReference", skip_serializing_if = "Option::is_none")]
pub entry_reference: Option<String>,
/// endToEndId
#[serde(rename = "endToEndId", skip_serializing_if = "Option::is_none")]
pub end_to_end_id: Option<String>,
/// mandateId
#[serde(rename = "mandateId", skip_serializing_if = "Option::is_none")]
pub mandate_id: Option<String>,
/// checkId
#[serde(rename = "checkId", skip_serializing_if = "Option::is_none")]
pub check_id: Option<String>,
/// creditorId
#[serde(rename = "creditorId", skip_serializing_if = "Option::is_none")]
pub creditor_id: Option<String>,
/// bookingDate
#[serde(rename = "bookingDate", skip_serializing_if = "Option::is_none")]
pub booking_date: Option<String>,
/// valueDate
#[serde(rename = "valueDate", skip_serializing_if = "Option::is_none")]
pub value_date: Option<String>,
/// bookingDateTime
#[serde(rename = "bookingDateTime", skip_serializing_if = "Option::is_none")]
pub booking_date_time: Option<String>,
/// valueDateTime
#[serde(rename = "valueDateTime", skip_serializing_if = "Option::is_none")]
pub value_date_time: Option<String>,
/// transactionAmount
#[serde(rename = "transactionAmount")]
pub transaction_amount: models::TransactionAmountSchema,
#[serde(rename = "currencyExchange", skip_serializing_if = "Option::is_none")]
pub currency_exchange: Option<Vec<models::CurrencyExchangeSchema>>,
/// creditorName
#[serde(rename = "creditorName", skip_serializing_if = "Option::is_none")]
pub creditor_name: Option<String>,
/// creditorAccount
#[serde(rename = "creditorAccount", skip_serializing_if = "Option::is_none")]
pub creditor_account: Option<models::AccountSchema>,
/// ultimateCreditor
#[serde(rename = "ultimateCreditor", skip_serializing_if = "Option::is_none")]
pub ultimate_creditor: Option<String>,
/// debtorName
#[serde(rename = "debtorName", skip_serializing_if = "Option::is_none")]
pub debtor_name: Option<String>,
/// debtorAccount
#[serde(rename = "debtorAccount", skip_serializing_if = "Option::is_none")]
pub debtor_account: Option<models::AccountSchema>,
/// ultimateDebtor
#[serde(rename = "ultimateDebtor", skip_serializing_if = "Option::is_none")]
pub ultimate_debtor: Option<String>,
/// remittanceInformationUnstructured
#[serde(rename = "remittanceInformationUnstructured", skip_serializing_if = "Option::is_none")]
pub remittance_information_unstructured: Option<String>,
/// remittanceInformationUnstructuredArray
#[serde(rename = "remittanceInformationUnstructuredArray", skip_serializing_if = "Option::is_none")]
pub remittance_information_unstructured_array: Option<Vec<String>>,
/// remittanceInformationStructured
#[serde(rename = "remittanceInformationStructured", skip_serializing_if = "Option::is_none")]
pub remittance_information_structured: Option<String>,
/// remittanceInformationStructuredArray
#[serde(rename = "remittanceInformationStructuredArray", skip_serializing_if = "Option::is_none")]
pub remittance_information_structured_array: Option<Vec<String>>,
/// additionalInformation
#[serde(rename = "additionalInformation", skip_serializing_if = "Option::is_none")]
pub additional_information: Option<String>,
/// purposeCode
#[serde(rename = "purposeCode", skip_serializing_if = "Option::is_none")]
pub purpose_code: Option<String>,
/// bankTransactionCode
#[serde(rename = "bankTransactionCode", skip_serializing_if = "Option::is_none")]
pub bank_transaction_code: Option<String>,
/// proprietaryBankTransactionCode
#[serde(rename = "proprietaryBankTransactionCode", skip_serializing_if = "Option::is_none")]
pub proprietary_bank_transaction_code: Option<String>,
/// internalTransactionId
#[serde(rename = "internalTransactionId", skip_serializing_if = "Option::is_none")]
pub internal_transaction_id: Option<String>,
}
impl TransactionSchema {
/// TransactionSchema.
pub fn new(transaction_amount: models::TransactionAmountSchema) -> TransactionSchema {
TransactionSchema {
transaction_id: None,
entry_reference: None,
end_to_end_id: None,
mandate_id: None,
check_id: None,
creditor_id: None,
booking_date: None,
value_date: None,
booking_date_time: None,
value_date_time: None,
transaction_amount,
currency_exchange: None,
creditor_name: None,
creditor_account: None,
ultimate_creditor: None,
debtor_name: None,
debtor_account: None,
ultimate_debtor: None,
remittance_information_unstructured: None,
remittance_information_unstructured_array: None,
remittance_information_structured: None,
remittance_information_structured_array: None,
additional_information: None,
purpose_code: None,
bank_transaction_code: None,
proprietary_bank_transaction_code: None,
internal_transaction_id: None,
}
}
}