use anyhow::Result;
use crate::{client::SpapiClient, models};
impl SpapiClient {
pub async fn confirm_customization_details(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateConfirmCustomizationDetailsRequest,
) -> Result<models::messaging::CreateConfirmCustomizationDetailsResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/confirm_customization_details", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::confirm_customization_details(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_amazon_motors(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateAmazonMotorsRequest,
) -> Result<models::messaging::CreateAmazonMotorsResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_amazon_motors", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_amazon_motors(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_confirm_delivery_details(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateConfirmDeliveryDetailsRequest,
) -> Result<models::messaging::CreateConfirmDeliveryDetailsResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_confirm_delivery_details", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_confirm_delivery_details(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_confirm_order_details(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateConfirmOrderDetailsRequest,
) -> Result<models::messaging::CreateConfirmOrderDetailsResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_confirm_order_details", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_confirm_order_details(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_confirm_service_details(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateConfirmServiceDetailsRequest,
) -> Result<models::messaging::CreateConfirmServiceDetailsResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_confirm_service_details", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_confirm_service_details(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_digital_access_key(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateDigitalAccessKeyRequest,
) -> Result<models::messaging::CreateDigitalAccessKeyResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_digital_access_key", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_digital_access_key(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_legal_disclosure(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateLegalDisclosureRequest,
) -> Result<models::messaging::CreateLegalDisclosureResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_legal_disclosure", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_legal_disclosure(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_negative_feedback_removal(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
) -> Result<models::messaging::CreateNegativeFeedbackRemovalResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_negative_feedback_removal", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_negative_feedback_removal(
&configuration,
amazon_order_id,
marketplace_ids,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_unexpected_problem(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateUnexpectedProblemRequest,
) -> Result<models::messaging::CreateUnexpectedProblemResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_unexpected_problem", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_unexpected_problem(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn create_warranty(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::CreateWarrantyRequest,
) -> Result<models::messaging::CreateWarrantyResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/create_warranty", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::create_warranty(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn get_attributes(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
) -> Result<models::messaging::GetAttributesResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/get_attributes", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::get_attributes(
&configuration,
amazon_order_id,
marketplace_ids,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn get_messaging_actions_for_order(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
) -> Result<models::messaging::GetMessagingActionsForOrderResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/get_messaging_actions_for_order", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::get_messaging_actions_for_order(
&configuration,
amazon_order_id,
marketplace_ids,
)
.await?;
guard.mark_response().await;
Ok(res)
}
pub async fn send_invoice(
&self,
amazon_order_id: &str,
marketplace_ids: Vec<String>,
body: models::messaging::InvoiceRequest,
) -> Result<models::messaging::InvoiceResponse> {
let configuration = self.create_configuration().await?;
let guard = self
.limiter()
.wait("messaging_v1/send_invoice", 1.0, 5)
.await?;
let res = crate::apis::messaging_v1::send_invoice(
&configuration,
amazon_order_id,
marketplace_ids,
body,
)
.await?;
guard.mark_response().await;
Ok(res)
}
}