public final class DefaultSubscriptionsApi extends BaseApi implements SubscriptionsApi
BaseApi.RequestExecutor, BaseApi.RequestSupplier, BaseApi.ResponseHandler<T>authManagers, config, httpCallback, internalUserAgent| Constructor and Description |
|---|
DefaultSubscriptionsApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers)
Initializes the controller.
|
DefaultSubscriptionsApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers,
HttpCallback httpCallback)
Initializes the controller with HTTPCallback.
|
| Modifier and Type | Method and Description |
|---|---|
CancelSubscriptionResponse |
cancelSubscription(String subscriptionId)
Schedules a `CANCEL` action to cancel an active subscription by setting the `canceled_date`
field to the end of the active billing period and changing the subscription status from
ACTIVE to CANCELED after this date.
|
CompletableFuture<CancelSubscriptionResponse> |
cancelSubscriptionAsync(String subscriptionId)
Schedules a `CANCEL` action to cancel an active subscription by setting the `canceled_date`
field to the end of the active billing period and changing the subscription status from
ACTIVE to CANCELED after this date.
|
CreateSubscriptionResponse |
createSubscription(CreateSubscriptionRequest body)
Creates a subscription to a subscription plan by a customer.
|
CompletableFuture<CreateSubscriptionResponse> |
createSubscriptionAsync(CreateSubscriptionRequest body)
Creates a subscription to a subscription plan by a customer.
|
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 for a specific subscription.
|
CompletableFuture<ListSubscriptionEventsResponse> |
listSubscriptionEventsAsync(String subscriptionId,
String cursor,
Integer limit)
Lists all 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 subscription.
|
CompletableFuture<RetrieveSubscriptionResponse> |
retrieveSubscriptionAsync(String subscriptionId,
String include)
Retrieves a 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 in an existing subscription.
|
CompletableFuture<SwapPlanResponse> |
swapPlanAsync(String subscriptionId,
SwapPlanRequest body)
Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing subscription.
|
UpdateSubscriptionResponse |
updateSubscription(String subscriptionId,
UpdateSubscriptionRequest body)
Updates a subscription.
|
CompletableFuture<UpdateSubscriptionResponse> |
updateSubscriptionAsync(String subscriptionId,
UpdateSubscriptionRequest body)
Updates a subscription.
|
getClientInstance, getHttpCallback, makeHttpCallAsync, validateResponsepublic DefaultSubscriptionsApi(Configuration config, HttpClient httpClient, Map<String,AuthManager> authManagers)
config - Configurations added in client.httpClient - Send HTTP requests and read the responses.authManagers - Apply authorization to requests.public DefaultSubscriptionsApi(Configuration config, HttpClient httpClient, Map<String,AuthManager> authManagers, HttpCallback httpCallback)
config - Configurations added in client.httpClient - Send HTTP requests and read the responses.authManagers - Apply authorization to requests.httpCallback - Callback to be called before and after the HTTP call.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 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 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/working-with-apis/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/working-with-apis/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 © 2022. All rights reserved.