public final class DefaultSubscriptionsApi extends BaseApi implements SubscriptionsApi
AUTHENTICATION_KEY, GLOBAL_ERROR_CASES| Constructor and Description |
|---|
DefaultSubscriptionsApi(io.apimatic.core.GlobalConfiguration globalConfig)
Initializes the controller.
|
| Modifier and Type | Method and Description |
|---|---|
BulkSwapPlanResponse |
bulkSwapPlan(BulkSwapPlanRequest body)
Schedules a plan variation change for all active subscriptions under a given plan variation.
|
CompletableFuture<BulkSwapPlanResponse> |
bulkSwapPlanAsync(BulkSwapPlanRequest body)
Schedules a plan variation change for all active subscriptions under a given plan variation.
|
CancelSubscriptionResponse |
cancelSubscription(String subscriptionId)
Schedules a `CANCEL` action to cancel an active subscription.
|
CompletableFuture<CancelSubscriptionResponse> |
cancelSubscriptionAsync(String subscriptionId)
Schedules a `CANCEL` action to cancel an active subscription.
|
ChangeBillingAnchorDateResponse |
changeBillingAnchorDate(String subscriptionId,
ChangeBillingAnchorDateRequest body)
Changes the [billing anchor
date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates)
for a subscription.
|
CompletableFuture<ChangeBillingAnchorDateResponse> |
changeBillingAnchorDateAsync(String subscriptionId,
ChangeBillingAnchorDateRequest body)
Changes the [billing anchor
date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates)
for a subscription.
|
CreateSubscriptionResponse |
createSubscription(CreateSubscriptionRequest body)
Enrolls a customer in a subscription.
|
CompletableFuture<CreateSubscriptionResponse> |
createSubscriptionAsync(CreateSubscriptionRequest body)
Enrolls a customer in a subscription.
|
DeleteSubscriptionActionResponse |
deleteSubscriptionAction(String subscriptionId,
String actionId)
Deletes a scheduled action for a subscription.
|
CompletableFuture<DeleteSubscriptionActionResponse> |
deleteSubscriptionActionAsync(String subscriptionId,
String actionId)
Deletes a scheduled action for a subscription.
|
ListSubscriptionEventsResponse |
listSubscriptionEvents(String subscriptionId,
String cursor,
Integer limit)
Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for
a specific subscription.
|
CompletableFuture<ListSubscriptionEventsResponse> |
listSubscriptionEventsAsync(String subscriptionId,
String cursor,
Integer limit)
Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for
a specific subscription.
|
PauseSubscriptionResponse |
pauseSubscription(String subscriptionId,
PauseSubscriptionRequest body)
Schedules a `PAUSE` action to pause an active subscription.
|
CompletableFuture<PauseSubscriptionResponse> |
pauseSubscriptionAsync(String subscriptionId,
PauseSubscriptionRequest body)
Schedules a `PAUSE` action to pause an active subscription.
|
ResumeSubscriptionResponse |
resumeSubscription(String subscriptionId,
ResumeSubscriptionRequest body)
Schedules a `RESUME` action to resume a paused or a deactivated subscription.
|
CompletableFuture<ResumeSubscriptionResponse> |
resumeSubscriptionAsync(String subscriptionId,
ResumeSubscriptionRequest body)
Schedules a `RESUME` action to resume a paused or a deactivated subscription.
|
RetrieveSubscriptionResponse |
retrieveSubscription(String subscriptionId,
String include)
Retrieves a specific subscription.
|
CompletableFuture<RetrieveSubscriptionResponse> |
retrieveSubscriptionAsync(String subscriptionId,
String include)
Retrieves a specific subscription.
|
SearchSubscriptionsResponse |
searchSubscriptions(SearchSubscriptionsRequest body)
Searches for subscriptions.
|
CompletableFuture<SearchSubscriptionsResponse> |
searchSubscriptionsAsync(SearchSubscriptionsRequest body)
Searches for subscriptions.
|
SwapPlanResponse |
swapPlan(String subscriptionId,
SwapPlanRequest body)
Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing
subscription.
|
CompletableFuture<SwapPlanResponse> |
swapPlanAsync(String subscriptionId,
SwapPlanRequest body)
Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing
subscription.
|
UpdateSubscriptionResponse |
updateSubscription(String subscriptionId,
UpdateSubscriptionRequest body)
Updates a subscription by modifying or clearing `subscription` field values.
|
CompletableFuture<UpdateSubscriptionResponse> |
updateSubscriptionAsync(String subscriptionId,
UpdateSubscriptionRequest body)
Updates a subscription by modifying or clearing `subscription` field values.
|
getClientInstance, getGlobalConfiguration, getHttpCallbackpublic DefaultSubscriptionsApi(io.apimatic.core.GlobalConfiguration globalConfig)
globalConfig - Configurations added in client.public CreateSubscriptionResponse createSubscription(CreateSubscriptionRequest body) throws ApiException, IOException
createSubscription in interface SubscriptionsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CreateSubscriptionResponse> createSubscriptionAsync(CreateSubscriptionRequest body)
createSubscriptionAsync in interface SubscriptionsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public BulkSwapPlanResponse bulkSwapPlan(BulkSwapPlanRequest body) throws ApiException, IOException
bulkSwapPlan in interface SubscriptionsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<BulkSwapPlanResponse> bulkSwapPlanAsync(BulkSwapPlanRequest body)
bulkSwapPlanAsync in interface SubscriptionsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchSubscriptionsResponse searchSubscriptions(SearchSubscriptionsRequest body) throws ApiException, IOException
searchSubscriptions in interface SubscriptionsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<SearchSubscriptionsResponse> searchSubscriptionsAsync(SearchSubscriptionsRequest body)
searchSubscriptionsAsync in interface SubscriptionsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public RetrieveSubscriptionResponse retrieveSubscription(String subscriptionId, String include) throws ApiException, IOException
retrieveSubscription in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to retrieve.include - Optional parameter: A query parameter to specify related information to be
included in the response. The supported query parameter values are: - `actions`: to
include scheduled actions on the targeted subscription.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveSubscriptionResponse> retrieveSubscriptionAsync(String subscriptionId, String include)
retrieveSubscriptionAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to retrieve.include - Optional parameter: A query parameter to specify related information to be
included in the response. The supported query parameter values are: - `actions`: to
include scheduled actions on the targeted subscription.public UpdateSubscriptionResponse updateSubscription(String subscriptionId, UpdateSubscriptionRequest body) throws ApiException, IOException
updateSubscription in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<UpdateSubscriptionResponse> updateSubscriptionAsync(String subscriptionId, UpdateSubscriptionRequest body)
updateSubscriptionAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public DeleteSubscriptionActionResponse deleteSubscriptionAction(String subscriptionId, String actionId) throws ApiException, IOException
deleteSubscriptionAction in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription the targeted action is
to act upon.actionId - Required parameter: The ID of the targeted action to be deleted.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<DeleteSubscriptionActionResponse> deleteSubscriptionActionAsync(String subscriptionId, String actionId)
deleteSubscriptionActionAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription the targeted action is
to act upon.actionId - Required parameter: The ID of the targeted action to be deleted.public ChangeBillingAnchorDateResponse changeBillingAnchorDate(String subscriptionId, ChangeBillingAnchorDateRequest body) throws ApiException, IOException
changeBillingAnchorDate in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to update the billing
anchor date.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ChangeBillingAnchorDateResponse> changeBillingAnchorDateAsync(String subscriptionId, ChangeBillingAnchorDateRequest body)
changeBillingAnchorDateAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to update the billing
anchor date.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public CancelSubscriptionResponse cancelSubscription(String subscriptionId) throws ApiException, IOException
cancelSubscription in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to cancel.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CancelSubscriptionResponse> cancelSubscriptionAsync(String subscriptionId)
cancelSubscriptionAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to cancel.public ListSubscriptionEventsResponse listSubscriptionEvents(String subscriptionId, String cursor, Integer limit) throws ApiException, IOException
listSubscriptionEvents in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to retrieve the events
for.cursor - Optional parameter: When the total number of resulting subscription events
exceeds the limit of a paged response, specify the cursor returned from a preceding
response here to fetch the next set of results. If the cursor is unset, the response
contains the last page of the results. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit - Optional parameter: The upper limit on the number of subscription events to
return in a paged response.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListSubscriptionEventsResponse> listSubscriptionEventsAsync(String subscriptionId, String cursor, Integer limit)
listSubscriptionEventsAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to retrieve the events
for.cursor - Optional parameter: When the total number of resulting subscription events
exceeds the limit of a paged response, specify the cursor returned from a preceding
response here to fetch the next set of results. If the cursor is unset, the response
contains the last page of the results. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit - Optional parameter: The upper limit on the number of subscription events to
return in a paged response.public PauseSubscriptionResponse pauseSubscription(String subscriptionId, PauseSubscriptionRequest body) throws ApiException, IOException
pauseSubscription in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to pause.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<PauseSubscriptionResponse> pauseSubscriptionAsync(String subscriptionId, PauseSubscriptionRequest body)
pauseSubscriptionAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to pause.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public ResumeSubscriptionResponse resumeSubscription(String subscriptionId, ResumeSubscriptionRequest body) throws ApiException, IOException
resumeSubscription in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to resume.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ResumeSubscriptionResponse> resumeSubscriptionAsync(String subscriptionId, ResumeSubscriptionRequest body)
resumeSubscriptionAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to resume.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SwapPlanResponse swapPlan(String subscriptionId, SwapPlanRequest body) throws ApiException, IOException
swapPlan in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to swap the
subscription plan for.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<SwapPlanResponse> swapPlanAsync(String subscriptionId, SwapPlanRequest body)
swapPlanAsync in interface SubscriptionsApisubscriptionId - Required parameter: The ID of the subscription to swap the
subscription plan for.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.Copyright © 2024. All rights reserved.