Module: HomeAway::API::Domain::MyReservations

Included in:
Client
Defined in:
lib/homeaway/api/domain/my_reservations.rb

Instance Method Summary collapse

Instance Method Details

#my_reservations(listing_id, opts = {}) ⇒ HomeAway::API::Paginator

Note:

user must be logged in via 3 legged oauth to call this function without error

Returns a paginated list of the current and future reservations for the given listing from oldest to newest.

analogous to calling a GET on API url /public/myReservations

Parameters:

  • listing_id (String)

    The listingId of the listing to get the reservations for.

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :begin_date (String)

    Lower bound date of the reservations to find in the format yyyy-MM-dd

  • :reference_number (String)

    Reference number to filter on

  • :end_date (String)

    Upper bound date of the reservations to find in the format yyyy-MM-dd

  • :last_name (String)

    Last name of traveler to filter on

  • :payment_status (String)

    PaymentStatus to filter on

  • :availability_status (String)

    Status to filter on

  • :first_name (String)

    First name of traveler to filter on

  • :email (String)

    Email of traveler to filter on

  • :sort_by (String)

    Sort (format [field:ASC|DESC,field:ASC|DESC,…]) result by one or more of the following: availabilityStatus|beginDate|paymentStatus

  • :page (Integer)

    The page of the listing set.

  • :page_size (Integer)

    The size of the page to return

Returns:



41
42
43
44
45
46
47
48
49
# File 'lib/homeaway/api/domain/my_reservations.rb', line 41

def my_reservations(listing_id, opts={})
  params = {
      'page' => 1,
      'pageSize' => @configuration.page_size,
      'listingId' => listing_id.to_s
  }.merge(HomeAway::API::Util::Validators.query_keys(opts))
  hashie = get '/public/myReservations', params
  HomeAway::API::Paginator.new(self, hashie, @configuration.auto_pagination)
end