lib/square/api/customer_groups_api.rb
# Retrieves the list of customer groups of a business.
# @param [String] cursor Optional parameter: A pagination cursor returned by
# a previous call to this endpoint. Provide this cursor to retrieve the next
# set of results for your original query.  For more information, see
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
# ion).
# @param [Integer] limit Optional parameter: The maximum number of results
# to return in a single page. This limit is advisory. The response might
# contain more or fewer results. The limit is ignored if it is less than 1
# or greater than 50. The default value is 50.  For more information, see
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
# ion).
# @return [ListCustomerGroupsResponse Hash] response from the API call
Retrieves the list of customer groups of a business.
Retrieves the list of customer groups of a business .
def list_customer_groups(cursor: nil,
                             limit: nil)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/customers/groups'
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'cursor' => cursor,
        'limit' => limit
      )
      _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_customer_groups ( cursor : nil , limit : nil ) _query_builder = config . get_base_uri _query_builder << '/v2/customers/groups' _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'cursor' => cursor , 'limit' => limit ) _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
Retrieves the list of customer groups of a business.
Retrieves the list of customer groups 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
ListCustomerGroupsResponse Hash
cursor
<not_specific>
limit
<not_specific>
<not_specific>
limit Optional parameter: The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. The limit is ignored if it is less than 1 or greater than 50. The default value is 50. For more information, see [Pagination].
limit Optional parameter : The maximum number of results to return in a single page . This limit is advisory . The response might contain more or fewer results . The limit is ignored if it is less than 1 or greater than 50 . The default value is 50 . For more information see [ Pagination ] .