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 CustomerPortalApi<'a> {
pub(crate) client: &'a Client,
}
#[derive(Debug, Clone, Serialize)]
pub struct UpdateCustomerPortalProfileParams {
#[serde(skip)]
pub body: SdkUpdateCustomerPortalProfileRequestApplicationJson,
}
impl UpdateCustomerPortalProfileParams {
#[allow(deprecated)]
pub fn new(body: SdkUpdateCustomerPortalProfileRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct CancelCustomerSubscriptionAtPeriodEndParams {
#[serde(skip)]
pub body: SdkCancelCustomerSubscriptionAtPeriodEndRequestApplicationJson,
}
impl CancelCustomerSubscriptionAtPeriodEndParams {
#[allow(deprecated)]
pub fn new(body: SdkCancelCustomerSubscriptionAtPeriodEndRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct CancelCustomerSubscriptionImmediatelyParams {
#[serde(skip)]
pub body: SdkCancelCustomerSubscriptionImmediatelyRequestApplicationJson,
}
impl CancelCustomerSubscriptionImmediatelyParams {
#[allow(deprecated)]
pub fn new(body: SdkCancelCustomerSubscriptionImmediatelyRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct PauseCustomerSubscriptionParams {
#[serde(skip)]
pub body: SdkPauseCustomerSubscriptionRequestApplicationJson,
}
impl PauseCustomerSubscriptionParams {
#[allow(deprecated)]
pub fn new(body: SdkPauseCustomerSubscriptionRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ResumeCustomerSubscriptionParams {
#[serde(skip)]
pub body: SdkResumeCustomerSubscriptionRequestApplicationJson,
}
impl ResumeCustomerSubscriptionParams {
#[allow(deprecated)]
pub fn new(body: SdkResumeCustomerSubscriptionRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct UpdateCustomerSubscriptionPaymentMethodParams {
#[serde(skip)]
pub body: SdkUpdateCustomerSubscriptionPaymentMethodRequestApplicationJson,
}
impl UpdateCustomerSubscriptionPaymentMethodParams {
#[allow(deprecated)]
pub fn new(body: SdkUpdateCustomerSubscriptionPaymentMethodRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct PreviewCustomerSubscriptionPlanChangeParams {
#[serde(skip)]
pub body: SdkPreviewCustomerSubscriptionPlanChangeRequestApplicationJson,
}
impl PreviewCustomerSubscriptionPlanChangeParams {
#[allow(deprecated)]
pub fn new(body: SdkPreviewCustomerSubscriptionPlanChangeRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ConfirmCustomerSubscriptionPlanChangeParams {
#[serde(skip)]
pub body: SdkConfirmCustomerSubscriptionPlanChangeRequestApplicationJson,
}
impl ConfirmCustomerSubscriptionPlanChangeParams {
#[allow(deprecated)]
pub fn new(body: SdkConfirmCustomerSubscriptionPlanChangeRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct PreviewCustomerSubscriptionRenewalDateChangeParams {
#[serde(skip)]
pub body: SdkPreviewCustomerSubscriptionRenewalDateChangeRequestApplicationJson,
}
impl PreviewCustomerSubscriptionRenewalDateChangeParams {
#[allow(deprecated)]
pub fn new(
body: SdkPreviewCustomerSubscriptionRenewalDateChangeRequestApplicationJson,
) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ConfirmCustomerSubscriptionRenewalDateChangeParams {
#[serde(skip)]
pub body: SdkConfirmCustomerSubscriptionRenewalDateChangeRequestApplicationJson,
}
impl ConfirmCustomerSubscriptionRenewalDateChangeParams {
#[allow(deprecated)]
pub fn new(
body: SdkConfirmCustomerSubscriptionRenewalDateChangeRequestApplicationJson,
) -> Self {
Self { body }
}
}
impl<'a> CustomerPortalApi<'a> {
pub async fn get_customer_portal_profile(
&self,
) -> Result<SdkGetCustomerPortalProfileResponseValue200ApplicationJson, Error> {
self.get_customer_portal_profile_with_options(None).await
}
pub async fn get_customer_portal_profile_with_options(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetCustomerPortalProfileResponseValue200ApplicationJson, Error> {
self.get_customer_portal_profile_raw(options)
.await
.map(|response| response.data)
}
pub async fn get_customer_portal_profile_raw(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkGetCustomerPortalProfileResponseValue200ApplicationJson>, Error>
{
let path = "/v2/customer-portal/me".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getCustomerPortalProfile".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/me",
)
.await
}
pub async fn update_customer_portal_profile(
&self,
params: UpdateCustomerPortalProfileParams,
) -> Result<SdkUpdateCustomerPortalProfileResponseValue200ApplicationJson, Error> {
self.update_customer_portal_profile_with_options(params, None)
.await
}
pub async fn update_customer_portal_profile_with_options(
&self,
params: UpdateCustomerPortalProfileParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkUpdateCustomerPortalProfileResponseValue200ApplicationJson, Error> {
self.update_customer_portal_profile_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn update_customer_portal_profile_raw(
&self,
params: UpdateCustomerPortalProfileParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkUpdateCustomerPortalProfileResponseValue200ApplicationJson>,
Error,
> {
let path = "/v2/customer-portal/me".to_string();
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("updateCustomerPortalProfile".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/customer-portal/me",
)
.await
}
pub async fn list_customer_portal_orders(
&self,
) -> Result<SdkListCustomerPortalOrdersResponseValue200ApplicationJson, Error> {
self.list_customer_portal_orders_with_options(None).await
}
pub async fn list_customer_portal_orders_with_options(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<SdkListCustomerPortalOrdersResponseValue200ApplicationJson, Error> {
self.list_customer_portal_orders_raw(options)
.await
.map(|response| response.data)
}
pub async fn list_customer_portal_orders_raw(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkListCustomerPortalOrdersResponseValue200ApplicationJson>, Error>
{
let path = "/v2/customer-portal/orders".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("listCustomerPortalOrders".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/orders",
)
.await
}
pub async fn get_customer_portal_order(
&self,
order: &str,
) -> Result<SdkGetCustomerPortalOrderResponseValue200ApplicationJson, Error> {
self.get_customer_portal_order_with_options(order, None)
.await
}
pub async fn get_customer_portal_order_with_options(
&self,
order: &str,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetCustomerPortalOrderResponseValue200ApplicationJson, Error> {
self.get_customer_portal_order_raw(order, options)
.await
.map(|response| response.data)
}
pub async fn get_customer_portal_order_raw(
&self,
order: &str,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkGetCustomerPortalOrderResponseValue200ApplicationJson>, Error>
{
let order = crate::client::path_segment(order);
let path = format!("/v2/customer-portal/orders/{order}");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getCustomerPortalOrder".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/orders/{order}",
)
.await
}
pub async fn list_customer_portal_subscriptions(
&self,
) -> Result<SdkListCustomerPortalSubscriptionsResponseValue200ApplicationJson, Error> {
self.list_customer_portal_subscriptions_with_options(None)
.await
}
pub async fn list_customer_portal_subscriptions_with_options(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<SdkListCustomerPortalSubscriptionsResponseValue200ApplicationJson, Error> {
self.list_customer_portal_subscriptions_raw(options)
.await
.map(|response| response.data)
}
pub async fn list_customer_portal_subscriptions_raw(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkListCustomerPortalSubscriptionsResponseValue200ApplicationJson>,
Error,
> {
let path = "/v2/customer-portal/subscriptions".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("listCustomerPortalSubscriptions".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/subscriptions",
)
.await
}
pub async fn get_customer_portal_subscription(
&self,
subscription: &str,
) -> Result<SdkGetCustomerPortalSubscriptionResponseValue200ApplicationJson, Error> {
self.get_customer_portal_subscription_with_options(subscription, None)
.await
}
pub async fn get_customer_portal_subscription_with_options(
&self,
subscription: &str,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetCustomerPortalSubscriptionResponseValue200ApplicationJson, Error> {
self.get_customer_portal_subscription_raw(subscription, options)
.await
.map(|response| response.data)
}
pub async fn get_customer_portal_subscription_raw(
&self,
subscription: &str,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkGetCustomerPortalSubscriptionResponseValue200ApplicationJson>,
Error,
> {
let subscription = crate::client::path_segment(subscription);
let path = format!("/v2/customer-portal/subscriptions/{subscription}");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getCustomerPortalSubscription".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/subscriptions/{subscription}",
)
.await
}
pub async fn get_customer_portal_subscription_capabilities(
&self,
subscription: &str,
) -> Result<SdkGetCustomerPortalSubscriptionCapabilitiesResponseValue200ApplicationJson, Error>
{
self.get_customer_portal_subscription_capabilities_with_options(subscription, None)
.await
}
pub async fn get_customer_portal_subscription_capabilities_with_options(
&self,
subscription: &str,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetCustomerPortalSubscriptionCapabilitiesResponseValue200ApplicationJson, Error>
{
self.get_customer_portal_subscription_capabilities_raw(subscription, options)
.await
.map(|response| response.data)
}
pub async fn get_customer_portal_subscription_capabilities_raw(
&self,
subscription: &str,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<
SdkGetCustomerPortalSubscriptionCapabilitiesResponseValue200ApplicationJson,
>,
Error,
> {
let subscription = crate::client::path_segment(subscription);
let path = format!("/v2/customer-portal/subscriptions/{subscription}/capabilities");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getCustomerPortalSubscriptionCapabilities".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/subscriptions/{subscription}/capabilities",
)
.await
}
pub async fn list_customer_portal_entitlements(
&self,
) -> Result<SdkListCustomerPortalEntitlementsResponseValue200ApplicationJson, Error> {
self.list_customer_portal_entitlements_with_options(None)
.await
}
pub async fn list_customer_portal_entitlements_with_options(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<SdkListCustomerPortalEntitlementsResponseValue200ApplicationJson, Error> {
self.list_customer_portal_entitlements_raw(options)
.await
.map(|response| response.data)
}
pub async fn list_customer_portal_entitlements_raw(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkListCustomerPortalEntitlementsResponseValue200ApplicationJson>,
Error,
> {
let path = "/v2/customer-portal/entitlements".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("listCustomerPortalEntitlements".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/customer-portal/entitlements",
)
.await
}
pub async fn cancel_customer_subscription_at_period_end(
&self,
product_subscription: &str,
params: CancelCustomerSubscriptionAtPeriodEndParams,
) -> Result<SdkCancelCustomerSubscriptionAtPeriodEndResponseValue200ApplicationJson, Error>
{
self.cancel_customer_subscription_at_period_end_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn cancel_customer_subscription_at_period_end_with_options(
&self,
product_subscription: &str,
params: CancelCustomerSubscriptionAtPeriodEndParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCancelCustomerSubscriptionAtPeriodEndResponseValue200ApplicationJson, Error>
{
self.cancel_customer_subscription_at_period_end_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn cancel_customer_subscription_at_period_end_raw(
&self,
product_subscription: &str,
params: CancelCustomerSubscriptionAtPeriodEndParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkCancelCustomerSubscriptionAtPeriodEndResponseValue200ApplicationJson>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/cancel-period-end"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("cancelCustomerSubscriptionAtPeriodEnd".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/cancel-period-end")
.await
}
pub async fn cancel_customer_subscription_immediately(
&self,
product_subscription: &str,
params: CancelCustomerSubscriptionImmediatelyParams,
) -> Result<SdkCancelCustomerSubscriptionImmediatelyResponseValue200ApplicationJson, Error>
{
self.cancel_customer_subscription_immediately_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn cancel_customer_subscription_immediately_with_options(
&self,
product_subscription: &str,
params: CancelCustomerSubscriptionImmediatelyParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCancelCustomerSubscriptionImmediatelyResponseValue200ApplicationJson, Error>
{
self.cancel_customer_subscription_immediately_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn cancel_customer_subscription_immediately_raw(
&self,
product_subscription: &str,
params: CancelCustomerSubscriptionImmediatelyParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkCancelCustomerSubscriptionImmediatelyResponseValue200ApplicationJson>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/cancel-immediately"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("cancelCustomerSubscriptionImmediately".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/cancel-immediately")
.await
}
pub async fn pause_customer_subscription(
&self,
product_subscription: &str,
params: PauseCustomerSubscriptionParams,
) -> Result<SdkPauseCustomerSubscriptionResponseValue200ApplicationJson, Error> {
self.pause_customer_subscription_with_options(product_subscription, params, None)
.await
}
pub async fn pause_customer_subscription_with_options(
&self,
product_subscription: &str,
params: PauseCustomerSubscriptionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkPauseCustomerSubscriptionResponseValue200ApplicationJson, Error> {
self.pause_customer_subscription_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn pause_customer_subscription_raw(
&self,
product_subscription: &str,
params: PauseCustomerSubscriptionParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkPauseCustomerSubscriptionResponseValue200ApplicationJson>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path =
format!("/v2/customer-portal/subscriptions/{product_subscription}/actions/pause");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("pauseCustomerSubscription".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/customer-portal/subscriptions/{productSubscription}/actions/pause",
)
.await
}
pub async fn resume_customer_subscription(
&self,
product_subscription: &str,
params: ResumeCustomerSubscriptionParams,
) -> Result<SdkResumeCustomerSubscriptionResponseValue200ApplicationJson, Error> {
self.resume_customer_subscription_with_options(product_subscription, params, None)
.await
}
pub async fn resume_customer_subscription_with_options(
&self,
product_subscription: &str,
params: ResumeCustomerSubscriptionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkResumeCustomerSubscriptionResponseValue200ApplicationJson, Error> {
self.resume_customer_subscription_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn resume_customer_subscription_raw(
&self,
product_subscription: &str,
params: ResumeCustomerSubscriptionParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkResumeCustomerSubscriptionResponseValue200ApplicationJson>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path =
format!("/v2/customer-portal/subscriptions/{product_subscription}/actions/resume");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("resumeCustomerSubscription".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/customer-portal/subscriptions/{productSubscription}/actions/resume",
)
.await
}
pub async fn update_customer_subscription_payment_method(
&self,
product_subscription: &str,
params: UpdateCustomerSubscriptionPaymentMethodParams,
) -> Result<SdkUpdateCustomerSubscriptionPaymentMethodResponseValue200ApplicationJson, Error>
{
self.update_customer_subscription_payment_method_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn update_customer_subscription_payment_method_with_options(
&self,
product_subscription: &str,
params: UpdateCustomerSubscriptionPaymentMethodParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkUpdateCustomerSubscriptionPaymentMethodResponseValue200ApplicationJson, Error>
{
self.update_customer_subscription_payment_method_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn update_customer_subscription_payment_method_raw(
&self,
product_subscription: &str,
params: UpdateCustomerSubscriptionPaymentMethodParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<
SdkUpdateCustomerSubscriptionPaymentMethodResponseValue200ApplicationJson,
>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/update-payment-method"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("updateCustomerSubscriptionPaymentMethod".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/update-payment-method")
.await
}
pub async fn preview_customer_subscription_plan_change(
&self,
product_subscription: &str,
params: PreviewCustomerSubscriptionPlanChangeParams,
) -> Result<SdkPreviewCustomerSubscriptionPlanChangeResponseValue200ApplicationJson, Error>
{
self.preview_customer_subscription_plan_change_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn preview_customer_subscription_plan_change_with_options(
&self,
product_subscription: &str,
params: PreviewCustomerSubscriptionPlanChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkPreviewCustomerSubscriptionPlanChangeResponseValue200ApplicationJson, Error>
{
self.preview_customer_subscription_plan_change_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn preview_customer_subscription_plan_change_raw(
&self,
product_subscription: &str,
params: PreviewCustomerSubscriptionPlanChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkPreviewCustomerSubscriptionPlanChangeResponseValue200ApplicationJson>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/change-plan/preview"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("previewCustomerSubscriptionPlanChange".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/change-plan/preview")
.await
}
pub async fn confirm_customer_subscription_plan_change(
&self,
product_subscription: &str,
params: ConfirmCustomerSubscriptionPlanChangeParams,
) -> Result<SdkConfirmCustomerSubscriptionPlanChangeResponseValue200ApplicationJson, Error>
{
self.confirm_customer_subscription_plan_change_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn confirm_customer_subscription_plan_change_with_options(
&self,
product_subscription: &str,
params: ConfirmCustomerSubscriptionPlanChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkConfirmCustomerSubscriptionPlanChangeResponseValue200ApplicationJson, Error>
{
self.confirm_customer_subscription_plan_change_raw(product_subscription, params, options)
.await
.map(|response| response.data)
}
pub async fn confirm_customer_subscription_plan_change_raw(
&self,
product_subscription: &str,
params: ConfirmCustomerSubscriptionPlanChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkConfirmCustomerSubscriptionPlanChangeResponseValue200ApplicationJson>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/change-plan/confirm"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("confirmCustomerSubscriptionPlanChange".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/change-plan/confirm")
.await
}
pub async fn preview_customer_subscription_renewal_date_change(
&self,
product_subscription: &str,
params: PreviewCustomerSubscriptionRenewalDateChangeParams,
) -> Result<SdkPreviewCustomerSubscriptionRenewalDateChangeResponseValue200ApplicationJson, Error>
{
self.preview_customer_subscription_renewal_date_change_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn preview_customer_subscription_renewal_date_change_with_options(
&self,
product_subscription: &str,
params: PreviewCustomerSubscriptionRenewalDateChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkPreviewCustomerSubscriptionRenewalDateChangeResponseValue200ApplicationJson, Error>
{
self.preview_customer_subscription_renewal_date_change_raw(
product_subscription,
params,
options,
)
.await
.map(|response| response.data)
}
pub async fn preview_customer_subscription_renewal_date_change_raw(
&self,
product_subscription: &str,
params: PreviewCustomerSubscriptionRenewalDateChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<
SdkPreviewCustomerSubscriptionRenewalDateChangeResponseValue200ApplicationJson,
>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/change-renewal-date/preview"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("previewCustomerSubscriptionRenewalDateChange".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/change-renewal-date/preview")
.await
}
pub async fn confirm_customer_subscription_renewal_date_change(
&self,
product_subscription: &str,
params: ConfirmCustomerSubscriptionRenewalDateChangeParams,
) -> Result<SdkConfirmCustomerSubscriptionRenewalDateChangeResponseValue200ApplicationJson, Error>
{
self.confirm_customer_subscription_renewal_date_change_with_options(
product_subscription,
params,
None,
)
.await
}
pub async fn confirm_customer_subscription_renewal_date_change_with_options(
&self,
product_subscription: &str,
params: ConfirmCustomerSubscriptionRenewalDateChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkConfirmCustomerSubscriptionRenewalDateChangeResponseValue200ApplicationJson, Error>
{
self.confirm_customer_subscription_renewal_date_change_raw(
product_subscription,
params,
options,
)
.await
.map(|response| response.data)
}
pub async fn confirm_customer_subscription_renewal_date_change_raw(
&self,
product_subscription: &str,
params: ConfirmCustomerSubscriptionRenewalDateChangeParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<
SdkConfirmCustomerSubscriptionRenewalDateChangeResponseValue200ApplicationJson,
>,
Error,
> {
let product_subscription = crate::client::path_segment(product_subscription);
let path = format!(
"/v2/customer-portal/subscriptions/{product_subscription}/actions/change-renewal-date/confirm"
);
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("confirmCustomerSubscriptionRenewalDateChange".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(method, &path, ¶ms, Some(¶ms.body), options, "POST /v2/customer-portal/subscriptions/{productSubscription}/actions/change-renewal-date/confirm")
.await
}
}