use crate::client::Client;
#[allow(unused_imports)]
use crate::enums::*;
use crate::error::Error;
#[allow(unused_imports)]
use crate::models::*;
#[allow(unused_imports)]
use serde::Serialize;
pub struct InvoicesApi<'a> {
pub(crate) client: &'a Client,
}
#[derive(Debug, Clone, Serialize)]
pub struct ListParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub page: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub search: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub search_by: Option<InvoicesSearchBy>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub serial_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_info: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub product_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub discord_data: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub crypto_txid: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub crypto_address: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub coupon_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<Vec<InvoicesStatus>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_methods: Option<Vec<InvoicesPaymentMethods>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sort: Option<InvoicesSort>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
impl Default for ListParams {
#[allow(deprecated)]
fn default() -> Self {
Self {
limit: Some(15),
page: Some(1),
search: Default::default(),
search_by: Default::default(),
id: Default::default(),
email: Default::default(),
transaction_id: Default::default(),
serial_code: Default::default(),
additional_info: Default::default(),
product_name: Default::default(),
discord_data: Default::default(),
crypto_txid: Default::default(),
crypto_address: Default::default(),
coupon_code: Default::default(),
status: Default::default(),
payment_methods: Default::default(),
sort: Default::default(),
x_store: Default::default(),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct CreateParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkCreateInvoiceRequestApplicationJson,
}
impl CreateParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateInvoiceRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SearchParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkSearchInvoicesRequestApplicationJson,
}
impl SearchParams {
#[allow(deprecated)]
pub fn new(body: SdkSearchInvoicesRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct GoToCheckoutParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetDeliverablesParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct MarkCompletedParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkMarkPendingInvoiceCompletedRequestApplicationJson,
}
impl MarkCompletedParams {
#[allow(deprecated)]
pub fn new(body: SdkMarkPendingInvoiceCompletedRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct MarkVoidedParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkMarkPendingInvoiceVoidedRequestApplicationJson,
}
impl MarkVoidedParams {
#[allow(deprecated)]
pub fn new(body: SdkMarkPendingInvoiceVoidedRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct IssueReplacementParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkIssueReplacementForCompletedInvoiceRequestApplicationJson,
}
impl IssueReplacementParams {
#[allow(deprecated)]
pub fn new(body: SdkIssueReplacementForCompletedInvoiceRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct UpdateStatusParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkUpdateInvoiceStatusRequestApplicationJson,
}
impl UpdateStatusParams {
#[allow(deprecated)]
pub fn new(body: SdkUpdateInvoiceStatusRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct CreateRefundParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkCreateInvoiceRefundRequestApplicationJson,
}
impl CreateRefundParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateInvoiceRefundRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct RetryFulfillmentParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkCreateFulfillmentRetryRequestApplicationJson,
}
impl RetryFulfillmentParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateFulfillmentRetryRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct RetryDynamicDeliveryParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkCreateDynamicDeliveryRetryRequestApplicationJson,
}
impl RetryDynamicDeliveryParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateDynamicDeliveryRetryRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct NotifyFulfillmentParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkCreateFulfillmentNotificationsRequestApplicationJson,
}
impl NotifyFulfillmentParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateFulfillmentNotificationsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
impl<'a> InvoicesApi<'a> {
pub async fn list(
&self,
params: ListParams,
) -> Result<SdkListInvoicesResponseValue200ApplicationJson, Error> {
self.list_with_options(params, None).await
}
pub async fn list_with_options(
&self,
params: ListParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkListInvoicesResponseValue200ApplicationJson, Error> {
self.list_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn list_raw(
&self,
params: ListParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkListInvoicesResponseValue200ApplicationJson>, Error> {
let path = "/v2/invoices".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("listInvoices".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(method, &path, ¶ms, options, "GET /v2/invoices")
.await
}
pub async fn create(
&self,
params: CreateParams,
) -> Result<SdkCreateInvoiceResponseValue201ApplicationJson, Error> {
self.create_with_options(params, None).await
}
pub async fn create_with_options(
&self,
params: CreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateInvoiceResponseValue201ApplicationJson, Error> {
self.create_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn create_raw(
&self,
params: CreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkCreateInvoiceResponseValue201ApplicationJson>, Error> {
let path = "/v2/invoices".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createInvoice".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/invoices",
)
.await
}
pub async fn search(
&self,
params: SearchParams,
) -> Result<SdkSearchInvoicesResponseValue200ApplicationJson, Error> {
self.search_with_options(params, None).await
}
pub async fn search_with_options(
&self,
params: SearchParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkSearchInvoicesResponseValue200ApplicationJson, Error> {
self.search_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn search_raw(
&self,
params: SearchParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkSearchInvoicesResponseValue200ApplicationJson>, Error> {
let path = "/v2/invoices/search".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("searchInvoices".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/invoices/search",
)
.await
}
pub async fn get(
&self,
invoice: &str,
params: GetParams,
) -> Result<SdkGetInvoiceResponseValue200ApplicationJson, Error> {
self.get_with_options(invoice, params, None).await
}
pub async fn get_with_options(
&self,
invoice: &str,
params: GetParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetInvoiceResponseValue200ApplicationJson, Error> {
self.get_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn get_raw(
&self,
invoice: &str,
params: GetParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkGetInvoiceResponseValue200ApplicationJson>, Error> {
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getInvoice".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"GET /v2/invoices/{invoice}",
)
.await
}
pub async fn go_to_checkout(
&self,
invoice: &str,
params: GoToCheckoutParams,
) -> Result<SdkCreateCheckoutSessionResponseValue200ApplicationJson, Error> {
self.go_to_checkout_with_options(invoice, params, None)
.await
}
pub async fn go_to_checkout_with_options(
&self,
invoice: &str,
params: GoToCheckoutParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateCheckoutSessionResponseValue200ApplicationJson, Error> {
self.go_to_checkout_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn go_to_checkout_raw(
&self,
invoice: &str,
params: GoToCheckoutParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkCreateCheckoutSessionResponseValue200ApplicationJson>, Error>
{
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/checkout");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createCheckoutSession".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"POST /v2/invoices/{invoice}/checkout",
)
.await
}
pub async fn get_deliverables(
&self,
invoice: &str,
params: GetDeliverablesParams,
) -> Result<SdkGetInvoiceDeliverablesResponseValue200ApplicationJson, Error> {
self.get_deliverables_with_options(invoice, params, None)
.await
}
pub async fn get_deliverables_with_options(
&self,
invoice: &str,
params: GetDeliverablesParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetInvoiceDeliverablesResponseValue200ApplicationJson, Error> {
self.get_deliverables_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn get_deliverables_raw(
&self,
invoice: &str,
params: GetDeliverablesParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkGetInvoiceDeliverablesResponseValue200ApplicationJson>, Error>
{
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/deliverables");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getInvoiceDeliverables".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"GET /v2/invoices/{invoice}/deliverables",
)
.await
}
pub async fn mark_completed(
&self,
invoice: &str,
params: MarkCompletedParams,
) -> Result<SdkMarkPendingInvoiceCompletedResponseValue200ApplicationJson, Error> {
self.mark_completed_with_options(invoice, params, None)
.await
}
pub async fn mark_completed_with_options(
&self,
invoice: &str,
params: MarkCompletedParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkMarkPendingInvoiceCompletedResponseValue200ApplicationJson, Error> {
self.mark_completed_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn mark_completed_raw(
&self,
invoice: &str,
params: MarkCompletedParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkMarkPendingInvoiceCompletedResponseValue200ApplicationJson>,
Error,
> {
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/mark-completed");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("markPendingInvoiceCompleted".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/invoices/{invoice}/mark-completed",
)
.await
}
pub async fn mark_voided(
&self,
invoice: &str,
params: MarkVoidedParams,
) -> Result<SdkMarkPendingInvoiceVoidedResponseValue200ApplicationJson, Error> {
self.mark_voided_with_options(invoice, params, None).await
}
pub async fn mark_voided_with_options(
&self,
invoice: &str,
params: MarkVoidedParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkMarkPendingInvoiceVoidedResponseValue200ApplicationJson, Error> {
self.mark_voided_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn mark_voided_raw(
&self,
invoice: &str,
params: MarkVoidedParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkMarkPendingInvoiceVoidedResponseValue200ApplicationJson>, Error>
{
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/mark-voided");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("markPendingInvoiceVoided".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/invoices/{invoice}/mark-voided",
)
.await
}
pub async fn issue_replacement(
&self,
invoice: &str,
params: IssueReplacementParams,
) -> Result<SdkIssueReplacementForCompletedInvoiceResponseValue200ApplicationJson, Error> {
self.issue_replacement_with_options(invoice, params, None)
.await
}
pub async fn issue_replacement_with_options(
&self,
invoice: &str,
params: IssueReplacementParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkIssueReplacementForCompletedInvoiceResponseValue200ApplicationJson, Error> {
self.issue_replacement_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn issue_replacement_raw(
&self,
invoice: &str,
params: IssueReplacementParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkIssueReplacementForCompletedInvoiceResponseValue200ApplicationJson>,
Error,
> {
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/issue-replacement");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("issueReplacementForCompletedInvoice".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/invoices/{invoice}/issue-replacement",
)
.await
}
pub async fn update_status(
&self,
invoice: &str,
params: UpdateStatusParams,
) -> Result<SdkUpdateInvoiceStatusResponseValue200ApplicationJson, Error> {
self.update_status_with_options(invoice, params, None).await
}
pub async fn update_status_with_options(
&self,
invoice: &str,
params: UpdateStatusParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkUpdateInvoiceStatusResponseValue200ApplicationJson, Error> {
self.update_status_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn update_status_raw(
&self,
invoice: &str,
params: UpdateStatusParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkUpdateInvoiceStatusResponseValue200ApplicationJson>, Error>
{
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/status");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("updateInvoiceStatus".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/invoices/{invoice}/status",
)
.await
}
pub async fn create_refund(
&self,
invoice: &str,
params: CreateRefundParams,
) -> Result<SdkCreateInvoiceRefundResponseValue200ApplicationJson, Error> {
self.create_refund_with_options(invoice, params, None).await
}
pub async fn create_refund_with_options(
&self,
invoice: &str,
params: CreateRefundParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateInvoiceRefundResponseValue200ApplicationJson, Error> {
self.create_refund_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn create_refund_raw(
&self,
invoice: &str,
params: CreateRefundParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkCreateInvoiceRefundResponseValue200ApplicationJson>, Error>
{
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/refunds");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createInvoiceRefund".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/invoices/{invoice}/refunds",
)
.await
}
pub async fn retry_fulfillment(
&self,
invoice: &str,
params: RetryFulfillmentParams,
) -> Result<SdkCreateFulfillmentRetryResponseValue200ApplicationJson, Error> {
self.retry_fulfillment_with_options(invoice, params, None)
.await
}
pub async fn retry_fulfillment_with_options(
&self,
invoice: &str,
params: RetryFulfillmentParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateFulfillmentRetryResponseValue200ApplicationJson, Error> {
self.retry_fulfillment_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn retry_fulfillment_raw(
&self,
invoice: &str,
params: RetryFulfillmentParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkCreateFulfillmentRetryResponseValue200ApplicationJson>, Error>
{
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/fulfillment-retries");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createFulfillmentRetry".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/invoices/{invoice}/fulfillment-retries",
)
.await
}
pub async fn retry_dynamic_delivery(
&self,
invoice: &str,
params: RetryDynamicDeliveryParams,
) -> Result<SdkCreateDynamicDeliveryRetryResponseValue200ApplicationJson, Error> {
self.retry_dynamic_delivery_with_options(invoice, params, None)
.await
}
pub async fn retry_dynamic_delivery_with_options(
&self,
invoice: &str,
params: RetryDynamicDeliveryParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateDynamicDeliveryRetryResponseValue200ApplicationJson, Error> {
self.retry_dynamic_delivery_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn retry_dynamic_delivery_raw(
&self,
invoice: &str,
params: RetryDynamicDeliveryParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkCreateDynamicDeliveryRetryResponseValue200ApplicationJson>,
Error,
> {
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/dynamic-delivery-retries");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createDynamicDeliveryRetry".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/invoices/{invoice}/dynamic-delivery-retries",
)
.await
}
pub async fn notify_fulfillment(
&self,
invoice: &str,
params: NotifyFulfillmentParams,
) -> Result<SdkCreateFulfillmentNotificationsResponseValue200ApplicationJson, Error> {
self.notify_fulfillment_with_options(invoice, params, None)
.await
}
pub async fn notify_fulfillment_with_options(
&self,
invoice: &str,
params: NotifyFulfillmentParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateFulfillmentNotificationsResponseValue200ApplicationJson, Error> {
self.notify_fulfillment_raw(invoice, params, options)
.await
.map(|response| response.data)
}
pub async fn notify_fulfillment_raw(
&self,
invoice: &str,
params: NotifyFulfillmentParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkCreateFulfillmentNotificationsResponseValue200ApplicationJson>,
Error,
> {
let invoice = crate::client::path_segment(invoice);
let path = format!("/v2/invoices/{invoice}/fulfillment-notifications");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createFulfillmentNotifications".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/invoices/{invoice}/fulfillment-notifications",
)
.await
}
}