lib/square/api/catalog_api.rb
# Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified
# types in the catalog.
# The `types` parameter is specified as a comma-separated list of the
# [CatalogObjectType]($m/CatalogObjectType) values,
# for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`,
# `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`".
# __Important:__ ListCatalog does not return deleted catalog items. To
# retrieve
# deleted catalog items, use
# [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects)
# and set the `include_deleted_objects` attribute value to `true`.
# @param [String] cursor 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.
# @param [String] 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.
# @param [Long] catalog_version 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.
# @return [ListCatalogResponse Hash] response from the API call
Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified
types in the catalog.
Returns a list of all [ CatalogObject ] ( $m / CatalogObject ) s of the specified types in the catalog .
def list_catalog(cursor: nil,
                     types: nil,
                     catalog_version: nil)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/catalog/list'
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'cursor' => cursor,
        'types' => types,
        'catalog_version' => catalog_version
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.get(
        _query_url,
        headers: _headers
      )
      OAuth2.apply(config, _request)
      _response = execute_request(_request)
      decoded = APIHelper.json_deserialize(_response.raw_body)
      _errors = APIHelper.map_response(decoded, ['errors'])
      ApiResponse.new(
        _response, data: decoded, errors: _errors
      )
    end
def list_catalog ( cursor : nil , types : nil , catalog_version : nil ) _query_builder = config . get_base_uri _query_builder << '/v2/catalog/list' _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'cursor' => cursor , 'types' => types , 'catalog_version' => catalog_version ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . get ( _query_url , headers : _headers ) OAuth2 . apply ( config , _request ) _response = execute_request ( _request ) decoded = APIHelper . json_deserialize ( _response . raw_body ) _errors = APIHelper . map_response ( decoded , [ 'errors' ] ) ApiResponse . new ( _response , data : decoded , errors : _errors ) end
Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified
types in the catalog.
Returns a list of all [ CatalogObject ] ( $m / CatalogObject ) s of the specified types in the catalog .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
ListCatalogResponse Hash
cursor
<not_specific>
types
<not_specific>
catalog_version
<not_specific>
<not_specific>
catalog_version 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.
catalog_version 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 .