Class: Square::Bookings::LocationProfiles::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/square/bookings/location_profiles/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Square::Bookings::LocationProfiles::Client



8
9
10
# File 'lib/square/bookings/location_profiles/client.rb', line 8

def initialize(client:)
  @client = client
end

Instance Method Details

#list(request_options: {}, **params) ⇒ Square::Types::ListLocationBookingProfilesResponse

Lists location booking profiles of a seller.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/square/bookings/location_profiles/client.rb', line 15

def list(request_options: {}, **params)
  _query_param_names = %w[limit cursor]
  _query = params.slice(*_query_param_names)
  params.except(*_query_param_names)

  _request = Square::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Square::Environment::SANDBOX,
    method: "GET",
    path: "v2/bookings/location-booking-profiles",
    query: _query
  )
  _response = @client.send(_request)
  if _response.code >= "200" && _response.code < "300"
    return Square::Types::ListLocationBookingProfilesResponse.load(_response.body)
  end

  raise _response.body
end