lib/square/api/catalog_api.rb
# 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. Deletion is a cascading event such that all children of the
# targeted object are also deleted. For example, deleting a CatalogItem will
# also delete all of its [CatalogItemVariation]($m/CatalogItemVariation)
# children.
# `BatchDeleteCatalogObjects` succeeds even if only a portion of the
# targeted
# IDs can be deleted. The response will only include IDs that were
# actually deleted.
# @param [BatchDeleteCatalogObjectsRequest] body Required parameter: An
# object containing the fields to POST for the request.  See the
# corresponding object definition for field details.
# @return [BatchDeleteCatalogObjectsResponse Hash] response from the API call
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. Deletion is a cascading event such that all children of the
targeted object are also deleted. For example, deleting a CatalogItem will
also delete all of its [CatalogItemVariation]($m/CatalogItemVariation)
children.
`BatchDeleteCatalogObjects` succeeds even if only a portion of the
targeted
IDs can be deleted. The response will only include IDs that were
actually deleted.
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 . Deletion is a cascading event such that all children of the targeted object are also deleted . For example deleting a CatalogItem will also delete all of its [ CatalogItemVariation ] ( $m / CatalogItemVariation ) children . ` BatchDeleteCatalogObjects ` succeeds even if only a portion of the targeted IDs can be deleted . The response will only include IDs that were actually deleted .
def batch_delete_catalog_objects(body:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/catalog/batch-delete'
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json',
        'content-type' => 'application/json; charset=utf-8'
      }
      _request = config.http_client.post(
        _query_url,
        headers: _headers,
        parameters: body.to_json
      )
      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 batch_delete_catalog_objects ( body : ) _query_builder = config . get_base_uri _query_builder << '/v2/catalog/batch-delete' _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' , 'content-type' => 'application/json; charset=utf-8' } _request = config . http_client . post ( _query_url , headers : _headers , parameters : body . to_json ) 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
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.
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 .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
BatchDeleteCatalogObjectsResponse Hash
body
<not_specific>
<not_specific>
body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.
body Required parameter : An object containing the fields to POST for the request . See the corresponding object definition for field details .