fireblocks-sdk 2025.10.17

Rust implementation of the Fireblocks SDK
Documentation
// Fireblocks API
//
// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech

use {
    crate::models,
    serde::{Deserialize, Serialize},
};

/// PixPaymentInfo : PIX payment information for Brazilian instant payments
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PixPaymentInfo {
    /// The payment rail type for PIX transfers
    #[serde(rename = "rail")]
    pub rail: Rail,
    /// The addressing system used for PIX transfers
    #[serde(rename = "addressingSystem")]
    pub addressing_system: AddressingSystem,
    /// The given name (first name) of the account holder
    #[serde(rename = "accountHolderGivenName")]
    pub account_holder_given_name: String,
    /// The surname (last name) of the account holder
    #[serde(rename = "accountHolderSurname")]
    pub account_holder_surname: String,
    /// The country for the transfer (ISO 3166-1 alpha-2 code)
    #[serde(rename = "country")]
    pub country: String,
    /// The PIX key used for the transfer
    #[serde(rename = "pixKey")]
    pub pix_key: String,
    /// The name of the bank
    #[serde(rename = "bankName", skip_serializing_if = "Option::is_none")]
    pub bank_name: Option<String>,
    /// The bank code (ISPB - Identificador do Sistema de Pagamentos
    /// Brasileiros)
    #[serde(rename = "bankCode", skip_serializing_if = "Option::is_none")]
    pub bank_code: Option<String>,
    /// The type of PIX key being used
    #[serde(rename = "keyType")]
    pub key_type: KeyType,
}

impl PixPaymentInfo {
    /// PIX payment information for Brazilian instant payments
    pub fn new(
        rail: Rail,
        addressing_system: AddressingSystem,
        account_holder_given_name: String,
        account_holder_surname: String,
        country: String,
        pix_key: String,
        key_type: KeyType,
    ) -> PixPaymentInfo {
        PixPaymentInfo {
            rail,
            addressing_system,
            account_holder_given_name,
            account_holder_surname,
            country,
            pix_key,
            bank_name: None,
            bank_code: None,
            key_type,
        }
    }
}
/// The payment rail type for PIX transfers
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Rail {
    #[serde(rename = "PIX")]
    Pix,
}

impl Default for Rail {
    fn default() -> Rail {
        Self::Pix
    }
}
/// The addressing system used for PIX transfers
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AddressingSystem {
    #[serde(rename = "PIX")]
    Pix,
}

impl Default for AddressingSystem {
    fn default() -> AddressingSystem {
        Self::Pix
    }
}
/// The type of PIX key being used
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum KeyType {
    #[serde(rename = "CPF")]
    Cpf,
    #[serde(rename = "CNPJ")]
    Cnpj,
    #[serde(rename = "EMAIL")]
    Email,
    #[serde(rename = "PHONE")]
    Phone,
    #[serde(rename = "RANDOM")]
    Random,
}

impl Default for KeyType {
    fn default() -> KeyType {
        Self::Cpf
    }
}