public final class DefaultCustomersApi extends BaseApi implements CustomersApi
BaseApi.RequestExecutor, BaseApi.RequestSupplier, BaseApi.ResponseHandler<T>
authManagers, config, httpCallback, internalUserAgent
Constructor and Description |
---|
DefaultCustomersApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers)
Initializes the controller.
|
DefaultCustomersApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers,
HttpCallback httpCallback)
Initializes the controller with HTTPCallback.
|
getClientInstance, getHttpCallback, makeHttpCallAsync, validateResponse
public DefaultCustomersApi(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 DefaultCustomersApi(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 ListCustomersResponse listCustomers(String cursor, Integer limit, String sortField, String sortOrder) throws ApiException, IOException
listCustomers
in interface CustomersApi
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 your original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit
- Optional parameter: The maximum number of results to return in a single page.
This limit is advisory. The response might contain more or fewer results. If the
specified limit is less than 1 or greater than 100, Square returns a `400
VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100. For more
information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).sortField
- Optional parameter: Indicates how customers should be sorted. The default
value is `DEFAULT`.sortOrder
- Optional parameter: Indicates whether customers should be sorted in
ascending (`ASC`) or descending (`DESC`) order. The default value is `ASC`.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListCustomersResponse> listCustomersAsync(String cursor, Integer limit, String sortField, String sortOrder)
listCustomersAsync
in interface CustomersApi
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 your original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit
- Optional parameter: The maximum number of results to return in a single page.
This limit is advisory. The response might contain more or fewer results. If the
specified limit is less than 1 or greater than 100, Square returns a `400
VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100. For more
information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).sortField
- Optional parameter: Indicates how customers should be sorted. The default
value is `DEFAULT`.sortOrder
- Optional parameter: Indicates whether customers should be sorted in
ascending (`ASC`) or descending (`DESC`) order. The default value is `ASC`.public CreateCustomerResponse createCustomer(CreateCustomerRequest body) throws ApiException, IOException
createCustomer
in interface CustomersApi
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<CreateCustomerResponse> createCustomerAsync(CreateCustomerRequest body)
createCustomerAsync
in interface CustomersApi
body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchCustomersResponse searchCustomers(SearchCustomersRequest body) throws ApiException, IOException
searchCustomers
in interface CustomersApi
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<SearchCustomersResponse> searchCustomersAsync(SearchCustomersRequest body)
searchCustomersAsync
in interface CustomersApi
body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public DeleteCustomerResponse deleteCustomer(String customerId, Long version) throws ApiException, IOException
deleteCustomer
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to delete.version
- Optional parameter: The current version of the customer profile. As a best
practice, you should include this parameter to enable [optimistic
concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control. For more information, see [Delete a customer
profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.public CompletableFuture<DeleteCustomerResponse> deleteCustomerAsync(String customerId, Long version)
deleteCustomerAsync
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to delete.version
- Optional parameter: The current version of the customer profile. As a best
practice, you should include this parameter to enable [optimistic
concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control. For more information, see [Delete a customer
profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).public RetrieveCustomerResponse retrieveCustomer(String customerId) throws ApiException, IOException
retrieveCustomer
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to retrieve.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveCustomerResponse> retrieveCustomerAsync(String customerId)
retrieveCustomerAsync
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to retrieve.public UpdateCustomerResponse updateCustomer(String customerId, UpdateCustomerRequest body) throws ApiException, IOException
updateCustomer
in interface CustomersApi
customerId
- Required parameter: The ID of the customer 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<UpdateCustomerResponse> updateCustomerAsync(String customerId, UpdateCustomerRequest body)
updateCustomerAsync
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to update.body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.@Deprecated public CreateCustomerCardResponse createCustomerCard(String customerId, CreateCustomerCardRequest body) throws ApiException, IOException
createCustomerCard
in interface CustomersApi
customerId
- Required parameter: The Square ID of the customer profile the card is
linked to.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.@Deprecated public CompletableFuture<CreateCustomerCardResponse> createCustomerCardAsync(String customerId, CreateCustomerCardRequest body)
createCustomerCardAsync
in interface CustomersApi
customerId
- Required parameter: The Square ID of the customer profile the card is
linked to.body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.@Deprecated public DeleteCustomerCardResponse deleteCustomerCard(String customerId, String cardId) throws ApiException, IOException
deleteCustomerCard
in interface CustomersApi
customerId
- Required parameter: The ID of the customer that the card on file belongs
to.cardId
- Required parameter: The ID of the card on file to delete.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.@Deprecated public CompletableFuture<DeleteCustomerCardResponse> deleteCustomerCardAsync(String customerId, String cardId)
deleteCustomerCardAsync
in interface CustomersApi
customerId
- Required parameter: The ID of the customer that the card on file belongs
to.cardId
- Required parameter: The ID of the card on file to delete.public RemoveGroupFromCustomerResponse removeGroupFromCustomer(String customerId, String groupId) throws ApiException, IOException
removeGroupFromCustomer
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to remove from the group.groupId
- Required parameter: The ID of the customer group to remove the customer
from.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.public CompletableFuture<RemoveGroupFromCustomerResponse> removeGroupFromCustomerAsync(String customerId, String groupId)
removeGroupFromCustomerAsync
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to remove from the group.groupId
- Required parameter: The ID of the customer group to remove the customer
from.public AddGroupToCustomerResponse addGroupToCustomer(String customerId, String groupId) throws ApiException, IOException
addGroupToCustomer
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to add to a group.groupId
- Required parameter: The ID of the customer group to add the customer to.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.public CompletableFuture<AddGroupToCustomerResponse> addGroupToCustomerAsync(String customerId, String groupId)
addGroupToCustomerAsync
in interface CustomersApi
customerId
- Required parameter: The ID of the customer to add to a group.groupId
- Required parameter: The ID of the customer group to add the customer to.Copyright © 2022. All rights reserved.