amazon_spapi/client_apis/finances_v0.rs
1use anyhow::Result;
2
3use crate::{client::SpapiClient, models};
4
5impl SpapiClient {
6 /// Returns financial event groups for a given date range. It may take up to 48 hours for orders to appear in your financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
7 pub async fn list_financial_event_groups(
8 &self,
9 max_results_per_page: Option<i32>,
10 financial_event_group_started_before: Option<String>,
11 financial_event_group_started_after: Option<String>,
12 next_token: Option<&str>,
13 ) -> Result<models::finances_v0::ListFinancialEventGroupsResponse> {
14 let configuration = self.create_configuration().await?;
15 let guard = self
16 .limiter()
17 .wait("/finances/v0/financialEventGroups", 0.5, 30)
18 .await?;
19 let res = crate::apis::finances_v0::list_financial_event_groups(
20 &configuration,
21 max_results_per_page,
22 financial_event_group_started_before,
23 financial_event_group_started_after,
24 next_token,
25 )
26 .await?;
27 guard.mark_response().await;
28 Ok(res)
29 }
30
31 /// Returns financial events for the specified data range. It may take up to 48 hours for orders to appear in your financial events. **Note:** in `ListFinancialEvents`, deferred events don't show up in responses until in they are released. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
32 pub async fn list_financial_events(
33 &self,
34 max_results_per_page: Option<i32>,
35 posted_after: Option<String>,
36 posted_before: Option<String>,
37 next_token: Option<&str>,
38 ) -> Result<models::finances_v0::ListFinancialEventsResponse> {
39 let configuration = self.create_configuration().await?;
40 let guard = self
41 .limiter()
42 .wait("/finances/v0/financialEvents", 0.5, 30)
43 .await?;
44 let res = crate::apis::finances_v0::list_financial_events(
45 &configuration,
46 max_results_per_page,
47 posted_after,
48 posted_before,
49 next_token,
50 )
51 .await?;
52 guard.mark_response().await;
53 Ok(res)
54 }
55
56 pub async fn list_financial_events_by_group_id(
57 &self,
58 event_group_id: &str,
59 max_results_per_page: Option<i32>,
60 posted_after: Option<String>,
61 posted_before: Option<String>,
62 next_token: Option<&str>,
63 ) -> Result<models::finances_v0::ListFinancialEventsResponse> {
64 let configuration = self.create_configuration().await?;
65 let guard = self
66 .limiter()
67 .wait("/finances/v0/financialEventsByGroupId", 0.5, 30)
68 .await?;
69 let res = crate::apis::finances_v0::list_financial_events_by_group_id(
70 &configuration,
71 event_group_id,
72 max_results_per_page,
73 posted_after,
74 posted_before,
75 next_token,
76 )
77 .await?;
78 guard.mark_response().await;
79 Ok(res)
80 }
81
82 /// Returns all financial events for the specified financial event group. It may take up to 48 hours for orders to appear in your financial events. **Note:** This operation will only retrieve group's data for the past two years. If a request is submitted for data spanning more than two years, an empty response is returned. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
83 pub async fn list_financial_events_by_order_id(
84 &self,
85 order_id: &str,
86 max_results_per_page: Option<i32>,
87 next_token: Option<&str>,
88 ) -> Result<models::finances_v0::ListFinancialEventsResponse> {
89 let configuration = self.create_configuration().await?;
90 let guard = self
91 .limiter()
92 .wait("/finances/v0/financialEventsByOrderId", 0.5, 30)
93 .await?;
94 let res = crate::apis::finances_v0::list_financial_events_by_order_id(
95 &configuration,
96 order_id,
97 max_results_per_page,
98 next_token,
99 )
100 .await?;
101 guard.mark_response().await;
102 Ok(res)
103 }
104}