1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use crate::filters::{common::ListFilters, fee::FeeFilters};
use crate::models::PaginationParams;
/// Request parameters for listing fees from the `/fees` endpoint.
///
/// This struct combines pagination parameters and fee-specific filters
/// to build a comprehensive request for retrieving fee lists.
#[derive(Debug, Clone)]
pub struct ListFeesRequest {
pub pagination: PaginationParams,
pub filters: FeeFilters,
}
impl ListFeesRequest {
/// Creates a new empty list fees request.
///
/// # Returns
/// A new `ListFeesRequest` instance with default pagination and no filters.
pub fn new() -> Self {
Self {
pagination: PaginationParams::default(),
filters: FeeFilters::default(),
}
}
/// Sets the pagination parameters for the request.
pub fn with_pagination(mut self, pagination: PaginationParams) -> Self {
self.pagination = pagination;
self
}
/// Sets the fee filters for the request.
pub fn with_filters(mut self, filters: FeeFilters) -> Self {
self.filters = filters;
self
}
/// Converts the request parameters into HTTP query parameters.
///
/// # Returns
/// A vector of query parameter tuples containing both pagination and filter criteria.
pub fn to_query_params(&self) -> Vec<(&str, String)> {
let mut params = self.pagination.to_query_params();
params.extend(self.filters.to_query_params());
params
}
}
impl Default for ListFeesRequest {
fn default() -> Self {
Self::new()
}
}
/// Request parameters for retrieving a specific fee by its Lago ID.
#[derive(Debug, Clone)]
pub struct GetFeeRequest {
pub fee_id: String,
}
impl GetFeeRequest {
/// Creates a new get fee request.
///
/// # Arguments
/// * `fee_id` - The Lago ID (UUID) of the fee to retrieve
///
/// # Returns
/// A new `GetFeeRequest` instance with the specified fee ID.
pub fn new(fee_id: String) -> Self {
Self { fee_id }
}
}