public final class DefaultCatalogApi extends BaseApi implements CatalogApi
BaseApi.RequestExecutor, BaseApi.RequestSupplier, BaseApi.ResponseHandler<T>authManagers, config, httpCallback, internalUserAgent| Constructor and Description |
|---|
DefaultCatalogApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers)
Initializes the controller.
|
DefaultCatalogApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers,
HttpCallback httpCallback)
Initializes the controller with HTTPCallback.
|
| Modifier and Type | Method and Description |
|---|---|
BatchDeleteCatalogObjectsResponse |
batchDeleteCatalogObjects(BatchDeleteCatalogObjectsRequest body)
Deletes a set of [CatalogItem]($m/CatalogItem)s based on the provided list of target IDs and
returns a set of successfully deleted IDs in the response.
|
CompletableFuture<BatchDeleteCatalogObjectsResponse> |
batchDeleteCatalogObjectsAsync(BatchDeleteCatalogObjectsRequest body)
Deletes a set of [CatalogItem]($m/CatalogItem)s based on the provided list of target IDs and
returns a set of successfully deleted IDs in the response.
|
BatchRetrieveCatalogObjectsResponse |
batchRetrieveCatalogObjects(BatchRetrieveCatalogObjectsRequest body)
Returns a set of objects based on the provided ID.
|
CompletableFuture<BatchRetrieveCatalogObjectsResponse> |
batchRetrieveCatalogObjectsAsync(BatchRetrieveCatalogObjectsRequest body)
Returns a set of objects based on the provided ID.
|
BatchUpsertCatalogObjectsResponse |
batchUpsertCatalogObjects(BatchUpsertCatalogObjectsRequest body)
Creates or updates up to 10,000 target objects based on the provided list of objects.
|
CompletableFuture<BatchUpsertCatalogObjectsResponse> |
batchUpsertCatalogObjectsAsync(BatchUpsertCatalogObjectsRequest body)
Creates or updates up to 10,000 target objects based on the provided list of objects.
|
CatalogInfoResponse |
catalogInfo()
Retrieves information about the Square Catalog API, such as batch size limits that can be
used by the `BatchUpsertCatalogObjects` endpoint.
|
CompletableFuture<CatalogInfoResponse> |
catalogInfoAsync()
Retrieves information about the Square Catalog API, such as batch size limits that can be
used by the `BatchUpsertCatalogObjects` endpoint.
|
CreateCatalogImageResponse |
createCatalogImage(CreateCatalogImageRequest request,
FileWrapper imageFile)
Uploads an image file to be represented by a [CatalogImage]($m/CatalogImage) object that can
be linked to an existing [CatalogObject]($m/CatalogObject) instance.
|
CompletableFuture<CreateCatalogImageResponse> |
createCatalogImageAsync(CreateCatalogImageRequest request,
FileWrapper imageFile)
Uploads an image file to be represented by a [CatalogImage]($m/CatalogImage) object that can
be linked to an existing [CatalogObject]($m/CatalogObject) instance.
|
DeleteCatalogObjectResponse |
deleteCatalogObject(String objectId)
Deletes a single [CatalogObject]($m/CatalogObject) based on the provided ID and returns the
set of successfully deleted IDs in the response.
|
CompletableFuture<DeleteCatalogObjectResponse> |
deleteCatalogObjectAsync(String objectId)
Deletes a single [CatalogObject]($m/CatalogObject) based on the provided ID and returns the
set of successfully deleted IDs in the response.
|
ListCatalogResponse |
listCatalog(String cursor,
String types,
Long catalogVersion)
Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified types in the
catalog.
|
CompletableFuture<ListCatalogResponse> |
listCatalogAsync(String cursor,
String types,
Long catalogVersion)
Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified types in the
catalog.
|
RetrieveCatalogObjectResponse |
retrieveCatalogObject(String objectId,
Boolean includeRelatedObjects,
Long catalogVersion)
Returns a single [CatalogItem]($m/CatalogItem) as a [CatalogObject]($m/CatalogObject) based
on the provided ID.
|
CompletableFuture<RetrieveCatalogObjectResponse> |
retrieveCatalogObjectAsync(String objectId,
Boolean includeRelatedObjects,
Long catalogVersion)
Returns a single [CatalogItem]($m/CatalogItem) as a [CatalogObject]($m/CatalogObject) based
on the provided ID.
|
SearchCatalogItemsResponse |
searchCatalogItems(SearchCatalogItemsRequest body)
Searches for catalog items or item variations by matching supported search attribute values,
including custom attribute values, against one or more of the specified query filters.
|
CompletableFuture<SearchCatalogItemsResponse> |
searchCatalogItemsAsync(SearchCatalogItemsRequest body)
Searches for catalog items or item variations by matching supported search attribute values,
including custom attribute values, against one or more of the specified query filters.
|
SearchCatalogObjectsResponse |
searchCatalogObjects(SearchCatalogObjectsRequest body)
Searches for [CatalogObject]($m/CatalogObject) of any type by matching supported search
attribute values, excluding custom attribute values on items or item variations, against one
or more of the specified query filters.
|
CompletableFuture<SearchCatalogObjectsResponse> |
searchCatalogObjectsAsync(SearchCatalogObjectsRequest body)
Searches for [CatalogObject]($m/CatalogObject) of any type by matching supported search
attribute values, excluding custom attribute values on items or item variations, against one
or more of the specified query filters.
|
UpdateCatalogImageResponse |
updateCatalogImage(String imageId,
UpdateCatalogImageRequest request,
FileWrapper imageFile)
Uploads a new image file to replace the existing one in the specified
[CatalogImage]($m/CatalogImage) object.
|
CompletableFuture<UpdateCatalogImageResponse> |
updateCatalogImageAsync(String imageId,
UpdateCatalogImageRequest request,
FileWrapper imageFile)
Uploads a new image file to replace the existing one in the specified
[CatalogImage]($m/CatalogImage) object.
|
UpdateItemModifierListsResponse |
updateItemModifierLists(UpdateItemModifierListsRequest body)
Updates the [CatalogModifierList]($m/CatalogModifierList) objects that apply to the targeted
[CatalogItem]($m/CatalogItem) without having to perform an upsert on the entire item.
|
CompletableFuture<UpdateItemModifierListsResponse> |
updateItemModifierListsAsync(UpdateItemModifierListsRequest body)
Updates the [CatalogModifierList]($m/CatalogModifierList) objects that apply to the targeted
[CatalogItem]($m/CatalogItem) without having to perform an upsert on the entire item.
|
UpdateItemTaxesResponse |
updateItemTaxes(UpdateItemTaxesRequest body)
Updates the [CatalogTax]($m/CatalogTax) objects that apply to the targeted
[CatalogItem]($m/CatalogItem) without having to perform an upsert on the entire item.
|
CompletableFuture<UpdateItemTaxesResponse> |
updateItemTaxesAsync(UpdateItemTaxesRequest body)
Updates the [CatalogTax]($m/CatalogTax) objects that apply to the targeted
[CatalogItem]($m/CatalogItem) without having to perform an upsert on the entire item.
|
UpsertCatalogObjectResponse |
upsertCatalogObject(UpsertCatalogObjectRequest body)
Creates or updates the target [CatalogObject]($m/CatalogObject).
|
CompletableFuture<UpsertCatalogObjectResponse> |
upsertCatalogObjectAsync(UpsertCatalogObjectRequest body)
Creates or updates the target [CatalogObject]($m/CatalogObject).
|
getClientInstance, getHttpCallback, makeHttpCallAsync, validateResponsepublic DefaultCatalogApi(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 DefaultCatalogApi(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 BatchDeleteCatalogObjectsResponse batchDeleteCatalogObjects(BatchDeleteCatalogObjectsRequest body) throws ApiException, IOException
batchDeleteCatalogObjects in interface CatalogApibody - 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<BatchDeleteCatalogObjectsResponse> batchDeleteCatalogObjectsAsync(BatchDeleteCatalogObjectsRequest body)
batchDeleteCatalogObjectsAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public BatchRetrieveCatalogObjectsResponse batchRetrieveCatalogObjects(BatchRetrieveCatalogObjectsRequest body) throws ApiException, IOException
batchRetrieveCatalogObjects in interface CatalogApibody - 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<BatchRetrieveCatalogObjectsResponse> batchRetrieveCatalogObjectsAsync(BatchRetrieveCatalogObjectsRequest body)
batchRetrieveCatalogObjectsAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public BatchUpsertCatalogObjectsResponse batchUpsertCatalogObjects(BatchUpsertCatalogObjectsRequest body) throws ApiException, IOException
batchUpsertCatalogObjects in interface CatalogApibody - 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<BatchUpsertCatalogObjectsResponse> batchUpsertCatalogObjectsAsync(BatchUpsertCatalogObjectsRequest body)
batchUpsertCatalogObjectsAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public CreateCatalogImageResponse createCatalogImage(CreateCatalogImageRequest request, FileWrapper imageFile) throws ApiException, IOException
createCatalogImage in interface CatalogApirequest - Optional parameter: Example:imageFile - Optional parameter: Example:ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CreateCatalogImageResponse> createCatalogImageAsync(CreateCatalogImageRequest request, FileWrapper imageFile)
createCatalogImageAsync in interface CatalogApirequest - Optional parameter: Example:imageFile - Optional parameter: Example:public UpdateCatalogImageResponse updateCatalogImage(String imageId, UpdateCatalogImageRequest request, FileWrapper imageFile) throws ApiException, IOException
updateCatalogImage in interface CatalogApiimageId - Required parameter: The ID of the `CatalogImage` object to update the
encapsulated image file.request - Optional parameter: Example:imageFile - Optional parameter: Example:ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<UpdateCatalogImageResponse> updateCatalogImageAsync(String imageId, UpdateCatalogImageRequest request, FileWrapper imageFile)
updateCatalogImageAsync in interface CatalogApiimageId - Required parameter: The ID of the `CatalogImage` object to update the
encapsulated image file.request - Optional parameter: Example:imageFile - Optional parameter: Example:public CatalogInfoResponse catalogInfo() throws ApiException, IOException
catalogInfo in interface CatalogApiApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CatalogInfoResponse> catalogInfoAsync()
catalogInfoAsync in interface CatalogApipublic ListCatalogResponse listCatalog(String cursor, String types, Long catalogVersion) throws ApiException, IOException
listCatalog in interface CatalogApicursor - Optional parameter: The pagination cursor returned in the previous response.
Leave unset for an initial request. The page size is currently set to be 100. See
[Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more
information.types - Optional parameter: An optional case-insensitive, comma-separated list of
object types to retrieve. The valid values are defined in the
[CatalogObjectType]($m/CatalogObjectType) enum, for example, `ITEM`,
`ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`,
`IMAGE`, etc. If this is unspecified, the operation returns objects of all the top
level types at the version of the Square API used to make the request. Object types
that are nested onto other object types are not included in the defaults. At the
current API version the default object types are: ITEM, CATEGORY, TAX, DISCOUNT,
MODIFIER_LIST, DINING_OPTION, TAX_EXEMPTION, SERVICE_CHARGE, PRICING_RULE,
PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, SUBSCRIPTION_PLAN, ITEM_OPTION,
CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.catalogVersion - Optional parameter: The specific version of the catalog objects to be
included in the response. This allows you to retrieve historical versions of objects.
The specified version value is matched against the
[CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results
will be from the current version of the catalog.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListCatalogResponse> listCatalogAsync(String cursor, String types, Long catalogVersion)
listCatalogAsync in interface CatalogApicursor - Optional parameter: The pagination cursor returned in the previous response.
Leave unset for an initial request. The page size is currently set to be 100. See
[Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more
information.types - Optional parameter: An optional case-insensitive, comma-separated list of
object types to retrieve. The valid values are defined in the
[CatalogObjectType]($m/CatalogObjectType) enum, for example, `ITEM`,
`ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`,
`IMAGE`, etc. If this is unspecified, the operation returns objects of all the top
level types at the version of the Square API used to make the request. Object types
that are nested onto other object types are not included in the defaults. At the
current API version the default object types are: ITEM, CATEGORY, TAX, DISCOUNT,
MODIFIER_LIST, DINING_OPTION, TAX_EXEMPTION, SERVICE_CHARGE, PRICING_RULE,
PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, SUBSCRIPTION_PLAN, ITEM_OPTION,
CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.catalogVersion - Optional parameter: The specific version of the catalog objects to be
included in the response. This allows you to retrieve historical versions of objects.
The specified version value is matched against the
[CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results
will be from the current version of the catalog.public UpsertCatalogObjectResponse upsertCatalogObject(UpsertCatalogObjectRequest body) throws ApiException, IOException
upsertCatalogObject in interface CatalogApibody - 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<UpsertCatalogObjectResponse> upsertCatalogObjectAsync(UpsertCatalogObjectRequest body)
upsertCatalogObjectAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public DeleteCatalogObjectResponse deleteCatalogObject(String objectId) throws ApiException, IOException
deleteCatalogObject in interface CatalogApiobjectId - Required parameter: The ID of the catalog object to be deleted. When an
object is deleted, other objects in the graph that depend on that object will be
deleted as well (for example, deleting a catalog item will delete its catalog item
variations).ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<DeleteCatalogObjectResponse> deleteCatalogObjectAsync(String objectId)
deleteCatalogObjectAsync in interface CatalogApiobjectId - Required parameter: The ID of the catalog object to be deleted. When an
object is deleted, other objects in the graph that depend on that object will be
deleted as well (for example, deleting a catalog item will delete its catalog item
variations).public RetrieveCatalogObjectResponse retrieveCatalogObject(String objectId, Boolean includeRelatedObjects, Long catalogVersion) throws ApiException, IOException
retrieveCatalogObject in interface CatalogApiobjectId - Required parameter: The object ID of any type of catalog objects to be
retrieved.includeRelatedObjects - Optional parameter: If `true`, the response will include
additional objects that are related to the requested objects. Related objects are
defined as any objects referenced by ID by the results in the `objects` field of the
response. These objects are put in the `related_objects` field. Setting this to
`true` is helpful when the objects are needed for immediate display to a user. This
process only goes one level deep. Objects referenced by the related objects will not
be included. For example, if the `objects` field of the response contains a
CatalogItem, its associated CatalogCategory objects, CatalogTax objects, CatalogImage
objects and CatalogModifierLists will be returned in the `related_objects` field of
the response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of the
response. Default value: `false`catalogVersion - Optional parameter: Requests objects as of a specific version of the
catalog. This allows you to retrieve historical versions of objects. The value to
retrieve a specific version of an object can be found in the version field of
[CatalogObject]($m/CatalogObject)s. If not included, results will be from the current
version of the catalog.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveCatalogObjectResponse> retrieveCatalogObjectAsync(String objectId, Boolean includeRelatedObjects, Long catalogVersion)
retrieveCatalogObjectAsync in interface CatalogApiobjectId - Required parameter: The object ID of any type of catalog objects to be
retrieved.includeRelatedObjects - Optional parameter: If `true`, the response will include
additional objects that are related to the requested objects. Related objects are
defined as any objects referenced by ID by the results in the `objects` field of the
response. These objects are put in the `related_objects` field. Setting this to
`true` is helpful when the objects are needed for immediate display to a user. This
process only goes one level deep. Objects referenced by the related objects will not
be included. For example, if the `objects` field of the response contains a
CatalogItem, its associated CatalogCategory objects, CatalogTax objects, CatalogImage
objects and CatalogModifierLists will be returned in the `related_objects` field of
the response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of the
response. Default value: `false`catalogVersion - Optional parameter: Requests objects as of a specific version of the
catalog. This allows you to retrieve historical versions of objects. The value to
retrieve a specific version of an object can be found in the version field of
[CatalogObject]($m/CatalogObject)s. If not included, results will be from the current
version of the catalog.public SearchCatalogObjectsResponse searchCatalogObjects(SearchCatalogObjectsRequest body) throws ApiException, IOException
searchCatalogObjects in interface CatalogApibody - 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<SearchCatalogObjectsResponse> searchCatalogObjectsAsync(SearchCatalogObjectsRequest body)
searchCatalogObjectsAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchCatalogItemsResponse searchCatalogItems(SearchCatalogItemsRequest body) throws ApiException, IOException
searchCatalogItems in interface CatalogApibody - 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<SearchCatalogItemsResponse> searchCatalogItemsAsync(SearchCatalogItemsRequest body)
searchCatalogItemsAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public UpdateItemModifierListsResponse updateItemModifierLists(UpdateItemModifierListsRequest body) throws ApiException, IOException
updateItemModifierLists in interface CatalogApibody - 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<UpdateItemModifierListsResponse> updateItemModifierListsAsync(UpdateItemModifierListsRequest body)
updateItemModifierListsAsync in interface CatalogApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public UpdateItemTaxesResponse updateItemTaxes(UpdateItemTaxesRequest body) throws ApiException, IOException
updateItemTaxes in interface CatalogApibody - 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<UpdateItemTaxesResponse> updateItemTaxesAsync(UpdateItemTaxesRequest body)
updateItemTaxesAsync in interface CatalogApibody - 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.