public final class DefaultGiftCardsApi extends BaseApi implements GiftCardsApi
BaseApi.RequestExecutor, BaseApi.RequestSupplier, BaseApi.ResponseHandler<T>authManagers, config, httpCallback, internalUserAgent| Constructor and Description |
|---|
DefaultGiftCardsApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers)
Initializes the controller.
|
DefaultGiftCardsApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers,
HttpCallback httpCallback)
Initializes the controller with HTTPCallback.
|
| Modifier and Type | Method and Description |
|---|---|
CreateGiftCardResponse |
createGiftCard(CreateGiftCardRequest body)
Creates a digital gift card or registers a physical (plastic) gift card.
|
CompletableFuture<CreateGiftCardResponse> |
createGiftCardAsync(CreateGiftCardRequest body)
Creates a digital gift card or registers a physical (plastic) gift card.
|
LinkCustomerToGiftCardResponse |
linkCustomerToGiftCard(String giftCardId,
LinkCustomerToGiftCardRequest body)
Links a customer to a gift card, which is also referred to as adding a card on file.
|
CompletableFuture<LinkCustomerToGiftCardResponse> |
linkCustomerToGiftCardAsync(String giftCardId,
LinkCustomerToGiftCardRequest body)
Links a customer to a gift card, which is also referred to as adding a card on file.
|
ListGiftCardsResponse |
listGiftCards(String type,
String state,
Integer limit,
String cursor,
String customerId)
Lists all gift cards.
|
CompletableFuture<ListGiftCardsResponse> |
listGiftCardsAsync(String type,
String state,
Integer limit,
String cursor,
String customerId)
Lists all gift cards.
|
RetrieveGiftCardResponse |
retrieveGiftCard(String id)
Retrieves a gift card using the gift card ID.
|
CompletableFuture<RetrieveGiftCardResponse> |
retrieveGiftCardAsync(String id)
Retrieves a gift card using the gift card ID.
|
RetrieveGiftCardFromGANResponse |
retrieveGiftCardFromGAN(RetrieveGiftCardFromGANRequest body)
Retrieves a gift card using the gift card account number (GAN).
|
CompletableFuture<RetrieveGiftCardFromGANResponse> |
retrieveGiftCardFromGANAsync(RetrieveGiftCardFromGANRequest body)
Retrieves a gift card using the gift card account number (GAN).
|
RetrieveGiftCardFromNonceResponse |
retrieveGiftCardFromNonce(RetrieveGiftCardFromNonceRequest body)
Retrieves a gift card using a secure payment token that represents the gift card.
|
CompletableFuture<RetrieveGiftCardFromNonceResponse> |
retrieveGiftCardFromNonceAsync(RetrieveGiftCardFromNonceRequest body)
Retrieves a gift card using a secure payment token that represents the gift card.
|
UnlinkCustomerFromGiftCardResponse |
unlinkCustomerFromGiftCard(String giftCardId,
UnlinkCustomerFromGiftCardRequest body)
Unlinks a customer from a gift card, which is also referred to as removing a card on file.
|
CompletableFuture<UnlinkCustomerFromGiftCardResponse> |
unlinkCustomerFromGiftCardAsync(String giftCardId,
UnlinkCustomerFromGiftCardRequest body)
Unlinks a customer from a gift card, which is also referred to as removing a card on file.
|
getClientInstance, getHttpCallback, makeHttpCallAsync, validateResponsepublic DefaultGiftCardsApi(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 DefaultGiftCardsApi(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 ListGiftCardsResponse listGiftCards(String type, String state, Integer limit, String cursor, String customerId) throws ApiException, IOException
listGiftCards in interface GiftCardsApitype - Optional parameter: If a [type]($m/GiftCardType) is provided, the endpoint
returns gift cards of the specified type. Otherwise, the endpoint returns gift cards
of all types.state - Optional parameter: If a [state]($m/GiftCardStatus) is provided, the endpoint
returns the gift cards in the specified state. Otherwise, the endpoint returns the
gift cards of all states.limit - Optional parameter: If a limit is provided, the endpoint returns only the
specified number of results per page. The maximum value is 50. The default value is
30. For more information, see
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).cursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for the original
query. If a cursor is not provided, the endpoint returns the first page of the
results. For more information, see
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).customerId - Optional parameter: If a customer ID is provided, the endpoint returns
only the gift cards linked to the specified customer.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListGiftCardsResponse> listGiftCardsAsync(String type, String state, Integer limit, String cursor, String customerId)
listGiftCardsAsync in interface GiftCardsApitype - Optional parameter: If a [type]($m/GiftCardType) is provided, the endpoint
returns gift cards of the specified type. Otherwise, the endpoint returns gift cards
of all types.state - Optional parameter: If a [state]($m/GiftCardStatus) is provided, the endpoint
returns the gift cards in the specified state. Otherwise, the endpoint returns the
gift cards of all states.limit - Optional parameter: If a limit is provided, the endpoint returns only the
specified number of results per page. The maximum value is 50. The default value is
30. For more information, see
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).cursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for the original
query. If a cursor is not provided, the endpoint returns the first page of the
results. For more information, see
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).customerId - Optional parameter: If a customer ID is provided, the endpoint returns
only the gift cards linked to the specified customer.public CreateGiftCardResponse createGiftCard(CreateGiftCardRequest body) throws ApiException, IOException
createGiftCard in interface GiftCardsApibody - 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<CreateGiftCardResponse> createGiftCardAsync(CreateGiftCardRequest body)
createGiftCardAsync in interface GiftCardsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public RetrieveGiftCardFromGANResponse retrieveGiftCardFromGAN(RetrieveGiftCardFromGANRequest body) throws ApiException, IOException
retrieveGiftCardFromGAN in interface GiftCardsApibody - 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<RetrieveGiftCardFromGANResponse> retrieveGiftCardFromGANAsync(RetrieveGiftCardFromGANRequest body)
retrieveGiftCardFromGANAsync in interface GiftCardsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public RetrieveGiftCardFromNonceResponse retrieveGiftCardFromNonce(RetrieveGiftCardFromNonceRequest body) throws ApiException, IOException
retrieveGiftCardFromNonce in interface GiftCardsApibody - 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<RetrieveGiftCardFromNonceResponse> retrieveGiftCardFromNonceAsync(RetrieveGiftCardFromNonceRequest body)
retrieveGiftCardFromNonceAsync in interface GiftCardsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public LinkCustomerToGiftCardResponse linkCustomerToGiftCard(String giftCardId, LinkCustomerToGiftCardRequest body) throws ApiException, IOException
linkCustomerToGiftCard in interface GiftCardsApigiftCardId - Required parameter: The ID of the gift card to be linked.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<LinkCustomerToGiftCardResponse> linkCustomerToGiftCardAsync(String giftCardId, LinkCustomerToGiftCardRequest body)
linkCustomerToGiftCardAsync in interface GiftCardsApigiftCardId - Required parameter: The ID of the gift card to be linked.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public UnlinkCustomerFromGiftCardResponse unlinkCustomerFromGiftCard(String giftCardId, UnlinkCustomerFromGiftCardRequest body) throws ApiException, IOException
unlinkCustomerFromGiftCard in interface GiftCardsApigiftCardId - Required parameter: The ID of the gift card to be unlinked.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<UnlinkCustomerFromGiftCardResponse> unlinkCustomerFromGiftCardAsync(String giftCardId, UnlinkCustomerFromGiftCardRequest body)
unlinkCustomerFromGiftCardAsync in interface GiftCardsApigiftCardId - Required parameter: The ID of the gift card to be unlinked.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public RetrieveGiftCardResponse retrieveGiftCard(String id) throws ApiException, IOException
retrieveGiftCard in interface GiftCardsApiid - Required parameter: The ID of the gift card to retrieve.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveGiftCardResponse> retrieveGiftCardAsync(String id)
retrieveGiftCardAsync in interface GiftCardsApiid - Required parameter: The ID of the gift card to retrieve.Copyright © 2022. All rights reserved.