public final class DefaultDevicesApi extends BaseApi implements DevicesApi
BaseApi.RequestExecutor, BaseApi.RequestSupplier, BaseApi.ResponseHandler<T>authManagers, config, httpCallback, internalUserAgent| Constructor and Description |
|---|
DefaultDevicesApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers)
Initializes the controller.
|
DefaultDevicesApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers,
HttpCallback httpCallback)
Initializes the controller with HTTPCallback.
|
| Modifier and Type | Method and Description |
|---|---|
CreateDeviceCodeResponse |
createDeviceCode(CreateDeviceCodeRequest body)
Creates a DeviceCode that can be used to login to a Square Terminal device to enter the
connected terminal mode.
|
CompletableFuture<CreateDeviceCodeResponse> |
createDeviceCodeAsync(CreateDeviceCodeRequest body)
Creates a DeviceCode that can be used to login to a Square Terminal device to enter the
connected terminal mode.
|
GetDeviceCodeResponse |
getDeviceCode(String id)
Retrieves DeviceCode with the associated ID.
|
CompletableFuture<GetDeviceCodeResponse> |
getDeviceCodeAsync(String id)
Retrieves DeviceCode with the associated ID.
|
ListDeviceCodesResponse |
listDeviceCodes(String cursor,
String locationId,
String productType,
String status)
Lists all DeviceCodes associated with the merchant.
|
CompletableFuture<ListDeviceCodesResponse> |
listDeviceCodesAsync(String cursor,
String locationId,
String productType,
String status)
Lists all DeviceCodes associated with the merchant.
|
getClientInstance, getHttpCallback, makeHttpCallAsync, validateResponsepublic DefaultDevicesApi(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 DefaultDevicesApi(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 ListDeviceCodesResponse listDeviceCodes(String cursor, String locationId, String productType, String status) throws ApiException, IOException
listDeviceCodes in interface DevicesApicursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this to retrieve the next set of results for your original query.
See [Paginating
results](https://developer.squareup.com/docs/working-with-apis/pagination) for more
information.locationId - Optional parameter: If specified, only returns DeviceCodes of the
specified location. Returns DeviceCodes of all locations if empty.productType - Optional parameter: If specified, only returns DeviceCodes targeting the
specified product type. Returns DeviceCodes of all product types if empty.status - Optional parameter: If specified, returns DeviceCodes with the specified
statuses. Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListDeviceCodesResponse> listDeviceCodesAsync(String cursor, String locationId, String productType, String status)
listDeviceCodesAsync in interface DevicesApicursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this to retrieve the next set of results for your original query.
See [Paginating
results](https://developer.squareup.com/docs/working-with-apis/pagination) for more
information.locationId - Optional parameter: If specified, only returns DeviceCodes of the
specified location. Returns DeviceCodes of all locations if empty.productType - Optional parameter: If specified, only returns DeviceCodes targeting the
specified product type. Returns DeviceCodes of all product types if empty.status - Optional parameter: If specified, returns DeviceCodes with the specified
statuses. Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.public CreateDeviceCodeResponse createDeviceCode(CreateDeviceCodeRequest body) throws ApiException, IOException
createDeviceCode in interface DevicesApibody - 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<CreateDeviceCodeResponse> createDeviceCodeAsync(CreateDeviceCodeRequest body)
createDeviceCodeAsync in interface DevicesApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public GetDeviceCodeResponse getDeviceCode(String id) throws ApiException, IOException
getDeviceCode in interface DevicesApiid - Required parameter: The unique identifier for the device code.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<GetDeviceCodeResponse> getDeviceCodeAsync(String id)
getDeviceCodeAsync in interface DevicesApiid - Required parameter: The unique identifier for the device code.Copyright © 2022. All rights reserved.