lib/square/api/locations_api.rb
# Provides information of all locations of a business.
# Many Square API endpoints require a `location_id` parameter.
# The `id` field of the [`Location`]($m/Location) objects returned by this
# endpoint correspond to that `location_id` parameter.
# @return [ListLocationsResponse Hash] response from the API call
Provides information of all locations of a business.
Many Square API endpoints require a `location_id` parameter.
Provides information of all locations of a business . Many Square API endpoints require a ` location_id ` parameter .
def list_locations
      _query_builder = config.get_base_uri
      _query_builder << '/v2/locations'
      _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_locations _query_builder = config . get_base_uri _query_builder << '/v2/locations' _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
Provides information of all locations of a business.
Provides information of all locations of a business .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
ListLocationsResponse Hash