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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
use anyhow::Result;
use crate::{client::SpapiClient, models};
impl SpapiClient {
/// Creates a destination resource to receive notifications. The `createDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn create_destination(
&self,
body: models::notifications::CreateDestinationRequest,
) -> Result<models::notifications::CreateDestinationResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/create_destination", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::create_destination(
&configuration,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the `createDestination` operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn create_subscription(
&self,
notification_type: &str,
body: models::notifications::CreateSubscriptionRequest,
) -> Result<models::notifications::CreateSubscriptionResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/create_subscription", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::create_subscription(
&configuration,
notification_type,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Deletes the destination that you specify. The `deleteDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn delete_destination(
&self,
destination_id: &str,
) -> Result<models::notifications::DeleteDestinationResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/delete_destination", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::delete_destination(
&configuration,
destination_id,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Deletes the subscription indicated by the subscription identifier and notification type that you specify. The `deleteSubscriptionById` operation is grantless. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn delete_subscription_by_id(
&self,
subscription_id: &str,
notification_type: &str,
) -> Result<models::notifications::DeleteSubscriptionByIdResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/delete_subscription_by_id", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::delete_subscription_by_id(
&configuration,
subscription_id,
notification_type,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Returns information about the destination that you specify. The `getDestination` operation is grantless. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn get_destination(
&self,
destination_id: &str,
) -> Result<models::notifications::GetDestinationResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/get_destination", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::get_destination(
&configuration,
destination_id,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Returns information about all destinations. The `getDestinations` operation is grantless. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn get_destinations(
&self,
) -> Result<models::notifications::GetDestinationsResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/get_destinations", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::get_destinations(
&configuration,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Returns information about subscription of the specified notification type and payload version. `payloadVersion` is an optional parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn get_subscription(
&self,
notification_type: &str,
payload_version: Option<&str>,
) -> Result<models::notifications::GetSubscriptionResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/get_subscription", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::get_subscription(
&configuration,
notification_type,
payload_version,
)
.await?;
guard.mark_response().await;
Ok(res)
}
/// Returns information about a subscription for the specified notification type. The `getSubscriptionById` operation is grantless. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |
pub async fn get_subscription_by_id(
&self,
subscription_id: &str,
notification_type: &str,
) -> Result<models::notifications::GetSubscriptionByIdResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("notifications_v1/get_subscription_by_id", 1.0, 5)
.await?;
let res = crate::apis::notifications_v1::get_subscription_by_id(
&configuration,
subscription_id,
notification_type,
)
.await?;
guard.mark_response().await;
Ok(res)
}
}