crypto_pay_api/models/
response.rs

1use serde::Deserialize;
2
3use super::{Check, Invoice, Transfer};
4
5#[derive(Debug, Deserialize)]
6pub struct ApiResponse<T> {
7    pub ok: bool,
8    pub result: Option<T>,
9    pub error: Option<String>,
10    pub error_code: Option<i32>,
11}
12
13#[derive(Debug, Deserialize)]
14pub struct GetMeResponse {
15    /// Unique ID of the application.
16    pub app_id: i64,
17    /// Name of the application.
18    pub name: String,
19    /// Username of the payment processing bot.
20    pub payment_processing_bot_username: String,
21    /// Optional. Webhook endpoint for the application.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub webhook_endpoint: Option<String>,
24}
25
26#[derive(Debug, Deserialize)]
27pub struct GetInvoicesResponse {
28    pub items: Vec<Invoice>,
29}
30
31#[derive(Debug, Deserialize)]
32pub struct GetTransfersResponse {
33    pub items: Vec<Transfer>,
34}
35
36#[derive(Debug, Deserialize)]
37pub struct GetChecksResponse {
38    pub items: Vec<Check>,
39}