amazon_spapi/client_apis/
messaging_v1.rs

1use anyhow::Result;
2
3use crate::{client::SpapiClient, models};
4
5impl SpapiClient {
6    /// Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
7    pub async fn confirm_customization_details(
8        &self,
9        amazon_order_id: &str,
10        marketplace_ids: Vec<String>,
11        body: models::messaging::CreateConfirmCustomizationDetailsRequest,
12    ) -> Result<models::messaging::CreateConfirmCustomizationDetailsResponse> {
13        let configuration = self.create_configuration().await?;
14        let guard = self
15            .limiter()
16            .wait("messaging_v1/confirm_customization_details", 1.0, 5)
17            .await?;
18        let res = crate::apis::messaging_v1::confirm_customization_details(
19            &configuration,
20            amazon_order_id,
21            marketplace_ids,
22            body,
23        )
24        .await?;
25        guard.mark_response().await;
26        Ok(res)
27    }
28
29    /// Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by Amazon Motors sellers.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
30    pub async fn create_amazon_motors(
31        &self,
32        amazon_order_id: &str,
33        marketplace_ids: Vec<String>,
34        body: models::messaging::CreateAmazonMotorsRequest,
35    ) -> Result<models::messaging::CreateAmazonMotorsResponse> {
36        let configuration = self.create_configuration().await?;
37        let guard = self
38            .limiter()
39            .wait("messaging_v1/create_amazon_motors", 1.0, 5)
40            .await?;
41        let res = crate::apis::messaging_v1::create_amazon_motors(
42            &configuration,
43            amazon_order_id,
44            marketplace_ids,
45            body,
46        )
47        .await?;
48        guard.mark_response().await;
49        Ok(res)
50    }
51
52    /// Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
53    pub async fn create_confirm_delivery_details(
54        &self,
55        amazon_order_id: &str,
56        marketplace_ids: Vec<String>,
57        body: models::messaging::CreateConfirmDeliveryDetailsRequest,
58    ) -> Result<models::messaging::CreateConfirmDeliveryDetailsResponse> {
59        let configuration = self.create_configuration().await?;
60        let guard = self
61            .limiter()
62            .wait("messaging_v1/create_confirm_delivery_details", 1.0, 5)
63            .await?;
64        let res = crate::apis::messaging_v1::create_confirm_delivery_details(
65            &configuration,
66            amazon_order_id,
67            marketplace_ids,
68            body,
69        )
70        .await?;
71        guard.mark_response().await;
72        Ok(res)
73    }
74
75    /// Sends a message to ask a buyer an order-related question prior to shipping their order.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
76    pub async fn create_confirm_order_details(
77        &self,
78        amazon_order_id: &str,
79        marketplace_ids: Vec<String>,
80        body: models::messaging::CreateConfirmOrderDetailsRequest,
81    ) -> Result<models::messaging::CreateConfirmOrderDetailsResponse> {
82        let configuration = self.create_configuration().await?;
83        let guard = self
84            .limiter()
85            .wait("messaging_v1/create_confirm_order_details", 1.0, 5)
86            .await?;
87        let res = crate::apis::messaging_v1::create_confirm_order_details(
88            &configuration,
89            amazon_order_id,
90            marketplace_ids,
91            body,
92        )
93        .await?;
94        guard.mark_response().await;
95        Ok(res)
96    }
97
98    /// Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
99    pub async fn create_confirm_service_details(
100        &self,
101        amazon_order_id: &str,
102        marketplace_ids: Vec<String>,
103        body: models::messaging::CreateConfirmServiceDetailsRequest,
104    ) -> Result<models::messaging::CreateConfirmServiceDetailsResponse> {
105        let configuration = self.create_configuration().await?;
106        let guard = self
107            .limiter()
108            .wait("messaging_v1/create_confirm_service_details", 1.0, 5)
109            .await?;
110        let res = crate::apis::messaging_v1::create_confirm_service_details(
111            &configuration,
112            amazon_order_id,
113            marketplace_ids,
114            body,
115        )
116        .await?;
117        guard.mark_response().await;
118        Ok(res)
119    }
120
121    /// Sends a buyer a message to share a digital access key that is required to utilize digital content in their order.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
122    pub async fn create_digital_access_key(
123        &self,
124        amazon_order_id: &str,
125        marketplace_ids: Vec<String>,
126        body: models::messaging::CreateDigitalAccessKeyRequest,
127    ) -> Result<models::messaging::CreateDigitalAccessKeyResponse> {
128        let configuration = self.create_configuration().await?;
129        let guard = self
130            .limiter()
131            .wait("messaging_v1/create_digital_access_key", 1.0, 5)
132            .await?;
133        let res = crate::apis::messaging_v1::create_digital_access_key(
134            &configuration,
135            amazon_order_id,
136            marketplace_ids,
137            body,
138        )
139        .await?;
140        guard.mark_response().await;
141        Ok(res)
142    }
143
144    /// Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer. This message should only be used to deliver documents that are required by law.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
145    pub async fn create_legal_disclosure(
146        &self,
147        amazon_order_id: &str,
148        marketplace_ids: Vec<String>,
149        body: models::messaging::CreateLegalDisclosureRequest,
150    ) -> Result<models::messaging::CreateLegalDisclosureResponse> {
151        let configuration = self.create_configuration().await?;
152        let guard = self
153            .limiter()
154            .wait("messaging_v1/create_legal_disclosure", 1.0, 5)
155            .await?;
156        let res = crate::apis::messaging_v1::create_legal_disclosure(
157            &configuration,
158            amazon_order_id,
159            marketplace_ids,
160            body,
161        )
162        .await?;
163        guard.mark_response().await;
164        Ok(res)
165    }
166
167    /// Sends a non-critical message that asks a buyer to remove their negative feedback. This message should only be sent after the seller has resolved the buyer's problem.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
168    pub async fn create_negative_feedback_removal(
169        &self,
170        amazon_order_id: &str,
171        marketplace_ids: Vec<String>,
172    ) -> Result<models::messaging::CreateNegativeFeedbackRemovalResponse> {
173        let configuration = self.create_configuration().await?;
174        let guard = self
175            .limiter()
176            .wait("messaging_v1/create_negative_feedback_removal", 1.0, 5)
177            .await?;
178        let res = crate::apis::messaging_v1::create_negative_feedback_removal(
179            &configuration,
180            amazon_order_id,
181            marketplace_ids,
182        )
183        .await?;
184        guard.mark_response().await;
185        Ok(res)
186    }
187
188    /// Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the order.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
189    pub async fn create_unexpected_problem(
190        &self,
191        amazon_order_id: &str,
192        marketplace_ids: Vec<String>,
193        body: models::messaging::CreateUnexpectedProblemRequest,
194    ) -> Result<models::messaging::CreateUnexpectedProblemResponse> {
195        let configuration = self.create_configuration().await?;
196        let guard = self
197            .limiter()
198            .wait("messaging_v1/create_unexpected_problem", 1.0, 5)
199            .await?;
200        let res = crate::apis::messaging_v1::create_unexpected_problem(
201            &configuration,
202            amazon_order_id,
203            marketplace_ids,
204            body,
205        )
206        .await?;
207        guard.mark_response().await;
208        Ok(res)
209    }
210
211    /// Sends a message to a buyer to provide details about warranty information on a purchase in their order.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
212    pub async fn create_warranty(
213        &self,
214        amazon_order_id: &str,
215        marketplace_ids: Vec<String>,
216        body: models::messaging::CreateWarrantyRequest,
217    ) -> Result<models::messaging::CreateWarrantyResponse> {
218        let configuration = self.create_configuration().await?;
219        let guard = self
220            .limiter()
221            .wait("messaging_v1/create_warranty", 1.0, 5)
222            .await?;
223        let res = crate::apis::messaging_v1::create_warranty(
224            &configuration,
225            amazon_order_id,
226            marketplace_ids,
227            body,
228        )
229        .await?;
230        guard.mark_response().await;
231        Ok(res)
232    }
233
234    /// Returns a response containing attributes related to an order. This includes buyer preferences.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
235    pub async fn get_attributes(
236        &self,
237        amazon_order_id: &str,
238        marketplace_ids: Vec<String>,
239    ) -> Result<models::messaging::GetAttributesResponse> {
240        let configuration = self.create_configuration().await?;
241        let guard = self
242            .limiter()
243            .wait("messaging_v1/get_attributes", 1.0, 5)
244            .await?;
245        let res = crate::apis::messaging_v1::get_attributes(
246            &configuration,
247            amazon_order_id,
248            marketplace_ids,
249        )
250        .await?;
251        guard.mark_response().await;
252        Ok(res)
253    }
254
255    /// Returns a list of message types that are available for an order that you specify. A message type is represented by an actions object, which contains a path and query parameter(s).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
256    pub async fn get_messaging_actions_for_order(
257        &self,
258        amazon_order_id: &str,
259        marketplace_ids: Vec<String>,
260    ) -> Result<models::messaging::GetMessagingActionsForOrderResponse> {
261        let configuration = self.create_configuration().await?;
262        let guard = self
263            .limiter()
264            .wait("messaging_v1/get_messaging_actions_for_order", 1.0, 5)
265            .await?;
266        let res = crate::apis::messaging_v1::get_messaging_actions_for_order(
267            &configuration,
268            amazon_order_id,
269            marketplace_ids,
270        )
271        .await?;
272        guard.mark_response().await;
273        Ok(res)
274    }
275
276    /// Sends a message providing the buyer an invoice.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
277    pub async fn send_invoice(
278        &self,
279        amazon_order_id: &str,
280        marketplace_ids: Vec<String>,
281        body: models::messaging::InvoiceRequest,
282    ) -> Result<models::messaging::InvoiceResponse> {
283        let configuration = self.create_configuration().await?;
284        let guard = self
285            .limiter()
286            .wait("messaging_v1/send_invoice", 1.0, 5)
287            .await?;
288        let res = crate::apis::messaging_v1::send_invoice(
289            &configuration,
290            amazon_order_id,
291            marketplace_ids,
292            body,
293        )
294        .await?;
295        guard.mark_response().await;
296        Ok(res)
297    }
298}