// Generated by `cargo run -p codegen` from spec/enablebanking-api.yaml, API version 1.0.0-967df6a1. Do not edit.
#[allow(unused_imports)]
pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
#[allow(unused_imports)]
use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt};
/// Types used as operation parameters and responses.
#[allow(clippy::all)]
pub mod types {
///`Access`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct Access {
/**List of accounts access to which is requested. If not set behaviour depends on the
bank: some banks allow users to choose list of accessible accounts through their
access consent UI, while other may provide access to all accounts or just access to
the list of accounts.*/
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub accounts: ::std::option::Option<::std::vec::Vec<AccountIdentification>>,
///Request consent with balances access
#[serde(default = "defaults::access_balances")]
pub balances: ::std::option::Option<bool>,
///Request consent with transactions access
#[serde(default = "defaults::access_transactions")]
pub transactions: ::std::option::Option<bool>,
/**This parameter specifies the date and time until which the authorised session
remains valid. The value must be in the RFC3339 date-time format with a timezone
offset, e.g. `2025-12-01T12:00:00.000000+00:00`. The provided value cannot exceed
the date and time, calculated as "now" + `maximum_consent_validity` (provided in
seconds for each ASPSP in response to the GET /aspsps request). The provided value
is subject to adjustment to comply with the ASPSP's requirements. Specifically, if
the provided value is less than the minimum consent validity allowed by the ASPSP
(e.g., some ASPSPs require a minimum of 1 hour or 1 day), the consent validity will
be adjusted to meet these requirements. However, the session validity will remain
exactly as specified. This means that even if the consent remains valid on the
ASPSP's side, the session will expire based on the initially provided value.*/
pub valid_until: ::jiff::Timestamp,
}
impl Access {
pub fn builder() -> builder::Access {
Default::default()
}
}
///`AccountIdentification`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct AccountIdentification {
///International Bank Account Number (IBAN) - identification used internationally by financial institutions to uniquely identify the account of a customer. Further specifications of the format and content of the IBAN can be found in the standard ISO 13616 "Banking and related financial services - International Bank Account Number (IBAN)" version 1997-10-01, or later revisions.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub iban: ::std::option::Option<::std::string::String>,
///Other identification if iban is not provided
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub other: ::std::option::Option<GenericIdentification>,
}
impl AccountIdentification {
pub fn builder() -> builder::AccountIdentification {
Default::default()
}
}
///`AccountResource`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct AccountResource {
///Primary account identifier
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub account_id: ::std::option::Option<AccountIdentification>,
///Information about the financial institution servicing the account
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub account_servicer: ::std::option::Option<FinancialInstitutionIdentification>,
///All account identifiers provided by ASPSPs (including primary identifier available in the accountId field)
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub all_account_ids: ::std::option::Option<
::std::vec::Vec<GenericIdentification>,
>,
pub cash_account_type: crate::types::CashAccountType,
///Specifies the maximum credit or overdraft allowed on the account
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub credit_limit: ::std::option::Option<crate::Amount>,
///Specifies the currency of the account
pub currency: ::std::string::String,
///Account description set by PSU or provided by ASPSP
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub details: ::std::option::Option<::std::string::String>,
///Primary account identification hash. It can be used for matching accounts between multiple sessions (even in case the sessions are authorized by different PSUs).
pub identification_hash: ::std::string::String,
///List of possible account identification hashes. Identification hash is based on the account number. Some accounts may have multiple account numbers (e.g. IBAN and BBAN). This field contains all possible hashes. Not all of these hashes can be used to uniquely identify an account and that the primary goal of them is to be able to fuzzy matching of accounts by certain properties. Primary hash is included in this list.
pub identification_hashes: ::std::vec::Vec<::std::string::String>,
/**Specifies whether Enable Banking is confident that the account holder is of legal age or is a minor. The field takes the following values:
true if the account holder is of legal age;
false if the account holder is a minor;
null (or the field is not set) if it is not possible to determine whether the account holder is of legal age or a minor or if the legal age check is not applicable (in cases such as if the account holder is a legal entity or there are multiple account co-holders)*/
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub legal_age: ::std::option::Option<bool>,
///Account holder(s) name
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
///Postal address of the account holder
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub postal_address: ::std::option::Option<PostalAddress>,
///Product Name of the Bank for this account, proprietary definition
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub product: ::std::option::Option<::std::string::String>,
///Relationship between the PSU and the account - Account Holder - Co-account Holder - Attorney
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub psu_status: ::std::option::Option<::std::string::String>,
///Unique account identificator used for fetching account balances and transactions. It is valid only until the session to which the account belongs is in the AUTHORIZED status. It can be not set in case it is know that it is not possible to fetch balances and transactions for the account (for example, in case the account is blocked or closed at the ASPSP side).
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub uid: ::std::option::Option<::uuid::Uuid>,
///Specifies the usage of the account
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub usage: ::std::option::Option<crate::types::Usage>,
}
impl AccountResource {
pub fn builder() -> builder::AccountResource {
Default::default()
}
}
///`Aspsp`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct Aspsp {
///Two-letter ISO 3166 code of the country, in which ASPSP operates
pub country: ::std::string::String,
///Name of the ASPSP (i.e. a bank or a similar financial institution)
pub name: ::std::string::String,
}
impl Aspsp {
pub fn builder() -> builder::Aspsp {
Default::default()
}
}
///`AspspData`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct AspspData {
///List of available authentication methods. Provided in case multiple methods are available or it is possible to supply authentication credentials while initiating authorization.
pub auth_methods: ::std::vec::Vec<AuthMethod>,
///Flag showing whether implementation is in beta mode
pub beta: bool,
///BIC of the ASPSP
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub bic: ::std::option::Option<::std::string::String>,
///Two-letter ISO 3166 code of the country, in which ASPSP operates
pub country: ::std::string::String,
///Group, which the ASPSP belongs to
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub group: ::std::option::Option<AspspGroup>,
///ASPSP logo URL. It is possible to transform (e.g. resize) the logo by adding special suffixes at the end of the URL. For example, `-/resize/500x/`. For full list of possible transformations, please refer to https://uploadcare.com/docs/transformations/image/
pub logo: Logo,
///Maximum consent validity which bank supports in seconds
pub maximum_consent_validity: i64,
///Name of the ASPSP (i.e. a bank or a similar financial institution)
pub name: ::std::string::String,
///Supported payment types by country and their properties
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payments: ::std::option::Option<::std::vec::Vec<ResponsePaymentType>>,
///List of PSU types supported by ASPSP
pub psu_types: ::std::vec::Vec<crate::types::PsuType>,
///List of the headers required to indicate to data retrieval endpoints that PSU is online. Either all required PSU headers or none of PSU headers are to be provided, otherwise PSU_HEADER_NOT_PROVIDED error will be returned.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub required_psu_headers: ::std::option::Option<
::std::vec::Vec<::std::string::String>,
>,
///Applicable only to sandbox environment. Additional information necessary to use sandbox environment.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub sandbox: ::std::option::Option<SandboxInfo>,
}
impl AspspData {
pub fn builder() -> builder::AspspData {
Default::default()
}
}
///`AspspGroup`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct AspspGroup {
///URL of the logo for the group to which the ASPSP belongs. This URL supports the same transformation postfixes as ASPSP logo URLs.
pub logo: Logo,
///Name of the group, which the ASPSP belongs to
pub name: ::std::string::String,
}
impl AspspGroup {
pub fn builder() -> builder::AspspGroup {
Default::default()
}
}
///`AuthMethod`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct AuthMethod {
pub approach: crate::types::AuthenticationApproach,
///List of credentials which are possible to supply while initiating authorization
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub credentials: ::std::option::Option<::std::vec::Vec<Credential>>,
///Flag showing whether the current authentication method is hidden from the user. If `true` then the user will not be able to select this authentication method. It is only possible to select this authentication method via API.
pub hidden_method: bool,
///Internal name of the authentication method
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
pub psu_type: crate::types::PsuType,
///Human-readable title of the authentication method
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub title: ::std::option::Option<::std::string::String>,
}
impl AuthMethod {
pub fn builder() -> builder::AuthMethod {
Default::default()
}
}
///`AuthorizeSessionRequest`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct AuthorizeSessionRequest {
///Authorization code returned when redirecting PSU
pub code: ::std::string::String,
}
impl AuthorizeSessionRequest {
pub fn builder() -> builder::AuthorizeSessionRequest {
Default::default()
}
}
///`AuthorizeSessionResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct AuthorizeSessionResponse {
pub access: Access,
///List of authorized accounts
pub accounts: ::std::vec::Vec<AccountResource>,
pub aspsp: Aspsp,
pub psu_type: crate::types::PsuType,
///ID of the PSU session
pub session_id: ::std::string::String,
}
impl AuthorizeSessionResponse {
pub fn builder() -> builder::AuthorizeSessionResponse {
Default::default()
}
}
///`BalanceResource`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct BalanceResource {
pub balance_amount: crate::Amount,
pub balance_type: crate::types::BalanceStatus,
///Timestamp of the last change of the balance amount
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub last_change_date_time: ::std::option::Option<::jiff::Timestamp>,
///Entry reference of the last transaction contributing to the balance value
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub last_committed_transaction: ::std::option::Option<::std::string::String>,
///Label of the balance
pub name: ::std::string::String,
///Reference date for the balance
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reference_date: ::std::option::Option<::jiff::civil::Date>,
}
impl BalanceResource {
pub fn builder() -> builder::BalanceResource {
Default::default()
}
}
///`BankTransactionCode`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct BankTransactionCode {
///Specifies the family of a transaction within the domain
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub code: ::std::option::Option<::std::string::String>,
///Arbitrary transaction categorization description
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
///Specifies the sub-product family of a transaction within a specific family
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub sub_code: ::std::option::Option<::std::string::String>,
}
impl BankTransactionCode {
pub fn builder() -> builder::BankTransactionCode {
Default::default()
}
}
///`Beneficiary`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct Beneficiary {
///Identification of the party receiving funds
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor: ::std::option::Option<PartyIdentification>,
pub creditor_account: GenericIdentification,
///Identification of the financial institution where the account receiving funds is held
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor_agent: ::std::option::Option<FinancialInstitutionIdentification>,
///ISO 4217 currency code, in which the account receiving funds is held
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor_currency: ::std::option::Option<::std::string::String>,
}
impl Beneficiary {
pub fn builder() -> builder::Beneficiary {
Default::default()
}
}
///`ClearingSystemMemberIdentification`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct ClearingSystemMemberIdentification {
///Specification of a pre-agreed offering between clearing agents or the channel through which the payment instruction is processed.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub clearing_system_id: ::std::option::Option<::std::string::String>,
///Identification of a member of a clearing system.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub member_id: ::std::option::Option<::std::string::String>,
}
impl ClearingSystemMemberIdentification {
pub fn builder() -> builder::ClearingSystemMemberIdentification {
Default::default()
}
}
///`ContactDetails`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct ContactDetails {
///Email address of a person
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub email_address: ::std::option::Option<::std::string::String>,
///Phone number of a person
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub phone_number: ::std::option::Option<::std::string::String>,
}
impl ContactDetails {
pub fn builder() -> builder::ContactDetails {
Default::default()
}
}
///Display only ASPSPs from specified country
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Country(::std::string::String);
impl ::std::ops::Deref for Country {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Country> for ::std::string::String {
fn from(value: Country) -> Self {
value.0
}
}
impl ::std::str::FromStr for Country {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^[A-Z]{2}$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Country {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Country {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Country {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`CreatePaymentRequest`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct CreatePaymentRequest {
pub aspsp: Aspsp,
///Desired authorization method (in case ASPSP integration supports multiple). Supported methods can be obtained from the `auth_methods` field available in ASPSP details.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub auth_method: ::std::option::Option<::std::string::String>,
///PSU credentials (e.g., user and/or company ID). If not provided through the API, they will be requested from the PSU during authorization. Credentials can be supplied only if `auth_method` is specified; otherwise, a `WRONG_REQUEST_PARAMETERS` error will be returned.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub credentials: ::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
///Controls whether the payment submission for execution is deferred after PSU authorization. When set to true, the payment will not be automatically submitted for execution after PSU completes authorization at the ASPSP. Instead, an explicit call to POST /payments/{payment_id}/submit is required to submit the payment for execution. Only effective when the selected ASPSP payment type has deferred_submission_supported: true. Defaults to false.
#[serde(default = "defaults::create_payment_request_defer_submission")]
pub defer_submission: ::std::option::Option<bool>,
///Preferred PSU language. Two-letter lowercase language code
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub language: ::std::option::Option<Language>,
pub payment_request: PaymentRequestResource,
pub payment_type: crate::types::PaymentType,
///Unique identification of a PSU used by the client application. It can be used to match payments of the same user. Although only hashed value is stored, it is recommended to use anonymised identifiers (i.e. digital ID instead of email or social security number). In case the parameter is not passed by the application, random value will be used.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub psu_id: ::std::option::Option<::std::string::String>,
pub psu_type: crate::types::PsuType,
///URL that PSU will be redirected to after authorization
pub redirect_url: RedirectUrl,
///Arbitrary string. Same string will be returned in query parameter when redirecting to the URL passed via redirect_url parameter
pub state: ::std::string::String,
///URL that will receive POST requests notifying about payment changes. See the [webhooks documentation](../webhooks/index.md#payment-status-webhook) for more details
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub webhook_url: ::std::option::Option<WebhookUrl>,
}
impl CreatePaymentRequest {
pub fn builder() -> builder::CreatePaymentRequest {
Default::default()
}
}
///`CreatePaymentResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct CreatePaymentResponse {
///Payment ID
pub payment_id: ::uuid::Uuid,
///Hashed unique identification of a PSU used by the client application. In case PSU ID is not passed by the client application, the hash is calculated based on a random value. The hash also inherits the application ID, so different hashes will be calculated when using the same PSU ID with different applications.
pub psu_id_hash: ::std::string::String,
pub status: crate::types::PaymentStatus,
///URL to redirect a PSU to
pub url: Url,
}
impl CreatePaymentResponse {
pub fn builder() -> builder::CreatePaymentResponse {
Default::default()
}
}
///`Credential`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct Credential {
///Description of the credential to be displayed to PSU
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
///Internal name of the credential. The name is to be used when passing credentials to the "start user authorization" request
pub name: ::std::string::String,
///Indication whether the credential is required
pub required: bool,
///Perl compatible regular expression used for check of the credential format
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub template: ::std::option::Option<::std::string::String>,
///Title for the credential to be displayed to PSU
pub title: ::std::string::String,
}
impl Credential {
pub fn builder() -> builder::Credential {
Default::default()
}
}
///Payment instruction to be executed by the ASPSP
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct CreditTransferTransaction {
pub beneficiary: Beneficiary,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub end_date: ::std::option::Option<EndDate>,
///Execution date shifting rule for standing orders
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub execution_rule: ::std::option::Option<crate::types::ExecutionRule>,
///Frequency rule for standing orders
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub frequency: ::std::option::Option<crate::types::FrequencyCode>,
pub instructed_amount: crate::Amount,
///Set of elements used to reference a payment instruction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payment_id: ::std::option::Option<PaymentIdentification>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reference_number: ::std::option::Option<ReferenceNumber>,
///List of needed regulatory reporting codes for international payments
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub regulatory_reporting: ::std::option::Option<
::std::vec::Vec<RegulatoryReporting>,
>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub remittance_information: ::std::option::Option<
UnstructuredRemittanceInformation,
>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub requested_execution_date: ::std::option::Option<RequestedExecutionDate>,
///Identifies the final party receiving the funds in the payment transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub ultimate_creditor: ::std::option::Option<PartyIdentification>,
///Identifies the original party from whom the funds originate in the payment transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub ultimate_debtor: ::std::option::Option<PartyIdentification>,
}
impl CreditTransferTransaction {
pub fn builder() -> builder::CreditTransferTransaction {
Default::default()
}
}
///Details of the payment instruction executed (to be executed) by the ASPSP
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct CreditTransferTransactionDetails {
pub beneficiary: Beneficiary,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub end_date: ::std::option::Option<EndDate>,
///Execution date shifting rule for standing orders
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub execution_rule: ::std::option::Option<crate::types::ExecutionRule>,
///Frequency rule for standing orders
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub frequency: ::std::option::Option<crate::types::FrequencyCode>,
pub instructed_amount: crate::Amount,
///Set of elements used to reference a payment instruction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payment_id: ::std::option::Option<PaymentIdentification>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reference_number: ::std::option::Option<ReferenceNumber>,
///List of needed regulatory reporting codes for international payments
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub regulatory_reporting: ::std::option::Option<
::std::vec::Vec<RegulatoryReporting>,
>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub remittance_information: ::std::option::Option<
UnstructuredRemittanceInformation,
>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub requested_execution_date: ::std::option::Option<RequestedExecutionDate>,
///Unique identifier of the payment transaction, which can be used for fetching details through the get payment transaction endpoint
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub transaction_id: ::std::option::Option<::std::string::String>,
///Status of the payment transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub transaction_status: ::std::option::Option<crate::types::PaymentStatus>,
///Identifies the final party receiving the funds in the payment transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub ultimate_creditor: ::std::option::Option<PartyIdentification>,
///Identifies the original party from whom the funds originate in the payment transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub ultimate_debtor: ::std::option::Option<PartyIdentification>,
}
impl CreditTransferTransactionDetails {
pub fn builder() -> builder::CreditTransferTransactionDetails {
Default::default()
}
}
///Specifies the currency of the amount or of the account according the ISO 4217 standard
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
#[serde(transparent)]
pub struct CurrencyCode(pub ::std::string::String);
impl ::std::ops::Deref for CurrencyCode {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<CurrencyCode> for ::std::string::String {
fn from(value: CurrencyCode) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for CurrencyCode {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::fmt::Display for CurrencyCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
impl ::std::str::FromStr for CurrencyCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
/**The last applicable day of execution for a given standing order.
If not given, the standing order is considered as endless.
*/
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(transparent)]
pub struct EndDate(pub ::jiff::civil::Date);
impl ::std::ops::Deref for EndDate {
type Target = ::jiff::civil::Date;
fn deref(&self) -> &::jiff::civil::Date {
&self.0
}
}
impl ::std::convert::From<EndDate> for ::jiff::civil::Date {
fn from(value: EndDate) -> Self {
value.0
}
}
impl ::std::convert::From<::jiff::civil::Date> for EndDate {
fn from(value: ::jiff::civil::Date) -> Self {
Self(value)
}
}
impl ::std::fmt::Display for EndDate {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
impl ::std::str::FromStr for EndDate {
type Err = <::jiff::civil::Date as ::std::str::FromStr>::Err;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.parse()?))
}
}
impl ::std::convert::TryFrom<&str> for EndDate {
type Error = <::jiff::civil::Date as ::std::str::FromStr>::Err;
fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
value.parse()
}
}
impl ::std::convert::TryFrom<String> for EndDate {
type Error = <::jiff::civil::Date as ::std::str::FromStr>::Err;
fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
value.parse()
}
}
///`ErrorResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct ErrorResponse {
///Error code, identical to the http response code
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub code: ::std::option::Option<i64>,
///Detailed explanation of an error
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub detail: ::std::option::Option<::serde_json::Value>,
///Text error code
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<crate::types::ErrorCode>,
///Error message
pub message: ::std::string::String,
}
impl ErrorResponse {
pub fn builder() -> builder::ErrorResponse {
Default::default()
}
}
///`ExchangeRate`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct ExchangeRate {
///Unique and unambiguous reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub contract_identification: ::std::option::Option<::std::string::String>,
///The factor used for conversion of an amount from one currency to another. This reflects the price at which one currency was bought with another currency.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub exchange_rate: ::std::option::Option<::std::string::String>,
///Original amount, in which transaction was initiated. In particular, for cross-currency card transactions, the value represents original value of a purchase or a withdrawal in a currency different from the card's native or default currency.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub instructed_amount: ::std::option::Option<crate::Amount>,
///Specifies the type of exchange rate applied to the transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub rate_type: ::std::option::Option<crate::types::RateType>,
///ISO 4217 code of the currency, in which the rate of exchange is expressed in a currency exchange. In the example 1GBP = xxxCUR, the unit currency is GBP.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub unit_currency: ::std::option::Option<CurrencyCode>,
}
impl ExchangeRate {
pub fn builder() -> builder::ExchangeRate {
Default::default()
}
}
///`FinancialInstitutionIdentification`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct FinancialInstitutionIdentification {
///Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362 "Banking - Banking telecommunication messages - Business identification code (BIC)".
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub bic_fi: ::std::option::Option<::std::string::String>,
///Information used to identify a member within a clearing system.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub clearing_system_member_id: ::std::option::Option<
ClearingSystemMemberIdentification,
>,
///Name of the financial institution
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
}
impl FinancialInstitutionIdentification {
pub fn builder() -> builder::FinancialInstitutionIdentification {
Default::default()
}
}
///`GenericIdentification`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct GenericIdentification {
///An identifier
pub identification: ::std::string::String,
///Entity that assigns the identification. This could be a country code or any organisation name or identifier that can be recognized by both parties
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub issuer: ::std::option::Option<::std::string::String>,
pub scheme_name: crate::types::SchemeName,
}
impl GenericIdentification {
pub fn builder() -> builder::GenericIdentification {
Default::default()
}
}
///`GetApplicationResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct GetApplicationResponse {
///Indication whether the application is active
pub active: bool,
///List of supported countries
pub countries: ::std::vec::Vec<::std::string::String>,
///Application description
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub environment: crate::types::Environment,
///Application key id
pub kid: ::std::string::String,
///Application name
pub name: ::std::string::String,
///List of allowed redirect urls
pub redirect_urls: ::std::vec::Vec<RedirectUrlsItem>,
///List of supported services
pub services: ::std::vec::Vec<crate::types::Service>,
}
impl GetApplicationResponse {
pub fn builder() -> builder::GetApplicationResponse {
Default::default()
}
}
///`GetAspspsResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct GetAspspsResponse {
///List of available ASPSPs and countries
pub aspsps: ::std::vec::Vec<AspspData>,
}
impl GetAspspsResponse {
pub fn builder() -> builder::GetAspspsResponse {
Default::default()
}
}
///`GetPaymentResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct GetPaymentResponse {
pub aspsp: Aspsp,
///Indicates whether the payment has reached the status expected to be final (i.e. if the value of the field is `true`, the payment status is not expected to change on later requests)
pub final_status: bool,
pub payment_details: PaymentRequestResourceDetails,
///Payment ID
pub payment_id: ::uuid::Uuid,
pub payment_type: crate::types::PaymentType,
///Hashed unique identification of a PSU used by the client application. In case PSU ID is not passed by the client application, the hash is calculated based on a random value. The hash also inherits the application ID, so different hashes will be calculated when using the same PSU ID with different applications.
pub psu_id_hash: ::std::string::String,
pub status: crate::types::PaymentStatus,
///Details explaining the payment status, provided when the cause can be determined unambiguously, mainly for rejected payments
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub status_reason_information: ::std::option::Option<StatusReasonInformation>,
}
impl GetPaymentResponse {
pub fn builder() -> builder::GetPaymentResponse {
Default::default()
}
}
///`GetPaymentTransactionResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct GetPaymentTransactionResponse {
///Payment ID
pub payment_id: ::uuid::Uuid,
pub transaction_details: CreditTransferTransactionDetails,
}
impl GetPaymentTransactionResponse {
pub fn builder() -> builder::GetPaymentTransactionResponse {
Default::default()
}
}
///`GetSessionResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct GetSessionResponse {
pub access: Access,
///List of account ids available in the session
pub accounts: ::std::vec::Vec<::uuid::Uuid>,
///Accounts data stored in the session
pub accounts_data: ::std::vec::Vec<SessionAccount>,
pub aspsp: Aspsp,
///Date and time when the session was authorized
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub authorized: ::std::option::Option<::jiff::Timestamp>,
///Date and time when the session was closed
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub closed: ::std::option::Option<::jiff::Timestamp>,
///Date and time when the session was created
pub created: ::jiff::Timestamp,
///Hashed unique identification of a PSU used by the client application. In case PSU ID is not passed by the client application, the hash is calculated based on a random value. The hash also inherits the application ID, so different hashes will be calculated when using the same PSU ID with different applications.
pub psu_id_hash: ::std::string::String,
pub psu_type: crate::types::PsuType,
pub status: crate::types::SessionStatus,
}
impl GetSessionResponse {
pub fn builder() -> builder::GetSessionResponse {
Default::default()
}
}
///`HalBalances`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct HalBalances {
///List of account balances
pub balances: ::std::vec::Vec<BalanceResource>,
}
impl HalBalances {
pub fn builder() -> builder::HalBalances {
Default::default()
}
}
///`HalTransactions`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct HalTransactions {
///Value to retrieve next page of transactions. Null if there are no more pages. Only valid in current session.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub continuation_key: ::std::option::Option<::std::string::String>,
///List of transactions
pub transactions: ::std::vec::Vec<Transaction>,
}
impl HalTransactions {
pub fn builder() -> builder::HalTransactions {
Default::default()
}
}
///Preferred PSU language. Two-letter lowercase language code
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Language(::std::string::String);
impl ::std::ops::Deref for Language {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Language> for ::std::string::String {
fn from(value: Language) -> Self {
value.0
}
}
impl ::std::str::FromStr for Language {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^[a-z]{2}$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z]{2}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Language {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Language {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Language {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///ASPSP logo URL. It is possible to transform (e.g. resize) the logo by adding special suffixes at the end of the URL. For example, `-/resize/500x/`. For full list of possible transformations, please refer to https://uploadcare.com/docs/transformations/image/
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Logo(::std::string::String);
impl ::std::ops::Deref for Logo {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Logo> for ::std::string::String {
fn from(value: Logo) -> Self {
value.0
}
}
impl ::std::str::FromStr for Logo {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 2083usize {
return Err("longer than 2083 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Logo {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Logo {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Logo {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`PartyIdentification`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct PartyIdentification {
///Specifies the contact details associated with a person or an organisation
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub contact_details: ::std::option::Option<ContactDetails>,
///Name by which a party is known and which is usually used to identify that party.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
///Unique identification of an account, a person or an organisation, as assigned by an issuer
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organisation_id: ::std::option::Option<GenericIdentification>,
///Information that locates and identifies a specific address, as defined by postal services
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub postal_address: ::std::option::Option<PostalAddress>,
///Unique identification of an account, a person or an organisation, as assigned by an issuer
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub private_id: ::std::option::Option<GenericIdentification>,
}
impl PartyIdentification {
pub fn builder() -> builder::PartyIdentification {
Default::default()
}
}
///`PaymentIdentification`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct PaymentIdentification {
/**Unique identification assigned by the initiating party to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain.
API: Unique identification shared between the merchant and the PSU
*/
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub end_to_end_id: ::std::option::Option<::std::string::String>,
/**Unique identification as assigned by an instructing party for an instructed party to unambiguously identify the instruction.
API: Unique identification shared between the PISP and the ASPSP
*/
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub instruction_id: ::std::option::Option<::std::string::String>,
}
impl PaymentIdentification {
pub fn builder() -> builder::PaymentIdentification {
Default::default()
}
}
/**Reference assigned by a sending party to unambiguously identify the payment information block within the message.
*/
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
#[serde(transparent)]
pub struct PaymentInformationId(pub ::std::string::String);
impl ::std::ops::Deref for PaymentInformationId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PaymentInformationId> for ::std::string::String {
fn from(value: PaymentInformationId) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for PaymentInformationId {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::fmt::Display for PaymentInformationId {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
impl ::std::str::FromStr for PaymentInformationId {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
///`PaymentRequestResource`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct PaymentRequestResource {
///Specifies which party/parties will bear the charges associated with the processing of the payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub charge_bearer: ::std::option::Option<crate::types::ChargeBearerCode>,
///Payment instructions to be executed towards one or multiple beneficiaries in the payment process. Maximum number of transactions depend on the ASPSP and type of the payment taking into accounts its specificities about payment request handling.
pub credit_transfer_transaction: ::std::vec::Vec<CreditTransferTransaction>,
///Identification of the party sending funds
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor: ::std::option::Option<PartyIdentification>,
///Identification of the account from which funds are sent when the payment is executed. When the debtor account is not provided it is to be chosen by the PSU during payment authorisation flow.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_account: ::std::option::Option<GenericIdentification>,
///Identification of the financial institution where the debtor account is held. To be provided only in case the financial institution can not be unambiguously identified the ASPSP name towards which the payment is initiated.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_agent: ::std::option::Option<FinancialInstitutionIdentification>,
///ISO 4217 code, in which debtor account is held
#[serde(default = "defaults::payment_request_resource_debtor_currency")]
pub debtor_currency: ::std::option::Option<::std::string::String>,
///Reference assigned by a sending party to unambiguously identify the payment information block within the message
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payment_information_id: ::std::option::Option<PaymentInformationId>,
///Set of elements used to further specify the type of payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payment_type_information: ::std::option::Option<PaymentTypeInformation>,
///Underlying reason for the payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub purpose: ::std::option::Option<crate::types::PurposeCode>,
}
impl PaymentRequestResource {
pub fn builder() -> builder::PaymentRequestResource {
Default::default()
}
}
///`PaymentRequestResourceDetails`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct PaymentRequestResourceDetails {
///Specifies which party/parties will bear the charges associated with the processing of the payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub charge_bearer: ::std::option::Option<crate::types::ChargeBearerCode>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub credit_transfer_transaction: ::std::option::Option<
::std::vec::Vec<CreditTransferTransactionDetails>,
>,
///Identification of the party sending funds
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor: ::std::option::Option<PartyIdentification>,
///Identification of the account from which funds are sent when the payment is executed. When the debtor account is not provided it is to be chosen by the PSU during payment authorisation flow.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_account: ::std::option::Option<GenericIdentification>,
///Identification of the financial institution where the debtor account is held. To be provided only in case the financial institution can not be unambiguously identified the ASPSP name towards which the payment is initiated.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_agent: ::std::option::Option<FinancialInstitutionIdentification>,
///ISO 4217 code, in which debtor account is held
#[serde(default = "defaults::payment_request_resource_details_debtor_currency")]
pub debtor_currency: ::std::option::Option<::std::string::String>,
///Reference assigned by a sending party to unambiguously identify the payment information block within the message
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payment_information_id: ::std::option::Option<PaymentInformationId>,
///Set of elements used to further specify the type of payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub payment_type_information: ::std::option::Option<PaymentTypeInformation>,
///Underlying reason for the payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub purpose: ::std::option::Option<crate::types::PurposeCode>,
}
impl ::std::default::Default for PaymentRequestResourceDetails {
fn default() -> Self {
Self {
charge_bearer: Default::default(),
credit_transfer_transaction: Default::default(),
debtor: Default::default(),
debtor_account: Default::default(),
debtor_agent: Default::default(),
debtor_currency: defaults::payment_request_resource_details_debtor_currency(),
payment_information_id: Default::default(),
payment_type_information: Default::default(),
purpose: Default::default(),
}
}
}
impl PaymentRequestResourceDetails {
pub fn builder() -> builder::PaymentRequestResourceDetails {
Default::default()
}
}
///`PaymentTypeInformation`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct PaymentTypeInformation {
///Specifies the high level purpose of the instruction based on a set of pre-defined categories. This is used by the initiating party to provide information concerning the processing of the payment. It is likely to trigger special processing by any of the agents involved in the payment chain.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub category_purpose: ::std::option::Option<crate::types::CategoryPurposeCode>,
///Indicator of the urgency or order of importance that the instructing party would like the instructed party to apply
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub instruction_priority: ::std::option::Option<crate::types::PriorityCode>,
///User community specific instrument
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub local_instrument: ::std::option::Option<::std::string::String>,
///Agreement under which or rules under which the transaction should be processed. Specifies a pre-agreed service or level of service between the parties, as published in an external service level code list
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub service_level: ::std::option::Option<crate::types::ServiceLevelCode>,
}
impl PaymentTypeInformation {
pub fn builder() -> builder::PaymentTypeInformation {
Default::default()
}
}
///`PostalAddress`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct PostalAddress {
///Unstructured address. The two lines must embed zip code and town name
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub address_line: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
///Available address type values
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub address_type: ::std::option::Option<crate::types::AddressType>,
///Number that identifies the position of a building on a street.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub building_number: ::std::option::Option<::std::string::String>,
///Two-letter ISO 3166 code of the country in which a person resides (the place of a person's home). In the case of a company, it is the country from which the affairs of that company are directed.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<::std::string::String>,
///Identifies a subdivision of a country such as state, region, county.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub country_sub_division: ::std::option::Option<::std::string::String>,
///Identification of a division of a large organisation or building.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub department: ::std::option::Option<::std::string::String>,
/**Identifier consisting of a group of letters and/or numbers that is
added to a postal address to assist the sorting of mail.*/
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub post_code: ::std::option::Option<::std::string::String>,
///Name of a street or thoroughfare.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub street_name: ::std::option::Option<::std::string::String>,
///Identification of a sub-division of a large organisation or building.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub sub_department: ::std::option::Option<::std::string::String>,
///Name of a built-up area, with defined boundaries, and a local government.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub town_name: ::std::option::Option<::std::string::String>,
}
impl PostalAddress {
pub fn builder() -> builder::PostalAddress {
Default::default()
}
}
///Comma separated latitude and longitude coordinates without spaces
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PsuGeoLocation(::std::string::String);
impl ::std::ops::Deref for PsuGeoLocation {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PsuGeoLocation> for ::std::string::String {
fn from(value: PsuGeoLocation) -> Self {
value.0
}
}
impl ::std::str::FromStr for PsuGeoLocation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{
::regress::Regex::new("-?\\d{1,2}\\.\\d{1,6},-?\\d{1,3}\\.\\d{1,6}")
.unwrap()
});
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"-?\\d{1,2}\\.\\d{1,6},-?\\d{1,3}\\.\\d{1,6}\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PsuGeoLocation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PsuGeoLocation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PsuGeoLocation {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///URL that PSU will be redirected to after authorization
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RedirectUrl(::std::string::String);
impl ::std::ops::Deref for RedirectUrl {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RedirectUrl> for ::std::string::String {
fn from(value: RedirectUrl) -> Self {
value.0
}
}
impl ::std::str::FromStr for RedirectUrl {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RedirectUrl {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RedirectUrl {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for RedirectUrl {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`RedirectUrlsItem`
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RedirectUrlsItem(::std::string::String);
impl ::std::ops::Deref for RedirectUrlsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RedirectUrlsItem> for ::std::string::String {
fn from(value: RedirectUrlsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for RedirectUrlsItem {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RedirectUrlsItem {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RedirectUrlsItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for RedirectUrlsItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
/**This field specifies the reference assigned by the sender to unambiguously identify the message.
*/
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
#[serde(transparent)]
pub struct ReferenceNumber(pub ::std::string::String);
impl ::std::ops::Deref for ReferenceNumber {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ReferenceNumber> for ::std::string::String {
fn from(value: ReferenceNumber) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for ReferenceNumber {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::fmt::Display for ReferenceNumber {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
impl ::std::str::FromStr for ReferenceNumber {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
///`RegulatoryAuthority`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct RegulatoryAuthority {
///Two-letter ISO 3166 code of the country in which the regulatory authority operates
pub country: ::std::string::String,
///Name of the regulatory authority
pub name: ::std::string::String,
}
impl RegulatoryAuthority {
pub fn builder() -> builder::RegulatoryAuthority {
Default::default()
}
}
///`RegulatoryReporting`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct RegulatoryReporting {
///Regulatory authority to which reporting shall be made
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub authority: ::std::option::Option<RegulatoryAuthority>,
pub details: RegulatoryReportingDetails,
}
impl RegulatoryReporting {
pub fn builder() -> builder::RegulatoryReporting {
Default::default()
}
}
///`RegulatoryReportingCode`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct RegulatoryReportingCode {
///Regulatory authority to which reporting shall be made
pub description: ::std::string::String,
///Value of the code, i.e. what needs to be passed as a code when filling in regulatory reporting details.
pub value: ::std::string::String,
}
impl RegulatoryReportingCode {
pub fn builder() -> builder::RegulatoryReportingCode {
Default::default()
}
}
///`RegulatoryReportingDetails`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct RegulatoryReportingDetails {
///Amount of money to be reported. If not provided the total instructed amount of the transaction is assumed.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub amount: ::std::option::Option<crate::Amount>,
///A code specifying the nature, purpose, and/or reason for the transaction. Codes to be used depend on the regulatory authority, to which they are being reported.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub code: ::std::option::Option<::std::string::String>,
///Additional details that cater for specific domestic regulatory requirements.
pub information: ::std::string::String,
}
impl RegulatoryReportingDetails {
pub fn builder() -> builder::RegulatoryReportingDetails {
Default::default()
}
}
///`RemittanceInformationLineInfo`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct RemittanceInformationLineInfo {
///Maximum length of remittance information line
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub max_length: ::std::option::Option<i64>,
///Minimum length of remittance information line
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub min_length: ::std::option::Option<i64>,
///Specifies a regexp pattern for the remittance information line
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub pattern: ::std::option::Option<::std::string::String>,
}
impl RemittanceInformationLineInfo {
pub fn builder() -> builder::RemittanceInformationLineInfo {
Default::default()
}
}
/**Date at which the initiating party requests the clearing agent to process the payment.
API:
This date can be used in the following cases:
- the single requested execution date for a payment having several instructions. In this case, this field must be set at the payment level.
- the requested execution date for a given instruction within a payment. In this case, this field must be set at each instruction level.
- The first date of execution for a standing order.
When the payment cannot be processed at this date, the ASPSP is allowed to shift the applied execution date to the next possible execution date for non-standing orders.
For standing orders, the [executionRule] parameter helps to compute the execution date to be applied.
*/
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(transparent)]
pub struct RequestedExecutionDate(pub ::jiff::civil::Date);
impl ::std::ops::Deref for RequestedExecutionDate {
type Target = ::jiff::civil::Date;
fn deref(&self) -> &::jiff::civil::Date {
&self.0
}
}
impl ::std::convert::From<RequestedExecutionDate> for ::jiff::civil::Date {
fn from(value: RequestedExecutionDate) -> Self {
value.0
}
}
impl ::std::convert::From<::jiff::civil::Date> for RequestedExecutionDate {
fn from(value: ::jiff::civil::Date) -> Self {
Self(value)
}
}
impl ::std::fmt::Display for RequestedExecutionDate {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
impl ::std::str::FromStr for RequestedExecutionDate {
type Err = <::jiff::civil::Date as ::std::str::FromStr>::Err;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.parse()?))
}
}
impl ::std::convert::TryFrom<&str> for RequestedExecutionDate {
type Error = <::jiff::civil::Date as ::std::str::FromStr>::Err;
fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
value.parse()
}
}
impl ::std::convert::TryFrom<String> for RequestedExecutionDate {
type Error = <::jiff::civil::Date as ::std::str::FromStr>::Err;
fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
value.parse()
}
}
///`ResponsePaymentType`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct ResponsePaymentType {
///List of supported auth methods for this payment type
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_auth_methods: ::std::option::Option<
::std::vec::Vec<::std::string::String>,
>,
///List of supported charge bearer codes
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub charge_bearer_values: ::std::option::Option<
::std::vec::Vec<crate::types::ChargeBearerCode>,
>,
///List of supported creditor account schemas
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor_account_schemas: ::std::option::Option<
::std::vec::Vec<crate::types::SchemeName>,
>,
///States if creditor agent bicFi is required. Create payment body field: `payment_request.credit_transfer_transaction[*].beneficiary.creditor_agent.bic_fi`
#[serde(
default = "defaults::response_payment_type_creditor_agent_bic_fi_required"
)]
pub creditor_agent_bic_fi_required: ::std::option::Option<bool>,
///States if creditor agent clearing system member ID is required. Create payment body field: `payment_request.credit_transfer_transaction[*].beneficiary.creditor_agent.clearing_system_member_id`
#[serde(
default = "defaults::response_payment_type_creditor_agent_clearing_system_member_id_required"
)]
pub creditor_agent_clearing_system_member_id_required: ::std::option::Option<
bool,
>,
///States if creditor country is required. Create payment body field: `payment_request.credit_transfer_transaction[*].beneficiary.creditor.postal_address.country`
#[serde(default = "defaults::response_payment_type_creditor_country_required")]
pub creditor_country_required: ::std::option::Option<bool>,
///States if creditor name is required. Create payment body field: `payment_request.credit_transfer_transaction[*].beneficiary.creditor.postal_address.country`
#[serde(default = "defaults::response_payment_type_creditor_name_required")]
pub creditor_name_required: ::std::option::Option<bool>,
///States if creditor postal address is required. Create payment body field: `payment_request.credit_transfer_transaction[*].beneficiary.creditor.postal_address`
#[serde(
default = "defaults::response_payment_type_creditor_postal_address_required"
)]
pub creditor_postal_address_required: ::std::option::Option<bool>,
///List of supported currencies
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub currencies: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
///States if debtor account is required for payment initiation request. When the debtor account is not provided it is to be chosen by the PSU during payment authorisation flow. Create payment body field: `payment_request.debtor_account`
#[serde(default = "defaults::response_payment_type_debtor_account_required")]
pub debtor_account_required: ::std::option::Option<bool>,
///List of supported debtor account schemas
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_account_schemas: ::std::option::Option<
::std::vec::Vec<crate::types::SchemeName>,
>,
///States if debtor's contact email is required when a payment this type is being initiated. Create payment body field: `payment_request.debtor.contact_details.email_address`
#[serde(
default = "defaults::response_payment_type_debtor_contact_email_required"
)]
pub debtor_contact_email_required: ::std::option::Option<bool>,
///States if debtor's contact phone is required when a payment this type is being initiated. Create payment body field: `payment_request.debtor.contact_details.phone_number`
#[serde(
default = "defaults::response_payment_type_debtor_contact_phone_required"
)]
pub debtor_contact_phone_required: ::std::option::Option<bool>,
///States if debtor currency is required. Create payment body field: `payment_request.debtor_currency`
#[serde(default = "defaults::response_payment_type_debtor_currency_required")]
pub debtor_currency_required: ::std::option::Option<bool>,
///Indicates whether this payment type supports deferred submission for execution. When true, the automatic submission of the payment for execution after PSU authorization can be deferred — the client must call POST /payments/{payment_id}/submit to explicitly submit the payment for execution.
#[serde(
default = "defaults::response_payment_type_deferred_submission_supported"
)]
pub deferred_submission_supported: ::std::option::Option<bool>,
///List of the final successful statuses for the payment type. Please note that when a payment reaches one of the statuses provided in this list, it is not yet guaranteed that the funds will be credited to the creditor's account specified in the payment request. It is up to the application that created the payment to conclude whether the funds are (or will be) received, depending on the actual payment status and other factors.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub final_successful_statuses: ::std::option::Option<
::std::vec::Vec<crate::types::PaymentStatus>,
>,
///Maximum number of transactions per payment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub max_transactions: ::std::option::Option<i64>,
pub payment_type: crate::types::PaymentType,
///List of supported priority codes
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub priority_codes: ::std::option::Option<
::std::vec::Vec<crate::types::PriorityCode>,
>,
pub psu_type: crate::types::PsuType,
///List of reference number schemas supported by a payment method
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reference_number_schemas: ::std::option::Option<
::std::vec::Vec<crate::types::ReferenceNumberScheme>,
>,
///States if reference number can be provided for credit transfer transactions
#[serde(default = "defaults::response_payment_type_reference_number_supported")]
pub reference_number_supported: ::std::option::Option<bool>,
///States if regulatory reporting shall be provided for credit transfer transactions. Create payment body field: `payment_request.credit_transfer_transaction[*].regulatory_reporting.details.code`
#[serde(
default = "defaults::response_payment_type_regulatory_reporting_code_required"
)]
pub regulatory_reporting_code_required: ::std::option::Option<bool>,
///List of supported codes for regulatory reporting details
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub regulatory_reporting_codes: ::std::option::Option<
::std::vec::Vec<RegulatoryReportingCode>,
>,
///Properties of remittance information. Each item of the array correspond to the remittance information line with the same index. When provided, the number of lines in the remittance information should be the same as the length of this array.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub remittance_information_lines: ::std::option::Option<
::std::vec::Vec<RemittanceInformationLineInfo>,
>,
///States if remittance information is required. Create payment body field: `payment_request.credit_transfer_transaction[*].remittance_information`
#[serde(
default = "defaults::response_payment_type_remittance_information_required"
)]
pub remittance_information_required: ::std::option::Option<bool>,
///States if both reference number and remittance information can be provided simultaneously
#[serde(
default = "defaults::response_payment_type_remittance_reference_supported"
)]
pub remittance_reference_supported: ::std::option::Option<bool>,
///Maximum requested execution date interval in the future
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub requested_execution_date_max_period: ::std::option::Option<i64>,
///States if requested execution date supported by a payment method
#[serde(
default = "defaults::response_payment_type_requested_execution_date_supported"
)]
pub requested_execution_date_supported: ::std::option::Option<bool>,
}
impl ResponsePaymentType {
pub fn builder() -> builder::ResponsePaymentType {
Default::default()
}
}
///`SandboxInfo`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct SandboxInfo {
///List of sandbox users which can be used to test sandbox environment
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub users: ::std::option::Option<::std::vec::Vec<SandboxUser>>,
}
impl SandboxInfo {
pub fn builder() -> builder::SandboxInfo {
Default::default()
}
}
///`SandboxUser`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default, PartialEq)]
pub struct SandboxUser {
///One time password
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub otp: ::std::option::Option<::std::string::String>,
///Password
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub password: ::std::option::Option<::std::string::String>,
///Username
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub username: ::std::option::Option<::std::string::String>,
}
impl SandboxUser {
pub fn builder() -> builder::SandboxUser {
Default::default()
}
}
///`SessionAccount`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct SessionAccount {
///Global account identification hash
pub identification_hash: ::std::string::String,
///List of possible account identification hashes. Identification hash is based on the account number. Some accounts may have multiple account numbers (e.g. IBAN and BBAN). This field contains all possible hashes.
pub identification_hashes: ::std::vec::Vec<::std::string::String>,
///Account identificator within the session
pub uid: ::uuid::Uuid,
}
impl SessionAccount {
pub fn builder() -> builder::SessionAccount {
Default::default()
}
}
///`StartAuthorizationRequest`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct StartAuthorizationRequest {
pub access: Access,
pub aspsp: Aspsp,
///Desired authorization method (in case ASPSP integration supports multiple). Supported methods can be obtained from the `auth_methods` field available in ASPSP details.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub auth_method: ::std::option::Option<::std::string::String>,
///PSU credentials (e.g., user and/or company ID). If not provided through the API, they will be requested from the PSU during authorization. Credentials can be supplied only if `auth_method` is specified; otherwise, a `WRONG_REQUEST_PARAMETERS` error will be returned.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub credentials: ::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
///Controls whether user credentials will be autosubmitted (if passed). If set to `false` then credentials form will be prefilled with passed credentials
#[serde(
default = "defaults::start_authorization_request_credentials_autosubmit"
)]
pub credentials_autosubmit: ::std::option::Option<bool>,
///Preferred PSU language. Two-letter lowercase language code
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub language: ::std::option::Option<Language>,
///Unique identification of a PSU used by the client application. It can be used to match sessions of the same user. Although only hashed value is stored, it is recommended to use anonymised identifiers (i.e. digital ID instead of email or social security number). In case the parameter is not passed by the application, random value will be used.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub psu_id: ::std::option::Option<::std::string::String>,
///PSU type used for the authorization flow. This parameter affects how the authorization is performed at the ASPSP (e.g., whether a personal or business login page is shown). A mismatch between the provided psu_type and the PSU's actual account type can result in authorization failures or the inability to see expected accounts. Since the default value depends on the specific connector, it is highly recommended to always provide this value for consistent behavior. If the application cannot determine the PSU type, it should be requested from the end user (PSU).
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub psu_type: ::std::option::Option<crate::types::PsuType>,
///URL that PSU will be redirected to after authorization
pub redirect_url: RedirectUrl,
///Arbitrary string. Same string will be returned in query parameter when redirecting to the URL passed via redirect_url parameter
pub state: ::std::string::String,
}
impl StartAuthorizationRequest {
pub fn builder() -> builder::StartAuthorizationRequest {
Default::default()
}
}
///`StartAuthorizationResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct StartAuthorizationResponse {
///PSU authorisation ID, a value used to identify an authorisation session. Please note that another session ID will used to fetch account data.
pub authorization_id: ::uuid::Uuid,
///Hashed unique identification of a PSU used by the client application. In case PSU ID is not passed by the client application, the hash is calculated based on a random value. The hash also inherits the application ID, so different hashes will be calculated when using the same PSU ID with different applications.
pub psu_id_hash: ::std::string::String,
///URL to redirect PSU to
pub url: Url,
}
impl StartAuthorizationResponse {
pub fn builder() -> builder::StartAuthorizationResponse {
Default::default()
}
}
///`StatusReasonInformation`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct StatusReasonInformation {
///ISO20022 status reason code
pub status_reason_code: ::std::string::String,
///Status reason description
pub status_reason_description: ::std::string::String,
}
impl StatusReasonInformation {
pub fn builder() -> builder::StatusReasonInformation {
Default::default()
}
}
///`SubmitPaymentResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct SubmitPaymentResponse {
///Indicates whether the payment has reached the status expected to be final (i.e. if the value of the field is `true`, the payment status is not expected to change on later requests)
pub final_status: bool,
///Payment ID
pub payment_id: ::uuid::Uuid,
pub status: crate::types::PaymentStatus,
///Additional information about the status reason
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub status_reason_information: ::std::option::Option<StatusReasonInformation>,
}
impl SubmitPaymentResponse {
pub fn builder() -> builder::SubmitPaymentResponse {
Default::default()
}
}
///`SuccessResponse`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct SuccessResponse {
///Returns "OK" in case of successful request
#[serde(default = "defaults::success_response_message")]
pub message: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for SuccessResponse {
fn default() -> Self {
Self {
message: defaults::success_response_message(),
}
}
}
impl SuccessResponse {
pub fn builder() -> builder::SuccessResponse {
Default::default()
}
}
///`Transaction`
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
pub struct Transaction {
///Funds on the account after execution of the transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub balance_after_transaction: ::std::option::Option<crate::Amount>,
///Allows the account servicer to correctly report a transaction, which in its turn will help account holders to perform their cash management and reconciliation operations.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub bank_transaction_code: ::std::option::Option<BankTransactionCode>,
///Booking date of the transaction on the account, i.e. the date at which the transaction has been recorded on books
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub booking_date: ::std::option::Option<::jiff::civil::Date>,
pub credit_debit_indicator: crate::types::CreditDebitIndicator,
///Identification of the party receiving funds in the transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor: ::std::option::Option<PartyIdentification>,
///Identification of the account on which the transaction is credited
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor_account: ::std::option::Option<AccountIdentification>,
///All other creditor account identifiers provided by ASPSPs
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor_account_additional_identification: ::std::option::Option<
::std::vec::Vec<GenericIdentification>,
>,
///Identification of the creditor agent
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub creditor_agent: ::std::option::Option<FinancialInstitutionIdentification>,
///Identification of the party sending funds in the transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor: ::std::option::Option<PartyIdentification>,
///Identification of the account on which the transaction is debited
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_account: ::std::option::Option<AccountIdentification>,
///All other debtor account identifiers provided by ASPSPs
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_account_additional_identification: ::std::option::Option<
::std::vec::Vec<GenericIdentification>,
>,
///Identification of the debtor agent
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub debtor_agent: ::std::option::Option<FinancialInstitutionIdentification>,
///Unique transaction identifier provided by ASPSP. This identifier is both unique and immutable for accounts with the same identification hashes and can be used for matching transactions across multiple PSU authentication sessions. Usually the same identifier is available for transactions in ASPSP's online/mobile interface and is called archive ID or similarly. Please note that this identifier is not globally unique and same entry references are likely to occur for transactions belonging to different accounts.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub entry_reference: ::std::option::Option<::std::string::String>,
///Provides details on the currency exchange rate and contract.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub exchange_rate: ::std::option::Option<ExchangeRate>,
///Category code conform to ISO 18245, related to the type of services or goods the merchant provides for the transaction
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub merchant_category_code: ::std::option::Option<::std::string::String>,
///The internal note made by PSU
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub note: ::std::option::Option<::std::string::String>,
///Credit transfer reference number (also known as the creditor reference or the structured creditor reference). The value is set when it is known that the transaction data contains a reference number (in either ISO 11649 or another format). If the format is known it is provided in the reference_number_schema field.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reference_number: ::std::option::Option<::std::string::String>,
///Indicates what kind of reference number is used.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reference_number_schema: ::std::option::Option<
crate::types::ReferenceNumberScheme,
>,
///Payment details. For credit transfers may contain free text, reference number or both at the same time (in case Extended Remittance Information is supported). When it is known that remittance information contains a reference number (either based on ISO 11649 or a local scheme), the reference number is also available via the `reference_number` field.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub remittance_information: ::std::option::Option<
::std::vec::Vec<::std::string::String>,
>,
pub status: crate::types::TransactionStatus,
pub transaction_amount: crate::Amount,
/**Date used for specific purposes:
- for card transaction: date of the transaction
- for credit transfer: acquiring date of the transaction
- for direct debit: receiving date of the transaction*/
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub transaction_date: ::std::option::Option<::jiff::civil::Date>,
///Identification used for fetching transaction details.This value can not be used to uniquely identify transactions and may change if the list of transactions is retrieved again. Null if fetching transaction details is not supported.
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub transaction_id: ::std::option::Option<::std::string::String>,
///Value date of the transaction on the account, i.e. the date at which funds become available to the account holder (in case of a credit transaction), or cease to be available to the account holder (in case of a debit transaction)
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub value_date: ::std::option::Option<::jiff::civil::Date>,
}
impl Transaction {
pub fn builder() -> builder::Transaction {
Default::default()
}
}
/**Payment details. For credit transfers may contain free text, reference number or both at the same time (in case Extended Remittance Information is supported). When it is known that remittance information contains a reference number (either based on ISO 11649 or a local scheme), the reference number is also available via the `referenceNumber` field of the `Transaction` data structure.
*/
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(transparent)]
pub struct UnstructuredRemittanceInformation(
pub ::std::vec::Vec<::std::string::String>,
);
impl ::std::ops::Deref for UnstructuredRemittanceInformation {
type Target = ::std::vec::Vec<::std::string::String>;
fn deref(&self) -> &::std::vec::Vec<::std::string::String> {
&self.0
}
}
impl ::std::convert::From<UnstructuredRemittanceInformation>
for ::std::vec::Vec<::std::string::String> {
fn from(value: UnstructuredRemittanceInformation) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<::std::string::String>>
for UnstructuredRemittanceInformation {
fn from(value: ::std::vec::Vec<::std::string::String>) -> Self {
Self(value)
}
}
///URL to redirect a PSU to
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Url(::std::string::String);
impl ::std::ops::Deref for Url {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Url> for ::std::string::String {
fn from(value: Url) -> Self {
value.0
}
}
impl ::std::str::FromStr for Url {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 2083usize {
return Err("longer than 2083 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Url {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Url {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Url {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///URL that will receive POST requests notifying about payment changes. See the [webhooks documentation](../webhooks/index.md#payment-status-webhook) for more details
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct WebhookUrl(::std::string::String);
impl ::std::ops::Deref for WebhookUrl {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<WebhookUrl> for ::std::string::String {
fn from(value: WebhookUrl) -> Self {
value.0
}
}
impl ::std::str::FromStr for WebhookUrl {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for WebhookUrl {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for WebhookUrl {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for WebhookUrl {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct Access {
accounts: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::AccountIdentification>>,
::std::string::String,
>,
balances: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
transactions: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
valid_until: ::std::result::Result<::jiff::Timestamp, ::std::string::String>,
}
impl ::std::default::Default for Access {
fn default() -> Self {
Self {
accounts: Ok(Default::default()),
balances: Ok(super::defaults::access_balances()),
transactions: Ok(super::defaults::access_transactions()),
valid_until: Err("no value supplied for valid_until".to_string()),
}
}
}
impl Access {
pub fn accounts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::AccountIdentification>>,
>,
T::Error: ::std::fmt::Display,
{
self.accounts = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for accounts: {e}")
});
self
}
pub fn balances<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.balances = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for balances: {e}")
});
self
}
pub fn transactions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.transactions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for transactions: {e}")
});
self
}
pub fn valid_until<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::jiff::Timestamp>,
T::Error: ::std::fmt::Display,
{
self.valid_until = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for valid_until: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Access> for super::Access {
type Error = super::error::ConversionError;
fn try_from(
value: Access,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
accounts: value.accounts?,
balances: value.balances?,
transactions: value.transactions?,
valid_until: value.valid_until?,
})
}
}
impl ::std::convert::From<super::Access> for Access {
fn from(value: super::Access) -> Self {
Self {
accounts: Ok(value.accounts),
balances: Ok(value.balances),
transactions: Ok(value.transactions),
valid_until: Ok(value.valid_until),
}
}
}
#[derive(Clone, Debug)]
pub struct AccountIdentification {
iban: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
other: ::std::result::Result<
::std::option::Option<super::GenericIdentification>,
::std::string::String,
>,
}
impl ::std::default::Default for AccountIdentification {
fn default() -> Self {
Self {
iban: Ok(Default::default()),
other: Ok(Default::default()),
}
}
}
impl AccountIdentification {
pub fn iban<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.iban = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for iban: {e}")
});
self
}
pub fn other<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::GenericIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.other = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for other: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AccountIdentification>
for super::AccountIdentification {
type Error = super::error::ConversionError;
fn try_from(
value: AccountIdentification,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
iban: value.iban?,
other: value.other?,
})
}
}
impl ::std::convert::From<super::AccountIdentification>
for AccountIdentification {
fn from(value: super::AccountIdentification) -> Self {
Self {
iban: Ok(value.iban),
other: Ok(value.other),
}
}
}
#[derive(Clone, Debug)]
pub struct AccountResource {
account_id: ::std::result::Result<
::std::option::Option<super::AccountIdentification>,
::std::string::String,
>,
account_servicer: ::std::result::Result<
::std::option::Option<super::FinancialInstitutionIdentification>,
::std::string::String,
>,
all_account_ids: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::GenericIdentification>>,
::std::string::String,
>,
cash_account_type: ::std::result::Result<
crate::types::CashAccountType,
::std::string::String,
>,
credit_limit: ::std::result::Result<
::std::option::Option<crate::Amount>,
::std::string::String,
>,
currency: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
details: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
identification_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
identification_hashes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
legal_age: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
postal_address: ::std::result::Result<
::std::option::Option<super::PostalAddress>,
::std::string::String,
>,
product: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
psu_status: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
uid: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
usage: ::std::result::Result<
::std::option::Option<crate::types::Usage>,
::std::string::String,
>,
}
impl ::std::default::Default for AccountResource {
fn default() -> Self {
Self {
account_id: Ok(Default::default()),
account_servicer: Ok(Default::default()),
all_account_ids: Ok(Default::default()),
cash_account_type: Err(
"no value supplied for cash_account_type".to_string(),
),
credit_limit: Ok(Default::default()),
currency: Err("no value supplied for currency".to_string()),
details: Ok(Default::default()),
identification_hash: Err(
"no value supplied for identification_hash".to_string(),
),
identification_hashes: Err(
"no value supplied for identification_hashes".to_string(),
),
legal_age: Ok(Default::default()),
name: Ok(Default::default()),
postal_address: Ok(Default::default()),
product: Ok(Default::default()),
psu_status: Ok(Default::default()),
uid: Ok(Default::default()),
usage: Ok(Default::default()),
}
}
}
impl AccountResource {
pub fn account_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::AccountIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.account_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for account_id: {e}")
});
self
}
pub fn account_servicer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::FinancialInstitutionIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.account_servicer = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for account_servicer: {e}"
)
});
self
}
pub fn all_account_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::GenericIdentification>>,
>,
T::Error: ::std::fmt::Display,
{
self.all_account_ids = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for all_account_ids: {e}"
)
});
self
}
pub fn cash_account_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::CashAccountType>,
T::Error: ::std::fmt::Display,
{
self.cash_account_type = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cash_account_type: {e}"
)
});
self
}
pub fn credit_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<crate::Amount>>,
T::Error: ::std::fmt::Display,
{
self.credit_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for credit_limit: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for details: {e}")
});
self
}
pub fn identification_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.identification_hash = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for identification_hash: {e}"
)
});
self
}
pub fn identification_hashes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.identification_hashes = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for identification_hashes: {e}"
)
});
self
}
pub fn legal_age<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.legal_age = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legal_age: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn postal_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::PostalAddress>>,
T::Error: ::std::fmt::Display,
{
self.postal_address = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for postal_address: {e}"
)
});
self
}
pub fn product<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.product = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product: {e}")
});
self
}
pub fn psu_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.psu_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_status: {e}")
});
self
}
pub fn uid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.uid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for uid: {e}")
});
self
}
pub fn usage<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<crate::types::Usage>>,
T::Error: ::std::fmt::Display,
{
self.usage = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for usage: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AccountResource> for super::AccountResource {
type Error = super::error::ConversionError;
fn try_from(
value: AccountResource,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
account_id: value.account_id?,
account_servicer: value.account_servicer?,
all_account_ids: value.all_account_ids?,
cash_account_type: value.cash_account_type?,
credit_limit: value.credit_limit?,
currency: value.currency?,
details: value.details?,
identification_hash: value.identification_hash?,
identification_hashes: value.identification_hashes?,
legal_age: value.legal_age?,
name: value.name?,
postal_address: value.postal_address?,
product: value.product?,
psu_status: value.psu_status?,
uid: value.uid?,
usage: value.usage?,
})
}
}
impl ::std::convert::From<super::AccountResource> for AccountResource {
fn from(value: super::AccountResource) -> Self {
Self {
account_id: Ok(value.account_id),
account_servicer: Ok(value.account_servicer),
all_account_ids: Ok(value.all_account_ids),
cash_account_type: Ok(value.cash_account_type),
credit_limit: Ok(value.credit_limit),
currency: Ok(value.currency),
details: Ok(value.details),
identification_hash: Ok(value.identification_hash),
identification_hashes: Ok(value.identification_hashes),
legal_age: Ok(value.legal_age),
name: Ok(value.name),
postal_address: Ok(value.postal_address),
product: Ok(value.product),
psu_status: Ok(value.psu_status),
uid: Ok(value.uid),
usage: Ok(value.usage),
}
}
}
#[derive(Clone, Debug)]
pub struct Aspsp {
country: ::std::result::Result<::std::string::String, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Aspsp {
fn default() -> Self {
Self {
country: Err("no value supplied for country".to_string()),
name: Err("no value supplied for name".to_string()),
}
}
}
impl Aspsp {
pub fn country<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.country = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for country: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Aspsp> for super::Aspsp {
type Error = super::error::ConversionError;
fn try_from(
value: Aspsp,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
country: value.country?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::Aspsp> for Aspsp {
fn from(value: super::Aspsp) -> Self {
Self {
country: Ok(value.country),
name: Ok(value.name),
}
}
}
#[derive(Clone, Debug)]
pub struct AspspData {
auth_methods: ::std::result::Result<
::std::vec::Vec<super::AuthMethod>,
::std::string::String,
>,
beta: ::std::result::Result<bool, ::std::string::String>,
bic: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
country: ::std::result::Result<::std::string::String, ::std::string::String>,
group: ::std::result::Result<
::std::option::Option<super::AspspGroup>,
::std::string::String,
>,
logo: ::std::result::Result<super::Logo, ::std::string::String>,
maximum_consent_validity: ::std::result::Result<i64, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
payments: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::ResponsePaymentType>>,
::std::string::String,
>,
psu_types: ::std::result::Result<
::std::vec::Vec<crate::types::PsuType>,
::std::string::String,
>,
required_psu_headers: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
sandbox: ::std::result::Result<
::std::option::Option<super::SandboxInfo>,
::std::string::String,
>,
}
impl ::std::default::Default for AspspData {
fn default() -> Self {
Self {
auth_methods: Err("no value supplied for auth_methods".to_string()),
beta: Err("no value supplied for beta".to_string()),
bic: Ok(Default::default()),
country: Err("no value supplied for country".to_string()),
group: Ok(Default::default()),
logo: Err("no value supplied for logo".to_string()),
maximum_consent_validity: Err(
"no value supplied for maximum_consent_validity".to_string(),
),
name: Err("no value supplied for name".to_string()),
payments: Ok(Default::default()),
psu_types: Err("no value supplied for psu_types".to_string()),
required_psu_headers: Ok(Default::default()),
sandbox: Ok(Default::default()),
}
}
}
impl AspspData {
pub fn auth_methods<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::AuthMethod>>,
T::Error: ::std::fmt::Display,
{
self.auth_methods = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for auth_methods: {e}")
});
self
}
pub fn beta<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.beta = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for beta: {e}")
});
self
}
pub fn bic<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.bic = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for bic: {e}")
});
self
}
pub fn country<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.country = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for country: {e}")
});
self
}
pub fn group<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AspspGroup>>,
T::Error: ::std::fmt::Display,
{
self.group = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for group: {e}")
});
self
}
pub fn logo<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Logo>,
T::Error: ::std::fmt::Display,
{
self.logo = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for logo: {e}")
});
self
}
pub fn maximum_consent_validity<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.maximum_consent_validity = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for maximum_consent_validity: {e}"
)
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn payments<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::ResponsePaymentType>>,
>,
T::Error: ::std::fmt::Display,
{
self.payments = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payments: {e}")
});
self
}
pub fn psu_types<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<crate::types::PsuType>>,
T::Error: ::std::fmt::Display,
{
self.psu_types = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_types: {e}")
});
self
}
pub fn required_psu_headers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.required_psu_headers = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for required_psu_headers: {e}"
)
});
self
}
pub fn sandbox<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::SandboxInfo>>,
T::Error: ::std::fmt::Display,
{
self.sandbox = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for sandbox: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AspspData> for super::AspspData {
type Error = super::error::ConversionError;
fn try_from(
value: AspspData,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
auth_methods: value.auth_methods?,
beta: value.beta?,
bic: value.bic?,
country: value.country?,
group: value.group?,
logo: value.logo?,
maximum_consent_validity: value.maximum_consent_validity?,
name: value.name?,
payments: value.payments?,
psu_types: value.psu_types?,
required_psu_headers: value.required_psu_headers?,
sandbox: value.sandbox?,
})
}
}
impl ::std::convert::From<super::AspspData> for AspspData {
fn from(value: super::AspspData) -> Self {
Self {
auth_methods: Ok(value.auth_methods),
beta: Ok(value.beta),
bic: Ok(value.bic),
country: Ok(value.country),
group: Ok(value.group),
logo: Ok(value.logo),
maximum_consent_validity: Ok(value.maximum_consent_validity),
name: Ok(value.name),
payments: Ok(value.payments),
psu_types: Ok(value.psu_types),
required_psu_headers: Ok(value.required_psu_headers),
sandbox: Ok(value.sandbox),
}
}
}
#[derive(Clone, Debug)]
pub struct AspspGroup {
logo: ::std::result::Result<super::Logo, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for AspspGroup {
fn default() -> Self {
Self {
logo: Err("no value supplied for logo".to_string()),
name: Err("no value supplied for name".to_string()),
}
}
}
impl AspspGroup {
pub fn logo<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Logo>,
T::Error: ::std::fmt::Display,
{
self.logo = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for logo: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AspspGroup> for super::AspspGroup {
type Error = super::error::ConversionError;
fn try_from(
value: AspspGroup,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
logo: value.logo?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::AspspGroup> for AspspGroup {
fn from(value: super::AspspGroup) -> Self {
Self {
logo: Ok(value.logo),
name: Ok(value.name),
}
}
}
#[derive(Clone, Debug)]
pub struct AuthMethod {
approach: ::std::result::Result<
crate::types::AuthenticationApproach,
::std::string::String,
>,
credentials: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::Credential>>,
::std::string::String,
>,
hidden_method: ::std::result::Result<bool, ::std::string::String>,
name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
psu_type: ::std::result::Result<
crate::types::PsuType,
::std::string::String,
>,
title: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for AuthMethod {
fn default() -> Self {
Self {
approach: Err("no value supplied for approach".to_string()),
credentials: Ok(Default::default()),
hidden_method: Err(
"no value supplied for hidden_method".to_string(),
),
name: Ok(Default::default()),
psu_type: Err("no value supplied for psu_type".to_string()),
title: Ok(Default::default()),
}
}
}
impl AuthMethod {
pub fn approach<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::AuthenticationApproach>,
T::Error: ::std::fmt::Display,
{
self.approach = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for approach: {e}")
});
self
}
pub fn credentials<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::Credential>>,
>,
T::Error: ::std::fmt::Display,
{
self.credentials = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for credentials: {e}")
});
self
}
pub fn hidden_method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.hidden_method = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for hidden_method: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn psu_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PsuType>,
T::Error: ::std::fmt::Display,
{
self.psu_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_type: {e}")
});
self
}
pub fn title<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.title = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for title: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AuthMethod> for super::AuthMethod {
type Error = super::error::ConversionError;
fn try_from(
value: AuthMethod,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
approach: value.approach?,
credentials: value.credentials?,
hidden_method: value.hidden_method?,
name: value.name?,
psu_type: value.psu_type?,
title: value.title?,
})
}
}
impl ::std::convert::From<super::AuthMethod> for AuthMethod {
fn from(value: super::AuthMethod) -> Self {
Self {
approach: Ok(value.approach),
credentials: Ok(value.credentials),
hidden_method: Ok(value.hidden_method),
name: Ok(value.name),
psu_type: Ok(value.psu_type),
title: Ok(value.title),
}
}
}
#[derive(Clone, Debug)]
pub struct AuthorizeSessionRequest {
code: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for AuthorizeSessionRequest {
fn default() -> Self {
Self {
code: Err("no value supplied for code".to_string()),
}
}
}
impl AuthorizeSessionRequest {
pub fn code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for code: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AuthorizeSessionRequest>
for super::AuthorizeSessionRequest {
type Error = super::error::ConversionError;
fn try_from(
value: AuthorizeSessionRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { code: value.code? })
}
}
impl ::std::convert::From<super::AuthorizeSessionRequest>
for AuthorizeSessionRequest {
fn from(value: super::AuthorizeSessionRequest) -> Self {
Self { code: Ok(value.code) }
}
}
#[derive(Clone, Debug)]
pub struct AuthorizeSessionResponse {
access: ::std::result::Result<super::Access, ::std::string::String>,
accounts: ::std::result::Result<
::std::vec::Vec<super::AccountResource>,
::std::string::String,
>,
aspsp: ::std::result::Result<super::Aspsp, ::std::string::String>,
psu_type: ::std::result::Result<
crate::types::PsuType,
::std::string::String,
>,
session_id: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for AuthorizeSessionResponse {
fn default() -> Self {
Self {
access: Err("no value supplied for access".to_string()),
accounts: Err("no value supplied for accounts".to_string()),
aspsp: Err("no value supplied for aspsp".to_string()),
psu_type: Err("no value supplied for psu_type".to_string()),
session_id: Err("no value supplied for session_id".to_string()),
}
}
}
impl AuthorizeSessionResponse {
pub fn access<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Access>,
T::Error: ::std::fmt::Display,
{
self.access = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for access: {e}")
});
self
}
pub fn accounts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::AccountResource>>,
T::Error: ::std::fmt::Display,
{
self.accounts = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for accounts: {e}")
});
self
}
pub fn aspsp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Aspsp>,
T::Error: ::std::fmt::Display,
{
self.aspsp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aspsp: {e}")
});
self
}
pub fn psu_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PsuType>,
T::Error: ::std::fmt::Display,
{
self.psu_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_type: {e}")
});
self
}
pub fn session_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.session_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for session_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AuthorizeSessionResponse>
for super::AuthorizeSessionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: AuthorizeSessionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
access: value.access?,
accounts: value.accounts?,
aspsp: value.aspsp?,
psu_type: value.psu_type?,
session_id: value.session_id?,
})
}
}
impl ::std::convert::From<super::AuthorizeSessionResponse>
for AuthorizeSessionResponse {
fn from(value: super::AuthorizeSessionResponse) -> Self {
Self {
access: Ok(value.access),
accounts: Ok(value.accounts),
aspsp: Ok(value.aspsp),
psu_type: Ok(value.psu_type),
session_id: Ok(value.session_id),
}
}
}
#[derive(Clone, Debug)]
pub struct BalanceResource {
balance_amount: ::std::result::Result<crate::Amount, ::std::string::String>,
balance_type: ::std::result::Result<
crate::types::BalanceStatus,
::std::string::String,
>,
last_change_date_time: ::std::result::Result<
::std::option::Option<::jiff::Timestamp>,
::std::string::String,
>,
last_committed_transaction: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
reference_date: ::std::result::Result<
::std::option::Option<::jiff::civil::Date>,
::std::string::String,
>,
}
impl ::std::default::Default for BalanceResource {
fn default() -> Self {
Self {
balance_amount: Err(
"no value supplied for balance_amount".to_string(),
),
balance_type: Err("no value supplied for balance_type".to_string()),
last_change_date_time: Ok(Default::default()),
last_committed_transaction: Ok(Default::default()),
name: Err("no value supplied for name".to_string()),
reference_date: Ok(Default::default()),
}
}
}
impl BalanceResource {
pub fn balance_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::Amount>,
T::Error: ::std::fmt::Display,
{
self.balance_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for balance_amount: {e}"
)
});
self
}
pub fn balance_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::BalanceStatus>,
T::Error: ::std::fmt::Display,
{
self.balance_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for balance_type: {e}")
});
self
}
pub fn last_change_date_time<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::Timestamp>>,
T::Error: ::std::fmt::Display,
{
self.last_change_date_time = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_change_date_time: {e}"
)
});
self
}
pub fn last_committed_transaction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.last_committed_transaction = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_committed_transaction: {e}"
)
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn reference_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::civil::Date>>,
T::Error: ::std::fmt::Display,
{
self.reference_date = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_date: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<BalanceResource> for super::BalanceResource {
type Error = super::error::ConversionError;
fn try_from(
value: BalanceResource,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
balance_amount: value.balance_amount?,
balance_type: value.balance_type?,
last_change_date_time: value.last_change_date_time?,
last_committed_transaction: value.last_committed_transaction?,
name: value.name?,
reference_date: value.reference_date?,
})
}
}
impl ::std::convert::From<super::BalanceResource> for BalanceResource {
fn from(value: super::BalanceResource) -> Self {
Self {
balance_amount: Ok(value.balance_amount),
balance_type: Ok(value.balance_type),
last_change_date_time: Ok(value.last_change_date_time),
last_committed_transaction: Ok(value.last_committed_transaction),
name: Ok(value.name),
reference_date: Ok(value.reference_date),
}
}
}
#[derive(Clone, Debug)]
pub struct BankTransactionCode {
code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
description: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
sub_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for BankTransactionCode {
fn default() -> Self {
Self {
code: Ok(Default::default()),
description: Ok(Default::default()),
sub_code: Ok(Default::default()),
}
}
}
impl BankTransactionCode {
pub fn code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for code: {e}")
});
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn sub_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.sub_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for sub_code: {e}")
});
self
}
}
impl ::std::convert::TryFrom<BankTransactionCode>
for super::BankTransactionCode {
type Error = super::error::ConversionError;
fn try_from(
value: BankTransactionCode,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
code: value.code?,
description: value.description?,
sub_code: value.sub_code?,
})
}
}
impl ::std::convert::From<super::BankTransactionCode> for BankTransactionCode {
fn from(value: super::BankTransactionCode) -> Self {
Self {
code: Ok(value.code),
description: Ok(value.description),
sub_code: Ok(value.sub_code),
}
}
}
#[derive(Clone, Debug)]
pub struct Beneficiary {
creditor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
creditor_account: ::std::result::Result<
super::GenericIdentification,
::std::string::String,
>,
creditor_agent: ::std::result::Result<
::std::option::Option<super::FinancialInstitutionIdentification>,
::std::string::String,
>,
creditor_currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Beneficiary {
fn default() -> Self {
Self {
creditor: Ok(Default::default()),
creditor_account: Err(
"no value supplied for creditor_account".to_string(),
),
creditor_agent: Ok(Default::default()),
creditor_currency: Ok(Default::default()),
}
}
}
impl Beneficiary {
pub fn creditor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for creditor: {e}")
});
self
}
pub fn creditor_account<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::GenericIdentification>,
T::Error: ::std::fmt::Display,
{
self.creditor_account = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_account: {e}"
)
});
self
}
pub fn creditor_agent<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::FinancialInstitutionIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor_agent = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_agent: {e}"
)
});
self
}
pub fn creditor_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.creditor_currency = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_currency: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<Beneficiary> for super::Beneficiary {
type Error = super::error::ConversionError;
fn try_from(
value: Beneficiary,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
creditor: value.creditor?,
creditor_account: value.creditor_account?,
creditor_agent: value.creditor_agent?,
creditor_currency: value.creditor_currency?,
})
}
}
impl ::std::convert::From<super::Beneficiary> for Beneficiary {
fn from(value: super::Beneficiary) -> Self {
Self {
creditor: Ok(value.creditor),
creditor_account: Ok(value.creditor_account),
creditor_agent: Ok(value.creditor_agent),
creditor_currency: Ok(value.creditor_currency),
}
}
}
#[derive(Clone, Debug)]
pub struct ClearingSystemMemberIdentification {
clearing_system_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
member_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for ClearingSystemMemberIdentification {
fn default() -> Self {
Self {
clearing_system_id: Ok(Default::default()),
member_id: Ok(Default::default()),
}
}
}
impl ClearingSystemMemberIdentification {
pub fn clearing_system_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.clearing_system_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for clearing_system_id: {e}"
)
});
self
}
pub fn member_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.member_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for member_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ClearingSystemMemberIdentification>
for super::ClearingSystemMemberIdentification {
type Error = super::error::ConversionError;
fn try_from(
value: ClearingSystemMemberIdentification,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
clearing_system_id: value.clearing_system_id?,
member_id: value.member_id?,
})
}
}
impl ::std::convert::From<super::ClearingSystemMemberIdentification>
for ClearingSystemMemberIdentification {
fn from(value: super::ClearingSystemMemberIdentification) -> Self {
Self {
clearing_system_id: Ok(value.clearing_system_id),
member_id: Ok(value.member_id),
}
}
}
#[derive(Clone, Debug)]
pub struct ContactDetails {
email_address: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
phone_number: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for ContactDetails {
fn default() -> Self {
Self {
email_address: Ok(Default::default()),
phone_number: Ok(Default::default()),
}
}
}
impl ContactDetails {
pub fn email_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.email_address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for email_address: {e}")
});
self
}
pub fn phone_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.phone_number = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for phone_number: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ContactDetails> for super::ContactDetails {
type Error = super::error::ConversionError;
fn try_from(
value: ContactDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
email_address: value.email_address?,
phone_number: value.phone_number?,
})
}
}
impl ::std::convert::From<super::ContactDetails> for ContactDetails {
fn from(value: super::ContactDetails) -> Self {
Self {
email_address: Ok(value.email_address),
phone_number: Ok(value.phone_number),
}
}
}
#[derive(Clone, Debug)]
pub struct CreatePaymentRequest {
aspsp: ::std::result::Result<super::Aspsp, ::std::string::String>,
auth_method: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
credentials: ::std::result::Result<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
::std::string::String,
>,
defer_submission: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
language: ::std::result::Result<
::std::option::Option<super::Language>,
::std::string::String,
>,
payment_request: ::std::result::Result<
super::PaymentRequestResource,
::std::string::String,
>,
payment_type: ::std::result::Result<
crate::types::PaymentType,
::std::string::String,
>,
psu_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
psu_type: ::std::result::Result<
crate::types::PsuType,
::std::string::String,
>,
redirect_url: ::std::result::Result<
super::RedirectUrl,
::std::string::String,
>,
state: ::std::result::Result<::std::string::String, ::std::string::String>,
webhook_url: ::std::result::Result<
::std::option::Option<super::WebhookUrl>,
::std::string::String,
>,
}
impl ::std::default::Default for CreatePaymentRequest {
fn default() -> Self {
Self {
aspsp: Err("no value supplied for aspsp".to_string()),
auth_method: Ok(Default::default()),
credentials: Ok(Default::default()),
defer_submission: Ok(
super::defaults::create_payment_request_defer_submission(),
),
language: Ok(Default::default()),
payment_request: Err(
"no value supplied for payment_request".to_string(),
),
payment_type: Err("no value supplied for payment_type".to_string()),
psu_id: Ok(Default::default()),
psu_type: Err("no value supplied for psu_type".to_string()),
redirect_url: Err("no value supplied for redirect_url".to_string()),
state: Err("no value supplied for state".to_string()),
webhook_url: Ok(Default::default()),
}
}
}
impl CreatePaymentRequest {
pub fn aspsp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Aspsp>,
T::Error: ::std::fmt::Display,
{
self.aspsp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aspsp: {e}")
});
self
}
pub fn auth_method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.auth_method = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for auth_method: {e}")
});
self
}
pub fn credentials<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.credentials = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for credentials: {e}")
});
self
}
pub fn defer_submission<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.defer_submission = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for defer_submission: {e}"
)
});
self
}
pub fn language<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Language>>,
T::Error: ::std::fmt::Display,
{
self.language = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for language: {e}")
});
self
}
pub fn payment_request<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PaymentRequestResource>,
T::Error: ::std::fmt::Display,
{
self.payment_request = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for payment_request: {e}"
)
});
self
}
pub fn payment_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PaymentType>,
T::Error: ::std::fmt::Display,
{
self.payment_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_type: {e}")
});
self
}
pub fn psu_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.psu_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_id: {e}")
});
self
}
pub fn psu_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PsuType>,
T::Error: ::std::fmt::Display,
{
self.psu_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_type: {e}")
});
self
}
pub fn redirect_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RedirectUrl>,
T::Error: ::std::fmt::Display,
{
self.redirect_url = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for redirect_url: {e}")
});
self
}
pub fn state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.state = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for state: {e}")
});
self
}
pub fn webhook_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::WebhookUrl>>,
T::Error: ::std::fmt::Display,
{
self.webhook_url = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for webhook_url: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CreatePaymentRequest>
for super::CreatePaymentRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CreatePaymentRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
aspsp: value.aspsp?,
auth_method: value.auth_method?,
credentials: value.credentials?,
defer_submission: value.defer_submission?,
language: value.language?,
payment_request: value.payment_request?,
payment_type: value.payment_type?,
psu_id: value.psu_id?,
psu_type: value.psu_type?,
redirect_url: value.redirect_url?,
state: value.state?,
webhook_url: value.webhook_url?,
})
}
}
impl ::std::convert::From<super::CreatePaymentRequest> for CreatePaymentRequest {
fn from(value: super::CreatePaymentRequest) -> Self {
Self {
aspsp: Ok(value.aspsp),
auth_method: Ok(value.auth_method),
credentials: Ok(value.credentials),
defer_submission: Ok(value.defer_submission),
language: Ok(value.language),
payment_request: Ok(value.payment_request),
payment_type: Ok(value.payment_type),
psu_id: Ok(value.psu_id),
psu_type: Ok(value.psu_type),
redirect_url: Ok(value.redirect_url),
state: Ok(value.state),
webhook_url: Ok(value.webhook_url),
}
}
}
#[derive(Clone, Debug)]
pub struct CreatePaymentResponse {
payment_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
psu_id_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
status: ::std::result::Result<
crate::types::PaymentStatus,
::std::string::String,
>,
url: ::std::result::Result<super::Url, ::std::string::String>,
}
impl ::std::default::Default for CreatePaymentResponse {
fn default() -> Self {
Self {
payment_id: Err("no value supplied for payment_id".to_string()),
psu_id_hash: Err("no value supplied for psu_id_hash".to_string()),
status: Err("no value supplied for status".to_string()),
url: Err("no value supplied for url".to_string()),
}
}
}
impl CreatePaymentResponse {
pub fn payment_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.payment_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_id: {e}")
});
self
}
pub fn psu_id_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.psu_id_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_id_hash: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PaymentStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for status: {e}")
});
self
}
pub fn url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Url>,
T::Error: ::std::fmt::Display,
{
self.url = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for url: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CreatePaymentResponse>
for super::CreatePaymentResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CreatePaymentResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
payment_id: value.payment_id?,
psu_id_hash: value.psu_id_hash?,
status: value.status?,
url: value.url?,
})
}
}
impl ::std::convert::From<super::CreatePaymentResponse>
for CreatePaymentResponse {
fn from(value: super::CreatePaymentResponse) -> Self {
Self {
payment_id: Ok(value.payment_id),
psu_id_hash: Ok(value.psu_id_hash),
status: Ok(value.status),
url: Ok(value.url),
}
}
}
#[derive(Clone, Debug)]
pub struct Credential {
description: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
required: ::std::result::Result<bool, ::std::string::String>,
template: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
title: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Credential {
fn default() -> Self {
Self {
description: Ok(Default::default()),
name: Err("no value supplied for name".to_string()),
required: Err("no value supplied for required".to_string()),
template: Ok(Default::default()),
title: Err("no value supplied for title".to_string()),
}
}
}
impl Credential {
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.required = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for required: {e}")
});
self
}
pub fn template<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.template = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for template: {e}")
});
self
}
pub fn title<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.title = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for title: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Credential> for super::Credential {
type Error = super::error::ConversionError;
fn try_from(
value: Credential,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
name: value.name?,
required: value.required?,
template: value.template?,
title: value.title?,
})
}
}
impl ::std::convert::From<super::Credential> for Credential {
fn from(value: super::Credential) -> Self {
Self {
description: Ok(value.description),
name: Ok(value.name),
required: Ok(value.required),
template: Ok(value.template),
title: Ok(value.title),
}
}
}
#[derive(Clone, Debug)]
pub struct CreditTransferTransaction {
beneficiary: ::std::result::Result<
super::Beneficiary,
::std::string::String,
>,
end_date: ::std::result::Result<
::std::option::Option<super::EndDate>,
::std::string::String,
>,
execution_rule: ::std::result::Result<
::std::option::Option<crate::types::ExecutionRule>,
::std::string::String,
>,
frequency: ::std::result::Result<
::std::option::Option<crate::types::FrequencyCode>,
::std::string::String,
>,
instructed_amount: ::std::result::Result<
crate::Amount,
::std::string::String,
>,
payment_id: ::std::result::Result<
::std::option::Option<super::PaymentIdentification>,
::std::string::String,
>,
reference_number: ::std::result::Result<
::std::option::Option<super::ReferenceNumber>,
::std::string::String,
>,
regulatory_reporting: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::RegulatoryReporting>>,
::std::string::String,
>,
remittance_information: ::std::result::Result<
::std::option::Option<super::UnstructuredRemittanceInformation>,
::std::string::String,
>,
requested_execution_date: ::std::result::Result<
::std::option::Option<super::RequestedExecutionDate>,
::std::string::String,
>,
ultimate_creditor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
ultimate_debtor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
}
impl ::std::default::Default for CreditTransferTransaction {
fn default() -> Self {
Self {
beneficiary: Err("no value supplied for beneficiary".to_string()),
end_date: Ok(Default::default()),
execution_rule: Ok(Default::default()),
frequency: Ok(Default::default()),
instructed_amount: Err(
"no value supplied for instructed_amount".to_string(),
),
payment_id: Ok(Default::default()),
reference_number: Ok(Default::default()),
regulatory_reporting: Ok(Default::default()),
remittance_information: Ok(Default::default()),
requested_execution_date: Ok(Default::default()),
ultimate_creditor: Ok(Default::default()),
ultimate_debtor: Ok(Default::default()),
}
}
}
impl CreditTransferTransaction {
pub fn beneficiary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Beneficiary>,
T::Error: ::std::fmt::Display,
{
self.beneficiary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for beneficiary: {e}")
});
self
}
pub fn end_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::EndDate>>,
T::Error: ::std::fmt::Display,
{
self.end_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_date: {e}")
});
self
}
pub fn execution_rule<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ExecutionRule>,
>,
T::Error: ::std::fmt::Display,
{
self.execution_rule = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for execution_rule: {e}"
)
});
self
}
pub fn frequency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::FrequencyCode>,
>,
T::Error: ::std::fmt::Display,
{
self.frequency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for frequency: {e}")
});
self
}
pub fn instructed_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::Amount>,
T::Error: ::std::fmt::Display,
{
self.instructed_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for instructed_amount: {e}"
)
});
self
}
pub fn payment_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PaymentIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.payment_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_id: {e}")
});
self
}
pub fn reference_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ReferenceNumber>,
>,
T::Error: ::std::fmt::Display,
{
self.reference_number = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_number: {e}"
)
});
self
}
pub fn regulatory_reporting<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::RegulatoryReporting>>,
>,
T::Error: ::std::fmt::Display,
{
self.regulatory_reporting = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for regulatory_reporting: {e}"
)
});
self
}
pub fn remittance_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::UnstructuredRemittanceInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.remittance_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remittance_information: {e}"
)
});
self
}
pub fn requested_execution_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::RequestedExecutionDate>,
>,
T::Error: ::std::fmt::Display,
{
self.requested_execution_date = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for requested_execution_date: {e}"
)
});
self
}
pub fn ultimate_creditor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.ultimate_creditor = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for ultimate_creditor: {e}"
)
});
self
}
pub fn ultimate_debtor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.ultimate_debtor = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for ultimate_debtor: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<CreditTransferTransaction>
for super::CreditTransferTransaction {
type Error = super::error::ConversionError;
fn try_from(
value: CreditTransferTransaction,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
beneficiary: value.beneficiary?,
end_date: value.end_date?,
execution_rule: value.execution_rule?,
frequency: value.frequency?,
instructed_amount: value.instructed_amount?,
payment_id: value.payment_id?,
reference_number: value.reference_number?,
regulatory_reporting: value.regulatory_reporting?,
remittance_information: value.remittance_information?,
requested_execution_date: value.requested_execution_date?,
ultimate_creditor: value.ultimate_creditor?,
ultimate_debtor: value.ultimate_debtor?,
})
}
}
impl ::std::convert::From<super::CreditTransferTransaction>
for CreditTransferTransaction {
fn from(value: super::CreditTransferTransaction) -> Self {
Self {
beneficiary: Ok(value.beneficiary),
end_date: Ok(value.end_date),
execution_rule: Ok(value.execution_rule),
frequency: Ok(value.frequency),
instructed_amount: Ok(value.instructed_amount),
payment_id: Ok(value.payment_id),
reference_number: Ok(value.reference_number),
regulatory_reporting: Ok(value.regulatory_reporting),
remittance_information: Ok(value.remittance_information),
requested_execution_date: Ok(value.requested_execution_date),
ultimate_creditor: Ok(value.ultimate_creditor),
ultimate_debtor: Ok(value.ultimate_debtor),
}
}
}
#[derive(Clone, Debug)]
pub struct CreditTransferTransactionDetails {
beneficiary: ::std::result::Result<
super::Beneficiary,
::std::string::String,
>,
end_date: ::std::result::Result<
::std::option::Option<super::EndDate>,
::std::string::String,
>,
execution_rule: ::std::result::Result<
::std::option::Option<crate::types::ExecutionRule>,
::std::string::String,
>,
frequency: ::std::result::Result<
::std::option::Option<crate::types::FrequencyCode>,
::std::string::String,
>,
instructed_amount: ::std::result::Result<
crate::Amount,
::std::string::String,
>,
payment_id: ::std::result::Result<
::std::option::Option<super::PaymentIdentification>,
::std::string::String,
>,
reference_number: ::std::result::Result<
::std::option::Option<super::ReferenceNumber>,
::std::string::String,
>,
regulatory_reporting: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::RegulatoryReporting>>,
::std::string::String,
>,
remittance_information: ::std::result::Result<
::std::option::Option<super::UnstructuredRemittanceInformation>,
::std::string::String,
>,
requested_execution_date: ::std::result::Result<
::std::option::Option<super::RequestedExecutionDate>,
::std::string::String,
>,
transaction_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
transaction_status: ::std::result::Result<
::std::option::Option<crate::types::PaymentStatus>,
::std::string::String,
>,
ultimate_creditor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
ultimate_debtor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
}
impl ::std::default::Default for CreditTransferTransactionDetails {
fn default() -> Self {
Self {
beneficiary: Err("no value supplied for beneficiary".to_string()),
end_date: Ok(Default::default()),
execution_rule: Ok(Default::default()),
frequency: Ok(Default::default()),
instructed_amount: Err(
"no value supplied for instructed_amount".to_string(),
),
payment_id: Ok(Default::default()),
reference_number: Ok(Default::default()),
regulatory_reporting: Ok(Default::default()),
remittance_information: Ok(Default::default()),
requested_execution_date: Ok(Default::default()),
transaction_id: Ok(Default::default()),
transaction_status: Ok(Default::default()),
ultimate_creditor: Ok(Default::default()),
ultimate_debtor: Ok(Default::default()),
}
}
}
impl CreditTransferTransactionDetails {
pub fn beneficiary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Beneficiary>,
T::Error: ::std::fmt::Display,
{
self.beneficiary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for beneficiary: {e}")
});
self
}
pub fn end_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::EndDate>>,
T::Error: ::std::fmt::Display,
{
self.end_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_date: {e}")
});
self
}
pub fn execution_rule<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ExecutionRule>,
>,
T::Error: ::std::fmt::Display,
{
self.execution_rule = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for execution_rule: {e}"
)
});
self
}
pub fn frequency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::FrequencyCode>,
>,
T::Error: ::std::fmt::Display,
{
self.frequency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for frequency: {e}")
});
self
}
pub fn instructed_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::Amount>,
T::Error: ::std::fmt::Display,
{
self.instructed_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for instructed_amount: {e}"
)
});
self
}
pub fn payment_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PaymentIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.payment_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_id: {e}")
});
self
}
pub fn reference_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ReferenceNumber>,
>,
T::Error: ::std::fmt::Display,
{
self.reference_number = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_number: {e}"
)
});
self
}
pub fn regulatory_reporting<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::RegulatoryReporting>>,
>,
T::Error: ::std::fmt::Display,
{
self.regulatory_reporting = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for regulatory_reporting: {e}"
)
});
self
}
pub fn remittance_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::UnstructuredRemittanceInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.remittance_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remittance_information: {e}"
)
});
self
}
pub fn requested_execution_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::RequestedExecutionDate>,
>,
T::Error: ::std::fmt::Display,
{
self.requested_execution_date = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for requested_execution_date: {e}"
)
});
self
}
pub fn transaction_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.transaction_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for transaction_id: {e}"
)
});
self
}
pub fn transaction_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::PaymentStatus>,
>,
T::Error: ::std::fmt::Display,
{
self.transaction_status = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for transaction_status: {e}"
)
});
self
}
pub fn ultimate_creditor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.ultimate_creditor = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for ultimate_creditor: {e}"
)
});
self
}
pub fn ultimate_debtor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.ultimate_debtor = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for ultimate_debtor: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<CreditTransferTransactionDetails>
for super::CreditTransferTransactionDetails {
type Error = super::error::ConversionError;
fn try_from(
value: CreditTransferTransactionDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
beneficiary: value.beneficiary?,
end_date: value.end_date?,
execution_rule: value.execution_rule?,
frequency: value.frequency?,
instructed_amount: value.instructed_amount?,
payment_id: value.payment_id?,
reference_number: value.reference_number?,
regulatory_reporting: value.regulatory_reporting?,
remittance_information: value.remittance_information?,
requested_execution_date: value.requested_execution_date?,
transaction_id: value.transaction_id?,
transaction_status: value.transaction_status?,
ultimate_creditor: value.ultimate_creditor?,
ultimate_debtor: value.ultimate_debtor?,
})
}
}
impl ::std::convert::From<super::CreditTransferTransactionDetails>
for CreditTransferTransactionDetails {
fn from(value: super::CreditTransferTransactionDetails) -> Self {
Self {
beneficiary: Ok(value.beneficiary),
end_date: Ok(value.end_date),
execution_rule: Ok(value.execution_rule),
frequency: Ok(value.frequency),
instructed_amount: Ok(value.instructed_amount),
payment_id: Ok(value.payment_id),
reference_number: Ok(value.reference_number),
regulatory_reporting: Ok(value.regulatory_reporting),
remittance_information: Ok(value.remittance_information),
requested_execution_date: Ok(value.requested_execution_date),
transaction_id: Ok(value.transaction_id),
transaction_status: Ok(value.transaction_status),
ultimate_creditor: Ok(value.ultimate_creditor),
ultimate_debtor: Ok(value.ultimate_debtor),
}
}
}
#[derive(Clone, Debug)]
pub struct ErrorResponse {
code: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
detail: ::std::result::Result<
::std::option::Option<::serde_json::Value>,
::std::string::String,
>,
error: ::std::result::Result<
::std::option::Option<crate::types::ErrorCode>,
::std::string::String,
>,
message: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for ErrorResponse {
fn default() -> Self {
Self {
code: Ok(Default::default()),
detail: Ok(Default::default()),
error: Ok(Default::default()),
message: Err("no value supplied for message".to_string()),
}
}
}
impl ErrorResponse {
pub fn code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for code: {e}")
});
self
}
pub fn detail<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::serde_json::Value>>,
T::Error: ::std::fmt::Display,
{
self.detail = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for detail: {e}")
});
self
}
pub fn error<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ErrorCode>,
>,
T::Error: ::std::fmt::Display,
{
self.error = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for error: {e}")
});
self
}
pub fn message<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.message = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for message: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ErrorResponse> for super::ErrorResponse {
type Error = super::error::ConversionError;
fn try_from(
value: ErrorResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
code: value.code?,
detail: value.detail?,
error: value.error?,
message: value.message?,
})
}
}
impl ::std::convert::From<super::ErrorResponse> for ErrorResponse {
fn from(value: super::ErrorResponse) -> Self {
Self {
code: Ok(value.code),
detail: Ok(value.detail),
error: Ok(value.error),
message: Ok(value.message),
}
}
}
#[derive(Clone, Debug)]
pub struct ExchangeRate {
contract_identification: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
exchange_rate: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
instructed_amount: ::std::result::Result<
::std::option::Option<crate::Amount>,
::std::string::String,
>,
rate_type: ::std::result::Result<
::std::option::Option<crate::types::RateType>,
::std::string::String,
>,
unit_currency: ::std::result::Result<
::std::option::Option<super::CurrencyCode>,
::std::string::String,
>,
}
impl ::std::default::Default for ExchangeRate {
fn default() -> Self {
Self {
contract_identification: Ok(Default::default()),
exchange_rate: Ok(Default::default()),
instructed_amount: Ok(Default::default()),
rate_type: Ok(Default::default()),
unit_currency: Ok(Default::default()),
}
}
}
impl ExchangeRate {
pub fn contract_identification<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.contract_identification = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for contract_identification: {e}"
)
});
self
}
pub fn exchange_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.exchange_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for exchange_rate: {e}")
});
self
}
pub fn instructed_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<crate::Amount>>,
T::Error: ::std::fmt::Display,
{
self.instructed_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for instructed_amount: {e}"
)
});
self
}
pub fn rate_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::RateType>,
>,
T::Error: ::std::fmt::Display,
{
self.rate_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for rate_type: {e}")
});
self
}
pub fn unit_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::CurrencyCode>>,
T::Error: ::std::fmt::Display,
{
self.unit_currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for unit_currency: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ExchangeRate> for super::ExchangeRate {
type Error = super::error::ConversionError;
fn try_from(
value: ExchangeRate,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
contract_identification: value.contract_identification?,
exchange_rate: value.exchange_rate?,
instructed_amount: value.instructed_amount?,
rate_type: value.rate_type?,
unit_currency: value.unit_currency?,
})
}
}
impl ::std::convert::From<super::ExchangeRate> for ExchangeRate {
fn from(value: super::ExchangeRate) -> Self {
Self {
contract_identification: Ok(value.contract_identification),
exchange_rate: Ok(value.exchange_rate),
instructed_amount: Ok(value.instructed_amount),
rate_type: Ok(value.rate_type),
unit_currency: Ok(value.unit_currency),
}
}
}
#[derive(Clone, Debug)]
pub struct FinancialInstitutionIdentification {
bic_fi: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
clearing_system_member_id: ::std::result::Result<
::std::option::Option<super::ClearingSystemMemberIdentification>,
::std::string::String,
>,
name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for FinancialInstitutionIdentification {
fn default() -> Self {
Self {
bic_fi: Ok(Default::default()),
clearing_system_member_id: Ok(Default::default()),
name: Ok(Default::default()),
}
}
}
impl FinancialInstitutionIdentification {
pub fn bic_fi<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.bic_fi = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for bic_fi: {e}")
});
self
}
pub fn clearing_system_member_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ClearingSystemMemberIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.clearing_system_member_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for clearing_system_member_id: {e}"
)
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<FinancialInstitutionIdentification>
for super::FinancialInstitutionIdentification {
type Error = super::error::ConversionError;
fn try_from(
value: FinancialInstitutionIdentification,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
bic_fi: value.bic_fi?,
clearing_system_member_id: value.clearing_system_member_id?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::FinancialInstitutionIdentification>
for FinancialInstitutionIdentification {
fn from(value: super::FinancialInstitutionIdentification) -> Self {
Self {
bic_fi: Ok(value.bic_fi),
clearing_system_member_id: Ok(value.clearing_system_member_id),
name: Ok(value.name),
}
}
}
#[derive(Clone, Debug)]
pub struct GenericIdentification {
identification: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
issuer: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
scheme_name: ::std::result::Result<
crate::types::SchemeName,
::std::string::String,
>,
}
impl ::std::default::Default for GenericIdentification {
fn default() -> Self {
Self {
identification: Err(
"no value supplied for identification".to_string(),
),
issuer: Ok(Default::default()),
scheme_name: Err("no value supplied for scheme_name".to_string()),
}
}
}
impl GenericIdentification {
pub fn identification<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.identification = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for identification: {e}"
)
});
self
}
pub fn issuer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.issuer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for issuer: {e}")
});
self
}
pub fn scheme_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::SchemeName>,
T::Error: ::std::fmt::Display,
{
self.scheme_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for scheme_name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GenericIdentification>
for super::GenericIdentification {
type Error = super::error::ConversionError;
fn try_from(
value: GenericIdentification,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
identification: value.identification?,
issuer: value.issuer?,
scheme_name: value.scheme_name?,
})
}
}
impl ::std::convert::From<super::GenericIdentification>
for GenericIdentification {
fn from(value: super::GenericIdentification) -> Self {
Self {
identification: Ok(value.identification),
issuer: Ok(value.issuer),
scheme_name: Ok(value.scheme_name),
}
}
}
#[derive(Clone, Debug)]
pub struct GetApplicationResponse {
active: ::std::result::Result<bool, ::std::string::String>,
countries: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
description: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
environment: ::std::result::Result<
crate::types::Environment,
::std::string::String,
>,
kid: ::std::result::Result<::std::string::String, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
redirect_urls: ::std::result::Result<
::std::vec::Vec<super::RedirectUrlsItem>,
::std::string::String,
>,
services: ::std::result::Result<
::std::vec::Vec<crate::types::Service>,
::std::string::String,
>,
}
impl ::std::default::Default for GetApplicationResponse {
fn default() -> Self {
Self {
active: Err("no value supplied for active".to_string()),
countries: Err("no value supplied for countries".to_string()),
description: Ok(Default::default()),
environment: Err("no value supplied for environment".to_string()),
kid: Err("no value supplied for kid".to_string()),
name: Err("no value supplied for name".to_string()),
redirect_urls: Err(
"no value supplied for redirect_urls".to_string(),
),
services: Err("no value supplied for services".to_string()),
}
}
}
impl GetApplicationResponse {
pub fn active<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.active = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for active: {e}")
});
self
}
pub fn countries<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.countries = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for countries: {e}")
});
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn environment<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::Environment>,
T::Error: ::std::fmt::Display,
{
self.environment = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for environment: {e}")
});
self
}
pub fn kid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.kid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for kid: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn redirect_urls<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::RedirectUrlsItem>>,
T::Error: ::std::fmt::Display,
{
self.redirect_urls = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for redirect_urls: {e}")
});
self
}
pub fn services<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<crate::types::Service>>,
T::Error: ::std::fmt::Display,
{
self.services = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for services: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetApplicationResponse>
for super::GetApplicationResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetApplicationResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
active: value.active?,
countries: value.countries?,
description: value.description?,
environment: value.environment?,
kid: value.kid?,
name: value.name?,
redirect_urls: value.redirect_urls?,
services: value.services?,
})
}
}
impl ::std::convert::From<super::GetApplicationResponse>
for GetApplicationResponse {
fn from(value: super::GetApplicationResponse) -> Self {
Self {
active: Ok(value.active),
countries: Ok(value.countries),
description: Ok(value.description),
environment: Ok(value.environment),
kid: Ok(value.kid),
name: Ok(value.name),
redirect_urls: Ok(value.redirect_urls),
services: Ok(value.services),
}
}
}
#[derive(Clone, Debug)]
pub struct GetAspspsResponse {
aspsps: ::std::result::Result<
::std::vec::Vec<super::AspspData>,
::std::string::String,
>,
}
impl ::std::default::Default for GetAspspsResponse {
fn default() -> Self {
Self {
aspsps: Err("no value supplied for aspsps".to_string()),
}
}
}
impl GetAspspsResponse {
pub fn aspsps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::AspspData>>,
T::Error: ::std::fmt::Display,
{
self.aspsps = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aspsps: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetAspspsResponse> for super::GetAspspsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetAspspsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { aspsps: value.aspsps? })
}
}
impl ::std::convert::From<super::GetAspspsResponse> for GetAspspsResponse {
fn from(value: super::GetAspspsResponse) -> Self {
Self { aspsps: Ok(value.aspsps) }
}
}
#[derive(Clone, Debug)]
pub struct GetPaymentResponse {
aspsp: ::std::result::Result<super::Aspsp, ::std::string::String>,
final_status: ::std::result::Result<bool, ::std::string::String>,
payment_details: ::std::result::Result<
super::PaymentRequestResourceDetails,
::std::string::String,
>,
payment_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
payment_type: ::std::result::Result<
crate::types::PaymentType,
::std::string::String,
>,
psu_id_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
status: ::std::result::Result<
crate::types::PaymentStatus,
::std::string::String,
>,
status_reason_information: ::std::result::Result<
::std::option::Option<super::StatusReasonInformation>,
::std::string::String,
>,
}
impl ::std::default::Default for GetPaymentResponse {
fn default() -> Self {
Self {
aspsp: Err("no value supplied for aspsp".to_string()),
final_status: Err("no value supplied for final_status".to_string()),
payment_details: Err(
"no value supplied for payment_details".to_string(),
),
payment_id: Err("no value supplied for payment_id".to_string()),
payment_type: Err("no value supplied for payment_type".to_string()),
psu_id_hash: Err("no value supplied for psu_id_hash".to_string()),
status: Err("no value supplied for status".to_string()),
status_reason_information: Ok(Default::default()),
}
}
}
impl GetPaymentResponse {
pub fn aspsp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Aspsp>,
T::Error: ::std::fmt::Display,
{
self.aspsp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aspsp: {e}")
});
self
}
pub fn final_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.final_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for final_status: {e}")
});
self
}
pub fn payment_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PaymentRequestResourceDetails>,
T::Error: ::std::fmt::Display,
{
self.payment_details = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for payment_details: {e}"
)
});
self
}
pub fn payment_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.payment_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_id: {e}")
});
self
}
pub fn payment_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PaymentType>,
T::Error: ::std::fmt::Display,
{
self.payment_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_type: {e}")
});
self
}
pub fn psu_id_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.psu_id_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_id_hash: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PaymentStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for status: {e}")
});
self
}
pub fn status_reason_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::StatusReasonInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.status_reason_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for status_reason_information: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<GetPaymentResponse> for super::GetPaymentResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetPaymentResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
aspsp: value.aspsp?,
final_status: value.final_status?,
payment_details: value.payment_details?,
payment_id: value.payment_id?,
payment_type: value.payment_type?,
psu_id_hash: value.psu_id_hash?,
status: value.status?,
status_reason_information: value.status_reason_information?,
})
}
}
impl ::std::convert::From<super::GetPaymentResponse> for GetPaymentResponse {
fn from(value: super::GetPaymentResponse) -> Self {
Self {
aspsp: Ok(value.aspsp),
final_status: Ok(value.final_status),
payment_details: Ok(value.payment_details),
payment_id: Ok(value.payment_id),
payment_type: Ok(value.payment_type),
psu_id_hash: Ok(value.psu_id_hash),
status: Ok(value.status),
status_reason_information: Ok(value.status_reason_information),
}
}
}
#[derive(Clone, Debug)]
pub struct GetPaymentTransactionResponse {
payment_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
transaction_details: ::std::result::Result<
super::CreditTransferTransactionDetails,
::std::string::String,
>,
}
impl ::std::default::Default for GetPaymentTransactionResponse {
fn default() -> Self {
Self {
payment_id: Err("no value supplied for payment_id".to_string()),
transaction_details: Err(
"no value supplied for transaction_details".to_string(),
),
}
}
}
impl GetPaymentTransactionResponse {
pub fn payment_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.payment_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_id: {e}")
});
self
}
pub fn transaction_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CreditTransferTransactionDetails>,
T::Error: ::std::fmt::Display,
{
self.transaction_details = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for transaction_details: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<GetPaymentTransactionResponse>
for super::GetPaymentTransactionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetPaymentTransactionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
payment_id: value.payment_id?,
transaction_details: value.transaction_details?,
})
}
}
impl ::std::convert::From<super::GetPaymentTransactionResponse>
for GetPaymentTransactionResponse {
fn from(value: super::GetPaymentTransactionResponse) -> Self {
Self {
payment_id: Ok(value.payment_id),
transaction_details: Ok(value.transaction_details),
}
}
}
#[derive(Clone, Debug)]
pub struct GetSessionResponse {
access: ::std::result::Result<super::Access, ::std::string::String>,
accounts: ::std::result::Result<
::std::vec::Vec<::uuid::Uuid>,
::std::string::String,
>,
accounts_data: ::std::result::Result<
::std::vec::Vec<super::SessionAccount>,
::std::string::String,
>,
aspsp: ::std::result::Result<super::Aspsp, ::std::string::String>,
authorized: ::std::result::Result<
::std::option::Option<::jiff::Timestamp>,
::std::string::String,
>,
closed: ::std::result::Result<
::std::option::Option<::jiff::Timestamp>,
::std::string::String,
>,
created: ::std::result::Result<::jiff::Timestamp, ::std::string::String>,
psu_id_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
psu_type: ::std::result::Result<
crate::types::PsuType,
::std::string::String,
>,
status: ::std::result::Result<
crate::types::SessionStatus,
::std::string::String,
>,
}
impl ::std::default::Default for GetSessionResponse {
fn default() -> Self {
Self {
access: Err("no value supplied for access".to_string()),
accounts: Err("no value supplied for accounts".to_string()),
accounts_data: Err(
"no value supplied for accounts_data".to_string(),
),
aspsp: Err("no value supplied for aspsp".to_string()),
authorized: Ok(Default::default()),
closed: Ok(Default::default()),
created: Err("no value supplied for created".to_string()),
psu_id_hash: Err("no value supplied for psu_id_hash".to_string()),
psu_type: Err("no value supplied for psu_type".to_string()),
status: Err("no value supplied for status".to_string()),
}
}
}
impl GetSessionResponse {
pub fn access<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Access>,
T::Error: ::std::fmt::Display,
{
self.access = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for access: {e}")
});
self
}
pub fn accounts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.accounts = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for accounts: {e}")
});
self
}
pub fn accounts_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::SessionAccount>>,
T::Error: ::std::fmt::Display,
{
self.accounts_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for accounts_data: {e}")
});
self
}
pub fn aspsp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Aspsp>,
T::Error: ::std::fmt::Display,
{
self.aspsp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aspsp: {e}")
});
self
}
pub fn authorized<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::Timestamp>>,
T::Error: ::std::fmt::Display,
{
self.authorized = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for authorized: {e}")
});
self
}
pub fn closed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::Timestamp>>,
T::Error: ::std::fmt::Display,
{
self.closed = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for closed: {e}")
});
self
}
pub fn created<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::jiff::Timestamp>,
T::Error: ::std::fmt::Display,
{
self.created = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for created: {e}")
});
self
}
pub fn psu_id_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.psu_id_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_id_hash: {e}")
});
self
}
pub fn psu_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PsuType>,
T::Error: ::std::fmt::Display,
{
self.psu_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_type: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::SessionStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for status: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetSessionResponse> for super::GetSessionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetSessionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
access: value.access?,
accounts: value.accounts?,
accounts_data: value.accounts_data?,
aspsp: value.aspsp?,
authorized: value.authorized?,
closed: value.closed?,
created: value.created?,
psu_id_hash: value.psu_id_hash?,
psu_type: value.psu_type?,
status: value.status?,
})
}
}
impl ::std::convert::From<super::GetSessionResponse> for GetSessionResponse {
fn from(value: super::GetSessionResponse) -> Self {
Self {
access: Ok(value.access),
accounts: Ok(value.accounts),
accounts_data: Ok(value.accounts_data),
aspsp: Ok(value.aspsp),
authorized: Ok(value.authorized),
closed: Ok(value.closed),
created: Ok(value.created),
psu_id_hash: Ok(value.psu_id_hash),
psu_type: Ok(value.psu_type),
status: Ok(value.status),
}
}
}
#[derive(Clone, Debug)]
pub struct HalBalances {
balances: ::std::result::Result<
::std::vec::Vec<super::BalanceResource>,
::std::string::String,
>,
}
impl ::std::default::Default for HalBalances {
fn default() -> Self {
Self {
balances: Err("no value supplied for balances".to_string()),
}
}
}
impl HalBalances {
pub fn balances<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::BalanceResource>>,
T::Error: ::std::fmt::Display,
{
self.balances = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for balances: {e}")
});
self
}
}
impl ::std::convert::TryFrom<HalBalances> for super::HalBalances {
type Error = super::error::ConversionError;
fn try_from(
value: HalBalances,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { balances: value.balances? })
}
}
impl ::std::convert::From<super::HalBalances> for HalBalances {
fn from(value: super::HalBalances) -> Self {
Self {
balances: Ok(value.balances),
}
}
}
#[derive(Clone, Debug)]
pub struct HalTransactions {
continuation_key: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
transactions: ::std::result::Result<
::std::vec::Vec<super::Transaction>,
::std::string::String,
>,
}
impl ::std::default::Default for HalTransactions {
fn default() -> Self {
Self {
continuation_key: Ok(Default::default()),
transactions: Err("no value supplied for transactions".to_string()),
}
}
}
impl HalTransactions {
pub fn continuation_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.continuation_key = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for continuation_key: {e}"
)
});
self
}
pub fn transactions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Transaction>>,
T::Error: ::std::fmt::Display,
{
self.transactions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for transactions: {e}")
});
self
}
}
impl ::std::convert::TryFrom<HalTransactions> for super::HalTransactions {
type Error = super::error::ConversionError;
fn try_from(
value: HalTransactions,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
continuation_key: value.continuation_key?,
transactions: value.transactions?,
})
}
}
impl ::std::convert::From<super::HalTransactions> for HalTransactions {
fn from(value: super::HalTransactions) -> Self {
Self {
continuation_key: Ok(value.continuation_key),
transactions: Ok(value.transactions),
}
}
}
#[derive(Clone, Debug)]
pub struct PartyIdentification {
contact_details: ::std::result::Result<
::std::option::Option<super::ContactDetails>,
::std::string::String,
>,
name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
organisation_id: ::std::result::Result<
::std::option::Option<super::GenericIdentification>,
::std::string::String,
>,
postal_address: ::std::result::Result<
::std::option::Option<super::PostalAddress>,
::std::string::String,
>,
private_id: ::std::result::Result<
::std::option::Option<super::GenericIdentification>,
::std::string::String,
>,
}
impl ::std::default::Default for PartyIdentification {
fn default() -> Self {
Self {
contact_details: Ok(Default::default()),
name: Ok(Default::default()),
organisation_id: Ok(Default::default()),
postal_address: Ok(Default::default()),
private_id: Ok(Default::default()),
}
}
}
impl PartyIdentification {
pub fn contact_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ContactDetails>>,
T::Error: ::std::fmt::Display,
{
self.contact_details = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for contact_details: {e}"
)
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
pub fn organisation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::GenericIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.organisation_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for organisation_id: {e}"
)
});
self
}
pub fn postal_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::PostalAddress>>,
T::Error: ::std::fmt::Display,
{
self.postal_address = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for postal_address: {e}"
)
});
self
}
pub fn private_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::GenericIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.private_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for private_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PartyIdentification>
for super::PartyIdentification {
type Error = super::error::ConversionError;
fn try_from(
value: PartyIdentification,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
contact_details: value.contact_details?,
name: value.name?,
organisation_id: value.organisation_id?,
postal_address: value.postal_address?,
private_id: value.private_id?,
})
}
}
impl ::std::convert::From<super::PartyIdentification> for PartyIdentification {
fn from(value: super::PartyIdentification) -> Self {
Self {
contact_details: Ok(value.contact_details),
name: Ok(value.name),
organisation_id: Ok(value.organisation_id),
postal_address: Ok(value.postal_address),
private_id: Ok(value.private_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PaymentIdentification {
end_to_end_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
instruction_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for PaymentIdentification {
fn default() -> Self {
Self {
end_to_end_id: Ok(Default::default()),
instruction_id: Ok(Default::default()),
}
}
}
impl PaymentIdentification {
pub fn end_to_end_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.end_to_end_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_to_end_id: {e}")
});
self
}
pub fn instruction_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.instruction_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for instruction_id: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<PaymentIdentification>
for super::PaymentIdentification {
type Error = super::error::ConversionError;
fn try_from(
value: PaymentIdentification,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_to_end_id: value.end_to_end_id?,
instruction_id: value.instruction_id?,
})
}
}
impl ::std::convert::From<super::PaymentIdentification>
for PaymentIdentification {
fn from(value: super::PaymentIdentification) -> Self {
Self {
end_to_end_id: Ok(value.end_to_end_id),
instruction_id: Ok(value.instruction_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PaymentRequestResource {
charge_bearer: ::std::result::Result<
::std::option::Option<crate::types::ChargeBearerCode>,
::std::string::String,
>,
credit_transfer_transaction: ::std::result::Result<
::std::vec::Vec<super::CreditTransferTransaction>,
::std::string::String,
>,
debtor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
debtor_account: ::std::result::Result<
::std::option::Option<super::GenericIdentification>,
::std::string::String,
>,
debtor_agent: ::std::result::Result<
::std::option::Option<super::FinancialInstitutionIdentification>,
::std::string::String,
>,
debtor_currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
payment_information_id: ::std::result::Result<
::std::option::Option<super::PaymentInformationId>,
::std::string::String,
>,
payment_type_information: ::std::result::Result<
::std::option::Option<super::PaymentTypeInformation>,
::std::string::String,
>,
purpose: ::std::result::Result<
::std::option::Option<crate::types::PurposeCode>,
::std::string::String,
>,
}
impl ::std::default::Default for PaymentRequestResource {
fn default() -> Self {
Self {
charge_bearer: Ok(Default::default()),
credit_transfer_transaction: Err(
"no value supplied for credit_transfer_transaction".to_string(),
),
debtor: Ok(Default::default()),
debtor_account: Ok(Default::default()),
debtor_agent: Ok(Default::default()),
debtor_currency: Ok(
super::defaults::payment_request_resource_debtor_currency(),
),
payment_information_id: Ok(Default::default()),
payment_type_information: Ok(Default::default()),
purpose: Ok(Default::default()),
}
}
}
impl PaymentRequestResource {
pub fn charge_bearer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ChargeBearerCode>,
>,
T::Error: ::std::fmt::Display,
{
self.charge_bearer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for charge_bearer: {e}")
});
self
}
pub fn credit_transfer_transaction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::CreditTransferTransaction>,
>,
T::Error: ::std::fmt::Display,
{
self.credit_transfer_transaction = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for credit_transfer_transaction: {e}"
)
});
self
}
pub fn debtor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for debtor: {e}")
});
self
}
pub fn debtor_account<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::GenericIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_account = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_account: {e}"
)
});
self
}
pub fn debtor_agent<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::FinancialInstitutionIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_agent = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for debtor_agent: {e}")
});
self
}
pub fn debtor_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.debtor_currency = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_currency: {e}"
)
});
self
}
pub fn payment_information_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PaymentInformationId>,
>,
T::Error: ::std::fmt::Display,
{
self.payment_information_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for payment_information_id: {e}"
)
});
self
}
pub fn payment_type_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PaymentTypeInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.payment_type_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for payment_type_information: {e}"
)
});
self
}
pub fn purpose<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::PurposeCode>,
>,
T::Error: ::std::fmt::Display,
{
self.purpose = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for purpose: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PaymentRequestResource>
for super::PaymentRequestResource {
type Error = super::error::ConversionError;
fn try_from(
value: PaymentRequestResource,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
charge_bearer: value.charge_bearer?,
credit_transfer_transaction: value.credit_transfer_transaction?,
debtor: value.debtor?,
debtor_account: value.debtor_account?,
debtor_agent: value.debtor_agent?,
debtor_currency: value.debtor_currency?,
payment_information_id: value.payment_information_id?,
payment_type_information: value.payment_type_information?,
purpose: value.purpose?,
})
}
}
impl ::std::convert::From<super::PaymentRequestResource>
for PaymentRequestResource {
fn from(value: super::PaymentRequestResource) -> Self {
Self {
charge_bearer: Ok(value.charge_bearer),
credit_transfer_transaction: Ok(value.credit_transfer_transaction),
debtor: Ok(value.debtor),
debtor_account: Ok(value.debtor_account),
debtor_agent: Ok(value.debtor_agent),
debtor_currency: Ok(value.debtor_currency),
payment_information_id: Ok(value.payment_information_id),
payment_type_information: Ok(value.payment_type_information),
purpose: Ok(value.purpose),
}
}
}
#[derive(Clone, Debug)]
pub struct PaymentRequestResourceDetails {
charge_bearer: ::std::result::Result<
::std::option::Option<crate::types::ChargeBearerCode>,
::std::string::String,
>,
credit_transfer_transaction: ::std::result::Result<
::std::option::Option<
::std::vec::Vec<super::CreditTransferTransactionDetails>,
>,
::std::string::String,
>,
debtor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
debtor_account: ::std::result::Result<
::std::option::Option<super::GenericIdentification>,
::std::string::String,
>,
debtor_agent: ::std::result::Result<
::std::option::Option<super::FinancialInstitutionIdentification>,
::std::string::String,
>,
debtor_currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
payment_information_id: ::std::result::Result<
::std::option::Option<super::PaymentInformationId>,
::std::string::String,
>,
payment_type_information: ::std::result::Result<
::std::option::Option<super::PaymentTypeInformation>,
::std::string::String,
>,
purpose: ::std::result::Result<
::std::option::Option<crate::types::PurposeCode>,
::std::string::String,
>,
}
impl ::std::default::Default for PaymentRequestResourceDetails {
fn default() -> Self {
Self {
charge_bearer: Ok(Default::default()),
credit_transfer_transaction: Ok(Default::default()),
debtor: Ok(Default::default()),
debtor_account: Ok(Default::default()),
debtor_agent: Ok(Default::default()),
debtor_currency: Ok(
super::defaults::payment_request_resource_details_debtor_currency(),
),
payment_information_id: Ok(Default::default()),
payment_type_information: Ok(Default::default()),
purpose: Ok(Default::default()),
}
}
}
impl PaymentRequestResourceDetails {
pub fn charge_bearer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ChargeBearerCode>,
>,
T::Error: ::std::fmt::Display,
{
self.charge_bearer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for charge_bearer: {e}")
});
self
}
pub fn credit_transfer_transaction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::std::vec::Vec<super::CreditTransferTransactionDetails>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.credit_transfer_transaction = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for credit_transfer_transaction: {e}"
)
});
self
}
pub fn debtor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for debtor: {e}")
});
self
}
pub fn debtor_account<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::GenericIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_account = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_account: {e}"
)
});
self
}
pub fn debtor_agent<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::FinancialInstitutionIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_agent = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for debtor_agent: {e}")
});
self
}
pub fn debtor_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.debtor_currency = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_currency: {e}"
)
});
self
}
pub fn payment_information_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PaymentInformationId>,
>,
T::Error: ::std::fmt::Display,
{
self.payment_information_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for payment_information_id: {e}"
)
});
self
}
pub fn payment_type_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PaymentTypeInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.payment_type_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for payment_type_information: {e}"
)
});
self
}
pub fn purpose<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::PurposeCode>,
>,
T::Error: ::std::fmt::Display,
{
self.purpose = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for purpose: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PaymentRequestResourceDetails>
for super::PaymentRequestResourceDetails {
type Error = super::error::ConversionError;
fn try_from(
value: PaymentRequestResourceDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
charge_bearer: value.charge_bearer?,
credit_transfer_transaction: value.credit_transfer_transaction?,
debtor: value.debtor?,
debtor_account: value.debtor_account?,
debtor_agent: value.debtor_agent?,
debtor_currency: value.debtor_currency?,
payment_information_id: value.payment_information_id?,
payment_type_information: value.payment_type_information?,
purpose: value.purpose?,
})
}
}
impl ::std::convert::From<super::PaymentRequestResourceDetails>
for PaymentRequestResourceDetails {
fn from(value: super::PaymentRequestResourceDetails) -> Self {
Self {
charge_bearer: Ok(value.charge_bearer),
credit_transfer_transaction: Ok(value.credit_transfer_transaction),
debtor: Ok(value.debtor),
debtor_account: Ok(value.debtor_account),
debtor_agent: Ok(value.debtor_agent),
debtor_currency: Ok(value.debtor_currency),
payment_information_id: Ok(value.payment_information_id),
payment_type_information: Ok(value.payment_type_information),
purpose: Ok(value.purpose),
}
}
}
#[derive(Clone, Debug)]
pub struct PaymentTypeInformation {
category_purpose: ::std::result::Result<
::std::option::Option<crate::types::CategoryPurposeCode>,
::std::string::String,
>,
instruction_priority: ::std::result::Result<
::std::option::Option<crate::types::PriorityCode>,
::std::string::String,
>,
local_instrument: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
service_level: ::std::result::Result<
::std::option::Option<crate::types::ServiceLevelCode>,
::std::string::String,
>,
}
impl ::std::default::Default for PaymentTypeInformation {
fn default() -> Self {
Self {
category_purpose: Ok(Default::default()),
instruction_priority: Ok(Default::default()),
local_instrument: Ok(Default::default()),
service_level: Ok(Default::default()),
}
}
}
impl PaymentTypeInformation {
pub fn category_purpose<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::CategoryPurposeCode>,
>,
T::Error: ::std::fmt::Display,
{
self.category_purpose = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for category_purpose: {e}"
)
});
self
}
pub fn instruction_priority<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::PriorityCode>,
>,
T::Error: ::std::fmt::Display,
{
self.instruction_priority = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for instruction_priority: {e}"
)
});
self
}
pub fn local_instrument<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.local_instrument = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for local_instrument: {e}"
)
});
self
}
pub fn service_level<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ServiceLevelCode>,
>,
T::Error: ::std::fmt::Display,
{
self.service_level = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for service_level: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PaymentTypeInformation>
for super::PaymentTypeInformation {
type Error = super::error::ConversionError;
fn try_from(
value: PaymentTypeInformation,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category_purpose: value.category_purpose?,
instruction_priority: value.instruction_priority?,
local_instrument: value.local_instrument?,
service_level: value.service_level?,
})
}
}
impl ::std::convert::From<super::PaymentTypeInformation>
for PaymentTypeInformation {
fn from(value: super::PaymentTypeInformation) -> Self {
Self {
category_purpose: Ok(value.category_purpose),
instruction_priority: Ok(value.instruction_priority),
local_instrument: Ok(value.local_instrument),
service_level: Ok(value.service_level),
}
}
}
#[derive(Clone, Debug)]
pub struct PostalAddress {
address_line: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
address_type: ::std::result::Result<
::std::option::Option<crate::types::AddressType>,
::std::string::String,
>,
building_number: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
country: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
country_sub_division: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
department: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
post_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
street_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
sub_department: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
town_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for PostalAddress {
fn default() -> Self {
Self {
address_line: Ok(Default::default()),
address_type: Ok(Default::default()),
building_number: Ok(Default::default()),
country: Ok(Default::default()),
country_sub_division: Ok(Default::default()),
department: Ok(Default::default()),
post_code: Ok(Default::default()),
street_name: Ok(Default::default()),
sub_department: Ok(Default::default()),
town_name: Ok(Default::default()),
}
}
}
impl PostalAddress {
pub fn address_line<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.address_line = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for address_line: {e}")
});
self
}
pub fn address_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::AddressType>,
>,
T::Error: ::std::fmt::Display,
{
self.address_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for address_type: {e}")
});
self
}
pub fn building_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.building_number = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for building_number: {e}"
)
});
self
}
pub fn country<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.country = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for country: {e}")
});
self
}
pub fn country_sub_division<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.country_sub_division = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for country_sub_division: {e}"
)
});
self
}
pub fn department<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.department = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for department: {e}")
});
self
}
pub fn post_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.post_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for post_code: {e}")
});
self
}
pub fn street_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.street_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for street_name: {e}")
});
self
}
pub fn sub_department<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.sub_department = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for sub_department: {e}"
)
});
self
}
pub fn town_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.town_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for town_name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PostalAddress> for super::PostalAddress {
type Error = super::error::ConversionError;
fn try_from(
value: PostalAddress,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
address_line: value.address_line?,
address_type: value.address_type?,
building_number: value.building_number?,
country: value.country?,
country_sub_division: value.country_sub_division?,
department: value.department?,
post_code: value.post_code?,
street_name: value.street_name?,
sub_department: value.sub_department?,
town_name: value.town_name?,
})
}
}
impl ::std::convert::From<super::PostalAddress> for PostalAddress {
fn from(value: super::PostalAddress) -> Self {
Self {
address_line: Ok(value.address_line),
address_type: Ok(value.address_type),
building_number: Ok(value.building_number),
country: Ok(value.country),
country_sub_division: Ok(value.country_sub_division),
department: Ok(value.department),
post_code: Ok(value.post_code),
street_name: Ok(value.street_name),
sub_department: Ok(value.sub_department),
town_name: Ok(value.town_name),
}
}
}
#[derive(Clone, Debug)]
pub struct RegulatoryAuthority {
country: ::std::result::Result<::std::string::String, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for RegulatoryAuthority {
fn default() -> Self {
Self {
country: Err("no value supplied for country".to_string()),
name: Err("no value supplied for name".to_string()),
}
}
}
impl RegulatoryAuthority {
pub fn country<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.country = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for country: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RegulatoryAuthority>
for super::RegulatoryAuthority {
type Error = super::error::ConversionError;
fn try_from(
value: RegulatoryAuthority,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
country: value.country?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::RegulatoryAuthority> for RegulatoryAuthority {
fn from(value: super::RegulatoryAuthority) -> Self {
Self {
country: Ok(value.country),
name: Ok(value.name),
}
}
}
#[derive(Clone, Debug)]
pub struct RegulatoryReporting {
authority: ::std::result::Result<
::std::option::Option<super::RegulatoryAuthority>,
::std::string::String,
>,
details: ::std::result::Result<
super::RegulatoryReportingDetails,
::std::string::String,
>,
}
impl ::std::default::Default for RegulatoryReporting {
fn default() -> Self {
Self {
authority: Ok(Default::default()),
details: Err("no value supplied for details".to_string()),
}
}
}
impl RegulatoryReporting {
pub fn authority<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::RegulatoryAuthority>,
>,
T::Error: ::std::fmt::Display,
{
self.authority = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for authority: {e}")
});
self
}
pub fn details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RegulatoryReportingDetails>,
T::Error: ::std::fmt::Display,
{
self.details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for details: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RegulatoryReporting>
for super::RegulatoryReporting {
type Error = super::error::ConversionError;
fn try_from(
value: RegulatoryReporting,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
authority: value.authority?,
details: value.details?,
})
}
}
impl ::std::convert::From<super::RegulatoryReporting> for RegulatoryReporting {
fn from(value: super::RegulatoryReporting) -> Self {
Self {
authority: Ok(value.authority),
details: Ok(value.details),
}
}
}
#[derive(Clone, Debug)]
pub struct RegulatoryReportingCode {
description: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
value: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for RegulatoryReportingCode {
fn default() -> Self {
Self {
description: Err("no value supplied for description".to_string()),
value: Err("no value supplied for value".to_string()),
}
}
}
impl RegulatoryReportingCode {
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for value: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RegulatoryReportingCode>
for super::RegulatoryReportingCode {
type Error = super::error::ConversionError;
fn try_from(
value: RegulatoryReportingCode,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
value: value.value?,
})
}
}
impl ::std::convert::From<super::RegulatoryReportingCode>
for RegulatoryReportingCode {
fn from(value: super::RegulatoryReportingCode) -> Self {
Self {
description: Ok(value.description),
value: Ok(value.value),
}
}
}
#[derive(Clone, Debug)]
pub struct RegulatoryReportingDetails {
amount: ::std::result::Result<
::std::option::Option<crate::Amount>,
::std::string::String,
>,
code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
information: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for RegulatoryReportingDetails {
fn default() -> Self {
Self {
amount: Ok(Default::default()),
code: Ok(Default::default()),
information: Err("no value supplied for information".to_string()),
}
}
}
impl RegulatoryReportingDetails {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<crate::Amount>>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for amount: {e}")
});
self
}
pub fn code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for code: {e}")
});
self
}
pub fn information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.information = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for information: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RegulatoryReportingDetails>
for super::RegulatoryReportingDetails {
type Error = super::error::ConversionError;
fn try_from(
value: RegulatoryReportingDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
code: value.code?,
information: value.information?,
})
}
}
impl ::std::convert::From<super::RegulatoryReportingDetails>
for RegulatoryReportingDetails {
fn from(value: super::RegulatoryReportingDetails) -> Self {
Self {
amount: Ok(value.amount),
code: Ok(value.code),
information: Ok(value.information),
}
}
}
#[derive(Clone, Debug)]
pub struct RemittanceInformationLineInfo {
max_length: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
min_length: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
pattern: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for RemittanceInformationLineInfo {
fn default() -> Self {
Self {
max_length: Ok(Default::default()),
min_length: Ok(Default::default()),
pattern: Ok(Default::default()),
}
}
}
impl RemittanceInformationLineInfo {
pub fn max_length<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.max_length = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_length: {e}")
});
self
}
pub fn min_length<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.min_length = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_length: {e}")
});
self
}
pub fn pattern<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.pattern = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pattern: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RemittanceInformationLineInfo>
for super::RemittanceInformationLineInfo {
type Error = super::error::ConversionError;
fn try_from(
value: RemittanceInformationLineInfo,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
max_length: value.max_length?,
min_length: value.min_length?,
pattern: value.pattern?,
})
}
}
impl ::std::convert::From<super::RemittanceInformationLineInfo>
for RemittanceInformationLineInfo {
fn from(value: super::RemittanceInformationLineInfo) -> Self {
Self {
max_length: Ok(value.max_length),
min_length: Ok(value.min_length),
pattern: Ok(value.pattern),
}
}
}
#[derive(Clone, Debug)]
pub struct ResponsePaymentType {
allowed_auth_methods: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
charge_bearer_values: ::std::result::Result<
::std::option::Option<::std::vec::Vec<crate::types::ChargeBearerCode>>,
::std::string::String,
>,
creditor_account_schemas: ::std::result::Result<
::std::option::Option<::std::vec::Vec<crate::types::SchemeName>>,
::std::string::String,
>,
creditor_agent_bic_fi_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
creditor_agent_clearing_system_member_id_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
creditor_country_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
creditor_name_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
creditor_postal_address_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
currencies: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
debtor_account_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
debtor_account_schemas: ::std::result::Result<
::std::option::Option<::std::vec::Vec<crate::types::SchemeName>>,
::std::string::String,
>,
debtor_contact_email_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
debtor_contact_phone_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
debtor_currency_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
deferred_submission_supported: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
final_successful_statuses: ::std::result::Result<
::std::option::Option<::std::vec::Vec<crate::types::PaymentStatus>>,
::std::string::String,
>,
max_transactions: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
payment_type: ::std::result::Result<
crate::types::PaymentType,
::std::string::String,
>,
priority_codes: ::std::result::Result<
::std::option::Option<::std::vec::Vec<crate::types::PriorityCode>>,
::std::string::String,
>,
psu_type: ::std::result::Result<
crate::types::PsuType,
::std::string::String,
>,
reference_number_schemas: ::std::result::Result<
::std::option::Option<
::std::vec::Vec<crate::types::ReferenceNumberScheme>,
>,
::std::string::String,
>,
reference_number_supported: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
regulatory_reporting_code_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
regulatory_reporting_codes: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::RegulatoryReportingCode>>,
::std::string::String,
>,
remittance_information_lines: ::std::result::Result<
::std::option::Option<
::std::vec::Vec<super::RemittanceInformationLineInfo>,
>,
::std::string::String,
>,
remittance_information_required: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
remittance_reference_supported: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
requested_execution_date_max_period: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
requested_execution_date_supported: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
}
impl ::std::default::Default for ResponsePaymentType {
fn default() -> Self {
Self {
allowed_auth_methods: Ok(Default::default()),
charge_bearer_values: Ok(Default::default()),
creditor_account_schemas: Ok(Default::default()),
creditor_agent_bic_fi_required: Ok(
super::defaults::response_payment_type_creditor_agent_bic_fi_required(),
),
creditor_agent_clearing_system_member_id_required: Ok(
super::defaults::response_payment_type_creditor_agent_clearing_system_member_id_required(),
),
creditor_country_required: Ok(
super::defaults::response_payment_type_creditor_country_required(),
),
creditor_name_required: Ok(
super::defaults::response_payment_type_creditor_name_required(),
),
creditor_postal_address_required: Ok(
super::defaults::response_payment_type_creditor_postal_address_required(),
),
currencies: Ok(Default::default()),
debtor_account_required: Ok(
super::defaults::response_payment_type_debtor_account_required(),
),
debtor_account_schemas: Ok(Default::default()),
debtor_contact_email_required: Ok(
super::defaults::response_payment_type_debtor_contact_email_required(),
),
debtor_contact_phone_required: Ok(
super::defaults::response_payment_type_debtor_contact_phone_required(),
),
debtor_currency_required: Ok(
super::defaults::response_payment_type_debtor_currency_required(),
),
deferred_submission_supported: Ok(
super::defaults::response_payment_type_deferred_submission_supported(),
),
final_successful_statuses: Ok(Default::default()),
max_transactions: Ok(Default::default()),
payment_type: Err("no value supplied for payment_type".to_string()),
priority_codes: Ok(Default::default()),
psu_type: Err("no value supplied for psu_type".to_string()),
reference_number_schemas: Ok(Default::default()),
reference_number_supported: Ok(
super::defaults::response_payment_type_reference_number_supported(),
),
regulatory_reporting_code_required: Ok(
super::defaults::response_payment_type_regulatory_reporting_code_required(),
),
regulatory_reporting_codes: Ok(Default::default()),
remittance_information_lines: Ok(Default::default()),
remittance_information_required: Ok(
super::defaults::response_payment_type_remittance_information_required(),
),
remittance_reference_supported: Ok(
super::defaults::response_payment_type_remittance_reference_supported(),
),
requested_execution_date_max_period: Ok(Default::default()),
requested_execution_date_supported: Ok(
super::defaults::response_payment_type_requested_execution_date_supported(),
),
}
}
}
impl ResponsePaymentType {
pub fn allowed_auth_methods<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.allowed_auth_methods = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for allowed_auth_methods: {e}"
)
});
self
}
pub fn charge_bearer_values<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::std::vec::Vec<crate::types::ChargeBearerCode>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.charge_bearer_values = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for charge_bearer_values: {e}"
)
});
self
}
pub fn creditor_account_schemas<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<crate::types::SchemeName>>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor_account_schemas = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_account_schemas: {e}"
)
});
self
}
pub fn creditor_agent_bic_fi_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.creditor_agent_bic_fi_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_agent_bic_fi_required: {e}"
)
});
self
}
pub fn creditor_agent_clearing_system_member_id_required<T>(
mut self,
value: T,
) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.creditor_agent_clearing_system_member_id_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_agent_clearing_system_member_id_required: {e}"
)
});
self
}
pub fn creditor_country_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.creditor_country_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_country_required: {e}"
)
});
self
}
pub fn creditor_name_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.creditor_name_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_name_required: {e}"
)
});
self
}
pub fn creditor_postal_address_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.creditor_postal_address_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_postal_address_required: {e}"
)
});
self
}
pub fn currencies<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.currencies = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currencies: {e}")
});
self
}
pub fn debtor_account_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.debtor_account_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_account_required: {e}"
)
});
self
}
pub fn debtor_account_schemas<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<crate::types::SchemeName>>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_account_schemas = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_account_schemas: {e}"
)
});
self
}
pub fn debtor_contact_email_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.debtor_contact_email_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_contact_email_required: {e}"
)
});
self
}
pub fn debtor_contact_phone_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.debtor_contact_phone_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_contact_phone_required: {e}"
)
});
self
}
pub fn debtor_currency_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.debtor_currency_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_currency_required: {e}"
)
});
self
}
pub fn deferred_submission_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.deferred_submission_supported = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for deferred_submission_supported: {e}"
)
});
self
}
pub fn final_successful_statuses<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<crate::types::PaymentStatus>>,
>,
T::Error: ::std::fmt::Display,
{
self.final_successful_statuses = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for final_successful_statuses: {e}"
)
});
self
}
pub fn max_transactions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.max_transactions = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for max_transactions: {e}"
)
});
self
}
pub fn payment_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PaymentType>,
T::Error: ::std::fmt::Display,
{
self.payment_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_type: {e}")
});
self
}
pub fn priority_codes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<crate::types::PriorityCode>>,
>,
T::Error: ::std::fmt::Display,
{
self.priority_codes = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for priority_codes: {e}"
)
});
self
}
pub fn psu_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PsuType>,
T::Error: ::std::fmt::Display,
{
self.psu_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_type: {e}")
});
self
}
pub fn reference_number_schemas<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::std::vec::Vec<crate::types::ReferenceNumberScheme>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.reference_number_schemas = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_number_schemas: {e}"
)
});
self
}
pub fn reference_number_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.reference_number_supported = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_number_supported: {e}"
)
});
self
}
pub fn regulatory_reporting_code_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.regulatory_reporting_code_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for regulatory_reporting_code_required: {e}"
)
});
self
}
pub fn regulatory_reporting_codes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::std::vec::Vec<super::RegulatoryReportingCode>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.regulatory_reporting_codes = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for regulatory_reporting_codes: {e}"
)
});
self
}
pub fn remittance_information_lines<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::std::vec::Vec<super::RemittanceInformationLineInfo>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.remittance_information_lines = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remittance_information_lines: {e}"
)
});
self
}
pub fn remittance_information_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.remittance_information_required = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remittance_information_required: {e}"
)
});
self
}
pub fn remittance_reference_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.remittance_reference_supported = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remittance_reference_supported: {e}"
)
});
self
}
pub fn requested_execution_date_max_period<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.requested_execution_date_max_period = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for requested_execution_date_max_period: {e}"
)
});
self
}
pub fn requested_execution_date_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.requested_execution_date_supported = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for requested_execution_date_supported: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<ResponsePaymentType>
for super::ResponsePaymentType {
type Error = super::error::ConversionError;
fn try_from(
value: ResponsePaymentType,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
allowed_auth_methods: value.allowed_auth_methods?,
charge_bearer_values: value.charge_bearer_values?,
creditor_account_schemas: value.creditor_account_schemas?,
creditor_agent_bic_fi_required: value
.creditor_agent_bic_fi_required?,
creditor_agent_clearing_system_member_id_required: value
.creditor_agent_clearing_system_member_id_required?,
creditor_country_required: value.creditor_country_required?,
creditor_name_required: value.creditor_name_required?,
creditor_postal_address_required: value
.creditor_postal_address_required?,
currencies: value.currencies?,
debtor_account_required: value.debtor_account_required?,
debtor_account_schemas: value.debtor_account_schemas?,
debtor_contact_email_required: value.debtor_contact_email_required?,
debtor_contact_phone_required: value.debtor_contact_phone_required?,
debtor_currency_required: value.debtor_currency_required?,
deferred_submission_supported: value.deferred_submission_supported?,
final_successful_statuses: value.final_successful_statuses?,
max_transactions: value.max_transactions?,
payment_type: value.payment_type?,
priority_codes: value.priority_codes?,
psu_type: value.psu_type?,
reference_number_schemas: value.reference_number_schemas?,
reference_number_supported: value.reference_number_supported?,
regulatory_reporting_code_required: value
.regulatory_reporting_code_required?,
regulatory_reporting_codes: value.regulatory_reporting_codes?,
remittance_information_lines: value.remittance_information_lines?,
remittance_information_required: value
.remittance_information_required?,
remittance_reference_supported: value
.remittance_reference_supported?,
requested_execution_date_max_period: value
.requested_execution_date_max_period?,
requested_execution_date_supported: value
.requested_execution_date_supported?,
})
}
}
impl ::std::convert::From<super::ResponsePaymentType> for ResponsePaymentType {
fn from(value: super::ResponsePaymentType) -> Self {
Self {
allowed_auth_methods: Ok(value.allowed_auth_methods),
charge_bearer_values: Ok(value.charge_bearer_values),
creditor_account_schemas: Ok(value.creditor_account_schemas),
creditor_agent_bic_fi_required: Ok(
value.creditor_agent_bic_fi_required,
),
creditor_agent_clearing_system_member_id_required: Ok(
value.creditor_agent_clearing_system_member_id_required,
),
creditor_country_required: Ok(value.creditor_country_required),
creditor_name_required: Ok(value.creditor_name_required),
creditor_postal_address_required: Ok(
value.creditor_postal_address_required,
),
currencies: Ok(value.currencies),
debtor_account_required: Ok(value.debtor_account_required),
debtor_account_schemas: Ok(value.debtor_account_schemas),
debtor_contact_email_required: Ok(
value.debtor_contact_email_required,
),
debtor_contact_phone_required: Ok(
value.debtor_contact_phone_required,
),
debtor_currency_required: Ok(value.debtor_currency_required),
deferred_submission_supported: Ok(
value.deferred_submission_supported,
),
final_successful_statuses: Ok(value.final_successful_statuses),
max_transactions: Ok(value.max_transactions),
payment_type: Ok(value.payment_type),
priority_codes: Ok(value.priority_codes),
psu_type: Ok(value.psu_type),
reference_number_schemas: Ok(value.reference_number_schemas),
reference_number_supported: Ok(value.reference_number_supported),
regulatory_reporting_code_required: Ok(
value.regulatory_reporting_code_required,
),
regulatory_reporting_codes: Ok(value.regulatory_reporting_codes),
remittance_information_lines: Ok(value.remittance_information_lines),
remittance_information_required: Ok(
value.remittance_information_required,
),
remittance_reference_supported: Ok(
value.remittance_reference_supported,
),
requested_execution_date_max_period: Ok(
value.requested_execution_date_max_period,
),
requested_execution_date_supported: Ok(
value.requested_execution_date_supported,
),
}
}
}
#[derive(Clone, Debug)]
pub struct SandboxInfo {
users: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::SandboxUser>>,
::std::string::String,
>,
}
impl ::std::default::Default for SandboxInfo {
fn default() -> Self {
Self {
users: Ok(Default::default()),
}
}
}
impl SandboxInfo {
pub fn users<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::SandboxUser>>,
>,
T::Error: ::std::fmt::Display,
{
self.users = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for users: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SandboxInfo> for super::SandboxInfo {
type Error = super::error::ConversionError;
fn try_from(
value: SandboxInfo,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { users: value.users? })
}
}
impl ::std::convert::From<super::SandboxInfo> for SandboxInfo {
fn from(value: super::SandboxInfo) -> Self {
Self { users: Ok(value.users) }
}
}
#[derive(Clone, Debug)]
pub struct SandboxUser {
otp: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
password: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
username: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for SandboxUser {
fn default() -> Self {
Self {
otp: Ok(Default::default()),
password: Ok(Default::default()),
username: Ok(Default::default()),
}
}
}
impl SandboxUser {
pub fn otp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.otp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for otp: {e}")
});
self
}
pub fn password<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.password = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for password: {e}")
});
self
}
pub fn username<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.username = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for username: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SandboxUser> for super::SandboxUser {
type Error = super::error::ConversionError;
fn try_from(
value: SandboxUser,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
otp: value.otp?,
password: value.password?,
username: value.username?,
})
}
}
impl ::std::convert::From<super::SandboxUser> for SandboxUser {
fn from(value: super::SandboxUser) -> Self {
Self {
otp: Ok(value.otp),
password: Ok(value.password),
username: Ok(value.username),
}
}
}
#[derive(Clone, Debug)]
pub struct SessionAccount {
identification_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
identification_hashes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
uid: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
}
impl ::std::default::Default for SessionAccount {
fn default() -> Self {
Self {
identification_hash: Err(
"no value supplied for identification_hash".to_string(),
),
identification_hashes: Err(
"no value supplied for identification_hashes".to_string(),
),
uid: Err("no value supplied for uid".to_string()),
}
}
}
impl SessionAccount {
pub fn identification_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.identification_hash = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for identification_hash: {e}"
)
});
self
}
pub fn identification_hashes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.identification_hashes = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for identification_hashes: {e}"
)
});
self
}
pub fn uid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.uid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for uid: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SessionAccount> for super::SessionAccount {
type Error = super::error::ConversionError;
fn try_from(
value: SessionAccount,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
identification_hash: value.identification_hash?,
identification_hashes: value.identification_hashes?,
uid: value.uid?,
})
}
}
impl ::std::convert::From<super::SessionAccount> for SessionAccount {
fn from(value: super::SessionAccount) -> Self {
Self {
identification_hash: Ok(value.identification_hash),
identification_hashes: Ok(value.identification_hashes),
uid: Ok(value.uid),
}
}
}
#[derive(Clone, Debug)]
pub struct StartAuthorizationRequest {
access: ::std::result::Result<super::Access, ::std::string::String>,
aspsp: ::std::result::Result<super::Aspsp, ::std::string::String>,
auth_method: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
credentials: ::std::result::Result<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
::std::string::String,
>,
credentials_autosubmit: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
language: ::std::result::Result<
::std::option::Option<super::Language>,
::std::string::String,
>,
psu_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
psu_type: ::std::result::Result<
::std::option::Option<crate::types::PsuType>,
::std::string::String,
>,
redirect_url: ::std::result::Result<
super::RedirectUrl,
::std::string::String,
>,
state: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for StartAuthorizationRequest {
fn default() -> Self {
Self {
access: Err("no value supplied for access".to_string()),
aspsp: Err("no value supplied for aspsp".to_string()),
auth_method: Ok(Default::default()),
credentials: Ok(Default::default()),
credentials_autosubmit: Ok(
super::defaults::start_authorization_request_credentials_autosubmit(),
),
language: Ok(Default::default()),
psu_id: Ok(Default::default()),
psu_type: Ok(Default::default()),
redirect_url: Err("no value supplied for redirect_url".to_string()),
state: Err("no value supplied for state".to_string()),
}
}
}
impl StartAuthorizationRequest {
pub fn access<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Access>,
T::Error: ::std::fmt::Display,
{
self.access = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for access: {e}")
});
self
}
pub fn aspsp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Aspsp>,
T::Error: ::std::fmt::Display,
{
self.aspsp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aspsp: {e}")
});
self
}
pub fn auth_method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.auth_method = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for auth_method: {e}")
});
self
}
pub fn credentials<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.credentials = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for credentials: {e}")
});
self
}
pub fn credentials_autosubmit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.credentials_autosubmit = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for credentials_autosubmit: {e}"
)
});
self
}
pub fn language<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Language>>,
T::Error: ::std::fmt::Display,
{
self.language = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for language: {e}")
});
self
}
pub fn psu_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.psu_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_id: {e}")
});
self
}
pub fn psu_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<crate::types::PsuType>>,
T::Error: ::std::fmt::Display,
{
self.psu_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_type: {e}")
});
self
}
pub fn redirect_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RedirectUrl>,
T::Error: ::std::fmt::Display,
{
self.redirect_url = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for redirect_url: {e}")
});
self
}
pub fn state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.state = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for state: {e}")
});
self
}
}
impl ::std::convert::TryFrom<StartAuthorizationRequest>
for super::StartAuthorizationRequest {
type Error = super::error::ConversionError;
fn try_from(
value: StartAuthorizationRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
access: value.access?,
aspsp: value.aspsp?,
auth_method: value.auth_method?,
credentials: value.credentials?,
credentials_autosubmit: value.credentials_autosubmit?,
language: value.language?,
psu_id: value.psu_id?,
psu_type: value.psu_type?,
redirect_url: value.redirect_url?,
state: value.state?,
})
}
}
impl ::std::convert::From<super::StartAuthorizationRequest>
for StartAuthorizationRequest {
fn from(value: super::StartAuthorizationRequest) -> Self {
Self {
access: Ok(value.access),
aspsp: Ok(value.aspsp),
auth_method: Ok(value.auth_method),
credentials: Ok(value.credentials),
credentials_autosubmit: Ok(value.credentials_autosubmit),
language: Ok(value.language),
psu_id: Ok(value.psu_id),
psu_type: Ok(value.psu_type),
redirect_url: Ok(value.redirect_url),
state: Ok(value.state),
}
}
}
#[derive(Clone, Debug)]
pub struct StartAuthorizationResponse {
authorization_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
psu_id_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
url: ::std::result::Result<super::Url, ::std::string::String>,
}
impl ::std::default::Default for StartAuthorizationResponse {
fn default() -> Self {
Self {
authorization_id: Err(
"no value supplied for authorization_id".to_string(),
),
psu_id_hash: Err("no value supplied for psu_id_hash".to_string()),
url: Err("no value supplied for url".to_string()),
}
}
}
impl StartAuthorizationResponse {
pub fn authorization_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.authorization_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for authorization_id: {e}"
)
});
self
}
pub fn psu_id_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.psu_id_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for psu_id_hash: {e}")
});
self
}
pub fn url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Url>,
T::Error: ::std::fmt::Display,
{
self.url = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for url: {e}")
});
self
}
}
impl ::std::convert::TryFrom<StartAuthorizationResponse>
for super::StartAuthorizationResponse {
type Error = super::error::ConversionError;
fn try_from(
value: StartAuthorizationResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
authorization_id: value.authorization_id?,
psu_id_hash: value.psu_id_hash?,
url: value.url?,
})
}
}
impl ::std::convert::From<super::StartAuthorizationResponse>
for StartAuthorizationResponse {
fn from(value: super::StartAuthorizationResponse) -> Self {
Self {
authorization_id: Ok(value.authorization_id),
psu_id_hash: Ok(value.psu_id_hash),
url: Ok(value.url),
}
}
}
#[derive(Clone, Debug)]
pub struct StatusReasonInformation {
status_reason_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
status_reason_description: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for StatusReasonInformation {
fn default() -> Self {
Self {
status_reason_code: Err(
"no value supplied for status_reason_code".to_string(),
),
status_reason_description: Err(
"no value supplied for status_reason_description".to_string(),
),
}
}
}
impl StatusReasonInformation {
pub fn status_reason_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status_reason_code = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for status_reason_code: {e}"
)
});
self
}
pub fn status_reason_description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status_reason_description = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for status_reason_description: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<StatusReasonInformation>
for super::StatusReasonInformation {
type Error = super::error::ConversionError;
fn try_from(
value: StatusReasonInformation,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
status_reason_code: value.status_reason_code?,
status_reason_description: value.status_reason_description?,
})
}
}
impl ::std::convert::From<super::StatusReasonInformation>
for StatusReasonInformation {
fn from(value: super::StatusReasonInformation) -> Self {
Self {
status_reason_code: Ok(value.status_reason_code),
status_reason_description: Ok(value.status_reason_description),
}
}
}
#[derive(Clone, Debug)]
pub struct SubmitPaymentResponse {
final_status: ::std::result::Result<bool, ::std::string::String>,
payment_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
status: ::std::result::Result<
crate::types::PaymentStatus,
::std::string::String,
>,
status_reason_information: ::std::result::Result<
::std::option::Option<super::StatusReasonInformation>,
::std::string::String,
>,
}
impl ::std::default::Default for SubmitPaymentResponse {
fn default() -> Self {
Self {
final_status: Err("no value supplied for final_status".to_string()),
payment_id: Err("no value supplied for payment_id".to_string()),
status: Err("no value supplied for status".to_string()),
status_reason_information: Ok(Default::default()),
}
}
}
impl SubmitPaymentResponse {
pub fn final_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.final_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for final_status: {e}")
});
self
}
pub fn payment_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.payment_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for payment_id: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::PaymentStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for status: {e}")
});
self
}
pub fn status_reason_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::StatusReasonInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.status_reason_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for status_reason_information: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<SubmitPaymentResponse>
for super::SubmitPaymentResponse {
type Error = super::error::ConversionError;
fn try_from(
value: SubmitPaymentResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
final_status: value.final_status?,
payment_id: value.payment_id?,
status: value.status?,
status_reason_information: value.status_reason_information?,
})
}
}
impl ::std::convert::From<super::SubmitPaymentResponse>
for SubmitPaymentResponse {
fn from(value: super::SubmitPaymentResponse) -> Self {
Self {
final_status: Ok(value.final_status),
payment_id: Ok(value.payment_id),
status: Ok(value.status),
status_reason_information: Ok(value.status_reason_information),
}
}
}
#[derive(Clone, Debug)]
pub struct SuccessResponse {
message: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for SuccessResponse {
fn default() -> Self {
Self {
message: Ok(super::defaults::success_response_message()),
}
}
}
impl SuccessResponse {
pub fn message<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.message = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for message: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SuccessResponse> for super::SuccessResponse {
type Error = super::error::ConversionError;
fn try_from(
value: SuccessResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { message: value.message? })
}
}
impl ::std::convert::From<super::SuccessResponse> for SuccessResponse {
fn from(value: super::SuccessResponse) -> Self {
Self { message: Ok(value.message) }
}
}
#[derive(Clone, Debug)]
pub struct Transaction {
balance_after_transaction: ::std::result::Result<
::std::option::Option<crate::Amount>,
::std::string::String,
>,
bank_transaction_code: ::std::result::Result<
::std::option::Option<super::BankTransactionCode>,
::std::string::String,
>,
booking_date: ::std::result::Result<
::std::option::Option<::jiff::civil::Date>,
::std::string::String,
>,
credit_debit_indicator: ::std::result::Result<
crate::types::CreditDebitIndicator,
::std::string::String,
>,
creditor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
creditor_account: ::std::result::Result<
::std::option::Option<super::AccountIdentification>,
::std::string::String,
>,
creditor_account_additional_identification: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::GenericIdentification>>,
::std::string::String,
>,
creditor_agent: ::std::result::Result<
::std::option::Option<super::FinancialInstitutionIdentification>,
::std::string::String,
>,
debtor: ::std::result::Result<
::std::option::Option<super::PartyIdentification>,
::std::string::String,
>,
debtor_account: ::std::result::Result<
::std::option::Option<super::AccountIdentification>,
::std::string::String,
>,
debtor_account_additional_identification: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::GenericIdentification>>,
::std::string::String,
>,
debtor_agent: ::std::result::Result<
::std::option::Option<super::FinancialInstitutionIdentification>,
::std::string::String,
>,
entry_reference: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
exchange_rate: ::std::result::Result<
::std::option::Option<super::ExchangeRate>,
::std::string::String,
>,
merchant_category_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
note: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
reference_number: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
reference_number_schema: ::std::result::Result<
::std::option::Option<crate::types::ReferenceNumberScheme>,
::std::string::String,
>,
remittance_information: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
status: ::std::result::Result<
crate::types::TransactionStatus,
::std::string::String,
>,
transaction_amount: ::std::result::Result<
crate::Amount,
::std::string::String,
>,
transaction_date: ::std::result::Result<
::std::option::Option<::jiff::civil::Date>,
::std::string::String,
>,
transaction_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
value_date: ::std::result::Result<
::std::option::Option<::jiff::civil::Date>,
::std::string::String,
>,
}
impl ::std::default::Default for Transaction {
fn default() -> Self {
Self {
balance_after_transaction: Ok(Default::default()),
bank_transaction_code: Ok(Default::default()),
booking_date: Ok(Default::default()),
credit_debit_indicator: Err(
"no value supplied for credit_debit_indicator".to_string(),
),
creditor: Ok(Default::default()),
creditor_account: Ok(Default::default()),
creditor_account_additional_identification: Ok(Default::default()),
creditor_agent: Ok(Default::default()),
debtor: Ok(Default::default()),
debtor_account: Ok(Default::default()),
debtor_account_additional_identification: Ok(Default::default()),
debtor_agent: Ok(Default::default()),
entry_reference: Ok(Default::default()),
exchange_rate: Ok(Default::default()),
merchant_category_code: Ok(Default::default()),
note: Ok(Default::default()),
reference_number: Ok(Default::default()),
reference_number_schema: Ok(Default::default()),
remittance_information: Ok(Default::default()),
status: Err("no value supplied for status".to_string()),
transaction_amount: Err(
"no value supplied for transaction_amount".to_string(),
),
transaction_date: Ok(Default::default()),
transaction_id: Ok(Default::default()),
value_date: Ok(Default::default()),
}
}
}
impl Transaction {
pub fn balance_after_transaction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<crate::Amount>>,
T::Error: ::std::fmt::Display,
{
self.balance_after_transaction = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for balance_after_transaction: {e}"
)
});
self
}
pub fn bank_transaction_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::BankTransactionCode>,
>,
T::Error: ::std::fmt::Display,
{
self.bank_transaction_code = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for bank_transaction_code: {e}"
)
});
self
}
pub fn booking_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::civil::Date>>,
T::Error: ::std::fmt::Display,
{
self.booking_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for booking_date: {e}")
});
self
}
pub fn credit_debit_indicator<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::CreditDebitIndicator>,
T::Error: ::std::fmt::Display,
{
self.credit_debit_indicator = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for credit_debit_indicator: {e}"
)
});
self
}
pub fn creditor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for creditor: {e}")
});
self
}
pub fn creditor_account<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::AccountIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor_account = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_account: {e}"
)
});
self
}
pub fn creditor_account_additional_identification<T>(
mut self,
value: T,
) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::GenericIdentification>>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor_account_additional_identification = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_account_additional_identification: {e}"
)
});
self
}
pub fn creditor_agent<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::FinancialInstitutionIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.creditor_agent = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creditor_agent: {e}"
)
});
self
}
pub fn debtor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PartyIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for debtor: {e}")
});
self
}
pub fn debtor_account<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::AccountIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_account = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_account: {e}"
)
});
self
}
pub fn debtor_account_additional_identification<T>(
mut self,
value: T,
) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::GenericIdentification>>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_account_additional_identification = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for debtor_account_additional_identification: {e}"
)
});
self
}
pub fn debtor_agent<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::FinancialInstitutionIdentification>,
>,
T::Error: ::std::fmt::Display,
{
self.debtor_agent = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for debtor_agent: {e}")
});
self
}
pub fn entry_reference<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.entry_reference = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for entry_reference: {e}"
)
});
self
}
pub fn exchange_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ExchangeRate>>,
T::Error: ::std::fmt::Display,
{
self.exchange_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for exchange_rate: {e}")
});
self
}
pub fn merchant_category_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.merchant_category_code = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for merchant_category_code: {e}"
)
});
self
}
pub fn note<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.note = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for note: {e}")
});
self
}
pub fn reference_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.reference_number = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_number: {e}"
)
});
self
}
pub fn reference_number_schema<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<crate::types::ReferenceNumberScheme>,
>,
T::Error: ::std::fmt::Display,
{
self.reference_number_schema = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for reference_number_schema: {e}"
)
});
self
}
pub fn remittance_information<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.remittance_information = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remittance_information: {e}"
)
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::types::TransactionStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for status: {e}")
});
self
}
pub fn transaction_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<crate::Amount>,
T::Error: ::std::fmt::Display,
{
self.transaction_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for transaction_amount: {e}"
)
});
self
}
pub fn transaction_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::civil::Date>>,
T::Error: ::std::fmt::Display,
{
self.transaction_date = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for transaction_date: {e}"
)
});
self
}
pub fn transaction_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.transaction_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for transaction_id: {e}"
)
});
self
}
pub fn value_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::jiff::civil::Date>>,
T::Error: ::std::fmt::Display,
{
self.value_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for value_date: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Transaction> for super::Transaction {
type Error = super::error::ConversionError;
fn try_from(
value: Transaction,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
balance_after_transaction: value.balance_after_transaction?,
bank_transaction_code: value.bank_transaction_code?,
booking_date: value.booking_date?,
credit_debit_indicator: value.credit_debit_indicator?,
creditor: value.creditor?,
creditor_account: value.creditor_account?,
creditor_account_additional_identification: value
.creditor_account_additional_identification?,
creditor_agent: value.creditor_agent?,
debtor: value.debtor?,
debtor_account: value.debtor_account?,
debtor_account_additional_identification: value
.debtor_account_additional_identification?,
debtor_agent: value.debtor_agent?,
entry_reference: value.entry_reference?,
exchange_rate: value.exchange_rate?,
merchant_category_code: value.merchant_category_code?,
note: value.note?,
reference_number: value.reference_number?,
reference_number_schema: value.reference_number_schema?,
remittance_information: value.remittance_information?,
status: value.status?,
transaction_amount: value.transaction_amount?,
transaction_date: value.transaction_date?,
transaction_id: value.transaction_id?,
value_date: value.value_date?,
})
}
}
impl ::std::convert::From<super::Transaction> for Transaction {
fn from(value: super::Transaction) -> Self {
Self {
balance_after_transaction: Ok(value.balance_after_transaction),
bank_transaction_code: Ok(value.bank_transaction_code),
booking_date: Ok(value.booking_date),
credit_debit_indicator: Ok(value.credit_debit_indicator),
creditor: Ok(value.creditor),
creditor_account: Ok(value.creditor_account),
creditor_account_additional_identification: Ok(
value.creditor_account_additional_identification,
),
creditor_agent: Ok(value.creditor_agent),
debtor: Ok(value.debtor),
debtor_account: Ok(value.debtor_account),
debtor_account_additional_identification: Ok(
value.debtor_account_additional_identification,
),
debtor_agent: Ok(value.debtor_agent),
entry_reference: Ok(value.entry_reference),
exchange_rate: Ok(value.exchange_rate),
merchant_category_code: Ok(value.merchant_category_code),
note: Ok(value.note),
reference_number: Ok(value.reference_number),
reference_number_schema: Ok(value.reference_number_schema),
remittance_information: Ok(value.remittance_information),
status: Ok(value.status),
transaction_amount: Ok(value.transaction_amount),
transaction_date: Ok(value.transaction_date),
transaction_id: Ok(value.transaction_id),
value_date: Ok(value.value_date),
}
}
}
}
/// Generation of default values for serde.
pub mod defaults {
pub(super) fn access_balances() -> ::std::option::Option<bool> {
::std::option::Option::Some(true)
}
pub(super) fn access_transactions() -> ::std::option::Option<bool> {
::std::option::Option::Some(true)
}
pub(super) fn create_payment_request_defer_submission() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn payment_request_resource_debtor_currency() -> ::std::option::Option<
::std::string::String,
> {
::std::option::Option::Some("XXX".to_string())
}
pub(super) fn payment_request_resource_details_debtor_currency() -> ::std::option::Option<
::std::string::String,
> {
::std::option::Option::Some("XXX".to_string())
}
pub(super) fn response_payment_type_creditor_agent_bic_fi_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_creditor_agent_clearing_system_member_id_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_creditor_country_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_creditor_name_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_creditor_postal_address_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_debtor_account_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_debtor_contact_email_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_debtor_contact_phone_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_debtor_currency_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_deferred_submission_supported() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_reference_number_supported() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_regulatory_reporting_code_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_remittance_information_required() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_remittance_reference_supported() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn response_payment_type_requested_execution_date_supported() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(false)
}
pub(super) fn start_authorization_request_credentials_autosubmit() -> ::std::option::Option<
bool,
> {
::std::option::Option::Some(true)
}
pub(super) fn success_response_message() -> ::std::option::Option<
::std::string::String,
> {
::std::option::Option::Some("OK".to_string())
}
}
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(
&self,
f: &mut ::std::fmt::Formatter<'_>,
) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(
&self,
f: &mut ::std::fmt::Formatter<'_>,
) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///`AddressType`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum AddressType {
///`Business`
Business,
///`Correspondence`
Correspondence,
///`DeliveryTo`
DeliveryTo,
///`MailTo`
MailTo,
///`POBox`
PoBox,
///`Postal`
Postal,
///`Residential`
Residential,
///`Statement`
Statement,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl AddressType {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Business => "Business",
Self::Correspondence => "Correspondence",
Self::DeliveryTo => "DeliveryTo",
Self::MailTo => "MailTo",
Self::PoBox => "POBox",
Self::Postal => "Postal",
Self::Residential => "Residential",
Self::Statement => "Statement",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for AddressType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for AddressType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"Business" => Self::Business,
"Correspondence" => Self::Correspondence,
"DeliveryTo" => Self::DeliveryTo,
"MailTo" => Self::MailTo,
"POBox" => Self::PoBox,
"Postal" => Self::Postal,
"Residential" => Self::Residential,
"Statement" => Self::Statement,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for AddressType {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for AddressType {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for AddressType {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`AuthenticationApproach`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum AuthenticationApproach {
///`REDIRECT`
Redirect,
///`DECOUPLED`
Decoupled,
///`EMBEDDED`
Embedded,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl AuthenticationApproach {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Redirect => "REDIRECT",
Self::Decoupled => "DECOUPLED",
Self::Embedded => "EMBEDDED",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for AuthenticationApproach {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for AuthenticationApproach {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"REDIRECT" => Self::Redirect,
"DECOUPLED" => Self::Decoupled,
"EMBEDDED" => Self::Embedded,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for AuthenticationApproach {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for AuthenticationApproach {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for AuthenticationApproach {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`BalanceStatus`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum BalanceStatus {
///`CLAV`
Clav,
///`CLBD`
Clbd,
///`FWAV`
Fwav,
///`INFO`
Info,
///`ITAV`
Itav,
///`ITBD`
Itbd,
///`OPAV`
Opav,
///`OPBD`
Opbd,
///`PRCD`
Prcd,
///`OTHR`
Othr,
///`VALU`
Valu,
///`XPCD`
Xpcd,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl BalanceStatus {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Clav => "CLAV",
Self::Clbd => "CLBD",
Self::Fwav => "FWAV",
Self::Info => "INFO",
Self::Itav => "ITAV",
Self::Itbd => "ITBD",
Self::Opav => "OPAV",
Self::Opbd => "OPBD",
Self::Prcd => "PRCD",
Self::Othr => "OTHR",
Self::Valu => "VALU",
Self::Xpcd => "XPCD",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for BalanceStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for BalanceStatus {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"CLAV" => Self::Clav,
"CLBD" => Self::Clbd,
"FWAV" => Self::Fwav,
"INFO" => Self::Info,
"ITAV" => Self::Itav,
"ITBD" => Self::Itbd,
"OPAV" => Self::Opav,
"OPBD" => Self::Opbd,
"PRCD" => Self::Prcd,
"OTHR" => Self::Othr,
"VALU" => Self::Valu,
"XPCD" => Self::Xpcd,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for BalanceStatus {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for BalanceStatus {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for BalanceStatus {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`CashAccountType`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum CashAccountType {
///`CACC`
Cacc,
///`CASH`
Cash,
///`CARD`
Card,
///`LOAN`
Loan,
///`SVGS`
Svgs,
///`OTHR`
Othr,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl CashAccountType {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Cacc => "CACC",
Self::Cash => "CASH",
Self::Card => "CARD",
Self::Loan => "LOAN",
Self::Svgs => "SVGS",
Self::Othr => "OTHR",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for CashAccountType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for CashAccountType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"CACC" => Self::Cacc,
"CASH" => Self::Cash,
"CARD" => Self::Card,
"LOAN" => Self::Loan,
"SVGS" => Self::Svgs,
"OTHR" => Self::Othr,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for CashAccountType {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for CashAccountType {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for CashAccountType {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`CategoryPurposeCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum CategoryPurposeCode {
///`BONU`
Bonu,
///`CASH`
Cash,
///`CBLK`
Cblk,
///`CCRD`
Ccrd,
///`CORT`
Cort,
///`DCRD`
Dcrd,
///`DIVI`
Divi,
///`DVPM`
Dvpm,
///`EPAY`
Epay,
///`FCOL`
Fcol,
///`GOVT`
Govt,
///`HEDG`
Hedg,
///`ICCP`
Iccp,
///`IDCP`
Idcp,
///`INTC`
Intc,
///`INTE`
Inte,
///`LOAN`
Loan,
///`MP2B`
Mp2b,
///`MP2P`
Mp2p,
///`OTHR`
Othr,
///`PENS`
Pens,
///`RPRE`
Rpre,
///`RRCT`
Rrct,
///`RVPM`
Rvpm,
///`SALA`
Sala,
///`SECU`
Secu,
///`SSBE`
Ssbe,
///`SUPP`
Supp,
///`TAXS`
Taxs,
///`TRAD`
Trad,
///`TREA`
Trea,
///`VATX`
Vatx,
///`WHLD`
Whld,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl CategoryPurposeCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Bonu => "BONU",
Self::Cash => "CASH",
Self::Cblk => "CBLK",
Self::Ccrd => "CCRD",
Self::Cort => "CORT",
Self::Dcrd => "DCRD",
Self::Divi => "DIVI",
Self::Dvpm => "DVPM",
Self::Epay => "EPAY",
Self::Fcol => "FCOL",
Self::Govt => "GOVT",
Self::Hedg => "HEDG",
Self::Iccp => "ICCP",
Self::Idcp => "IDCP",
Self::Intc => "INTC",
Self::Inte => "INTE",
Self::Loan => "LOAN",
Self::Mp2b => "MP2B",
Self::Mp2p => "MP2P",
Self::Othr => "OTHR",
Self::Pens => "PENS",
Self::Rpre => "RPRE",
Self::Rrct => "RRCT",
Self::Rvpm => "RVPM",
Self::Sala => "SALA",
Self::Secu => "SECU",
Self::Ssbe => "SSBE",
Self::Supp => "SUPP",
Self::Taxs => "TAXS",
Self::Trad => "TRAD",
Self::Trea => "TREA",
Self::Vatx => "VATX",
Self::Whld => "WHLD",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for CategoryPurposeCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for CategoryPurposeCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"BONU" => Self::Bonu,
"CASH" => Self::Cash,
"CBLK" => Self::Cblk,
"CCRD" => Self::Ccrd,
"CORT" => Self::Cort,
"DCRD" => Self::Dcrd,
"DIVI" => Self::Divi,
"DVPM" => Self::Dvpm,
"EPAY" => Self::Epay,
"FCOL" => Self::Fcol,
"GOVT" => Self::Govt,
"HEDG" => Self::Hedg,
"ICCP" => Self::Iccp,
"IDCP" => Self::Idcp,
"INTC" => Self::Intc,
"INTE" => Self::Inte,
"LOAN" => Self::Loan,
"MP2B" => Self::Mp2b,
"MP2P" => Self::Mp2p,
"OTHR" => Self::Othr,
"PENS" => Self::Pens,
"RPRE" => Self::Rpre,
"RRCT" => Self::Rrct,
"RVPM" => Self::Rvpm,
"SALA" => Self::Sala,
"SECU" => Self::Secu,
"SSBE" => Self::Ssbe,
"SUPP" => Self::Supp,
"TAXS" => Self::Taxs,
"TRAD" => Self::Trad,
"TREA" => Self::Trea,
"VATX" => Self::Vatx,
"WHLD" => Self::Whld,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for CategoryPurposeCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for CategoryPurposeCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for CategoryPurposeCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`ChargeBearerCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum ChargeBearerCode {
///`SLEV`
Slev,
///`SHAR`
Shar,
///`DEBT`
Debt,
///`CRED`
Cred,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl ChargeBearerCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Slev => "SLEV",
Self::Shar => "SHAR",
Self::Debt => "DEBT",
Self::Cred => "CRED",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for ChargeBearerCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for ChargeBearerCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"SLEV" => Self::Slev,
"SHAR" => Self::Shar,
"DEBT" => Self::Debt,
"CRED" => Self::Cred,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for ChargeBearerCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for ChargeBearerCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for ChargeBearerCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`CreditDebitIndicator`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum CreditDebitIndicator {
///`CRDT`
Crdt,
///`DBIT`
Dbit,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl CreditDebitIndicator {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Crdt => "CRDT",
Self::Dbit => "DBIT",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for CreditDebitIndicator {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for CreditDebitIndicator {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"CRDT" => Self::Crdt,
"DBIT" => Self::Dbit,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for CreditDebitIndicator {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for CreditDebitIndicator {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for CreditDebitIndicator {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`Environment`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum Environment {
///`SANDBOX`
Sandbox,
///`PRODUCTION`
Production,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl Environment {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Sandbox => "SANDBOX",
Self::Production => "PRODUCTION",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for Environment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for Environment {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"SANDBOX" => Self::Sandbox,
"PRODUCTION" => Self::Production,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for Environment {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for Environment {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for Environment {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`ErrorCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum ErrorCode {
///`ACCESS_DENIED`
AccessDenied,
///`ACCOUNT_DOES_NOT_EXIST`
AccountDoesNotExist,
///`ALREADY_AUTHORIZED`
AlreadyAuthorized,
///`ASPSP_ACCOUNT_NOT_ACCESSIBLE`
AspspAccountNotAccessible,
///`ASPSP_ERROR`
AspspError,
///`ASPSP_TIMEOUT`
AspspTimeout,
///`ASPSP_RATE_LIMIT_EXCEEDED`
AspspRateLimitExceeded,
///`AUTHORIZATION_NOT_PROVIDED`
AuthorizationNotProvided,
///`CLOSED_SESSION`
ClosedSession,
///`DATE_TO_WITHOUT_DATE_FROM`
DateToWithoutDateFrom,
///`DATE_FROM_IN_FUTURE`
DateFromInFuture,
///`EXPIRED_AUTHORIZATION_CODE`
ExpiredAuthorizationCode,
///`EXPIRED_SESSION`
ExpiredSession,
///`INVALID_ACCOUNT_ID`
InvalidAccountId,
///`INVALID_HOST`
InvalidHost,
///`UNAUTHORIZED_IP`
UnauthorizedIp,
///`NO_ACCOUNTS_ADDED`
NoAccountsAdded,
///`PAYMENT_NOT_FOUND`
PaymentNotFound,
///`PSU_HEADER_NOT_PROVIDED`
PsuHeaderNotProvided,
///`PSU_HEADER_INVALID`
PsuHeaderInvalid,
///`REDIRECT_URI_NOT_ALLOWED`
RedirectUriNotAllowed,
///`REVOKED_SESSION`
RevokedSession,
///`SESSION_DOES_NOT_EXIST`
SessionDoesNotExist,
///`UNAUTHORIZED_ACCESS`
UnauthorizedAccess,
///`UNTRUSTED_PAYMENT_PARTY`
UntrustedPaymentParty,
///`WEBHOOK_URI_NOT_ALLOWED`
WebhookUriNotAllowed,
///`WRONG_ASPSP_PROVIDED`
WrongAspspProvided,
///`WRONG_AUTHORIZATION_CODE`
WrongAuthorizationCode,
///`WRONG_DATE_INTERVAL`
WrongDateInterval,
///`WRONG_CREDENTIALS_PROVIDED`
WrongCredentialsProvided,
///`WRONG_REQUEST_PARAMETERS`
WrongRequestParameters,
///`WRONG_SESSION_STATUS`
WrongSessionStatus,
///`WRONG_TRANSACTIONS_PERIOD`
WrongTransactionsPeriod,
///`WRONG_CONTINUATION_KEY`
WrongContinuationKey,
///`TRANSACTION_DOES_NOT_EXIST`
TransactionDoesNotExist,
///`PAYMENT_LIMIT_EXCEEDED`
PaymentLimitExceeded,
///`ASPSP_PAYMENT_NOT_ACCESSIBLE`
AspspPaymentNotAccessible,
///`INVALID_PAYMENT`
InvalidPayment,
///`ASPSP_PSU_ACTION_REQUIRED`
AspspPsuActionRequired,
///`PAYMENT_NOT_FINALIZED`
PaymentNotFinalized,
///`PAYMENT_SUBMISSION_NOT_SUPPORTED`
PaymentSubmissionNotSupported,
///`PAYMENT_NOT_AUTHORIZED`
PaymentNotAuthorized,
///`PAYMENT_SUBMISSION_NOT_DEFERRED`
PaymentSubmissionNotDeferred,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl ErrorCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::AccessDenied => "ACCESS_DENIED",
Self::AccountDoesNotExist => "ACCOUNT_DOES_NOT_EXIST",
Self::AlreadyAuthorized => "ALREADY_AUTHORIZED",
Self::AspspAccountNotAccessible => "ASPSP_ACCOUNT_NOT_ACCESSIBLE",
Self::AspspError => "ASPSP_ERROR",
Self::AspspTimeout => "ASPSP_TIMEOUT",
Self::AspspRateLimitExceeded => "ASPSP_RATE_LIMIT_EXCEEDED",
Self::AuthorizationNotProvided => "AUTHORIZATION_NOT_PROVIDED",
Self::ClosedSession => "CLOSED_SESSION",
Self::DateToWithoutDateFrom => "DATE_TO_WITHOUT_DATE_FROM",
Self::DateFromInFuture => "DATE_FROM_IN_FUTURE",
Self::ExpiredAuthorizationCode => "EXPIRED_AUTHORIZATION_CODE",
Self::ExpiredSession => "EXPIRED_SESSION",
Self::InvalidAccountId => "INVALID_ACCOUNT_ID",
Self::InvalidHost => "INVALID_HOST",
Self::UnauthorizedIp => "UNAUTHORIZED_IP",
Self::NoAccountsAdded => "NO_ACCOUNTS_ADDED",
Self::PaymentNotFound => "PAYMENT_NOT_FOUND",
Self::PsuHeaderNotProvided => "PSU_HEADER_NOT_PROVIDED",
Self::PsuHeaderInvalid => "PSU_HEADER_INVALID",
Self::RedirectUriNotAllowed => "REDIRECT_URI_NOT_ALLOWED",
Self::RevokedSession => "REVOKED_SESSION",
Self::SessionDoesNotExist => "SESSION_DOES_NOT_EXIST",
Self::UnauthorizedAccess => "UNAUTHORIZED_ACCESS",
Self::UntrustedPaymentParty => "UNTRUSTED_PAYMENT_PARTY",
Self::WebhookUriNotAllowed => "WEBHOOK_URI_NOT_ALLOWED",
Self::WrongAspspProvided => "WRONG_ASPSP_PROVIDED",
Self::WrongAuthorizationCode => "WRONG_AUTHORIZATION_CODE",
Self::WrongDateInterval => "WRONG_DATE_INTERVAL",
Self::WrongCredentialsProvided => "WRONG_CREDENTIALS_PROVIDED",
Self::WrongRequestParameters => "WRONG_REQUEST_PARAMETERS",
Self::WrongSessionStatus => "WRONG_SESSION_STATUS",
Self::WrongTransactionsPeriod => "WRONG_TRANSACTIONS_PERIOD",
Self::WrongContinuationKey => "WRONG_CONTINUATION_KEY",
Self::TransactionDoesNotExist => "TRANSACTION_DOES_NOT_EXIST",
Self::PaymentLimitExceeded => "PAYMENT_LIMIT_EXCEEDED",
Self::AspspPaymentNotAccessible => "ASPSP_PAYMENT_NOT_ACCESSIBLE",
Self::InvalidPayment => "INVALID_PAYMENT",
Self::AspspPsuActionRequired => "ASPSP_PSU_ACTION_REQUIRED",
Self::PaymentNotFinalized => "PAYMENT_NOT_FINALIZED",
Self::PaymentSubmissionNotSupported => "PAYMENT_SUBMISSION_NOT_SUPPORTED",
Self::PaymentNotAuthorized => "PAYMENT_NOT_AUTHORIZED",
Self::PaymentSubmissionNotDeferred => "PAYMENT_SUBMISSION_NOT_DEFERRED",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for ErrorCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for ErrorCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"ACCESS_DENIED" => Self::AccessDenied,
"ACCOUNT_DOES_NOT_EXIST" => Self::AccountDoesNotExist,
"ALREADY_AUTHORIZED" => Self::AlreadyAuthorized,
"ASPSP_ACCOUNT_NOT_ACCESSIBLE" => Self::AspspAccountNotAccessible,
"ASPSP_ERROR" => Self::AspspError,
"ASPSP_TIMEOUT" => Self::AspspTimeout,
"ASPSP_RATE_LIMIT_EXCEEDED" => Self::AspspRateLimitExceeded,
"AUTHORIZATION_NOT_PROVIDED" => Self::AuthorizationNotProvided,
"CLOSED_SESSION" => Self::ClosedSession,
"DATE_TO_WITHOUT_DATE_FROM" => Self::DateToWithoutDateFrom,
"DATE_FROM_IN_FUTURE" => Self::DateFromInFuture,
"EXPIRED_AUTHORIZATION_CODE" => Self::ExpiredAuthorizationCode,
"EXPIRED_SESSION" => Self::ExpiredSession,
"INVALID_ACCOUNT_ID" => Self::InvalidAccountId,
"INVALID_HOST" => Self::InvalidHost,
"UNAUTHORIZED_IP" => Self::UnauthorizedIp,
"NO_ACCOUNTS_ADDED" => Self::NoAccountsAdded,
"PAYMENT_NOT_FOUND" => Self::PaymentNotFound,
"PSU_HEADER_NOT_PROVIDED" => Self::PsuHeaderNotProvided,
"PSU_HEADER_INVALID" => Self::PsuHeaderInvalid,
"REDIRECT_URI_NOT_ALLOWED" => Self::RedirectUriNotAllowed,
"REVOKED_SESSION" => Self::RevokedSession,
"SESSION_DOES_NOT_EXIST" => Self::SessionDoesNotExist,
"UNAUTHORIZED_ACCESS" => Self::UnauthorizedAccess,
"UNTRUSTED_PAYMENT_PARTY" => Self::UntrustedPaymentParty,
"WEBHOOK_URI_NOT_ALLOWED" => Self::WebhookUriNotAllowed,
"WRONG_ASPSP_PROVIDED" => Self::WrongAspspProvided,
"WRONG_AUTHORIZATION_CODE" => Self::WrongAuthorizationCode,
"WRONG_DATE_INTERVAL" => Self::WrongDateInterval,
"WRONG_CREDENTIALS_PROVIDED" => Self::WrongCredentialsProvided,
"WRONG_REQUEST_PARAMETERS" => Self::WrongRequestParameters,
"WRONG_SESSION_STATUS" => Self::WrongSessionStatus,
"WRONG_TRANSACTIONS_PERIOD" => Self::WrongTransactionsPeriod,
"WRONG_CONTINUATION_KEY" => Self::WrongContinuationKey,
"TRANSACTION_DOES_NOT_EXIST" => Self::TransactionDoesNotExist,
"PAYMENT_LIMIT_EXCEEDED" => Self::PaymentLimitExceeded,
"ASPSP_PAYMENT_NOT_ACCESSIBLE" => Self::AspspPaymentNotAccessible,
"INVALID_PAYMENT" => Self::InvalidPayment,
"ASPSP_PSU_ACTION_REQUIRED" => Self::AspspPsuActionRequired,
"PAYMENT_NOT_FINALIZED" => Self::PaymentNotFinalized,
"PAYMENT_SUBMISSION_NOT_SUPPORTED" => {
Self::PaymentSubmissionNotSupported
}
"PAYMENT_NOT_AUTHORIZED" => Self::PaymentNotAuthorized,
"PAYMENT_SUBMISSION_NOT_DEFERRED" => {
Self::PaymentSubmissionNotDeferred
}
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for ErrorCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for ErrorCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for ErrorCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`ExecutionRule`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum ExecutionRule {
///`FWNG`
Fwng,
///`PREC`
Prec,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl ExecutionRule {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Fwng => "FWNG",
Self::Prec => "PREC",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for ExecutionRule {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for ExecutionRule {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"FWNG" => Self::Fwng,
"PREC" => Self::Prec,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for ExecutionRule {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for ExecutionRule {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for ExecutionRule {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`FrequencyCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum FrequencyCode {
///`DAIL`
Dail,
///`WEEK`
Week,
///`TOWK`
Towk,
///`MNTH`
Mnth,
///`TOMN`
Tomn,
///`QUTR`
Qutr,
///`SEMI`
Semi,
///`YEAR`
Year,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl FrequencyCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Dail => "DAIL",
Self::Week => "WEEK",
Self::Towk => "TOWK",
Self::Mnth => "MNTH",
Self::Tomn => "TOMN",
Self::Qutr => "QUTR",
Self::Semi => "SEMI",
Self::Year => "YEAR",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for FrequencyCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for FrequencyCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"DAIL" => Self::Dail,
"WEEK" => Self::Week,
"TOWK" => Self::Towk,
"MNTH" => Self::Mnth,
"TOMN" => Self::Tomn,
"QUTR" => Self::Qutr,
"SEMI" => Self::Semi,
"YEAR" => Self::Year,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for FrequencyCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for FrequencyCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for FrequencyCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`PSUType`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum PsuType {
///`business`
Business,
///`personal`
Personal,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl PsuType {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Business => "business",
Self::Personal => "personal",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for PsuType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for PsuType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"business" => Self::Business,
"personal" => Self::Personal,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for PsuType {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for PsuType {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for PsuType {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`PaymentStatus`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum PaymentStatus {
///`ACCC`
Accc,
///`ACCP`
Accp,
///`ACSC`
Acsc,
///`ACSP`
Acsp,
///`ACTC`
Actc,
///`ACWC`
Acwc,
///`ACWP`
Acwp,
///`PART`
Part,
///`RCVD`
Rcvd,
///`PDNG`
Pdng,
///`RJCT`
Rjct,
///`ACPT`
Acpt,
///`ACCR`
Accr,
///`RJCR`
Rjcr,
///`PACR`
Pacr,
///`PDCR`
Pdcr,
///`CNCL`
Cncl,
///`NULL`
Null,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl PaymentStatus {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Accc => "ACCC",
Self::Accp => "ACCP",
Self::Acsc => "ACSC",
Self::Acsp => "ACSP",
Self::Actc => "ACTC",
Self::Acwc => "ACWC",
Self::Acwp => "ACWP",
Self::Part => "PART",
Self::Rcvd => "RCVD",
Self::Pdng => "PDNG",
Self::Rjct => "RJCT",
Self::Acpt => "ACPT",
Self::Accr => "ACCR",
Self::Rjcr => "RJCR",
Self::Pacr => "PACR",
Self::Pdcr => "PDCR",
Self::Cncl => "CNCL",
Self::Null => "NULL",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for PaymentStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for PaymentStatus {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"ACCC" => Self::Accc,
"ACCP" => Self::Accp,
"ACSC" => Self::Acsc,
"ACSP" => Self::Acsp,
"ACTC" => Self::Actc,
"ACWC" => Self::Acwc,
"ACWP" => Self::Acwp,
"PART" => Self::Part,
"RCVD" => Self::Rcvd,
"PDNG" => Self::Pdng,
"RJCT" => Self::Rjct,
"ACPT" => Self::Acpt,
"ACCR" => Self::Accr,
"RJCR" => Self::Rjcr,
"PACR" => Self::Pacr,
"PDCR" => Self::Pdcr,
"CNCL" => Self::Cncl,
"NULL" => Self::Null,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for PaymentStatus {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for PaymentStatus {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for PaymentStatus {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`PaymentType`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum PaymentType {
///`SEPA`
Sepa,
///`INST_SEPA`
InstSepa,
///`DOMESTIC`
Domestic,
///`CROSSBORDER`
Crossborder,
///`DOMESTIC_PL_ELIXIR`
DomesticPlElixir,
///`DOMESTIC_PL_EXPRESS_ELIXIR`
DomesticPlExpressElixir,
///`DOMESTIC_PL_SORBNET`
DomesticPlSorbnet,
///`DOMESTIC_PL_BLUE_CASH`
DomesticPlBlueCash,
///`DOMESTIC_SE_GIRO`
DomesticSeGiro,
///`INTERNAL`
Internal,
///`BULK_SEPA`
BulkSepa,
///`BULK_DOMESTIC`
BulkDomestic,
///`BULK_DOMESTIC_SE_GIRO`
BulkDomesticSeGiro,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl PaymentType {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Sepa => "SEPA",
Self::InstSepa => "INST_SEPA",
Self::Domestic => "DOMESTIC",
Self::Crossborder => "CROSSBORDER",
Self::DomesticPlElixir => "DOMESTIC_PL_ELIXIR",
Self::DomesticPlExpressElixir => "DOMESTIC_PL_EXPRESS_ELIXIR",
Self::DomesticPlSorbnet => "DOMESTIC_PL_SORBNET",
Self::DomesticPlBlueCash => "DOMESTIC_PL_BLUE_CASH",
Self::DomesticSeGiro => "DOMESTIC_SE_GIRO",
Self::Internal => "INTERNAL",
Self::BulkSepa => "BULK_SEPA",
Self::BulkDomestic => "BULK_DOMESTIC",
Self::BulkDomesticSeGiro => "BULK_DOMESTIC_SE_GIRO",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for PaymentType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for PaymentType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"SEPA" => Self::Sepa,
"INST_SEPA" => Self::InstSepa,
"DOMESTIC" => Self::Domestic,
"CROSSBORDER" => Self::Crossborder,
"DOMESTIC_PL_ELIXIR" => Self::DomesticPlElixir,
"DOMESTIC_PL_EXPRESS_ELIXIR" => Self::DomesticPlExpressElixir,
"DOMESTIC_PL_SORBNET" => Self::DomesticPlSorbnet,
"DOMESTIC_PL_BLUE_CASH" => Self::DomesticPlBlueCash,
"DOMESTIC_SE_GIRO" => Self::DomesticSeGiro,
"INTERNAL" => Self::Internal,
"BULK_SEPA" => Self::BulkSepa,
"BULK_DOMESTIC" => Self::BulkDomestic,
"BULK_DOMESTIC_SE_GIRO" => Self::BulkDomesticSeGiro,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for PaymentType {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for PaymentType {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for PaymentType {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`PriorityCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum PriorityCode {
///`HIGH`
High,
///`NORM`
Norm,
///`EXPR`
Expr,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl PriorityCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::High => "HIGH",
Self::Norm => "NORM",
Self::Expr => "EXPR",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for PriorityCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for PriorityCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"HIGH" => Self::High,
"NORM" => Self::Norm,
"EXPR" => Self::Expr,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for PriorityCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for PriorityCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for PriorityCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`PurposeCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum PurposeCode {
///`ACCT`
Acct,
///`CASH`
Cash,
///`COMC`
Comc,
///`CPKC`
Cpkc,
///`TRPT`
Trpt,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl PurposeCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Acct => "ACCT",
Self::Cash => "CASH",
Self::Comc => "COMC",
Self::Cpkc => "CPKC",
Self::Trpt => "TRPT",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for PurposeCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for PurposeCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"ACCT" => Self::Acct,
"CASH" => Self::Cash,
"COMC" => Self::Comc,
"CPKC" => Self::Cpkc,
"TRPT" => Self::Trpt,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for PurposeCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for PurposeCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for PurposeCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`RateType`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum RateType {
///`SPOT`
Spot,
///`SALE`
Sale,
///`AGRD`
Agrd,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl RateType {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Spot => "SPOT",
Self::Sale => "SALE",
Self::Agrd => "AGRD",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for RateType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for RateType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"SPOT" => Self::Spot,
"SALE" => Self::Sale,
"AGRD" => Self::Agrd,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for RateType {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for RateType {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for RateType {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`ReferenceNumberScheme`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum ReferenceNumberScheme {
///`SEBG`
Sebg,
///`NORF`
Norf,
///`FIRF`
Firf,
///`INTL`
Intl,
///`BERF`
Berf,
///`SDDM`
Sddm,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl ReferenceNumberScheme {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Sebg => "SEBG",
Self::Norf => "NORF",
Self::Firf => "FIRF",
Self::Intl => "INTL",
Self::Berf => "BERF",
Self::Sddm => "SDDM",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for ReferenceNumberScheme {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for ReferenceNumberScheme {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"SEBG" => Self::Sebg,
"NORF" => Self::Norf,
"FIRF" => Self::Firf,
"INTL" => Self::Intl,
"BERF" => Self::Berf,
"SDDM" => Self::Sddm,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for ReferenceNumberScheme {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for ReferenceNumberScheme {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for ReferenceNumberScheme {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`SchemeName`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum SchemeName {
///`CHID`
Chid,
///`GS1G`
Gs1g,
///`DUNS`
Duns,
///`BANK`
Bank,
///`TXID`
Txid,
///`CUST`
Cust,
///`EMPL`
Empl,
///`OTHC`
Othc,
///`DRLC`
Drlc,
///`CUSI`
Cusi,
///`SOSE`
Sose,
///`ARNU`
Arnu,
///`CCPT`
Ccpt,
///`OTHI`
Othi,
///`COID`
Coid,
///`SREN`
Sren,
///`SRET`
Sret,
///`NIDN`
Nidn,
///`OAUT`
Oaut,
///`CPAN`
Cpan,
///`BBAN`
Bban,
///`IBAN`
Iban,
///`MIBN`
Mibn,
///`BGNR`
Bgnr,
///`PGNR`
Pgnr,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl SchemeName {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Chid => "CHID",
Self::Gs1g => "GS1G",
Self::Duns => "DUNS",
Self::Bank => "BANK",
Self::Txid => "TXID",
Self::Cust => "CUST",
Self::Empl => "EMPL",
Self::Othc => "OTHC",
Self::Drlc => "DRLC",
Self::Cusi => "CUSI",
Self::Sose => "SOSE",
Self::Arnu => "ARNU",
Self::Ccpt => "CCPT",
Self::Othi => "OTHI",
Self::Coid => "COID",
Self::Sren => "SREN",
Self::Sret => "SRET",
Self::Nidn => "NIDN",
Self::Oaut => "OAUT",
Self::Cpan => "CPAN",
Self::Bban => "BBAN",
Self::Iban => "IBAN",
Self::Mibn => "MIBN",
Self::Bgnr => "BGNR",
Self::Pgnr => "PGNR",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for SchemeName {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for SchemeName {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"CHID" => Self::Chid,
"GS1G" => Self::Gs1g,
"DUNS" => Self::Duns,
"BANK" => Self::Bank,
"TXID" => Self::Txid,
"CUST" => Self::Cust,
"EMPL" => Self::Empl,
"OTHC" => Self::Othc,
"DRLC" => Self::Drlc,
"CUSI" => Self::Cusi,
"SOSE" => Self::Sose,
"ARNU" => Self::Arnu,
"CCPT" => Self::Ccpt,
"OTHI" => Self::Othi,
"COID" => Self::Coid,
"SREN" => Self::Sren,
"SRET" => Self::Sret,
"NIDN" => Self::Nidn,
"OAUT" => Self::Oaut,
"CPAN" => Self::Cpan,
"BBAN" => Self::Bban,
"IBAN" => Self::Iban,
"MIBN" => Self::Mibn,
"BGNR" => Self::Bgnr,
"PGNR" => Self::Pgnr,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for SchemeName {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for SchemeName {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for SchemeName {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`Service`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum Service {
///`AIS`
Ais,
///`PIS`
Pis,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl Service {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Ais => "AIS",
Self::Pis => "PIS",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for Service {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for Service {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"AIS" => Self::Ais,
"PIS" => Self::Pis,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for Service {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for Service {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for Service {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`ServiceLevelCode`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum ServiceLevelCode {
///`BKTR`
Bktr,
///`G001`
G001,
///`G002`
G002,
///`G003`
G003,
///`G004`
G004,
///`NUGP`
Nugp,
///`NURG`
Nurg,
///`PRPT`
Prpt,
///`SDVA`
Sdva,
///`SEPA`
Sepa,
///`SVDE`
Svde,
///`URGP`
Urgp,
///`URNS`
Urns,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl ServiceLevelCode {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Bktr => "BKTR",
Self::G001 => "G001",
Self::G002 => "G002",
Self::G003 => "G003",
Self::G004 => "G004",
Self::Nugp => "NUGP",
Self::Nurg => "NURG",
Self::Prpt => "PRPT",
Self::Sdva => "SDVA",
Self::Sepa => "SEPA",
Self::Svde => "SVDE",
Self::Urgp => "URGP",
Self::Urns => "URNS",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for ServiceLevelCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for ServiceLevelCode {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"BKTR" => Self::Bktr,
"G001" => Self::G001,
"G002" => Self::G002,
"G003" => Self::G003,
"G004" => Self::G004,
"NUGP" => Self::Nugp,
"NURG" => Self::Nurg,
"PRPT" => Self::Prpt,
"SDVA" => Self::Sdva,
"SEPA" => Self::Sepa,
"SVDE" => Self::Svde,
"URGP" => Self::Urgp,
"URNS" => Self::Urns,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for ServiceLevelCode {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for ServiceLevelCode {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for ServiceLevelCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`SessionStatus`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum SessionStatus {
///`INVALID`
Invalid,
///`PENDING_AUTHORIZATION`
PendingAuthorization,
///`RETURNED_FROM_BANK`
ReturnedFromBank,
///`AUTHORIZED`
Authorized,
///`EXPIRED`
Expired,
///`CLOSED`
Closed,
///`REVOKED`
Revoked,
///`CANCELLED`
Cancelled,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl SessionStatus {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Invalid => "INVALID",
Self::PendingAuthorization => "PENDING_AUTHORIZATION",
Self::ReturnedFromBank => "RETURNED_FROM_BANK",
Self::Authorized => "AUTHORIZED",
Self::Expired => "EXPIRED",
Self::Closed => "CLOSED",
Self::Revoked => "REVOKED",
Self::Cancelled => "CANCELLED",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for SessionStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for SessionStatus {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"INVALID" => Self::Invalid,
"PENDING_AUTHORIZATION" => Self::PendingAuthorization,
"RETURNED_FROM_BANK" => Self::ReturnedFromBank,
"AUTHORIZED" => Self::Authorized,
"EXPIRED" => Self::Expired,
"CLOSED" => Self::Closed,
"REVOKED" => Self::Revoked,
"CANCELLED" => Self::Cancelled,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for SessionStatus {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for SessionStatus {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for SessionStatus {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`TransactionStatus`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum TransactionStatus {
///`BOOK`
Book,
///`CNCL`
Cncl,
///`HOLD`
Hold,
///`OTHR`
Othr,
///`PDNG`
Pdng,
///`RJCT`
Rjct,
///`SCHD`
Schd,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl TransactionStatus {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Book => "BOOK",
Self::Cncl => "CNCL",
Self::Hold => "HOLD",
Self::Othr => "OTHR",
Self::Pdng => "PDNG",
Self::Rjct => "RJCT",
Self::Schd => "SCHD",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for TransactionStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for TransactionStatus {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"BOOK" => Self::Book,
"CNCL" => Self::Cncl,
"HOLD" => Self::Hold,
"OTHR" => Self::Othr,
"PDNG" => Self::Pdng,
"RJCT" => Self::Rjct,
"SCHD" => Self::Schd,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for TransactionStatus {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for TransactionStatus {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for TransactionStatus {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`TransactionsFetchStrategy`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum TransactionsFetchStrategy {
///`default`
Default,
///`longest`
Longest,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl TransactionsFetchStrategy {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Default => "default",
Self::Longest => "longest",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for TransactionsFetchStrategy {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for TransactionsFetchStrategy {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"default" => Self::Default,
"longest" => Self::Longest,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for TransactionsFetchStrategy {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for TransactionsFetchStrategy {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for TransactionsFetchStrategy {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
///`Usage`
///
/// Values the description does not list arrive as [`Self::Unknown`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[non_exhaustive]
pub enum Usage {
///`PRIV`
Priv,
///`ORGA`
Orga,
/// A value this version of the description does not list, kept as sent.
Unknown(::std::string::String),
}
impl Usage {
/// The value as the API spells it.
pub fn as_str(&self) -> &str {
match self {
Self::Priv => "PRIV",
Self::Orga => "ORGA",
Self::Unknown(value) => value,
}
}
}
impl ::std::fmt::Display for Usage {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl ::std::str::FromStr for Usage {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(
match value {
"PRIV" => Self::Priv,
"ORGA" => Self::Orga,
other => Self::Unknown(other.to_owned()),
},
)
}
}
impl ::std::convert::From<&str> for Usage {
fn from(value: &str) -> Self {
match value.parse() {
Ok(parsed) => parsed,
Err(never) => match never {}
}
}
}
impl ::serde::Serialize for Usage {
fn serialize<S: ::serde::Serializer>(
&self,
serializer: S,
) -> ::std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> ::serde::Deserialize<'de> for Usage {
fn deserialize<D: ::serde::Deserializer<'de>>(
deserializer: D,
) -> ::std::result::Result<Self, D::Error> {
let value = <::std::string::String as ::serde::Deserialize>::deserialize(
deserializer,
)?;
Ok(Self::from(value.as_str()))
}
}
}
#[derive(Clone, Debug)]
/**Client for API reference
Version: 1.0.0-967df6a1*/
pub struct Client {
pub(crate) baseurl: String,
pub(crate) client: reqwest::Client,
pub(crate) inner: crate::auth::Signer,
}
impl Client {
/// Create a new client.
///
/// `baseurl` is the base URL provided to the internal
/// `reqwest::Client`, and should include a scheme and hostname,
/// as well as port and a path stem if applicable.
pub fn new(baseurl: &str, inner: crate::auth::Signer) -> Self {
#[cfg(not(target_arch = "wasm32"))]
let client = {
let dur = ::std::time::Duration::from_secs(15u64);
reqwest::ClientBuilder::new().connect_timeout(dur).timeout(dur)
};
#[cfg(target_arch = "wasm32")]
let client = reqwest::ClientBuilder::new();
Self::new_with_client(baseurl, client.build().unwrap(), inner)
}
/// Construct a new client with an existing `reqwest::Client`,
/// allowing more control over its configuration.
///
/// `baseurl` is the base URL provided to the internal
/// `reqwest::Client`, and should include a scheme and hostname,
/// as well as port and a path stem if applicable.
pub fn new_with_client(
baseurl: &str,
client: reqwest::Client,
inner: crate::auth::Signer,
) -> Self {
Self {
baseurl: baseurl.to_string(),
client,
inner,
}
}
}
impl ClientInfo<crate::auth::Signer> for Client {
fn api_version() -> &'static str {
"1.0.0-967df6a1"
}
fn baseurl(&self) -> &str {
self.baseurl.as_str()
}
fn client(&self) -> &reqwest::Client {
&self.client
}
fn inner(&self) -> &crate::auth::Signer {
&self.inner
}
}
const _: () = {
#[allow(dead_code)]
fn assert_client_hooks()
where
Client: ClientHooks<crate::auth::Signer>,
{}
};
impl Client {
/**Get account balances
Fetching account balances from ASPSP for an account by its ID
Sends a `GET` request to `/accounts/{account_id}/balances`
Arguments:
- `account_id`: PSU account ID accessible in the provided session
- `psu_accept`: PSU accept header
- `psu_accept_charset`: PSU charset
- `psu_accept_encoding`: PSU accept encoding
- `psu_accept_language`: PSU accept language
- `psu_geo_location`: Comma separated latitude and longitude coordinates without spaces
- `psu_ip_address`: PSU IP address
- `psu_referer`: PSU Referer
- `psu_user_agent`: PSU browser User Agent
```text
let response = client.get_account_balances()
.account_id(account_id)
.psu_accept(psu_accept)
.psu_accept_charset(psu_accept_charset)
.psu_accept_encoding(psu_accept_encoding)
.psu_accept_language(psu_accept_language)
.psu_geo_location(psu_geo_location)
.psu_ip_address(psu_ip_address)
.psu_referer(psu_referer)
.psu_user_agent(psu_user_agent)
.send()
.await;
```*/
pub fn get_account_balances(&self) -> builder::GetAccountBalances<'_> {
builder::GetAccountBalances::new(self)
}
/**Get account details
Fetching account details from ASPSP for an account by its ID
Sends a `GET` request to `/accounts/{account_id}/details`
Arguments:
- `account_id`: Account ID
- `psu_accept`: PSU accept header
- `psu_accept_charset`: PSU charset
- `psu_accept_encoding`: PSU accept encoding
- `psu_accept_language`: PSU accept language
- `psu_geo_location`: Comma separated latitude and longitude coordinates without spaces
- `psu_ip_address`: PSU IP address
- `psu_referer`: PSU Referer
- `psu_user_agent`: PSU browser User Agent
```text
let response = client.get_account_details()
.account_id(account_id)
.psu_accept(psu_accept)
.psu_accept_charset(psu_accept_charset)
.psu_accept_encoding(psu_accept_encoding)
.psu_accept_language(psu_accept_language)
.psu_geo_location(psu_geo_location)
.psu_ip_address(psu_ip_address)
.psu_referer(psu_referer)
.psu_user_agent(psu_user_agent)
.send()
.await;
```*/
pub fn get_account_details(&self) -> builder::GetAccountDetails<'_> {
builder::GetAccountDetails::new(self)
}
/**Get account transactions
Fetching account transactions from ASPSP for an account by its ID
Sends a `GET` request to `/accounts/{account_id}/transactions`
Arguments:
- `account_id`: PSU account ID accessible in the provided session
- `continuation_key`: Key, allowing iterate over multiple API pages of transactions
- `date_from`: Date to fetch transactions from (including the date, UTC timezone is assumed)
- `date_to`: Date to fetch transactions to (including the date, UTC timezone is assumed)
- `strategy`: Strategy how transaction are fetched
- `transaction_status`: Filter transactions by provided status
- `psu_accept`: PSU accept header
- `psu_accept_charset`: PSU charset
- `psu_accept_encoding`: PSU accept encoding
- `psu_accept_language`: PSU accept language
- `psu_geo_location`: Comma separated latitude and longitude coordinates without spaces
- `psu_ip_address`: PSU IP address
- `psu_referer`: PSU Referer
- `psu_user_agent`: PSU browser User Agent
```text
let response = client.get_account_transactions()
.account_id(account_id)
.continuation_key(continuation_key)
.date_from(date_from)
.date_to(date_to)
.strategy(strategy)
.transaction_status(transaction_status)
.psu_accept(psu_accept)
.psu_accept_charset(psu_accept_charset)
.psu_accept_encoding(psu_accept_encoding)
.psu_accept_language(psu_accept_language)
.psu_geo_location(psu_geo_location)
.psu_ip_address(psu_ip_address)
.psu_referer(psu_referer)
.psu_user_agent(psu_user_agent)
.send()
.await;
```*/
pub fn get_account_transactions(&self) -> builder::GetAccountTransactions<'_> {
builder::GetAccountTransactions::new(self)
}
/**Get transaction details
Fetching transaction details from ASPSP for an account transaction by its ID
Sends a `GET` request to `/accounts/{account_id}/transactions/{transaction_id}`
Arguments:
- `account_id`: Account ID
- `transaction_id`: Transaction ID
- `psu_accept`: PSU accept header
- `psu_accept_charset`: PSU charset
- `psu_accept_encoding`: PSU accept encoding
- `psu_accept_language`: PSU accept language
- `psu_geo_location`: Comma separated latitude and longitude coordinates without spaces
- `psu_ip_address`: PSU IP address
- `psu_referer`: PSU Referer
- `psu_user_agent`: PSU browser User Agent
```text
let response = client.get_transaction()
.account_id(account_id)
.transaction_id(transaction_id)
.psu_accept(psu_accept)
.psu_accept_charset(psu_accept_charset)
.psu_accept_encoding(psu_accept_encoding)
.psu_accept_language(psu_accept_language)
.psu_geo_location(psu_geo_location)
.psu_ip_address(psu_ip_address)
.psu_referer(psu_referer)
.psu_user_agent(psu_user_agent)
.send()
.await;
```*/
pub fn get_transaction(&self) -> builder::GetTransaction<'_> {
builder::GetTransaction::new(self)
}
/**Get application
Get application associated with provided JWT key ID
Sends a `GET` request to `/application`
```text
let response = client.get_application()
.send()
.await;
```*/
pub fn get_application(&self) -> builder::GetApplication<'_> {
builder::GetApplication::new(self)
}
/**Get list of ASPSPs
Get list of ASPSPs with their meta information
Sends a `GET` request to `/aspsps`
Arguments:
- `country`: Display only ASPSPs from specified country
- `payment_type`: Display only ASPSPs which support specified payment type
- `psu_type`: Display only ASPSPs which support specified psu type
- `service`: Display only ASPSPs which support specified service
```text
let response = client.get_aspsps()
.country(country)
.payment_type(payment_type)
.psu_type(psu_type)
.service(service)
.send()
.await;
```*/
pub fn get_aspsps(&self) -> builder::GetAspsps<'_> {
builder::GetAspsps::new(self)
}
/**Start user authorization
Start authorization by getting a redirect link and redirecting a PSU to that link
Sends a `POST` request to `/auth`
```text
let response = client.start_authorization()
.body(body)
.send()
.await;
```*/
pub fn start_authorization(&self) -> builder::StartAuthorization<'_> {
builder::StartAuthorization::new(self)
}
/**Create payment
Creating a payment consisting of one or multiple payment transactions
Sends a `POST` request to `/payments`
```text
let response = client.create_payment()
.body(body)
.send()
.await;
```*/
pub fn create_payment(&self) -> builder::CreatePayment<'_> {
builder::CreatePayment::new(self)
}
/**Get payment
Fetching payment status and details
Sends a `GET` request to `/payments/{payment_id}`
Arguments:
- `payment_id`: Payment ID
```text
let response = client.get_payment()
.payment_id(payment_id)
.send()
.await;
```*/
pub fn get_payment(&self) -> builder::GetPayment<'_> {
builder::GetPayment::new(self)
}
/**Delete payment
Delete finished or failed payment
Sends a `DELETE` request to `/payments/{payment_id}`
Arguments:
- `payment_id`: Payment ID
```text
let response = client.delete_payment()
.payment_id(payment_id)
.send()
.await;
```*/
pub fn delete_payment(&self) -> builder::DeletePayment<'_> {
builder::DeletePayment::new(self)
}
/**Submit payment for execution
Explicitly submit a payment for execution. The payment must have been created with defer_submission=true, be in authorized state (PSU has completed authorization at the ASPSP), and not yet submitted for execution.
Sends a `POST` request to `/payments/{payment_id}/submit`
Arguments:
- `payment_id`: Payment ID
- `body`
```text
let response = client.submit_payment()
.payment_id(payment_id)
.body(body)
.send()
.await;
```*/
pub fn submit_payment(&self) -> builder::SubmitPayment<'_> {
builder::SubmitPayment::new(self)
}
/**Get payment transaction
Fetching transaction details for a single transaction within a bulk payment
Sends a `GET` request to `/payments/{payment_id}/transactions/{transaction_id}`
Arguments:
- `payment_id`: Payment ID
- `transaction_id`: Transaction ID
```text
let response = client.get_payment_transaction()
.payment_id(payment_id)
.transaction_id(transaction_id)
.send()
.await;
```*/
pub fn get_payment_transaction(&self) -> builder::GetPaymentTransaction<'_> {
builder::GetPaymentTransaction::new(self)
}
/**Authorize user session
Authorize user session by provided authorization code
Sends a `POST` request to `/sessions`
```text
let response = client.authorize_session()
.body(body)
.send()
.await;
```*/
pub fn authorize_session(&self) -> builder::AuthorizeSession<'_> {
builder::AuthorizeSession::new(self)
}
/**Get session data
Get session data by session ID
Sends a `GET` request to `/sessions/{session_id}`
Arguments:
- `session_id`: Previously authorized session ID
```text
let response = client.get_session()
.session_id(session_id)
.send()
.await;
```*/
pub fn get_session(&self) -> builder::GetSession<'_> {
builder::GetSession::new(self)
}
/**Delete session
Delete session by session ID. PSU's bank consent will be closed automatically if possible
Sends a `DELETE` request to `/sessions/{session_id}`
Arguments:
- `session_id`: Previously authorized session ID
- `psu_accept`: PSU accept header
- `psu_accept_charset`: PSU charset
- `psu_accept_encoding`: PSU accept encoding
- `psu_accept_language`: PSU accept language
- `psu_geo_location`: Comma separated latitude and longitude coordinates without spaces
- `psu_ip_address`: PSU IP address
- `psu_referer`: PSU Referer
- `psu_user_agent`: PSU browser User Agent
```text
let response = client.delete_session()
.session_id(session_id)
.psu_accept(psu_accept)
.psu_accept_charset(psu_accept_charset)
.psu_accept_encoding(psu_accept_encoding)
.psu_accept_language(psu_accept_language)
.psu_geo_location(psu_geo_location)
.psu_ip_address(psu_ip_address)
.psu_referer(psu_referer)
.psu_user_agent(psu_user_agent)
.send()
.await;
```*/
pub fn delete_session(&self) -> builder::DeleteSession<'_> {
builder::DeleteSession::new(self)
}
}
/// Types for composing operation parameters.
#[allow(clippy::all)]
pub mod builder {
use super::types;
#[allow(unused_imports)]
use super::{
encode_path, ByteStream, ClientInfo, ClientHooks, Error, OperationInfo,
RequestBuilderExt, ResponseValue,
};
/**Builder for [`Client::get_account_balances`]
[`Client::get_account_balances`]: super::Client::get_account_balances*/
#[derive(Debug, Clone)]
pub struct GetAccountBalances<'a> {
client: &'a super::Client,
account_id: Result<::uuid::Uuid, String>,
psu_accept: Result<Option<::std::string::String>, String>,
psu_accept_charset: Result<Option<::std::string::String>, String>,
psu_accept_encoding: Result<Option<::std::string::String>, String>,
psu_accept_language: Result<Option<::std::string::String>, String>,
psu_geo_location: Result<Option<types::PsuGeoLocation>, String>,
psu_ip_address: Result<Option<::std::string::String>, String>,
psu_referer: Result<Option<::std::string::String>, String>,
psu_user_agent: Result<Option<::std::string::String>, String>,
}
impl<'a> GetAccountBalances<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
psu_accept: Ok(None),
psu_accept_charset: Ok(None),
psu_accept_encoding: Ok(None),
psu_accept_language: Ok(None),
psu_geo_location: Ok(None),
psu_ip_address: Ok(None),
psu_referer: Ok(None),
psu_user_agent: Ok(None),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.account_id = value
.try_into()
.map_err(|_| {
"conversion to `:: uuid :: Uuid` for account_id failed".to_string()
});
self
}
pub fn psu_accept<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept failed"
.to_string()
});
self
}
pub fn psu_accept_charset<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_charset = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_charset failed"
.to_string()
});
self
}
pub fn psu_accept_encoding<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_encoding = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_encoding failed"
.to_string()
});
self
}
pub fn psu_accept_language<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_language = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_language failed"
.to_string()
});
self
}
pub fn psu_geo_location<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::PsuGeoLocation>,
{
self.psu_geo_location = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `PsuGeoLocation` for psu_geo_location failed"
.to_string()
});
self
}
pub fn psu_ip_address<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_ip_address = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_ip_address failed"
.to_string()
});
self
}
pub fn psu_referer<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_referer = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_referer failed"
.to_string()
});
self
}
pub fn psu_user_agent<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_user_agent = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_user_agent failed"
.to_string()
});
self
}
///Sends a `GET` request to `/accounts/{account_id}/balances`
pub async fn send(
self,
) -> Result<ResponseValue<types::HalBalances>, Error<types::ErrorResponse>> {
let Self {
client,
account_id,
psu_accept,
psu_accept_charset,
psu_accept_encoding,
psu_accept_language,
psu_geo_location,
psu_ip_address,
psu_referer,
psu_user_agent,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let psu_accept = psu_accept.map_err(Error::InvalidRequest)?;
let psu_accept_charset = psu_accept_charset.map_err(Error::InvalidRequest)?;
let psu_accept_encoding = psu_accept_encoding
.map_err(Error::InvalidRequest)?;
let psu_accept_language = psu_accept_language
.map_err(Error::InvalidRequest)?;
let psu_geo_location = psu_geo_location.map_err(Error::InvalidRequest)?;
let psu_ip_address = psu_ip_address.map_err(Error::InvalidRequest)?;
let psu_referer = psu_referer.map_err(Error::InvalidRequest)?;
let psu_user_agent = psu_user_agent.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/balances", client.baseurl, encode_path(& account_id
.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(9usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
if let Some(value) = psu_accept {
header_map.append("Psu-Accept", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_charset {
header_map.append("Psu-Accept-Charset", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_encoding {
header_map.append("Psu-Accept-Encoding", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_language {
header_map.append("Psu-Accept-language", value.to_string().try_into()?);
}
if let Some(value) = psu_geo_location {
header_map.append("Psu-Geo-Location", value.to_string().try_into()?);
}
if let Some(value) = psu_ip_address {
header_map.append("Psu-Ip-Address", value.to_string().try_into()?);
}
if let Some(value) = psu_referer {
header_map.append("Psu-Referer", value.to_string().try_into()?);
}
if let Some(value) = psu_user_agent {
header_map.append("Psu-User-Agent", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_account_balances",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_account_details`]
[`Client::get_account_details`]: super::Client::get_account_details*/
#[derive(Debug, Clone)]
pub struct GetAccountDetails<'a> {
client: &'a super::Client,
account_id: Result<::uuid::Uuid, String>,
psu_accept: Result<Option<::std::string::String>, String>,
psu_accept_charset: Result<Option<::std::string::String>, String>,
psu_accept_encoding: Result<Option<::std::string::String>, String>,
psu_accept_language: Result<Option<::std::string::String>, String>,
psu_geo_location: Result<Option<types::PsuGeoLocation>, String>,
psu_ip_address: Result<Option<::std::string::String>, String>,
psu_referer: Result<Option<::std::string::String>, String>,
psu_user_agent: Result<Option<::std::string::String>, String>,
}
impl<'a> GetAccountDetails<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
psu_accept: Ok(None),
psu_accept_charset: Ok(None),
psu_accept_encoding: Ok(None),
psu_accept_language: Ok(None),
psu_geo_location: Ok(None),
psu_ip_address: Ok(None),
psu_referer: Ok(None),
psu_user_agent: Ok(None),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.account_id = value
.try_into()
.map_err(|_| {
"conversion to `:: uuid :: Uuid` for account_id failed".to_string()
});
self
}
pub fn psu_accept<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept failed"
.to_string()
});
self
}
pub fn psu_accept_charset<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_charset = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_charset failed"
.to_string()
});
self
}
pub fn psu_accept_encoding<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_encoding = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_encoding failed"
.to_string()
});
self
}
pub fn psu_accept_language<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_language = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_language failed"
.to_string()
});
self
}
pub fn psu_geo_location<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::PsuGeoLocation>,
{
self.psu_geo_location = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `PsuGeoLocation` for psu_geo_location failed"
.to_string()
});
self
}
pub fn psu_ip_address<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_ip_address = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_ip_address failed"
.to_string()
});
self
}
pub fn psu_referer<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_referer = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_referer failed"
.to_string()
});
self
}
pub fn psu_user_agent<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_user_agent = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_user_agent failed"
.to_string()
});
self
}
///Sends a `GET` request to `/accounts/{account_id}/details`
pub async fn send(
self,
) -> Result<ResponseValue<types::AccountResource>, Error<types::ErrorResponse>> {
let Self {
client,
account_id,
psu_accept,
psu_accept_charset,
psu_accept_encoding,
psu_accept_language,
psu_geo_location,
psu_ip_address,
psu_referer,
psu_user_agent,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let psu_accept = psu_accept.map_err(Error::InvalidRequest)?;
let psu_accept_charset = psu_accept_charset.map_err(Error::InvalidRequest)?;
let psu_accept_encoding = psu_accept_encoding
.map_err(Error::InvalidRequest)?;
let psu_accept_language = psu_accept_language
.map_err(Error::InvalidRequest)?;
let psu_geo_location = psu_geo_location.map_err(Error::InvalidRequest)?;
let psu_ip_address = psu_ip_address.map_err(Error::InvalidRequest)?;
let psu_referer = psu_referer.map_err(Error::InvalidRequest)?;
let psu_user_agent = psu_user_agent.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/details", client.baseurl, encode_path(& account_id
.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(9usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
if let Some(value) = psu_accept {
header_map.append("Psu-Accept", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_charset {
header_map.append("Psu-Accept-Charset", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_encoding {
header_map.append("Psu-Accept-Encoding", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_language {
header_map.append("Psu-Accept-language", value.to_string().try_into()?);
}
if let Some(value) = psu_geo_location {
header_map.append("Psu-Geo-Location", value.to_string().try_into()?);
}
if let Some(value) = psu_ip_address {
header_map.append("Psu-Ip-Address", value.to_string().try_into()?);
}
if let Some(value) = psu_referer {
header_map.append("Psu-Referer", value.to_string().try_into()?);
}
if let Some(value) = psu_user_agent {
header_map.append("Psu-User-Agent", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_account_details",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_account_transactions`]
[`Client::get_account_transactions`]: super::Client::get_account_transactions*/
#[derive(Debug, Clone)]
pub struct GetAccountTransactions<'a> {
client: &'a super::Client,
account_id: Result<::uuid::Uuid, String>,
continuation_key: Result<Option<::std::string::String>, String>,
date_from: Result<Option<::jiff::civil::Date>, String>,
date_to: Result<Option<::jiff::civil::Date>, String>,
strategy: Result<Option<crate::types::TransactionsFetchStrategy>, String>,
transaction_status: Result<Option<crate::types::TransactionStatus>, String>,
psu_accept: Result<Option<::std::string::String>, String>,
psu_accept_charset: Result<Option<::std::string::String>, String>,
psu_accept_encoding: Result<Option<::std::string::String>, String>,
psu_accept_language: Result<Option<::std::string::String>, String>,
psu_geo_location: Result<Option<types::PsuGeoLocation>, String>,
psu_ip_address: Result<Option<::std::string::String>, String>,
psu_referer: Result<Option<::std::string::String>, String>,
psu_user_agent: Result<Option<::std::string::String>, String>,
}
impl<'a> GetAccountTransactions<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
continuation_key: Ok(None),
date_from: Ok(None),
date_to: Ok(None),
strategy: Ok(None),
transaction_status: Ok(None),
psu_accept: Ok(None),
psu_accept_charset: Ok(None),
psu_accept_encoding: Ok(None),
psu_accept_language: Ok(None),
psu_geo_location: Ok(None),
psu_ip_address: Ok(None),
psu_referer: Ok(None),
psu_user_agent: Ok(None),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.account_id = value
.try_into()
.map_err(|_| {
"conversion to `:: uuid :: Uuid` for account_id failed".to_string()
});
self
}
pub fn continuation_key<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.continuation_key = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for continuation_key failed"
.to_string()
});
self
}
pub fn date_from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::jiff::civil::Date>,
{
self.date_from = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: jiff :: civil :: Date` for date_from failed"
.to_string()
});
self
}
pub fn date_to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::jiff::civil::Date>,
{
self.date_to = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: jiff :: civil :: Date` for date_to failed"
.to_string()
});
self
}
pub fn strategy<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<crate::types::TransactionsFetchStrategy>,
{
self.strategy = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `crate :: types :: TransactionsFetchStrategy` for strategy failed"
.to_string()
});
self
}
pub fn transaction_status<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<crate::types::TransactionStatus>,
{
self.transaction_status = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `crate :: types :: TransactionStatus` for transaction_status failed"
.to_string()
});
self
}
pub fn psu_accept<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept failed"
.to_string()
});
self
}
pub fn psu_accept_charset<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_charset = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_charset failed"
.to_string()
});
self
}
pub fn psu_accept_encoding<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_encoding = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_encoding failed"
.to_string()
});
self
}
pub fn psu_accept_language<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_language = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_language failed"
.to_string()
});
self
}
pub fn psu_geo_location<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::PsuGeoLocation>,
{
self.psu_geo_location = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `PsuGeoLocation` for psu_geo_location failed"
.to_string()
});
self
}
pub fn psu_ip_address<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_ip_address = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_ip_address failed"
.to_string()
});
self
}
pub fn psu_referer<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_referer = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_referer failed"
.to_string()
});
self
}
pub fn psu_user_agent<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_user_agent = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_user_agent failed"
.to_string()
});
self
}
///Sends a `GET` request to `/accounts/{account_id}/transactions`
pub async fn send(
self,
) -> Result<ResponseValue<types::HalTransactions>, Error<types::ErrorResponse>> {
let Self {
client,
account_id,
continuation_key,
date_from,
date_to,
strategy,
transaction_status,
psu_accept,
psu_accept_charset,
psu_accept_encoding,
psu_accept_language,
psu_geo_location,
psu_ip_address,
psu_referer,
psu_user_agent,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let continuation_key = continuation_key.map_err(Error::InvalidRequest)?;
let date_from = date_from.map_err(Error::InvalidRequest)?;
let date_to = date_to.map_err(Error::InvalidRequest)?;
let strategy = strategy.map_err(Error::InvalidRequest)?;
let transaction_status = transaction_status.map_err(Error::InvalidRequest)?;
let psu_accept = psu_accept.map_err(Error::InvalidRequest)?;
let psu_accept_charset = psu_accept_charset.map_err(Error::InvalidRequest)?;
let psu_accept_encoding = psu_accept_encoding
.map_err(Error::InvalidRequest)?;
let psu_accept_language = psu_accept_language
.map_err(Error::InvalidRequest)?;
let psu_geo_location = psu_geo_location.map_err(Error::InvalidRequest)?;
let psu_ip_address = psu_ip_address.map_err(Error::InvalidRequest)?;
let psu_referer = psu_referer.map_err(Error::InvalidRequest)?;
let psu_user_agent = psu_user_agent.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/transactions", client.baseurl, encode_path(& account_id
.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(9usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
if let Some(value) = psu_accept {
header_map.append("Psu-Accept", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_charset {
header_map.append("Psu-Accept-Charset", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_encoding {
header_map.append("Psu-Accept-Encoding", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_language {
header_map.append("Psu-Accept-language", value.to_string().try_into()?);
}
if let Some(value) = psu_geo_location {
header_map.append("Psu-Geo-Location", value.to_string().try_into()?);
}
if let Some(value) = psu_ip_address {
header_map.append("Psu-Ip-Address", value.to_string().try_into()?);
}
if let Some(value) = psu_referer {
header_map.append("Psu-Referer", value.to_string().try_into()?);
}
if let Some(value) = psu_user_agent {
header_map.append("Psu-User-Agent", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(
&progenitor_client::QueryParam::new(
"continuation_key",
&continuation_key,
),
)
.query(&progenitor_client::QueryParam::new("date_from", &date_from))
.query(&progenitor_client::QueryParam::new("date_to", &date_to))
.query(&progenitor_client::QueryParam::new("strategy", &strategy))
.query(
&progenitor_client::QueryParam::new(
"transaction_status",
&transaction_status,
),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_account_transactions",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_transaction`]
[`Client::get_transaction`]: super::Client::get_transaction*/
#[derive(Debug, Clone)]
pub struct GetTransaction<'a> {
client: &'a super::Client,
account_id: Result<::uuid::Uuid, String>,
transaction_id: Result<::std::string::String, String>,
psu_accept: Result<Option<::std::string::String>, String>,
psu_accept_charset: Result<Option<::std::string::String>, String>,
psu_accept_encoding: Result<Option<::std::string::String>, String>,
psu_accept_language: Result<Option<::std::string::String>, String>,
psu_geo_location: Result<Option<types::PsuGeoLocation>, String>,
psu_ip_address: Result<Option<::std::string::String>, String>,
psu_referer: Result<Option<::std::string::String>, String>,
psu_user_agent: Result<Option<::std::string::String>, String>,
}
impl<'a> GetTransaction<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
transaction_id: Err("transaction_id was not initialized".to_string()),
psu_accept: Ok(None),
psu_accept_charset: Ok(None),
psu_accept_encoding: Ok(None),
psu_accept_language: Ok(None),
psu_geo_location: Ok(None),
psu_ip_address: Ok(None),
psu_referer: Ok(None),
psu_user_agent: Ok(None),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.account_id = value
.try_into()
.map_err(|_| {
"conversion to `:: uuid :: Uuid` for account_id failed".to_string()
});
self
}
pub fn transaction_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.transaction_id = value
.try_into()
.map_err(|_| {
"conversion to `:: std :: string :: String` for transaction_id failed"
.to_string()
});
self
}
pub fn psu_accept<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept failed"
.to_string()
});
self
}
pub fn psu_accept_charset<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_charset = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_charset failed"
.to_string()
});
self
}
pub fn psu_accept_encoding<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_encoding = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_encoding failed"
.to_string()
});
self
}
pub fn psu_accept_language<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_language = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_language failed"
.to_string()
});
self
}
pub fn psu_geo_location<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::PsuGeoLocation>,
{
self.psu_geo_location = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `PsuGeoLocation` for psu_geo_location failed"
.to_string()
});
self
}
pub fn psu_ip_address<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_ip_address = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_ip_address failed"
.to_string()
});
self
}
pub fn psu_referer<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_referer = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_referer failed"
.to_string()
});
self
}
pub fn psu_user_agent<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_user_agent = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_user_agent failed"
.to_string()
});
self
}
///Sends a `GET` request to `/accounts/{account_id}/transactions/{transaction_id}`
pub async fn send(
self,
) -> Result<ResponseValue<types::Transaction>, Error<types::ErrorResponse>> {
let Self {
client,
account_id,
transaction_id,
psu_accept,
psu_accept_charset,
psu_accept_encoding,
psu_accept_language,
psu_geo_location,
psu_ip_address,
psu_referer,
psu_user_agent,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let transaction_id = transaction_id.map_err(Error::InvalidRequest)?;
let psu_accept = psu_accept.map_err(Error::InvalidRequest)?;
let psu_accept_charset = psu_accept_charset.map_err(Error::InvalidRequest)?;
let psu_accept_encoding = psu_accept_encoding
.map_err(Error::InvalidRequest)?;
let psu_accept_language = psu_accept_language
.map_err(Error::InvalidRequest)?;
let psu_geo_location = psu_geo_location.map_err(Error::InvalidRequest)?;
let psu_ip_address = psu_ip_address.map_err(Error::InvalidRequest)?;
let psu_referer = psu_referer.map_err(Error::InvalidRequest)?;
let psu_user_agent = psu_user_agent.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/transactions/{}", client.baseurl, encode_path(&
account_id.to_string()), encode_path(& transaction_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(9usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
if let Some(value) = psu_accept {
header_map.append("Psu-Accept", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_charset {
header_map.append("Psu-Accept-Charset", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_encoding {
header_map.append("Psu-Accept-Encoding", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_language {
header_map.append("Psu-Accept-language", value.to_string().try_into()?);
}
if let Some(value) = psu_geo_location {
header_map.append("Psu-Geo-Location", value.to_string().try_into()?);
}
if let Some(value) = psu_ip_address {
header_map.append("Psu-Ip-Address", value.to_string().try_into()?);
}
if let Some(value) = psu_referer {
header_map.append("Psu-Referer", value.to_string().try_into()?);
}
if let Some(value) = psu_user_agent {
header_map.append("Psu-User-Agent", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_transaction",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_application`]
[`Client::get_application`]: super::Client::get_application*/
#[derive(Debug, Clone)]
pub struct GetApplication<'a> {
client: &'a super::Client,
}
impl<'a> GetApplication<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self { client: client }
}
///Sends a `GET` request to `/application`
pub async fn send(
self,
) -> Result<
ResponseValue<types::GetApplicationResponse>,
Error<types::ErrorResponse>,
> {
let Self { client } = self;
let url = format!("{}/application", client.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_application",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_aspsps`]
[`Client::get_aspsps`]: super::Client::get_aspsps*/
#[derive(Debug, Clone)]
pub struct GetAspsps<'a> {
client: &'a super::Client,
country: Result<Option<types::Country>, String>,
payment_type: Result<Option<crate::types::PaymentType>, String>,
psu_type: Result<Option<crate::types::PsuType>, String>,
service: Result<Option<crate::types::Service>, String>,
}
impl<'a> GetAspsps<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
country: Ok(None),
payment_type: Ok(None),
psu_type: Ok(None),
service: Ok(None),
}
}
pub fn country<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::Country>,
{
self.country = value
.try_into()
.map(Some)
.map_err(|_| "conversion to `Country` for country failed".to_string());
self
}
pub fn payment_type<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<crate::types::PaymentType>,
{
self.payment_type = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `crate :: types :: PaymentType` for payment_type failed"
.to_string()
});
self
}
pub fn psu_type<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<crate::types::PsuType>,
{
self.psu_type = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `crate :: types :: PsuType` for psu_type failed"
.to_string()
});
self
}
pub fn service<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<crate::types::Service>,
{
self.service = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `crate :: types :: Service` for service failed"
.to_string()
});
self
}
///Sends a `GET` request to `/aspsps`
pub async fn send(
self,
) -> Result<
ResponseValue<types::GetAspspsResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, country, payment_type, psu_type, service } = self;
let country = country.map_err(Error::InvalidRequest)?;
let payment_type = payment_type.map_err(Error::InvalidRequest)?;
let psu_type = psu_type.map_err(Error::InvalidRequest)?;
let service = service.map_err(Error::InvalidRequest)?;
let url = format!("{}/aspsps", client.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("country", &country))
.query(
&progenitor_client::QueryParam::new("payment_type", &payment_type),
)
.query(&progenitor_client::QueryParam::new("psu_type", &psu_type))
.query(&progenitor_client::QueryParam::new("service", &service))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_aspsps",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::start_authorization`]
[`Client::start_authorization`]: super::Client::start_authorization*/
#[derive(Debug, Clone)]
pub struct StartAuthorization<'a> {
client: &'a super::Client,
body: Result<types::builder::StartAuthorizationRequest, String>,
}
impl<'a> StartAuthorization<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
body: Ok(::std::default::Default::default()),
}
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::StartAuthorizationRequest>,
<V as std::convert::TryInto<
types::StartAuthorizationRequest,
>>::Error: std::fmt::Display,
{
self.body = value
.try_into()
.map(From::from)
.map_err(|s| {
format!(
"conversion to `StartAuthorizationRequest` for body failed: {}",
s
)
});
self
}
pub fn body_map<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::StartAuthorizationRequest,
) -> types::builder::StartAuthorizationRequest,
{
self.body = self.body.map(f);
self
}
///Sends a `POST` request to `/auth`
pub async fn send(
self,
) -> Result<
ResponseValue<types::StartAuthorizationResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, body } = self;
let body = body
.and_then(|v| {
types::StartAuthorizationRequest::try_from(v)
.map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!("{}/auth", client.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "start_authorization",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::create_payment`]
[`Client::create_payment`]: super::Client::create_payment*/
#[derive(Debug, Clone)]
pub struct CreatePayment<'a> {
client: &'a super::Client,
body: Result<types::builder::CreatePaymentRequest, String>,
}
impl<'a> CreatePayment<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
body: Ok(::std::default::Default::default()),
}
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::CreatePaymentRequest>,
<V as std::convert::TryInto<
types::CreatePaymentRequest,
>>::Error: std::fmt::Display,
{
self.body = value
.try_into()
.map(From::from)
.map_err(|s| {
format!(
"conversion to `CreatePaymentRequest` for body failed: {}", s
)
});
self
}
pub fn body_map<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::CreatePaymentRequest,
) -> types::builder::CreatePaymentRequest,
{
self.body = self.body.map(f);
self
}
///Sends a `POST` request to `/payments`
pub async fn send(
self,
) -> Result<
ResponseValue<types::CreatePaymentResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, body } = self;
let body = body
.and_then(|v| {
types::CreatePaymentRequest::try_from(v).map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!("{}/payments", client.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_payment",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_payment`]
[`Client::get_payment`]: super::Client::get_payment*/
#[derive(Debug, Clone)]
pub struct GetPayment<'a> {
client: &'a super::Client,
payment_id: Result<::std::string::String, String>,
}
impl<'a> GetPayment<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
payment_id: Err("payment_id was not initialized".to_string()),
}
}
pub fn payment_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.payment_id = value
.try_into()
.map_err(|_| {
"conversion to `:: std :: string :: String` for payment_id failed"
.to_string()
});
self
}
///Sends a `GET` request to `/payments/{payment_id}`
pub async fn send(
self,
) -> Result<
ResponseValue<types::GetPaymentResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, payment_id } = self;
let payment_id = payment_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/payments/{}", client.baseurl, encode_path(& payment_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_payment",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::delete_payment`]
[`Client::delete_payment`]: super::Client::delete_payment*/
#[derive(Debug, Clone)]
pub struct DeletePayment<'a> {
client: &'a super::Client,
payment_id: Result<::std::string::String, String>,
}
impl<'a> DeletePayment<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
payment_id: Err("payment_id was not initialized".to_string()),
}
}
pub fn payment_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.payment_id = value
.try_into()
.map_err(|_| {
"conversion to `:: std :: string :: String` for payment_id failed"
.to_string()
});
self
}
///Sends a `DELETE` request to `/payments/{payment_id}`
pub async fn send(
self,
) -> Result<ResponseValue<types::SuccessResponse>, Error<types::ErrorResponse>> {
let Self { client, payment_id } = self;
let payment_id = payment_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/payments/{}", client.baseurl, encode_path(& payment_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_payment",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::submit_payment`]
[`Client::submit_payment`]: super::Client::submit_payment*/
#[derive(Debug, Clone)]
pub struct SubmitPayment<'a> {
client: &'a super::Client,
payment_id: Result<::std::string::String, String>,
body: Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
String,
>,
}
impl<'a> SubmitPayment<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
payment_id: Err("payment_id was not initialized".to_string()),
body: Err("body was not initialized".to_string()),
}
}
pub fn payment_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.payment_id = value
.try_into()
.map_err(|_| {
"conversion to `:: std :: string :: String` for payment_id failed"
.to_string()
});
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
{
self.body = value
.try_into()
.map_err(|_| {
"conversion to `:: serde_json :: Map < :: std :: string :: String , :: serde_json :: Value >` for body failed"
.to_string()
});
self
}
///Sends a `POST` request to `/payments/{payment_id}/submit`
pub async fn send(
self,
) -> Result<
ResponseValue<types::SubmitPaymentResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, payment_id, body } = self;
let payment_id = payment_id.map_err(Error::InvalidRequest)?;
let body = body.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/payments/{}/submit", client.baseurl, encode_path(& payment_id
.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "submit_payment",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_payment_transaction`]
[`Client::get_payment_transaction`]: super::Client::get_payment_transaction*/
#[derive(Debug, Clone)]
pub struct GetPaymentTransaction<'a> {
client: &'a super::Client,
payment_id: Result<::std::string::String, String>,
transaction_id: Result<::std::string::String, String>,
}
impl<'a> GetPaymentTransaction<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
payment_id: Err("payment_id was not initialized".to_string()),
transaction_id: Err("transaction_id was not initialized".to_string()),
}
}
pub fn payment_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.payment_id = value
.try_into()
.map_err(|_| {
"conversion to `:: std :: string :: String` for payment_id failed"
.to_string()
});
self
}
pub fn transaction_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.transaction_id = value
.try_into()
.map_err(|_| {
"conversion to `:: std :: string :: String` for transaction_id failed"
.to_string()
});
self
}
///Sends a `GET` request to `/payments/{payment_id}/transactions/{transaction_id}`
pub async fn send(
self,
) -> Result<
ResponseValue<types::GetPaymentTransactionResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, payment_id, transaction_id } = self;
let payment_id = payment_id.map_err(Error::InvalidRequest)?;
let transaction_id = transaction_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/payments/{}/transactions/{}", client.baseurl, encode_path(&
payment_id.to_string()), encode_path(& transaction_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_payment_transaction",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::authorize_session`]
[`Client::authorize_session`]: super::Client::authorize_session*/
#[derive(Debug, Clone)]
pub struct AuthorizeSession<'a> {
client: &'a super::Client,
body: Result<types::builder::AuthorizeSessionRequest, String>,
}
impl<'a> AuthorizeSession<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
body: Ok(::std::default::Default::default()),
}
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::AuthorizeSessionRequest>,
<V as std::convert::TryInto<
types::AuthorizeSessionRequest,
>>::Error: std::fmt::Display,
{
self.body = value
.try_into()
.map(From::from)
.map_err(|s| {
format!(
"conversion to `AuthorizeSessionRequest` for body failed: {}", s
)
});
self
}
pub fn body_map<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::AuthorizeSessionRequest,
) -> types::builder::AuthorizeSessionRequest,
{
self.body = self.body.map(f);
self
}
///Sends a `POST` request to `/sessions`
pub async fn send(
self,
) -> Result<
ResponseValue<types::AuthorizeSessionResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, body } = self;
let body = body
.and_then(|v| {
types::AuthorizeSessionRequest::try_from(v)
.map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!("{}/sessions", client.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "authorize_session",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::get_session`]
[`Client::get_session`]: super::Client::get_session*/
#[derive(Debug, Clone)]
pub struct GetSession<'a> {
client: &'a super::Client,
session_id: Result<::uuid::Uuid, String>,
}
impl<'a> GetSession<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
session_id: Err("session_id was not initialized".to_string()),
}
}
pub fn session_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.session_id = value
.try_into()
.map_err(|_| {
"conversion to `:: uuid :: Uuid` for session_id failed".to_string()
});
self
}
///Sends a `GET` request to `/sessions/{session_id}`
pub async fn send(
self,
) -> Result<
ResponseValue<types::GetSessionResponse>,
Error<types::ErrorResponse>,
> {
let Self { client, session_id } = self;
let session_id = session_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/sessions/{}", client.baseurl, encode_path(& session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_session",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/**Builder for [`Client::delete_session`]
[`Client::delete_session`]: super::Client::delete_session*/
#[derive(Debug, Clone)]
pub struct DeleteSession<'a> {
client: &'a super::Client,
session_id: Result<::uuid::Uuid, String>,
psu_accept: Result<Option<::std::string::String>, String>,
psu_accept_charset: Result<Option<::std::string::String>, String>,
psu_accept_encoding: Result<Option<::std::string::String>, String>,
psu_accept_language: Result<Option<::std::string::String>, String>,
psu_geo_location: Result<Option<types::PsuGeoLocation>, String>,
psu_ip_address: Result<Option<::std::string::String>, String>,
psu_referer: Result<Option<::std::string::String>, String>,
psu_user_agent: Result<Option<::std::string::String>, String>,
}
impl<'a> DeleteSession<'a> {
pub fn new(client: &'a super::Client) -> Self {
Self {
client: client,
session_id: Err("session_id was not initialized".to_string()),
psu_accept: Ok(None),
psu_accept_charset: Ok(None),
psu_accept_encoding: Ok(None),
psu_accept_language: Ok(None),
psu_geo_location: Ok(None),
psu_ip_address: Ok(None),
psu_referer: Ok(None),
psu_user_agent: Ok(None),
}
}
pub fn session_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.session_id = value
.try_into()
.map_err(|_| {
"conversion to `:: uuid :: Uuid` for session_id failed".to_string()
});
self
}
pub fn psu_accept<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept failed"
.to_string()
});
self
}
pub fn psu_accept_charset<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_charset = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_charset failed"
.to_string()
});
self
}
pub fn psu_accept_encoding<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_encoding = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_encoding failed"
.to_string()
});
self
}
pub fn psu_accept_language<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_accept_language = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_accept_language failed"
.to_string()
});
self
}
pub fn psu_geo_location<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::PsuGeoLocation>,
{
self.psu_geo_location = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `PsuGeoLocation` for psu_geo_location failed"
.to_string()
});
self
}
pub fn psu_ip_address<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_ip_address = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_ip_address failed"
.to_string()
});
self
}
pub fn psu_referer<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_referer = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_referer failed"
.to_string()
});
self
}
pub fn psu_user_agent<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.psu_user_agent = value
.try_into()
.map(Some)
.map_err(|_| {
"conversion to `:: std :: string :: String` for psu_user_agent failed"
.to_string()
});
self
}
///Sends a `DELETE` request to `/sessions/{session_id}`
pub async fn send(
self,
) -> Result<ResponseValue<types::SuccessResponse>, Error<types::ErrorResponse>> {
let Self {
client,
session_id,
psu_accept,
psu_accept_charset,
psu_accept_encoding,
psu_accept_language,
psu_geo_location,
psu_ip_address,
psu_referer,
psu_user_agent,
} = self;
let session_id = session_id.map_err(Error::InvalidRequest)?;
let psu_accept = psu_accept.map_err(Error::InvalidRequest)?;
let psu_accept_charset = psu_accept_charset.map_err(Error::InvalidRequest)?;
let psu_accept_encoding = psu_accept_encoding
.map_err(Error::InvalidRequest)?;
let psu_accept_language = psu_accept_language
.map_err(Error::InvalidRequest)?;
let psu_geo_location = psu_geo_location.map_err(Error::InvalidRequest)?;
let psu_ip_address = psu_ip_address.map_err(Error::InvalidRequest)?;
let psu_referer = psu_referer.map_err(Error::InvalidRequest)?;
let psu_user_agent = psu_user_agent.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/sessions/{}", client.baseurl, encode_path(& session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(9usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(
super::Client::api_version(),
),
);
if let Some(value) = psu_accept {
header_map.append("Psu-Accept", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_charset {
header_map.append("Psu-Accept-Charset", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_encoding {
header_map.append("Psu-Accept-Encoding", value.to_string().try_into()?);
}
if let Some(value) = psu_accept_language {
header_map.append("Psu-Accept-language", value.to_string().try_into()?);
}
if let Some(value) = psu_geo_location {
header_map.append("Psu-Geo-Location", value.to_string().try_into()?);
}
if let Some(value) = psu_ip_address {
header_map.append("Psu-Ip-Address", value.to_string().try_into()?);
}
if let Some(value) = psu_referer {
header_map.append("Psu-Referer", value.to_string().try_into()?);
}
if let Some(value) = psu_user_agent {
header_map.append("Psu-User-Agent", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = client
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_session",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
401u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
403u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
404u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
408u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
422u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
429u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
500u16 => {
Err(
Error::ErrorResponse(
ResponseValue::from_response(response).await?,
),
)
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
}
/// Items consumers will typically use such as the Client.
pub mod prelude {
pub use self::super::Client;
}