lib/square/api/catalog_api.rb
# Deletes a single [CatalogObject]($m/CatalogObject) based on the
# provided ID and returns the 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]($m/CatalogItem)
# will also delete all of its
# [CatalogItemVariation]($m/CatalogItemVariation) children.
# @param [String] object_id 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).
# @return [DeleteCatalogObjectResponse Hash] response from the API call
Deletes a single [CatalogObject]($m/CatalogObject) based on the
provided ID and returns the set of successfully deleted IDs in the
response.
Deletion is a cascading event such that all children of the targeted
object
are also deleted.
Deletes a single [ CatalogObject ] ( $m / CatalogObject ) based on the provided ID and returns the set of successfully deleted IDs in the response . Deletion is a cascading event such that all children of the targeted object are also deleted .
def delete_catalog_object(object_id:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/catalog/object/{object_id}'
      _query_builder = APIHelper.append_url_with_template_parameters(
        _query_builder,
        'object_id' => { 'value' => object_id, 'encode' => true }
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.delete(
        _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 delete_catalog_object ( object_id : ) _query_builder = config . get_base_uri _query_builder << '/v2/catalog/object/{object_id}' _query_builder = APIHelper . append_url_with_template_parameters ( _query_builder , 'object_id' => { 'value' => object_id , 'encode' => true } ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . delete ( _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
Deletes a single [CatalogObject]($m/CatalogObject) based on the
provided ID and returns the set of successfully deleted IDs in the
response.
Deletes a single [ CatalogObject ] ( $m / CatalogObject ) based on the provided ID and returns the 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
DeleteCatalogObjectResponse Hash
object_id
<not_specific>
<not_specific>
object_id 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).
object_id 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 ) .