From f2a997d4d38f56cedf9ab108f534ff4d7f303c64 Mon Sep 17 00:00:00 2001 From: Fredar Date: Wed, 9 Sep 2015 22:28:03 +0200 Subject: [PATCH] Add missing CRUD actions to existing endpoints Remove unused BillingAddresses endpoint --- CHANGELOG.md | 3 + lib/bookingsync/api/client.rb | 2 - lib/bookingsync/api/client/accounts.rb | 11 +++ lib/bookingsync/api/client/bathrooms.rb | 11 +++ lib/bookingsync/api/client/bedrooms.rb | 11 +++ .../api/client/billing_addresses.rb | 22 ----- lib/bookingsync/api/client/bookings_fees.rb | 11 +++ .../api/client/bookings_payments.rb | 11 +++ lib/bookingsync/api/client/bookings_taxes.rb | 11 +++ lib/bookingsync/api/client/clients.rb | 11 +++ lib/bookingsync/api/client/destinations.rb | 11 +++ lib/bookingsync/api/client/fees.rb | 11 +++ lib/bookingsync/api/client/inquiries.rb | 11 +++ lib/bookingsync/api/client/payments.rb | 11 +++ lib/bookingsync/api/client/periods.rb | 11 +++ lib/bookingsync/api/client/photos.rb | 11 +++ lib/bookingsync/api/client/rates.rb | 11 +++ lib/bookingsync/api/client/rates_rules.rb | 44 ++++++++++ lib/bookingsync/api/client/rates_tables.rb | 11 +++ .../api/client/rental_agreements.rb | 11 +++ .../api/client/rentals_amenities.rb | 23 +++++ lib/bookingsync/api/client/rentals_fees.rb | 11 +++ lib/bookingsync/api/client/reviews.rb | 11 +++ lib/bookingsync/api/client/seasons.rb | 11 +++ lib/bookingsync/api/client/sources.rb | 11 +++ lib/bookingsync/api/client/special_offers.rb | 11 +++ lib/bookingsync/api/client/taxes.rb | 11 +++ spec/bookingsync/api/client/accounts_spec.rb | 7 ++ spec/bookingsync/api/client/bathrooms_spec.rb | 7 ++ spec/bookingsync/api/client/bedrooms_spec.rb | 7 ++ .../api/client/billing_addresses_spec.rb | 12 --- .../api/client/bookings_fees_spec.rb | 11 ++- ...ents_spec.rb => bookings_payments_spec.rb} | 7 ++ .../api/client/bookings_taxes_spec.rb | 11 ++- spec/bookingsync/api/client/clients_spec.rb | 29 ++++--- .../api/client/destinations_spec.rb | 7 ++ spec/bookingsync/api/client/fees_spec.rb | 11 ++- spec/bookingsync/api/client/inquiries_spec.rb | 7 ++ spec/bookingsync/api/client/payments_spec.rb | 7 ++ spec/bookingsync/api/client/periods_spec.rb | 7 ++ spec/bookingsync/api/client/photos_spec.rb | 7 ++ .../api/client/rates_rules_spec.rb | 59 +++++++++++++ spec/bookingsync/api/client/rates_spec.rb | 7 ++ .../api/client/rates_tables_spec.rb | 7 ++ .../api/client/rental_agreements_spec.rb | 7 ++ .../api/client/rentals_amenities_spec.rb | 44 ++++++++-- .../api/client/rentals_fees_spec.rb | 11 ++- spec/bookingsync/api/client/reviews_spec.rb | 7 ++ spec/bookingsync/api/client/seasons_spec.rb | 7 ++ spec/bookingsync/api/client/sources_spec.rb | 7 ++ .../api/client/special_offers_spec.rb | 7 ++ spec/bookingsync/api/client/taxes_spec.rb | 11 ++- .../_account/returns_a_single_account.yml | 80 +++++++++++++++++ .../_bathroom/returns_a_single_bathroom.yml | 81 +++++++++++++++++ .../_bedroom/returns_a_single_bedroom.yml | 81 +++++++++++++++++ .../returns_billing_addresses.yml | 65 -------------- .../_clients/returns_clients.yml | 66 -------------- .../_create_client/creates_a_new_client.yml | 64 -------------- .../updates_given_client_by_ID.yml | 62 ------------- .../returns_a_single_bookings_fee.yml | 81 +++++++++++++++++ .../returns_a_single_bookings_payment.yml | 80 +++++++++++++++++ .../returns_a_single_bookings_tax.yml | 81 +++++++++++++++++ .../_client/returns_a_single_client.yml | 81 +++++++++++++++++ .../_clients/returns_clients.yml | 87 +++++++++++++++++++ .../_create_client/creates_a_new_client.yml | 76 ++++++++++++++++ .../updates_given_client_by_ID.yml | 74 ++++++++++++++++ .../returns_a_single_destination.yml | 83 ++++++++++++++++++ .../_fee/returns_a_single_fee.yml | 81 +++++++++++++++++ .../_inquiry/returns_a_single_inquiry.yml | 80 +++++++++++++++++ .../_payment/returns_a_single_payment.yml | 80 +++++++++++++++++ .../_period/returns_a_single_period.yml | 80 +++++++++++++++++ .../_photo/returns_a_single_photo.yml | 80 +++++++++++++++++ .../_rate/returns_a_single_rate.yml | 80 +++++++++++++++++ .../creates_a_new_rates_rule.yml | 75 ++++++++++++++++ .../deletes_given_rates_rule.yml | 67 ++++++++++++++ .../updates_given_rates_rule_by_ID.yml | 73 ++++++++++++++++ .../returns_a_single_rates_rule.yml | 80 +++++++++++++++++ .../_rates_rules/returns_rates_rules.yml | 60 ++++++++----- .../returns_a_single_rates_table.yml | 80 +++++++++++++++++ .../returns_a_single_rental_agreement.yml | 80 +++++++++++++++++ ....yml => creates_a_new_rentals_amenity.yml} | 54 +++++++----- .../deletes_given_rentals_amenity.yml | 67 ++++++++++++++ .../updates_given_rentals_amenity_by_ID.yml} | 61 +++++++------ .../returns_a_single_rentals_fee.yml | 81 +++++++++++++++++ .../_review/returns_a_single_review.yml | 81 +++++++++++++++++ .../_season/returns_a_single_season.yml | 81 +++++++++++++++++ .../_source/returns_a_single_source.yml | 80 +++++++++++++++++ .../returns_a_single_special_offer.yml | 81 +++++++++++++++++ .../_tax/returns_a_single_tax.yml | 81 +++++++++++++++++ 89 files changed, 3056 insertions(+), 396 deletions(-) delete mode 100644 lib/bookingsync/api/client/billing_addresses.rb delete mode 100644 spec/bookingsync/api/client/billing_addresses_spec.rb rename spec/bookingsync/api/client/{billings_payments_spec.rb => bookings_payments_spec.rb} (63%) create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Accounts/_account/returns_a_single_account.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Bathrooms/_bathroom/returns_a_single_bathroom.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Bedrooms/_bedroom/returns_a_single_bedroom.yml delete mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml delete mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_clients/returns_clients.yml delete mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_create_client/creates_a_new_client.yml delete mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_edit_client/updates_given_client_by_ID.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_BookingsFees/_bookings_fee/returns_a_single_bookings_fee.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_BookingsPayments/_bookings_payment/returns_a_single_bookings_payment.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_BookingsTaxes/_bookings_tax/returns_a_single_bookings_tax.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Clients/_client/returns_a_single_client.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Clients/_clients/returns_clients.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Clients/_create_client/creates_a_new_client.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Clients/_edit_client/updates_given_client_by_ID.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Destinations/_destination/returns_a_single_destination.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Fees/_fee/returns_a_single_fee.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Inquiries/_inquiry/returns_a_single_inquiry.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Payments/_payment/returns_a_single_payment.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Periods/_period/returns_a_single_period.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photo/returns_a_single_photo.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rate/returns_a_single_rate.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_create_rates_rule/creates_a_new_rates_rule.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_delete_rates_rule/deletes_given_rates_rule.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_edit_rates_rule/updates_given_rates_rule_by_ID.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rule/returns_a_single_rates_rule.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RatesTables/_rates_table/returns_a_single_rates_table.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RentalAgreements/_rental_agreement/returns_a_single_rental_agreement.yml rename spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/{creates_a_new_rental_s_amenity.yml => creates_a_new_rentals_amenity.yml} (54%) create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_delete_rentals_amenity/deletes_given_rentals_amenity.yml rename spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/{_create_rentals_amenity/returns_newly_created_rental_s_amenity.yml => _edit_rentals_amenity/updates_given_rentals_amenity_by_ID.yml} (53%) create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_RentalsFees/_rentals_fee/returns_a_single_rentals_fee.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Reviews/_review/returns_a_single_review.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_season/returns_a_single_season.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Sources/_source/returns_a_single_source.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_special_offer/returns_a_single_special_offer.yml create mode 100644 spec/fixtures/cassettes/BookingSync_API_Client_Taxes/_tax/returns_a_single_tax.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 82f34ce7..7460fd3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## master +- Add missing CRUD actions to existing endpoints. +- Remove unused BillingAddresses endpoint. + ## 0.0.29 - Add support for Bathrooms and Bedrooms endpoints. diff --git a/lib/bookingsync/api/client.rb b/lib/bookingsync/api/client.rb index 97b5826b..b68f9eaf 100644 --- a/lib/bookingsync/api/client.rb +++ b/lib/bookingsync/api/client.rb @@ -2,7 +2,6 @@ require "bookingsync/api/client/accounts" require "bookingsync/api/client/amenities" require "bookingsync/api/client/availabilities" -require "bookingsync/api/client/billing_addresses" require "bookingsync/api/client/bathrooms" require "bookingsync/api/client/bedrooms" require "bookingsync/api/client/bookings" @@ -43,7 +42,6 @@ class Client include BookingSync::API::Client::Accounts include BookingSync::API::Client::Amenities include BookingSync::API::Client::Availabilities - include BookingSync::API::Client::BillingAddresses include BookingSync::API::Client::Bathrooms include BookingSync::API::Client::Bedrooms include BookingSync::API::Client::Bookings diff --git a/lib/bookingsync/api/client/accounts.rb b/lib/bookingsync/api/client/accounts.rb index 59fd5143..cac97f3c 100644 --- a/lib/bookingsync/api/client/accounts.rb +++ b/lib/bookingsync/api/client/accounts.rb @@ -15,6 +15,17 @@ module Accounts def accounts(options = {}, &block) paginate :accounts, options, &block end + + # Get a single account + # + # @param account [BookingSync::API::Resource|Integer] Account or ID + # of the account. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def account(account, options = {}) + get("accounts/#{account}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/bathrooms.rb b/lib/bookingsync/api/client/bathrooms.rb index 0d27e6c5..c131490f 100644 --- a/lib/bookingsync/api/client/bathrooms.rb +++ b/lib/bookingsync/api/client/bathrooms.rb @@ -17,6 +17,17 @@ def bathrooms(options = {}, &block) paginate :bathrooms, options, &block end + # Get a single bathroom + # + # @param bathroom [BookingSync::API::Resource|Integer] Bedroom or ID + # of the bathroom. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def bathroom(bathroom, options = {}) + get("bathrooms/#{bathroom}", options).pop + end + # Create a new bathroom # # @param rental [BookingSync::API::Resource|Integer] Rental or ID of diff --git a/lib/bookingsync/api/client/bedrooms.rb b/lib/bookingsync/api/client/bedrooms.rb index 6b6eeb19..a9602edb 100644 --- a/lib/bookingsync/api/client/bedrooms.rb +++ b/lib/bookingsync/api/client/bedrooms.rb @@ -17,6 +17,17 @@ def bedrooms(options = {}, &block) paginate :bedrooms, options, &block end + # Get a single bedroom + # + # @param bedroom [BookingSync::API::Resource|Integer] Bedroom or ID + # of the bedroom. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def bedroom(bedroom, options = {}) + get("bedrooms/#{bedroom}", options).pop + end + # Create a new bedroom # # @param rental [BookingSync::API::Resource|Integer] Rental or ID of diff --git a/lib/bookingsync/api/client/billing_addresses.rb b/lib/bookingsync/api/client/billing_addresses.rb deleted file mode 100644 index a95cf206..00000000 --- a/lib/bookingsync/api/client/billing_addresses.rb +++ /dev/null @@ -1,22 +0,0 @@ -module BookingSync::API - class Client - module BillingAddresses - # List billing addresses - # - # Returns billing addresses for the account user is authenticated with. - # @param options [Hash] A customizable set of options. - # @option options [Array] fields: List of fields to be fetched. - # @return [Array] Array of billing addresses. - # - # @example Get the list of billing addresses for the current account - # billing_addresses = @api.billing_addresses - # billing_addresses.first.city # => "Paris" - # @example Get the list of billing addresses only with city and address1 for smaller response - # @api.billing_addresses(fields: [:city, :address1]) - # @see http://docs.api.bookingsync.com/reference/endpoints/billing addresss/#list-billing-addresses - def billing_addresses(options = {}, &block) - paginate :billing_addresses, options, &block - end - end - end -end diff --git a/lib/bookingsync/api/client/bookings_fees.rb b/lib/bookingsync/api/client/bookings_fees.rb index 9148c10d..0c54889e 100644 --- a/lib/bookingsync/api/client/bookings_fees.rb +++ b/lib/bookingsync/api/client/bookings_fees.rb @@ -17,6 +17,17 @@ module BookingsFees def bookings_fees(options = {}, &block) paginate :bookings_fees, options, &block end + + # Get a single bookings fee + # + # @param bookings_fee [BookingSync::API::Resource|Integer] BookingsFee or ID + # of the bookings fee. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def bookings_fee(bookings_fee, options = {}) + get("bookings_fees/#{bookings_fee}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/bookings_payments.rb b/lib/bookingsync/api/client/bookings_payments.rb index 5375c990..558c1590 100644 --- a/lib/bookingsync/api/client/bookings_payments.rb +++ b/lib/bookingsync/api/client/bookings_payments.rb @@ -17,6 +17,17 @@ module BookingsPayments def bookings_payments(options = {}, &block) paginate :bookings_payments, options, &block end + + # Get a single bookings payment + # + # @param bookings_payment [BookingSync::API::Resource|Integer] BookingsPayment or ID + # of the bookings payment. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def bookings_payment(bookings_payment, options = {}) + get("bookings_payments/#{bookings_payment}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/bookings_taxes.rb b/lib/bookingsync/api/client/bookings_taxes.rb index e6e6316d..7598a369 100644 --- a/lib/bookingsync/api/client/bookings_taxes.rb +++ b/lib/bookingsync/api/client/bookings_taxes.rb @@ -17,6 +17,17 @@ module BookingsTaxes def bookings_taxes(options = {}, &block) paginate :bookings_taxes, options, &block end + + # Get a single bookings tax + # + # @param bookings_tax [BookingSync::API::Resource|Integer] BookingsTax or ID + # of the bookings tax. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def bookings_tax(bookings_tax, options = {}) + get("bookings_taxes/#{bookings_tax}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/clients.rb b/lib/bookingsync/api/client/clients.rb index c8562a9b..ce0c6b94 100644 --- a/lib/bookingsync/api/client/clients.rb +++ b/lib/bookingsync/api/client/clients.rb @@ -18,6 +18,17 @@ def clients(options = {}, &block) paginate :clients, options, &block end + # Get a single client + # + # @param client [BookingSync::API::Resource|Integer] Client or ID + # of the client. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def client(client, options = {}) + get("clients/#{client}", options).pop + end + # Create a new client # # @param options [Hash] Client attributes diff --git a/lib/bookingsync/api/client/destinations.rb b/lib/bookingsync/api/client/destinations.rb index bc5a2ab7..489f2933 100644 --- a/lib/bookingsync/api/client/destinations.rb +++ b/lib/bookingsync/api/client/destinations.rb @@ -17,6 +17,17 @@ module Destinations def destinations(options = {}, &block) paginate :destinations, options, &block end + + # Get a single destination + # + # @param destination [BookingSync::API::Resource|Integer] Destination or ID + # of the destination. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def destination(destination, options = {}) + get("destinations/#{destination}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/fees.rb b/lib/bookingsync/api/client/fees.rb index 3713b44b..b5fb9c33 100644 --- a/lib/bookingsync/api/client/fees.rb +++ b/lib/bookingsync/api/client/fees.rb @@ -17,6 +17,17 @@ module Fees def fees(options = {}, &block) paginate :fees, options, &block end + + # Get a single fee + # + # @param fee [BookingSync::API::Resource|Integer] Fee or ID + # of the fee. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def fee(fee, options = {}) + get("fees/#{fee}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/inquiries.rb b/lib/bookingsync/api/client/inquiries.rb index 80e6cbfa..0898e98c 100644 --- a/lib/bookingsync/api/client/inquiries.rb +++ b/lib/bookingsync/api/client/inquiries.rb @@ -11,6 +11,17 @@ def inquiries(options = {}, &block) paginate :inquiries, options, &block end + # Get a single inquiry + # + # @param inquiry [BookingSync::API::Resource|Integer] Inquiry or ID + # of the inquiry. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def inquiry(inquiry, options = {}) + get("inquiries/#{inquiry}", options).pop + end + # Create a new inquiry # # @param rental [BookingSync::API::Resource] Rental or ID of the rental diff --git a/lib/bookingsync/api/client/payments.rb b/lib/bookingsync/api/client/payments.rb index 1ae43c15..5a724750 100644 --- a/lib/bookingsync/api/client/payments.rb +++ b/lib/bookingsync/api/client/payments.rb @@ -18,6 +18,17 @@ def payments(options = {}, &block) paginate :payments, options, &block end + # Get a single payment + # + # @param payment [BookingSync::API::Resource|Integer] Payment or ID + # of the payment. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def payment(payment, options = {}) + get("payments/#{payment}", options).pop + end + # Create a new payment # # @param booking_id [Integer] ID of the booking diff --git a/lib/bookingsync/api/client/periods.rb b/lib/bookingsync/api/client/periods.rb index 59c7487b..b291701b 100644 --- a/lib/bookingsync/api/client/periods.rb +++ b/lib/bookingsync/api/client/periods.rb @@ -18,6 +18,17 @@ def periods(options = {}, &block) paginate :periods, options, &block end + # Get a single period + # + # @param period [BookingSync::API::Resource|Integer] Period or ID + # of the period. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def period(period, options = {}) + get("periods/#{period}", options).pop + end + # Create a new period # # @param season [BookingSync::API::Resource|Integer] Season or ID of diff --git a/lib/bookingsync/api/client/photos.rb b/lib/bookingsync/api/client/photos.rb index c18b29f8..8a1c1dbe 100644 --- a/lib/bookingsync/api/client/photos.rb +++ b/lib/bookingsync/api/client/photos.rb @@ -20,6 +20,17 @@ def photos(options = {}, &block) paginate :photos, options, &block end + # Get a single photo + # + # @param photo [BookingSync::API::Resource|Integer] Photo or ID + # of the photo. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def photo(photo, options = {}) + get("photos/#{photo}", options).pop + end + # Create a photo # # @param rental [BookingSync::API::Resource|Integer] Rental object or ID diff --git a/lib/bookingsync/api/client/rates.rb b/lib/bookingsync/api/client/rates.rb index e1fcbd81..afd4f939 100644 --- a/lib/bookingsync/api/client/rates.rb +++ b/lib/bookingsync/api/client/rates.rb @@ -18,6 +18,17 @@ module Rates def rates(options = {}, &block) paginate :rates, options, &block end + + # Get a single rate + # + # @param rate [BookingSync::API::Resource|Integer] Rate or ID + # of the rate. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def rate(rate, options = {}) + get("rates/#{rate}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/rates_rules.rb b/lib/bookingsync/api/client/rates_rules.rb index 30636cde..ac49cd74 100644 --- a/lib/bookingsync/api/client/rates_rules.rb +++ b/lib/bookingsync/api/client/rates_rules.rb @@ -17,6 +17,50 @@ module RatesRules def rates_rules(options = {}, &block) paginate :rates_rules, options, &block end + + # Get a single rates_rule + # + # @param rates_rule [BookingSync::API::Resource|Integer] RatesRule or ID + # of the rates_rule. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def rates_rule(rates_rule, options = {}) + get("rates_rules/#{rates_rule}", options).pop + end + + # Create a new rates_rule + # + # @param rates_table [BookingSync::API::Resource|Integer] RatesTable or ID of + # the rates_table for which rates_rule will be created. + # @param options [Hash] RatesRule's attributes. + # @return [BookingSync::API::Resource] Newly created rates_rule. + def create_rates_rule(rates_table, options = {}) + post("rates_tables/#{rates_table}/rates_rules", rates_rules: [options]).pop + end + + # Edit a rates_rule + # + # @param rates_rule [BookingSync::API::Resource|Integer] RatesRule or ID of + # the rates_rule to be updated. + # @param options [Hash] RatesRule attributes to be updated. + # @return [BookingSync::API::Resource] Updated rates_rule on success, + # exception is raised otherwise. + # @example + # rates_rule = @api.rates_rules.first + # @api.edit_rates_rule(rates_rule, { percentage: 10 }) + def edit_rates_rule(rates_rule, options = {}) + put("rates_rules/#{rates_rule}", rates_rules: [options]).pop + end + + # Delete a rates_rule + # + # @param rates_rule [BookingSync::API::Resource|Integer] RatesRule or ID + # of the rates_rule to be deleted. + # @return [NilClass] Returns nil on success. + def delete_rates_rule(rates_rule) + delete "rates_rules/#{rates_rule}" + end end end end diff --git a/lib/bookingsync/api/client/rates_tables.rb b/lib/bookingsync/api/client/rates_tables.rb index 5b064d7f..79c842cc 100644 --- a/lib/bookingsync/api/client/rates_tables.rb +++ b/lib/bookingsync/api/client/rates_tables.rb @@ -18,6 +18,17 @@ def rates_tables(options = {}, &block) paginate :rates_tables, options, &block end + # Get a single rates_table + # + # @param rates_table [BookingSync::API::Resource|Integer] RatesTable or ID + # of the rates_table. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def rates_table(rates_table, options = {}) + get("rates_tables/#{rates_table}", options).pop + end + # Create a new rates_table # # @param options [Hash] rates_table attributes diff --git a/lib/bookingsync/api/client/rental_agreements.rb b/lib/bookingsync/api/client/rental_agreements.rb index 40dae4a0..82f28256 100644 --- a/lib/bookingsync/api/client/rental_agreements.rb +++ b/lib/bookingsync/api/client/rental_agreements.rb @@ -19,6 +19,17 @@ def rental_agreements(options = {}, &block) paginate :rental_agreements, options, &block end + # Get a single rental_agreement + # + # @param rental_agreement [BookingSync::API::Resource|Integer] RentalAgreement or ID + # of the rental_agreement. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def rental_agreement(rental_agreement, options = {}) + get("rental_agreements/#{rental_agreement}", options).pop + end + # Create a new rental agreement for a booking. # # @param booking [BookingSync::API::Resource|Integer] Booking or ID of diff --git a/lib/bookingsync/api/client/rentals_amenities.rb b/lib/bookingsync/api/client/rentals_amenities.rb index 4109594a..0c46e6d7 100644 --- a/lib/bookingsync/api/client/rentals_amenities.rb +++ b/lib/bookingsync/api/client/rentals_amenities.rb @@ -37,6 +37,29 @@ def rentals_amenity(rentals_amenity) def create_rentals_amenity(rental, options = {}) post("rentals/#{rental}/rentals_amenities", rentals_amenities: [options]).pop end + + # Edit a rentals_amenity + # + # @param rentals_amenity [BookingSync::API::Resource|Integer] RentalsAmenity or ID of + # the rentals_amenity to be updated. + # @param options [Hash] rentals_amenity attributes to be updated. + # @return [BookingSync::API::Resource] Updated rentals_amenity on success, + # exception is raised otherwise. + # @example + # rentals_amenity = @api.rentals_amenities.first + # @api.edit_rentals_amenity(rentals_amenity, { details_en: "Details" }) + def edit_rentals_amenity(rentals_amenity, options = {}) + put("rentals_amenities/#{rentals_amenity}", rentals_amenities: [options]).pop + end + + # Delete a rentals_amenity + # + # @param rentals_amenity [BookingSync::API::Resource|Integer] RentalsAmenity or ID + # of the rentals_amenity to be deleted. + # @return [NilClass] Returns nil on success. + def delete_rentals_amenity(rentals_amenity) + delete "rentals_amenities/#{rentals_amenity}" + end end end end diff --git a/lib/bookingsync/api/client/rentals_fees.rb b/lib/bookingsync/api/client/rentals_fees.rb index e14c5780..676606c4 100644 --- a/lib/bookingsync/api/client/rentals_fees.rb +++ b/lib/bookingsync/api/client/rentals_fees.rb @@ -17,6 +17,17 @@ module RentalsFees def rentals_fees(options = {}, &block) paginate :rentals_fees, options, &block end + + # Get a single rentals_fee + # + # @param rentals_fee [BookingSync::API::Resource|Integer] RentalsFee or ID + # of the rentals_fee. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def rentals_fee(rentals_fee, options = {}) + get("rentals_fees/#{rentals_fee}", options).pop + end end end end diff --git a/lib/bookingsync/api/client/reviews.rb b/lib/bookingsync/api/client/reviews.rb index a4995cf6..6412847b 100644 --- a/lib/bookingsync/api/client/reviews.rb +++ b/lib/bookingsync/api/client/reviews.rb @@ -18,6 +18,17 @@ def reviews(options = {}, &block) paginate :reviews, options, &block end + # Get a single review + # + # @param review [BookingSync::API::Resource|Integer] Review or ID + # of the review. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def review(review, options = {}) + get("reviews/#{review}", options).pop + end + # Create a new review # # @param booking [BookingSync::API::Resource|Integer] Booking or ID of diff --git a/lib/bookingsync/api/client/seasons.rb b/lib/bookingsync/api/client/seasons.rb index d50933ee..fd1e5252 100644 --- a/lib/bookingsync/api/client/seasons.rb +++ b/lib/bookingsync/api/client/seasons.rb @@ -18,6 +18,17 @@ def seasons(options = {}, &block) paginate :seasons, options, &block end + # Get a single season + # + # @param season [BookingSync::API::Resource|Integer] Season or ID + # of the season. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def season(season, options = {}) + get("seasons/#{season}", options).pop + end + # Create a new season # # @param rates_table [BookingSync::API::Resource|Integer] Rates table diff --git a/lib/bookingsync/api/client/sources.rb b/lib/bookingsync/api/client/sources.rb index ad75253c..9c7f950d 100644 --- a/lib/bookingsync/api/client/sources.rb +++ b/lib/bookingsync/api/client/sources.rb @@ -18,6 +18,17 @@ def sources(options = {}, &block) paginate :sources, options, &block end + # Get a single source + # + # @param source [BookingSync::API::Resource|Integer] Source or ID + # of the source. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def source(source, options = {}) + get("sources/#{source}", options).pop + end + # Create a new source # # @param options [Hash] source attributes diff --git a/lib/bookingsync/api/client/special_offers.rb b/lib/bookingsync/api/client/special_offers.rb index 8deb2965..f3caf379 100644 --- a/lib/bookingsync/api/client/special_offers.rb +++ b/lib/bookingsync/api/client/special_offers.rb @@ -18,6 +18,17 @@ def special_offers(options = {}, &block) paginate :special_offers, options, &block end + # Get a single special_offer + # + # @param special_offer [BookingSync::API::Resource|Integer] SpecialOffer or ID + # of the special_offer. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def special_offer(special_offer, options = {}) + get("special_offers/#{special_offer}", options).pop + end + # Create a new special offer for a rental # # @param rental [BookingSync::API::Resource|Integer] Rental or ID of the diff --git a/lib/bookingsync/api/client/taxes.rb b/lib/bookingsync/api/client/taxes.rb index 27434e2b..d5cd446a 100644 --- a/lib/bookingsync/api/client/taxes.rb +++ b/lib/bookingsync/api/client/taxes.rb @@ -17,6 +17,17 @@ module Taxes def taxes(options = {}, &block) paginate :taxes, options, &block end + + # Get a single tax + # + # @param tax [BookingSync::API::Resource|Integer] Tax or ID + # of the tax. + # @param options [Hash] A customizable set of query options. + # @option options [Array] fields: List of fields to be fetched. + # @return [BookingSync::API::Resource] + def tax(tax, options = {}) + get("taxes/#{tax}", options).pop + end end end end diff --git a/spec/bookingsync/api/client/accounts_spec.rb b/spec/bookingsync/api/client/accounts_spec.rb index 10ec73cf..1cd8323d 100644 --- a/spec/bookingsync/api/client/accounts_spec.rb +++ b/spec/bookingsync/api/client/accounts_spec.rb @@ -9,4 +9,11 @@ assert_requested :get, bs_url("accounts") end end + + describe ".account", :vcr do + it "returns a single account" do + account = client.account(3837) + expect(account.id).to eq 3837 + end + end end diff --git a/spec/bookingsync/api/client/bathrooms_spec.rb b/spec/bookingsync/api/client/bathrooms_spec.rb index 47267bc1..d0280a4e 100644 --- a/spec/bookingsync/api/client/bathrooms_spec.rb +++ b/spec/bookingsync/api/client/bathrooms_spec.rb @@ -11,6 +11,13 @@ end end + describe ".bathroom", :vcr do + it "returns a single bathroom" do + bathroom = client.bathroom(730) + expect(bathroom.id).to eq 730 + end + end + describe ".create_bathroom", :vcr do let(:attributes) {{ name_en: "New bathroom", diff --git a/spec/bookingsync/api/client/bedrooms_spec.rb b/spec/bookingsync/api/client/bedrooms_spec.rb index fa5b65ef..06695256 100644 --- a/spec/bookingsync/api/client/bedrooms_spec.rb +++ b/spec/bookingsync/api/client/bedrooms_spec.rb @@ -11,6 +11,13 @@ end end + describe ".bedroom", :vcr do + it "returns a single bedroom" do + bedroom = client.bedroom(945) + expect(bedroom.id).to eq 945 + end + end + describe ".create_bedroom", :vcr do let(:attributes) {{ name_en: "New bedroom", diff --git a/spec/bookingsync/api/client/billing_addresses_spec.rb b/spec/bookingsync/api/client/billing_addresses_spec.rb deleted file mode 100644 index de8c748b..00000000 --- a/spec/bookingsync/api/client/billing_addresses_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require "spec_helper" - -describe BookingSync::API::Client::BillingAddresses do - let(:client) { BookingSync::API::Client.new(test_access_token) } - - describe ".billing_addresses", :vcr do - it "returns billing_addresses" do - expect(client.billing_addresses).not_to be_empty - assert_requested :get, bs_url("billing_addresses") - end - end -end diff --git a/spec/bookingsync/api/client/bookings_fees_spec.rb b/spec/bookingsync/api/client/bookings_fees_spec.rb index 37ed0576..0bf0c68a 100644 --- a/spec/bookingsync/api/client/bookings_fees_spec.rb +++ b/spec/bookingsync/api/client/bookings_fees_spec.rb @@ -1,12 +1,19 @@ require "spec_helper" describe BookingSync::API::Client::BookingsFees do - let(:api) { BookingSync::API::Client.new(test_access_token) } + let(:client) { BookingSync::API::Client.new(test_access_token) } describe ".bookings_fees", :vcr do it "returns bookings fees" do - expect(api.bookings_fees).not_to be_empty + expect(client.bookings_fees).not_to be_empty assert_requested :get, bs_url("bookings_fees") end end + + describe ".bookings_fee", :vcr do + it "returns a single bookings_fee" do + bookings_fee = client.bookings_fee(8112) + expect(bookings_fee.id).to eq 8112 + end + end end diff --git a/spec/bookingsync/api/client/billings_payments_spec.rb b/spec/bookingsync/api/client/bookings_payments_spec.rb similarity index 63% rename from spec/bookingsync/api/client/billings_payments_spec.rb rename to spec/bookingsync/api/client/bookings_payments_spec.rb index 5ff64d59..156ec930 100644 --- a/spec/bookingsync/api/client/billings_payments_spec.rb +++ b/spec/bookingsync/api/client/bookings_payments_spec.rb @@ -9,4 +9,11 @@ assert_requested :get, bs_url("bookings_payments") end end + + describe ".bookings_payment", :vcr do + it "returns a single bookings_payment" do + bookings_payment = client.bookings_payment(71982) + expect(bookings_payment.id).to eq 71982 + end + end end diff --git a/spec/bookingsync/api/client/bookings_taxes_spec.rb b/spec/bookingsync/api/client/bookings_taxes_spec.rb index 028f6f17..6d60355a 100644 --- a/spec/bookingsync/api/client/bookings_taxes_spec.rb +++ b/spec/bookingsync/api/client/bookings_taxes_spec.rb @@ -1,12 +1,19 @@ require "spec_helper" describe BookingSync::API::Client::BookingsTaxes do - let(:api) { BookingSync::API::Client.new(test_access_token) } + let(:client) { BookingSync::API::Client.new(test_access_token) } describe ".bookings_taxes", :vcr do it "returns bookings taxes" do - expect(api.bookings_taxes).not_to be_empty + expect(client.bookings_taxes).not_to be_empty assert_requested :get, bs_url("bookings_taxes") end end + + describe ".bookings_tax", :vcr do + it "returns a single bookings_tax" do + bookings_tax = client.bookings_tax(8157) + expect(bookings_tax.id).to eq 8157 + end + end end diff --git a/spec/bookingsync/api/client/clients_spec.rb b/spec/bookingsync/api/client/clients_spec.rb index 0bea76db..0ffc53d4 100644 --- a/spec/bookingsync/api/client/clients_spec.rb +++ b/spec/bookingsync/api/client/clients_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe BookingSync::API::Client::Bookings do +describe BookingSync::API::Client::Clients do let(:api) { BookingSync::API::Client.new(test_access_token) } describe ".clients", :vcr do @@ -10,14 +10,17 @@ end end + describe ".client", :vcr do + it "returns a single client" do + client = api.client(77703) + expect(client.id).to eq 77703 + end + end + describe ".create_client", :vcr do let(:attributes) {{ fullname: "John Smith", - phone: "11111111", - mobile: "33333333", - email: "smith@example.com", - fax: "1111111", - address1: "Italy", + emails: [{ label: "default", email: "smith@example.com" }], country_code: "IT", city: "Rome" }} @@ -29,24 +32,24 @@ end it "returns newly created client" do - VCR.use_cassette('BookingSync_API_Client_Bookings/_create_client/creates_a_new_client') do + VCR.use_cassette('BookingSync_API_Client_Clients/_create_client/creates_a_new_client') do client = api.create_client(attributes) - expect(client.email).to eql("smith@example.com") - expect(client.fullname).to eql("John Smith") + expect(client.emails).to eq [{:label=>"default", :email=>"smith@example.com"}] + expect(client.fullname).to eq ("John Smith") end end end describe ".edit_client", :vcr do it "updates given client by ID" do - api.edit_client(2, fullname: "Gary Smith") - assert_requested :put, bs_url("clients/2"), + api.edit_client(77703, fullname: "Gary Smith") + assert_requested :put, bs_url("clients/77703"), body: {clients: [{fullname: "Gary Smith"}]}.to_json end it "returns updated client" do - VCR.use_cassette('BookingSync_API_Client_Bookings/_edit_client/updates_given_client_by_ID') do - client = api.edit_client(2, fullname: "Gary Smith") + VCR.use_cassette('BookingSync_API_Client_Clients/_edit_client/updates_given_client_by_ID') do + client = api.edit_client(77703, fullname: "Gary Smith") expect(client).to be_kind_of(BookingSync::API::Resource) expect(client.fullname).to eq("Gary Smith") end diff --git a/spec/bookingsync/api/client/destinations_spec.rb b/spec/bookingsync/api/client/destinations_spec.rb index 9849ca11..5da8309d 100644 --- a/spec/bookingsync/api/client/destinations_spec.rb +++ b/spec/bookingsync/api/client/destinations_spec.rb @@ -9,4 +9,11 @@ assert_requested :get, bs_url("destinations") end end + + describe ".destination", :vcr do + it "returns a single destination" do + destination = client.destination(7301) + expect(destination.id).to eq 7301 + end + end end diff --git a/spec/bookingsync/api/client/fees_spec.rb b/spec/bookingsync/api/client/fees_spec.rb index e65e618e..01872871 100644 --- a/spec/bookingsync/api/client/fees_spec.rb +++ b/spec/bookingsync/api/client/fees_spec.rb @@ -1,12 +1,19 @@ require "spec_helper" describe BookingSync::API::Client::Fees do - let(:api) { BookingSync::API::Client.new(test_access_token) } + let(:client) { BookingSync::API::Client.new(test_access_token) } describe ".fees", :vcr do it "returns fees" do - expect(api.fees).not_to be_empty + expect(client.fees).not_to be_empty assert_requested :get, bs_url("fees") end end + + describe ".fee", :vcr do + it "returns a single fee" do + fee = client.fee(474) + expect(fee.id).to eq 474 + end + end end diff --git a/spec/bookingsync/api/client/inquiries_spec.rb b/spec/bookingsync/api/client/inquiries_spec.rb index 3f7561a2..103ee0a6 100644 --- a/spec/bookingsync/api/client/inquiries_spec.rb +++ b/spec/bookingsync/api/client/inquiries_spec.rb @@ -10,6 +10,13 @@ end end + describe ".inquiry", :vcr do + it "returns a single inquiry" do + inquiry = client.inquiry(6087) + expect(inquiry.id).to eq 6087 + end + end + describe ".create_inquiry", :vcr do let(:attributes) { { rental_id: 7, diff --git a/spec/bookingsync/api/client/payments_spec.rb b/spec/bookingsync/api/client/payments_spec.rb index 90f1c93b..9639ed90 100644 --- a/spec/bookingsync/api/client/payments_spec.rb +++ b/spec/bookingsync/api/client/payments_spec.rb @@ -10,6 +10,13 @@ end end + describe ".payment", :vcr do + it "returns a single payment" do + payment = api.payment(71959) + expect(payment.id).to eq 71959 + end + end + describe ".create_payment", :vcr do let(:attributes) {{ amount: 200, diff --git a/spec/bookingsync/api/client/periods_spec.rb b/spec/bookingsync/api/client/periods_spec.rb index d580ceb0..b959c7c3 100644 --- a/spec/bookingsync/api/client/periods_spec.rb +++ b/spec/bookingsync/api/client/periods_spec.rb @@ -10,6 +10,13 @@ end end + describe ".period", :vcr do + it "returns a single period" do + period = client.period(4737) + expect(period.id).to eq 4737 + end + end + describe ".create_period", :vcr do let(:attributes) { {start_at: "2013-04-10", end_at: "2013-04-22"} } let(:season) { BookingSync::API::Resource.new(client, id: 9) } diff --git a/spec/bookingsync/api/client/photos_spec.rb b/spec/bookingsync/api/client/photos_spec.rb index 917819aa..101db96e 100644 --- a/spec/bookingsync/api/client/photos_spec.rb +++ b/spec/bookingsync/api/client/photos_spec.rb @@ -11,6 +11,13 @@ end end + describe ".photo", :vcr do + it "returns a single photo" do + photo = client.photo(5793) + expect(photo.id).to eq 5793 + end + end + describe ".create_photo", :vcr do let(:attributes) do {photo_path: "spec/fixtures/files/test.jpg", diff --git a/spec/bookingsync/api/client/rates_rules_spec.rb b/spec/bookingsync/api/client/rates_rules_spec.rb index 01e89601..fee06d04 100644 --- a/spec/bookingsync/api/client/rates_rules_spec.rb +++ b/spec/bookingsync/api/client/rates_rules_spec.rb @@ -10,4 +10,63 @@ assert_requested :get, bs_url("rates_rules") end end + + describe ".rates_rule", :vcr do + it "returns a single rates_rule" do + rates_rule = client.rates_rule(252) + expect(rates_rule.id).to eq 252 + end + end + + describe ".create_rates_rule", :vcr do + let(:attributes) do + { + start_date: "2013-04-10", + end_date: "2013-04-22", + kind: "stay_at_least", + percentage: 10, + variables: { length: 1, unit: "days" } + } + end + let(:rates_table) { BookingSync::API::Resource.new(client, id: 274) } + + it "creates a new rates_rule" do + client.create_rates_rule(rates_table, attributes) + assert_requested :post, bs_url("rates_tables/274/rates_rules"), + body: { rates_rules: [attributes] }.to_json + end + + it "returns newly created rates_rule" do + VCR.use_cassette('BookingSync_API_Client_RatesRules/_create_rates_rule/creates_a_new_rates_rule') do + rates_rule = client.create_rates_rule(rates_table, attributes) + expect(rates_rule.start_date).to eql(Time.parse(attributes[:start_date])) + expect(rates_rule.end_date).to eql(Time.parse(attributes[:end_date])) + end + end + end + + describe ".edit_rates_rule", :vcr do + let(:attributes) { { end_date: '2014-07-15' } } + + it "updates given rates_rule by ID" do + client.edit_rates_rule(252, attributes) + assert_requested :put, bs_url("rates_rules/252"), + body: { rates_rules: [attributes] }.to_json + end + + it "returns updated rates_rule" do + VCR.use_cassette('BookingSync_API_Client_RatesRules/_edit_rates_rule/updates_given_rates_rule_by_ID') do + rates_rule = client.edit_rates_rule(252, attributes) + expect(rates_rule).to be_kind_of(BookingSync::API::Resource) + expect(rates_rule.end_date).to eq(Time.parse(attributes[:end_date])) + end + end + end + + describe ".delete_rates_rule", :vcr do + it "deletes given rates_rule" do + client.delete_rates_rule(250) + assert_requested :delete, bs_url("rates_rules/250") + end + end end diff --git a/spec/bookingsync/api/client/rates_spec.rb b/spec/bookingsync/api/client/rates_spec.rb index 6601548b..51ad3c95 100644 --- a/spec/bookingsync/api/client/rates_spec.rb +++ b/spec/bookingsync/api/client/rates_spec.rb @@ -9,4 +9,11 @@ assert_requested :get, bs_url("rates") end end + + describe ".rate", :vcr do + it "returns a single rate" do + rate = client.rate(18577) + expect(rate.id).to eq 18577 + end + end end diff --git a/spec/bookingsync/api/client/rates_tables_spec.rb b/spec/bookingsync/api/client/rates_tables_spec.rb index cbae2f75..be502bef 100644 --- a/spec/bookingsync/api/client/rates_tables_spec.rb +++ b/spec/bookingsync/api/client/rates_tables_spec.rb @@ -11,6 +11,13 @@ end end + describe ".rates_table", :vcr do + it "returns a single rates_table" do + rates_table = client.rates_table(274) + expect(rates_table.id).to eq 274 + end + end + describe ".create_rates_table", :vcr do let(:attributes) { { name: 'New rate table' } diff --git a/spec/bookingsync/api/client/rental_agreements_spec.rb b/spec/bookingsync/api/client/rental_agreements_spec.rb index 1fcf5679..43854d9d 100644 --- a/spec/bookingsync/api/client/rental_agreements_spec.rb +++ b/spec/bookingsync/api/client/rental_agreements_spec.rb @@ -13,6 +13,13 @@ end end + describe ".rental_agreement", :vcr do + it "returns a single rental_agreement" do + rental_agreement = client.rental_agreement(6905) + expect(rental_agreement.id).to eq 6905 + end + end + describe ".create_rental_agreement", :vcr do it "creates a new rental agreement" do client.create_rental_agreement(attributes) diff --git a/spec/bookingsync/api/client/rentals_amenities_spec.rb b/spec/bookingsync/api/client/rentals_amenities_spec.rb index 5d5915f1..a18b874a 100644 --- a/spec/bookingsync/api/client/rentals_amenities_spec.rb +++ b/spec/bookingsync/api/client/rentals_amenities_spec.rb @@ -30,17 +30,45 @@ end describe ".create_rentals_amenity", :vcr do - let(:rental) { BookingSync::API::Resource.new(client, id: 38) } + let(:attributes) { { amenity_id: 44, details_en: "Details" } } + let(:rental) { BookingSync::API::Resource.new(client, id: 5116) } - it "creates a new rental's amenity" do - client.create_rentals_amenity(rental, { amenity_id: 50 }) - assert_requested :post, bs_url("rentals/38/rentals_amenities"), - body: { rentals_amenities: [{ amenity_id: 50 }] }.to_json + it "creates a new rentals_amenity" do + client.create_rentals_amenity(rental, attributes) + assert_requested :post, bs_url("rentals/5116/rentals_amenities"), + body: { rentals_amenities: [attributes] }.to_json end - it "returns newly created rental's amenity" do - rentals_amenity = client.create_rentals_amenity(rental, { amenity_id: 51 }) - expect(rentals_amenity.links.amenity).to eql 51 + it "returns newly created rentals_amenity" do + VCR.use_cassette('BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rentals_amenity') do + rentals_amenity = client.create_rentals_amenity(rental, attributes) + expect(rentals_amenity.details).to eq({ en: "Details" }) + end + end + end + + describe ".edit_rentals_amenity", :vcr do + let(:attributes) { { details_en: "New Details" } } + + it "updates given rentals_amenity by ID" do + client.edit_rentals_amenity(6159, attributes) + assert_requested :put, bs_url("rentals_amenities/6159"), + body: { rentals_amenities: [attributes] }.to_json + end + + it "returns updated rentals_amenity" do + VCR.use_cassette('BookingSync_API_Client_RentalsAmenities/_edit_rentals_amenity/updates_given_rentals_amenity_by_ID') do + rentals_amenity = client.edit_rentals_amenity(6159, attributes) + expect(rentals_amenity).to be_kind_of(BookingSync::API::Resource) + expect(rentals_amenity.details).to eq({ en: "New Details" }) + end + end + end + + describe ".delete_rentals_amenity", :vcr do + it "deletes given rentals_amenity" do + client.delete_rentals_amenity(32833) + assert_requested :delete, bs_url("rentals_amenities/32833") end end end diff --git a/spec/bookingsync/api/client/rentals_fees_spec.rb b/spec/bookingsync/api/client/rentals_fees_spec.rb index fde857e0..2914fc6c 100644 --- a/spec/bookingsync/api/client/rentals_fees_spec.rb +++ b/spec/bookingsync/api/client/rentals_fees_spec.rb @@ -1,12 +1,19 @@ require "spec_helper" describe BookingSync::API::Client::RentalsFees do - let(:api) { BookingSync::API::Client.new(test_access_token) } + let(:client) { BookingSync::API::Client.new(test_access_token) } describe ".rentals_fees", :vcr do it "returns rentals fees" do - expect(api.rentals_fees).not_to be_empty + expect(client.rentals_fees).not_to be_empty assert_requested :get, bs_url("rentals_fees") end end + + describe ".rentals_fee", :vcr do + it "returns a single rentals_fee" do + rentals_fee = client.rentals_fee(3306) + expect(rentals_fee.id).to eq 3306 + end + end end diff --git a/spec/bookingsync/api/client/reviews_spec.rb b/spec/bookingsync/api/client/reviews_spec.rb index 4c870c4b..a430efc4 100644 --- a/spec/bookingsync/api/client/reviews_spec.rb +++ b/spec/bookingsync/api/client/reviews_spec.rb @@ -10,6 +10,13 @@ end end + describe ".review", :vcr do + it "returns a single review" do + review = client.review(34562) + expect(review.id).to eq 34562 + end + end + describe ".create_review", :vcr do let(:attributes) {{ comment: "Awesome place", diff --git a/spec/bookingsync/api/client/seasons_spec.rb b/spec/bookingsync/api/client/seasons_spec.rb index 0019d63d..d22eb3a8 100644 --- a/spec/bookingsync/api/client/seasons_spec.rb +++ b/spec/bookingsync/api/client/seasons_spec.rb @@ -11,6 +11,13 @@ end end + describe ".season", :vcr do + it "returns a single season" do + season = client.season(1803) + expect(season.id).to eq 1803 + end + end + describe ".create_season", :vcr do let(:attributes) {{ name: "New season", diff --git a/spec/bookingsync/api/client/sources_spec.rb b/spec/bookingsync/api/client/sources_spec.rb index 1bafb68b..fa60bbfc 100644 --- a/spec/bookingsync/api/client/sources_spec.rb +++ b/spec/bookingsync/api/client/sources_spec.rb @@ -11,6 +11,13 @@ end end + describe ".source", :vcr do + it "returns a single source" do + source = client.source(1874) + expect(source.id).to eq 1874 + end + end + describe ".create_source", :vcr do let(:attributes) { { name: 'New source' } diff --git a/spec/bookingsync/api/client/special_offers_spec.rb b/spec/bookingsync/api/client/special_offers_spec.rb index 268d18f3..8a3f9639 100644 --- a/spec/bookingsync/api/client/special_offers_spec.rb +++ b/spec/bookingsync/api/client/special_offers_spec.rb @@ -10,6 +10,13 @@ end end + describe ".special_offer", :vcr do + it "returns a single special_offer" do + special_offer = client.special_offer(86) + expect(special_offer.id).to eq 86 + end + end + describe ".create_special_offer", :vcr do let(:attributes) { { diff --git a/spec/bookingsync/api/client/taxes_spec.rb b/spec/bookingsync/api/client/taxes_spec.rb index dd013784..ba5637ef 100644 --- a/spec/bookingsync/api/client/taxes_spec.rb +++ b/spec/bookingsync/api/client/taxes_spec.rb @@ -1,12 +1,19 @@ require "spec_helper" describe BookingSync::API::Client::Taxes do - let(:api) { BookingSync::API::Client.new(test_access_token) } + let(:client) { BookingSync::API::Client.new(test_access_token) } describe ".taxes", :vcr do it "returns taxes" do - expect(api.taxes).not_to be_empty + expect(client.taxes).not_to be_empty assert_requested :get, bs_url("taxes") end end + + describe ".tax", :vcr do + it "returns a single tax" do + tax = client.tax(168) + expect(tax.id).to eq 168 + end + end end diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Accounts/_account/returns_a_single_account.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Accounts/_account/returns_a_single_account.yml new file mode 100644 index 00000000..8ba23037 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Accounts/_account/returns_a_single_account.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/accounts/3837 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 19:37:08 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441828800' + X-Ratelimit-Remaining: + - '997' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"254fcb1ac913a6c215dd91c8071d681b"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=d2f4d16e-e057-4332-a34b-f9ef8b4aa4a9; path=/; expires=Wed, 16 Sep + 2015 19:37:08 -0000; secure + - ahoy_visitor=3469e00e-6a02-48a4-856d-acd2f0f706e1; path=/; expires=Sat, 09 + Sep 2017 19:37:08 -0000; secure + X-Request-Id: + - db635b47-df38-434e-96df-640168bd62a0 + X-Runtime: + - '0.070139' + body: + encoding: UTF-8 + string: '{"accounts":[{"business_name":"BSA-Website-Test","created_at":"2014-08-08T18:20:53Z","id":3837,"updated_at":"2015-09-09T18:09:40Z","status":"trial","preferences":{"bookings":{"default_arrival_time":16,"default_departure_time":10}},"email":"dev@bookingsync.com"}],"meta":{}}' + http_version: + recorded_at: Wed, 09 Sep 2015 19:37:09 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Bathrooms/_bathroom/returns_a_single_bathroom.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Bathrooms/_bathroom/returns_a_single_bathroom.yml new file mode 100644 index 00000000..59b995fe --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Bathrooms/_bathroom/returns_a_single_bathroom.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/bathrooms/730 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 19:39:19 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441828800' + X-Ratelimit-Remaining: + - '973' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"cd45064290e7c035962bb17ea56dbc21"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=cd928190-4021-4b6c-8a5f-164e393caff3; path=/; expires=Wed, 16 Sep + 2015 19:39:19 -0000; secure + - ahoy_visitor=9e1fd6c0-8830-4dd8-8cd4-40f07d2fe7cd; path=/; expires=Sat, 09 + Sep 2017 19:39:19 -0000; secure + X-Request-Id: + - 241031bc-ea44-4c1d-8fbe-ccfb3c2ff66a + X-Runtime: + - '0.086251' + body: + encoding: UTF-8 + string: '{"links":{"bathrooms.rental":"https://www.bookingsync.com/api/v3/rentals/{bathrooms.rental}"},"bathrooms":[{"links":{"rental":5116},"id":730,"name":{"en":"Bathroom + 2","fr":"Salle de bain 2"},"wc":false,"shower":false,"bath":false,"created_at":"2015-08-31T19:52:34Z","updated_at":"2015-08-31T19:52:34Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 19:39:20 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Bedrooms/_bedroom/returns_a_single_bedroom.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Bedrooms/_bedroom/returns_a_single_bedroom.yml new file mode 100644 index 00000000..74cf0c55 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Bedrooms/_bedroom/returns_a_single_bedroom.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/bedrooms/945 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 19:39:50 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441828800' + X-Ratelimit-Remaining: + - '972' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"5d3983bdd4a4cb7cf46515c8c0d5a260"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=1b617644-5f33-4c15-be38-07a88d3c322a; path=/; expires=Wed, 16 Sep + 2015 19:39:50 -0000; secure + - ahoy_visitor=909a0306-caa8-4ad1-9881-dbb88ce05153; path=/; expires=Sat, 09 + Sep 2017 19:39:50 -0000; secure + X-Request-Id: + - 5cc70bad-f404-4550-93b8-bac83c79c2bf + X-Runtime: + - '0.076462' + body: + encoding: UTF-8 + string: '{"links":{"bedrooms.rental":"https://www.bookingsync.com/api/v3/rentals/{bedrooms.rental}"},"bedrooms":[{"links":{"rental":5116},"id":945,"name":{"en":"Bedroom + 2","fr":"Chambre 2"},"bunk_beds_count":0,"double_beds_count":0,"kingsize_beds_count":0,"queensize_beds_count":0,"single_beds_count":0,"sofa_beds_count":0,"created_at":"2015-08-12T22:23:31Z","updated_at":"2015-08-12T22:23:31Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 19:39:51 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml b/spec/fixtures/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml deleted file mode 100644 index a5e09f98..00000000 --- a/spec/fixtures/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://www.bookingsync.com/api/v3/billing_addresses - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.0 - Accept: - - application/vnd.api+json - Content-Type: - - application/vnd.api+json - Authorization: - - Bearer <> - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - X-Ratelimit-Limit: - - '1000' - X-Ratelimit-Reset: - - '1398243600' - X-Ratelimit-Remaining: - - '999' - Link: - - "; rel=\"first\", - ; rel=\"last\"" - X-Total-Pages: - - '1' - Access-Control-Allow-Origin: - - "*" - Access-Control-Request-Method: - - "*" - Content-Type: - - application/vnd.api+json; charset=utf-8 - X-Ua-Compatible: - - IE=Edge - Etag: - - "\"642b0f11189d5f78e47f6e8ffa72c11c\"" - Cache-Control: - - max-age=0, private, must-revalidate - P3p: - - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi - OUR SAMi OTRo UNRo PUBi IND UNI STA" - X-Request-Id: - - 06fdf0d1b76626f58d3129958a4df87b - X-Runtime: - - '0.850406' - Date: - - Wed, 23 Apr 2014 08:37:32 GMT - Connection: - - close - body: - encoding: UTF-8 - string: "{\"billing_addresses\":[{\"id\":1,\"payment_id\":134,\"address1\":\"Nader - Drive\",\"address2\":\"\",\"zip\":\"46548-8571\",\"city\":\"Predovicview\",\"state\":\"\",\"country_code\":\"GB\",\"created_at\":\"2014-04-23T08:33:37Z\",\"updated_at\":\"2014-04-23T08:33:37Z\"}]}" - http_version: - recorded_at: Wed, 23 Apr 2014 08:37:32 GMT -recorded_with: VCR 2.9.0 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_clients/returns_clients.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_clients/returns_clients.yml deleted file mode 100644 index acd909ca..00000000 --- a/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_clients/returns_clients.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://www.bookingsync.com/api/v3/clients - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.0 - Accept: - - application/vnd.api+json - Content-Type: - - application/vnd.api+json - Authorization: - - Bearer <> - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - X-Ratelimit-Limit: - - '1000' - X-Ratelimit-Reset: - - '1397512800' - X-Ratelimit-Remaining: - - '995' - Link: - - ; rel="first", ; - rel="last" - X-Total-Pages: - - '1' - Access-Control-Allow-Origin: - - '*' - Access-Control-Request-Method: - - '*' - Content-Type: - - application/vnd.api+json; charset=utf-8 - X-Ua-Compatible: - - IE=Edge - Etag: - - '"6e81308b8f347718bda235c6df6a1844"' - Cache-Control: - - max-age=0, private, must-revalidate - P3p: - - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi - OUR SAMi OTRo UNRo PUBi IND UNI STA" - X-Request-Id: - - 07022bc524a0d02d96dd7c435c9413ee - X-Runtime: - - '0.050475' - Date: - - Mon, 14 Apr 2014 21:17:01 GMT - Connection: - - close - body: - encoding: UTF-8 - string: '{"clients":[{"id":2,"email":"giuseppe.king@walker.us","phone":"","mobile":null,"fax":null,"address1":"","address2":null,"city":"","state":"","zip":"","country_code":"","account_id":1,"created_at":"2014-02-11T09:13:19Z","updated_at":"2014-03-21T13:42:36Z","fullname":"Jakayla - Feest","notes":null},{"id":4,"email":"henri.jakubowski@lebsack.name","phone":"","mobile":null,"fax":null,"address1":"","address2":null,"city":"","state":"","zip":"","country_code":"","account_id":1,"created_at":"2014-02-11T09:13:24Z","updated_at":"2014-03-21T13:42:54Z","fullname":"Katelyn - Bernier I","notes":null}]}' - http_version: - recorded_at: Mon, 14 Apr 2014 21:17:01 GMT -recorded_with: VCR 2.9.0 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_create_client/creates_a_new_client.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_create_client/creates_a_new_client.yml deleted file mode 100644 index 0654060b..00000000 --- a/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_create_client/creates_a_new_client.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://www.bookingsync.com/api/v3/clients - body: - encoding: UTF-8 - string: '{"clients":[{"fullname":"John Smith","phone":"11111111","mobile":"33333333","email":"smith@example.com","fax":"1111111","address1":"Italy","country_code":"IT","city":"Rome"}]}' - headers: - User-Agent: - - Faraday v0.9.0 - Accept: - - application/vnd.api+json - Content-Type: - - application/vnd.api+json - Authorization: - - Bearer <> - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 201 - message: Created - headers: - X-Ratelimit-Limit: - - '1000' - X-Ratelimit-Reset: - - '1397516400' - X-Ratelimit-Remaining: - - '996' - Location: - - https://www.bookingsync.com/api/v3/clients/21 - Access-Control-Allow-Origin: - - '*' - Access-Control-Request-Method: - - '*' - Content-Type: - - application/vnd.api+json; charset=utf-8 - X-Ua-Compatible: - - IE=Edge - Etag: - - '"f60f84f3cae91e0bb7b5a0b1f4983735"' - Cache-Control: - - max-age=0, private, must-revalidate - P3p: - - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi - OUR SAMi OTRo UNRo PUBi IND UNI STA" - Set-Cookie: - - _BookingSync_session=6f84ad4728ff2f51fd0ec06f51af6982; path=/; secure; HttpOnly - X-Request-Id: - - c511730e412109732e60d6d0c0a6720a - X-Runtime: - - '0.157385' - Date: - - Mon, 14 Apr 2014 22:04:17 GMT - Connection: - - close - body: - encoding: UTF-8 - string: '{"clients":[{"id":21,"email":"smith@example.com","phone":"11111111","mobile":"33333333","fax":"1111111","address1":"Italy","address2":null,"city":"Rome","state":null,"zip":null,"country_code":"IT","account_id":1,"created_at":"2014-04-14T22:04:16Z","updated_at":"2014-04-14T22:04:16Z","fullname":"John - Smith","notes":null}]}' - http_version: - recorded_at: Mon, 14 Apr 2014 22:04:17 GMT -recorded_with: VCR 2.9.0 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_edit_client/updates_given_client_by_ID.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_edit_client/updates_given_client_by_ID.yml deleted file mode 100644 index 280b53f7..00000000 --- a/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_edit_client/updates_given_client_by_ID.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -http_interactions: -- request: - method: put - uri: https://www.bookingsync.com/api/v3/clients/2 - body: - encoding: UTF-8 - string: '{"clients":[{"fullname":"Gary Smith"}]}' - headers: - User-Agent: - - Faraday v0.9.0 - Accept: - - application/vnd.api+json - Content-Type: - - application/vnd.api+json - Authorization: - - Bearer <> - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - X-Ratelimit-Limit: - - '1000' - X-Ratelimit-Reset: - - '1398106800' - X-Ratelimit-Remaining: - - '993' - Access-Control-Allow-Origin: - - '*' - Access-Control-Request-Method: - - '*' - Content-Type: - - application/vnd.api+json; charset=utf-8 - X-Ua-Compatible: - - IE=Edge - Etag: - - '"611bdb1657961179c09b8dab364b46ac"' - Cache-Control: - - max-age=0, private, must-revalidate - P3p: - - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi - OUR SAMi OTRo UNRo PUBi IND UNI STA" - Set-Cookie: - - _BookingSync_session=d5f491c8b46b52f121c4eb9b8c4d0f48; path=/; secure; HttpOnly - X-Request-Id: - - 94ffc7815ad532ba844b8bb11d957b0d - X-Runtime: - - '0.307201' - Date: - - Mon, 21 Apr 2014 18:40:41 GMT - Connection: - - close - body: - encoding: UTF-8 - string: '{"clients":[{"id":2,"email":"giuseppe.king@walker.us","phone":"","mobile":null,"fax":null,"address1":"","address2":null,"city":"","state":"","zip":"","country_code":"","account_id":1,"created_at":"2014-02-11T09:13:19Z","updated_at":"2014-04-14T22:23:54Z","fullname":"Gary - Smith","notes":null}]}' - http_version: - recorded_at: Mon, 21 Apr 2014 18:40:41 GMT -recorded_with: VCR 2.9.0 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_BookingsFees/_bookings_fee/returns_a_single_bookings_fee.yml b/spec/fixtures/cassettes/BookingSync_API_Client_BookingsFees/_bookings_fee/returns_a_single_bookings_fee.yml new file mode 100644 index 00000000..923601a5 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_BookingsFees/_bookings_fee/returns_a_single_bookings_fee.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/bookings_fees/8112 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:14:17 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '971' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"11196184ecd06659695c489cde1521d6"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=b22b8731-b6ff-4872-b2e4-e818ec62253e; path=/; expires=Wed, 16 Sep + 2015 21:14:17 -0000; secure + - ahoy_visitor=85dcd0ae-0428-464f-aa4d-ac3135de0c42; path=/; expires=Sat, 09 + Sep 2017 21:14:17 -0000; secure + X-Request-Id: + - d1d0b936-a36e-40d2-9c1c-5bb6ee1d54d9 + X-Runtime: + - '0.083536' + body: + encoding: UTF-8 + string: '{"links":{"bookings_fees.rentals_fee":"https://www.bookingsync.com/api/v3/rentals_fees/{bookings_fees.rentals_fee}","bookings_fees.booking":"https://www.bookingsync.com/api/v3/bookings/{bookings_fees.booking}","bookings_fees.fee":"https://www.bookingsync.com/api/v3/fees/{bookings_fees.fee}","bookings_fees.bookings_taxes":"https://www.bookingsync.com/api/v3/bookings_taxes/{bookings_fees.bookings_taxes}"},"bookings_fees":[{"links":{"rentals_fee":3306,"booking":142616,"fee":474,"bookings_taxes":[]},"id":8112,"name":{"en":"test + fee"},"price":"0.0","required":false,"included_in_price":true,"times_booked":2,"created_at":"2015-09-09T21:13:53Z","updated_at":"2015-09-09T21:13:53Z"}],"meta":{}}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:14:18 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_BookingsPayments/_bookings_payment/returns_a_single_bookings_payment.yml b/spec/fixtures/cassettes/BookingSync_API_Client_BookingsPayments/_bookings_payment/returns_a_single_bookings_payment.yml new file mode 100644 index 00000000..ead4f683 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_BookingsPayments/_bookings_payment/returns_a_single_bookings_payment.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/bookings_payments/71982 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:15:03 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '969' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"435be0b6c0ab126ec5d6c9f0e195e338"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=3f10c19d-8d9e-43d2-9f6a-355abde1b2ed; path=/; expires=Wed, 16 Sep + 2015 21:15:03 -0000; secure + - ahoy_visitor=d481da67-acd0-4226-ab2f-1013d2b8edef; path=/; expires=Sat, 09 + Sep 2017 21:15:03 -0000; secure + X-Request-Id: + - 3fd2a4f5-e733-4bf7-b92b-32ebba76d67f + X-Runtime: + - '0.082159' + body: + encoding: UTF-8 + string: '{"links":{"bookings_payments.account":"https://www.bookingsync.com/api/v3/accounts/{bookings_payments.account}","bookings_payments.booking":"https://www.bookingsync.com/api/v3/bookings/{bookings_payments.booking}","bookings_payments.payment":"https://www.bookingsync.com/api/v3/payments/{bookings_payments.payment}","bookings_payments.rental":"https://www.bookingsync.com/api/v3/rentals/{bookings_payments.rental}"},"bookings_payments":[{"links":{"account":3837,"booking":142616,"payment":71959,"rental":5116},"id":71982,"amount_in_cents":100000,"currency":"EUR","created_at":"2015-09-09T19:58:06Z","updated_at":"2015-09-09T19:58:06Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:15:03 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_BookingsTaxes/_bookings_tax/returns_a_single_bookings_tax.yml b/spec/fixtures/cassettes/BookingSync_API_Client_BookingsTaxes/_bookings_tax/returns_a_single_bookings_tax.yml new file mode 100644 index 00000000..35c30feb --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_BookingsTaxes/_bookings_tax/returns_a_single_bookings_tax.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/bookings_taxes/8157 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:15:35 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '967' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"f100a682735a4eaf8dcc65e936d065be"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=d7bb5bbf-319d-4f03-b0b4-a417136f5198; path=/; expires=Wed, 16 Sep + 2015 21:15:35 -0000; secure + - ahoy_visitor=9a154867-437e-4489-9d8d-6591a0e9c7be; path=/; expires=Sat, 09 + Sep 2017 21:15:35 -0000; secure + X-Request-Id: + - 35d2af3f-4890-43a2-9bdc-77ba17eb13f0 + X-Runtime: + - '0.079789' + body: + encoding: UTF-8 + string: '{"links":{"bookings_taxes.booking":"https://www.bookingsync.com/api/v3/bookings/{bookings_taxes.booking}","bookings_taxes.tax":"https://www.bookingsync.com/api/v3/taxes/{bookings_taxes.tax}","bookings_taxes.rental":"https://www.bookingsync.com/api/v3/rentals/{bookings_taxes.taxable.id}","bookings_taxes.fee":"https://www.bookingsync.com/api/v3/fees/{bookings_taxes.taxable.id}"},"bookings_taxes":[{"links":{"booking":142616,"tax":168,"taxable":{"id":5116,"type":"Rental"}},"id":8157,"name":{"en":"test + tax"},"tax_included_in_price":true,"percentage":"0.0","amount":null}],"meta":{}}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:15:36 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_client/returns_a_single_client.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_client/returns_a_single_client.yml new file mode 100644 index 00000000..bcaddb25 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_client/returns_a_single_client.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/clients/77703 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:09:05 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '978' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"d09581465982553e8120354ea2e078af"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=6da50b57-c531-4ccb-af3e-b943c0255d87; path=/; expires=Wed, 16 Sep + 2015 20:09:05 -0000; secure + - ahoy_visitor=58b9dc3b-d5ca-4241-bcc3-ef13f3b51a9f; path=/; expires=Sat, 09 + Sep 2017 20:09:05 -0000; secure + X-Request-Id: + - 57708e6c-c9b6-4e16-b358-f7cc1f422fcf + X-Runtime: + - '0.072296' + body: + encoding: UTF-8 + string: '{"links":{"clients.account":"https://www.bookingsync.com/api/v3/accounts/{clients.account}"},"clients":[{"links":{"account":3837},"id":77703,"addresses":[],"emails":[{"label":"default","email":"aa@test.com"}],"phones":[],"created_at":"2015-09-09T19:58:00Z","updated_at":"2015-09-09T20:07:42Z","fullname":"Gary + Smith","notes":"","preferred_locale":"","passport":""}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:09:06 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_clients/returns_clients.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_clients/returns_clients.yml new file mode 100644 index 00000000..0aac3fec --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_clients/returns_clients.yml @@ -0,0 +1,87 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/clients + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:09:05 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '979' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '7' + Etag: + - '"45e2bfc45bfb5c3a203922e86ed61a50"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=0499799e-9309-45f7-9a07-667e8263be8e; path=/; expires=Wed, 16 Sep + 2015 20:09:04 -0000; secure + - ahoy_visitor=72b6d853-1b72-4fa1-8941-04eda50b6596; path=/; expires=Sat, 09 + Sep 2017 20:09:04 -0000; secure + X-Request-Id: + - dddd7478-db29-46af-9e7c-bf6b01ca53f4 + X-Runtime: + - '0.070235' + body: + encoding: UTF-8 + string: '{"links":{"clients.account":"https://www.bookingsync.com/api/v3/accounts/{clients.account}"},"clients":[{"links":{"account":3837},"id":77703,"addresses":[],"emails":[{"label":"default","email":"aa@test.com"}],"phones":[],"created_at":"2015-09-09T19:58:00Z","updated_at":"2015-09-09T20:07:42Z","fullname":"Gary + Smith","notes":"","preferred_locale":"","passport":""},{"links":{"account":3837},"id":77704,"addresses":[],"emails":[],"phones":[],"created_at":"2015-09-09T20:03:44Z","updated_at":"2015-09-09T20:03:44Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null},{"links":{"account":3837},"id":77705,"addresses":[],"emails":[],"phones":[],"created_at":"2015-09-09T20:04:41Z","updated_at":"2015-09-09T20:04:41Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null},{"links":{"account":3837},"id":77706,"addresses":[],"emails":[],"phones":[],"created_at":"2015-09-09T20:05:08Z","updated_at":"2015-09-09T20:05:08Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null},{"links":{"account":3837},"id":77707,"addresses":[],"emails":[],"phones":[],"created_at":"2015-09-09T20:05:46Z","updated_at":"2015-09-09T20:05:46Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null},{"links":{"account":3837},"id":77708,"addresses":[],"emails":[],"phones":[],"created_at":"2015-09-09T20:06:56Z","updated_at":"2015-09-09T20:06:56Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null},{"links":{"account":3837},"id":77709,"addresses":[],"emails":[],"phones":[],"created_at":"2015-09-09T20:07:40Z","updated_at":"2015-09-09T20:07:40Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:09:05 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_create_client/creates_a_new_client.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_create_client/creates_a_new_client.yml new file mode 100644 index 00000000..706a332f --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_create_client/creates_a_new_client.yml @@ -0,0 +1,76 @@ +--- +http_interactions: +- request: + method: post + uri: https://www.bookingsync.com/api/v3/clients + body: + encoding: UTF-8 + string: '{"clients":[{"fullname":"John Smith","emails":[{"label":"default","email":"smith@example.com"}],"country_code":"IT","city":"Rome"}]}' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:12:27 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 201 Created + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '973' + Location: + - https://www.bookingsync.com/api/v3/clients/77710 + Etag: + - '"315799e6d1eeda96ad5f811e96c8a19f"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=f08f8b2d-017d-4b54-8bbc-415129187985; path=/; expires=Wed, 16 Sep + 2015 20:12:27 -0000; secure + - ahoy_visitor=d3a73869-c4b6-40c7-91de-ba789dba03d5; path=/; expires=Sat, 09 + Sep 2017 20:12:27 -0000; secure + X-Request-Id: + - c50332ee-14bf-4083-8864-63250605f403 + X-Runtime: + - '0.055171' + body: + encoding: UTF-8 + string: '{"links":{"clients.account":"https://www.bookingsync.com/api/v3/accounts/{clients.account}"},"clients":[{"links":{"account":3837},"id":77710,"addresses":[],"emails":[{"label":"default","email":"smith@example.com"}],"phones":[],"created_at":"2015-09-09T20:12:27Z","updated_at":"2015-09-09T20:12:27Z","fullname":"John + Smith","notes":null,"preferred_locale":null,"passport":null}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:12:28 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_edit_client/updates_given_client_by_ID.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_edit_client/updates_given_client_by_ID.yml new file mode 100644 index 00000000..57ebf507 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Clients/_edit_client/updates_given_client_by_ID.yml @@ -0,0 +1,74 @@ +--- +http_interactions: +- request: + method: put + uri: https://www.bookingsync.com/api/v3/clients/77703 + body: + encoding: UTF-8 + string: '{"clients":[{"fullname":"Gary Smith"}]}' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:09:09 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '976' + Etag: + - '"d42b7322ff42d48054159c24f952af38"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=0ccdd038-60ab-4a18-a78f-de9bd69b80b0; path=/; expires=Wed, 16 Sep + 2015 20:09:09 -0000; secure + - ahoy_visitor=14155540-844b-4bd6-bd33-af034d820c44; path=/; expires=Sat, 09 + Sep 2017 20:09:09 -0000; secure + X-Request-Id: + - d0ecc981-61da-49c0-98be-32a65aacb54b + X-Runtime: + - '0.092873' + body: + encoding: UTF-8 + string: '{"links":{"clients.account":"https://www.bookingsync.com/api/v3/accounts/{clients.account}"},"clients":[{"links":{"account":3837},"id":77703,"addresses":[],"emails":[{"label":"default","email":"aa@test.com"}],"phones":[],"created_at":"2015-09-09T19:58:00Z","updated_at":"2015-09-09T20:09:09Z","fullname":"Gary + Smith","notes":"","preferred_locale":"","passport":""}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:09:10 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Destinations/_destination/returns_a_single_destination.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Destinations/_destination/returns_a_single_destination.yml new file mode 100644 index 00000000..00826224 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Destinations/_destination/returns_a_single_destination.yml @@ -0,0 +1,83 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/destinations/7301 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:18:52 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '970' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"47249ebadc8b5a23bf610c28b73892d9"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=09a218d5-c4d0-40fb-aad7-9fecc2a44c54; path=/; expires=Wed, 16 Sep + 2015 20:18:52 -0000; secure + - ahoy_visitor=f972ba50-384c-4513-ba1b-685107d8790d; path=/; expires=Sat, 09 + Sep 2017 20:18:52 -0000; secure + X-Request-Id: + - 8d1b991c-ef2d-4a36-9e25-5d126e2e6ec8 + X-Runtime: + - '0.091339' + body: + encoding: UTF-8 + string: '{"destinations":[{"id":7301,"name":{"en":"Sivota Lefkada"},"fullname":{"en":"Sivota + Lefkada, Lefkada (Lefkas), Ionian Islands, Greece, Europe, World","fr":"Sivota + Lefkada, Lefkada (Lefkas), Ionian Islands, Greece, Europe, World"},"permalink":{"en":"world/europe/greece/ionian-islands/lefkada-lefkas/sivota-lefkada","fr":"world/europe/greece/ionian-islands/lefkada-lefkas/sivota-lefkada"},"aliases":{"en":"---\n- + Syvota\n"},"counter":2}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:18:54 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Fees/_fee/returns_a_single_fee.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Fees/_fee/returns_a_single_fee.yml new file mode 100644 index 00000000..3e82512d --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Fees/_fee/returns_a_single_fee.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/fees/474 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:13:16 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '974' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"70d379460c62943346fad5ed20f730b2"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=7dfd0b20-10ca-49da-94c6-e7af8a7c49c6; path=/; expires=Wed, 16 Sep + 2015 21:13:16 -0000; secure + - ahoy_visitor=4134a363-9027-493d-a702-cd33e52830f3; path=/; expires=Sat, 09 + Sep 2017 21:13:16 -0000; secure + X-Request-Id: + - 0ef203fd-5b8d-4066-a912-9d5faf8e7f7d + X-Runtime: + - '0.072005' + body: + encoding: UTF-8 + string: '{"links":{"fees.account":"https://www.bookingsync.com/api/v3/accounts/{fees.account}"},"fees":[{"links":{"account":3837},"id":474,"name":{"en":"test + fee"},"rate":"10.0","rate_kind":"fixed","created_at":"2015-09-09T20:23:53Z","updated_at":"2015-09-09T20:23:54Z","downpayment_percentage":"10.0"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:13:17 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Inquiries/_inquiry/returns_a_single_inquiry.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Inquiries/_inquiry/returns_a_single_inquiry.yml new file mode 100644 index 00000000..da75a584 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Inquiries/_inquiry/returns_a_single_inquiry.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/inquiries/6087 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:20:23 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '967' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"7ad75254fa31e77e6358c4387c7f14aa"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=17c3a9b5-46d3-4c02-b7bb-3242d7831ac1; path=/; expires=Wed, 16 Sep + 2015 20:20:23 -0000; secure + - ahoy_visitor=afc3ddaa-a46c-4d2d-ad0c-fb16b5402bbe; path=/; expires=Sat, 09 + Sep 2017 20:20:23 -0000; secure + X-Request-Id: + - f0f3fae1-0c52-410a-9985-57c6ae02cc2a + X-Runtime: + - '0.064880' + body: + encoding: UTF-8 + string: '{"links":{"inquiries.rental":"https://www.bookingsync.com/api/v3/rentals/{inquiries.rental}"},"inquiries":[{"links":{"rental":5117},"id":6087,"firstname":"aa","lastname":"aa","email":"a@op.pl","country_code":"","phone":"","start_at":null,"end_at":null,"adults":null,"children":null,"message":"","created_at":"2015-09-09T20:19:46Z","updated_at":"2015-09-09T20:19:46Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:20:24 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Payments/_payment/returns_a_single_payment.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Payments/_payment/returns_a_single_payment.yml new file mode 100644 index 00000000..bfaf86cf --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Payments/_payment/returns_a_single_payment.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/payments/71959 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:21:29 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '964' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"de3828affd8fd0467ae7f8dd184c9145"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=2ddf3ca7-683d-4c18-9cfd-bd49fca5878d; path=/; expires=Wed, 16 Sep + 2015 20:21:29 -0000; secure + - ahoy_visitor=a92053d0-dd01-4e84-80a3-aac59e828041; path=/; expires=Sat, 09 + Sep 2017 20:21:29 -0000; secure + X-Request-Id: + - 1f876fc5-afa6-4e0f-a64b-a8cc3a7126e0 + X-Runtime: + - '0.116286' + body: + encoding: UTF-8 + string: '{"links":{"payments.account":"https://www.bookingsync.com/api/v3/accounts/{payments.account}","payments.bookings":"https://www.bookingsync.com/api/v3/bookings/{payments.bookings}","payments.bookings_payments":"https://www.bookingsync.com/api/v3/bookings_payments/{payments.bookings_payments}"},"payments":[{"links":{"account":3837,"bookings":[142616],"bookings_payments":[71982]},"id":71959,"transaction_id":null,"order_id":null,"card":null,"amount_in_cents":100000,"currency":"EUR","kind":"online","fullname":"aa","email":"aa@test.com","address1":null,"address2":null,"zip":null,"city":null,"state":null,"country_code":null,"locale":null,"ip":null,"test":false,"notes":"","paid_at":"2015-09-09T00:00:00Z","created_at":"2015-09-09T19:58:06Z","updated_at":"2015-09-09T19:58:06Z","rejected_at":null,"canceled_at":null}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:21:30 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Periods/_period/returns_a_single_period.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Periods/_period/returns_a_single_period.yml new file mode 100644 index 00000000..90a29c9d --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Periods/_period/returns_a_single_period.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/periods/4737 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:22:14 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '962' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"417c24e30f24356166b181b60b87b336"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=08d1066d-b03a-4930-bddf-6fad43d1b29a; path=/; expires=Wed, 16 Sep + 2015 20:22:13 -0000; secure + - ahoy_visitor=3b89d058-3938-4770-9a48-3a50c4f74969; path=/; expires=Sat, 09 + Sep 2017 20:22:13 -0000; secure + X-Request-Id: + - 4f65eb4a-9b91-4240-9cb2-f50b2234586a + X-Runtime: + - '0.069400' + body: + encoding: UTF-8 + string: '{"links":{"periods.season":"https://www.bookingsync.com/api/v3/seasons/{periods.season}","periods.rates_table":"https://www.bookingsync.com/api/v3/rates_tables/{periods.rates_table}"},"periods":[{"links":{"season":1804,"rates_table":274},"id":4737,"start_date":"2015-08-29","end_date":"2015-09-19","created_at":"2014-08-08T18:33:28Z","updated_at":"2014-08-08T18:33:28Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:22:14 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photo/returns_a_single_photo.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photo/returns_a_single_photo.yml new file mode 100644 index 00000000..9fb01cb4 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photo/returns_a_single_photo.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/photos/5793 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:22:52 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '960' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"c35696f1c1211f3bb66c729759174d94"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=14a93957-acaf-4fc1-865a-a187dd8542d8; path=/; expires=Wed, 16 Sep + 2015 20:22:52 -0000; secure + - ahoy_visitor=fb271695-12ce-48dc-b1b6-ec890886a612; path=/; expires=Sat, 09 + Sep 2017 20:22:52 -0000; secure + X-Request-Id: + - ef15145c-aee1-4cd6-b47a-98107590a667 + X-Runtime: + - '0.085202' + body: + encoding: UTF-8 + string: '{"links":{"photos.rental":"https://www.bookingsync.com/api/v3/rentals/{photos.rental}"},"photos":[{"links":{"rental":5117},"id":5793,"description":{},"kind":null,"micro_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_32,q_90,w_48/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","thumb_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_64,q_90,w_96/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","small_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_128,q_90,w_192/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","compact_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_256,q_90,w_384/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","medium_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_512,q_90,w_768/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","large_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_800,q_90,w_1200/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","grande_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_1024,q_90,w_1536/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","giant_url":"https://res-5.cloudinary.com/bookingsync/image/upload/c_fill,fl_progressive,g_center,h_1600,q_90,w_2400/v1418041610/4cb2bb4f8bd14003ad3ef47867367512.jpg","position":10,"created_at":"2014-08-08T19:33:22Z","updated_at":"2014-12-08T12:26:48Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:22:53 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rate/returns_a_single_rate.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rate/returns_a_single_rate.yml new file mode 100644 index 00000000..076f77a3 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rate/returns_a_single_rate.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/rates/18577 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:23:47 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '957' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"0e1e2fedffbd2e140d6807bb3a59f5ee"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=def2c3dc-8349-413c-a6b7-7b3dcd68d944; path=/; expires=Wed, 16 Sep + 2015 20:23:47 -0000; secure + - ahoy_visitor=21ab6437-5b97-47f1-b681-542778c0cb1d; path=/; expires=Sat, 09 + Sep 2017 20:23:47 -0000; secure + X-Request-Id: + - 53b92be6-f6f5-44c4-b67a-28d21016cf91 + X-Runtime: + - '0.097459' + body: + encoding: UTF-8 + string: '{"links":{"rates.rental":"https://www.bookingsync.com/api/v3/rentals/{rates.rental}"},"rates":[{"links":{"rental":5117},"id":18577,"currency":"EUR","start_date":"2015-10-10","end_date":"2015-10-31","initial_nightly_rate":"162.51429","initial_weekly_rate":"1137.6","initial_monthly_rate":"4875.42857","final_nightly_rate":"162.51429","final_weekly_rate":"1137.6","final_monthly_rate":"4875.42857","minimum_stay":2,"created_at":"2014-10-29T19:57:52Z","updated_at":"2015-09-09T18:27:04Z"}],"meta":{}}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:23:48 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_create_rates_rule/creates_a_new_rates_rule.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_create_rates_rule/creates_a_new_rates_rule.yml new file mode 100644 index 00000000..98fb3fd4 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_create_rates_rule/creates_a_new_rates_rule.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: post + uri: https://www.bookingsync.com/api/v3/rates_tables/274/rates_rules + body: + encoding: UTF-8 + string: '{"rates_rules":[{"start_date":"2013-04-10","end_date":"2013-04-22","kind":"stay_at_least","percentage":10,"variables":{"length":1,"unit":"days"}}]}' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:36:13 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 201 Created + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '933' + Location: + - https://www.bookingsync.com/api/v3/rates_rules/13777 + Etag: + - '"30cfbc778aacad11a25e6514e6da7fe7"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=8827bc97-8687-4cf1-9053-41120272a38d; path=/; expires=Wed, 16 Sep + 2015 20:36:12 -0000; secure + - ahoy_visitor=fd213858-7820-4e5f-ad9a-d00cf4ae7d8d; path=/; expires=Sat, 09 + Sep 2017 20:36:12 -0000; secure + X-Request-Id: + - b19dfd8e-1c70-4ef3-a52b-d8009ee38db6 + X-Runtime: + - '0.565818' + body: + encoding: UTF-8 + string: '{"links":{"rates_rules.rates_table":"https://www.bookingsync.com/api/v3/rates_tables/{rates_rules.rates_table}","rates_rules.seasons":"https://www.bookingsync.com/api/v3/seasons/{rates_rules.seasons}"},"rates_rules":[{"links":{"rates_table":274,"seasons":[]},"id":13777,"always_applied":false,"percentage":"10.0","period_name":null,"kind":"stay_at_least","variables":{"length":1,"unit":"days"},"start_date":"2013-04-10","end_date":"2013-04-22","created_at":"2015-09-09T20:36:12Z","updated_at":"2015-09-09T20:36:12Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:36:13 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_delete_rates_rule/deletes_given_rates_rule.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_delete_rates_rule/deletes_given_rates_rule.yml new file mode 100644 index 00000000..b9354b01 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_delete_rates_rule/deletes_given_rates_rule.yml @@ -0,0 +1,67 @@ +--- +http_interactions: +- request: + method: delete + uri: https://www.bookingsync.com/api/v3/rates_rules/250 + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:31:37 GMT + Connection: + - keep-alive + Status: + - 204 No Content + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '937' + Cache-Control: + - no-cache + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=94903a5e-433c-44d6-98ca-ef3aafa51987; path=/; expires=Wed, 16 Sep + 2015 20:31:36 -0000; secure + - ahoy_visitor=4e5becfe-73ed-4dc5-a9a2-39c65f2fad92; path=/; expires=Sat, 09 + Sep 2017 20:31:36 -0000; secure + X-Request-Id: + - 1dea1e87-9fd8-4f7e-a423-617805c1282c + X-Runtime: + - '0.533819' + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Wed, 09 Sep 2015 20:31:38 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_edit_rates_rule/updates_given_rates_rule_by_ID.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_edit_rates_rule/updates_given_rates_rule_by_ID.yml new file mode 100644 index 00000000..ecb87a39 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_edit_rates_rule/updates_given_rates_rule_by_ID.yml @@ -0,0 +1,73 @@ +--- +http_interactions: +- request: + method: put + uri: https://www.bookingsync.com/api/v3/rates_rules/252 + body: + encoding: UTF-8 + string: '{"rates_rules":[{"end_date":"2014-07-15"}]}' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:30:59 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '939' + Etag: + - '"55d7af1127f12c1e23b68a508bf0226a"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=dae0b887-4e77-41d2-b566-f554cb3f55b5; path=/; expires=Wed, 16 Sep + 2015 20:30:59 -0000; secure + - ahoy_visitor=ccda9b99-e451-4772-b8ca-26d008dddb76; path=/; expires=Sat, 09 + Sep 2017 20:30:59 -0000; secure + X-Request-Id: + - 78593dcd-5328-4ecd-a31f-95671ccb4068 + X-Runtime: + - '0.573996' + body: + encoding: UTF-8 + string: '{"links":{"rates_rules.rates_table":"https://www.bookingsync.com/api/v3/rates_tables/{rates_rules.rates_table}","rates_rules.seasons":"https://www.bookingsync.com/api/v3/seasons/{rates_rules.seasons}"},"rates_rules":[{"links":{"rates_table":274,"seasons":[]},"id":252,"always_applied":true,"percentage":"-7.0","period_name":"","kind":"stay_at_least","variables":{"days":[],"length":21,"unit":"days"},"start_date":null,"end_date":"2014-07-15","created_at":"2014-08-08T18:34:37Z","updated_at":"2015-09-09T20:30:59Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:31:00 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rule/returns_a_single_rates_rule.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rule/returns_a_single_rates_rule.yml new file mode 100644 index 00000000..efca7e19 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rule/returns_a_single_rates_rule.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/rates_rules/252 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:30:58 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '941' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"6d1591039a912f0fababfd535793b2ff"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=eae6883f-1e5d-4a43-a997-56478fba963c; path=/; expires=Wed, 16 Sep + 2015 20:30:58 -0000; secure + - ahoy_visitor=a82d381f-ee60-4af9-b6b7-f0c41c990d5c; path=/; expires=Sat, 09 + Sep 2017 20:30:58 -0000; secure + X-Request-Id: + - 4e3c552c-aa3b-4b33-857d-9c1f8ba4c1da + X-Runtime: + - '0.073746' + body: + encoding: UTF-8 + string: '{"links":{"rates_rules.rates_table":"https://www.bookingsync.com/api/v3/rates_tables/{rates_rules.rates_table}","rates_rules.seasons":"https://www.bookingsync.com/api/v3/seasons/{rates_rules.seasons}"},"rates_rules":[{"links":{"rates_table":274,"seasons":[]},"id":252,"always_applied":true,"percentage":"-7.0","period_name":"","kind":"stay_at_least","variables":{"days":[],"length":21,"unit":"days"},"start_date":null,"end_date":null,"created_at":"2014-08-08T18:34:37Z","updated_at":"2014-11-17T23:03:40Z"}],"meta":{}}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:30:59 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rules/returns_rates_rules.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rules/returns_rates_rules.yml index 4527d5fe..42448777 100644 --- a/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rules/returns_rates_rules.yml +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RatesRules/_rates_rules/returns_rates_rules.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Faraday v0.9.0 + - BookingSync API gem v0.0.29 Accept: - application/vnd.api+json Content-Type: @@ -22,43 +22,59 @@ http_interactions: code: 200 message: OK headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:29:41 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff X-Ratelimit-Limit: - '1000' X-Ratelimit-Reset: - - '1399327200' + - '1441832400' X-Ratelimit-Remaining: - - '996' + - '948' Link: - ; rel="first", ; rel="last" X-Total-Pages: - '1' - Access-Control-Allow-Origin: - - "*" - Access-Control-Request-Method: - - "*" - Content-Type: - - application/vnd.api+json; charset=utf-8 - X-Ua-Compatible: - - IE=Edge + X-Total-Count: + - '2' Etag: - - '"fe6c62b3d861528e37782eeb75e83ca6"' + - '"94837e570637bb96c6fc15045ec86d19"' Cache-Control: - max-age=0, private, must-revalidate P3p: - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=6b4265c9-5ce5-4c04-a15c-2585c425268a; path=/; expires=Wed, 16 Sep + 2015 20:29:41 -0000; secure + - ahoy_visitor=e77e900b-4c8e-4c73-af9b-b66438067b52; path=/; expires=Sat, 09 + Sep 2017 20:29:41 -0000; secure X-Request-Id: - - 3ddf4d65541b95731dfc6524df691f9e + - 034d9a8e-e26e-430a-8549-194beb2368f0 X-Runtime: - - '0.451678' - Date: - - Mon, 05 May 2014 21:25:25 GMT - Connection: - - close + - '0.061595' body: encoding: UTF-8 - string: '{"links":{"rates_rules.seasons":"https://www.bookingsync.com/api/v3/seasons/{rates_rules.seasons}"},"rates_rules":[{"links":{"seasons":[]},"id":1,"rates_table_id":19,"always_applied":true,"percentage":10,"period_name":null,"kind":"late_booking","variables":{"unit":"days","length":10},"start_at":null,"end_at":null,"created_at":"2014-05-05T21:24:56Z","updated_at":"2014-05-05T21:24:56Z"}]}' - http_version: - recorded_at: Mon, 05 May 2014 21:25:25 GMT -recorded_with: VCR 2.9.0 + string: '{"links":{"rates_rules.rates_table":"https://www.bookingsync.com/api/v3/rates_tables/{rates_rules.rates_table}","rates_rules.seasons":"https://www.bookingsync.com/api/v3/seasons/{rates_rules.seasons}"},"rates_rules":[{"links":{"rates_table":274,"seasons":[1802,1803]},"id":250,"always_applied":false,"percentage":null,"period_name":"","kind":"prevent_if_booked_ahead_of","variables":{"days":[],"length":1,"unit":"years"},"start_date":null,"end_date":null,"created_at":"2014-08-08T18:34:10Z","updated_at":"2014-11-17T23:03:39Z"},{"links":{"rates_table":274,"seasons":[]},"id":252,"always_applied":true,"percentage":"-7.0","period_name":"","kind":"stay_at_least","variables":{"days":[],"length":21,"unit":"days"},"start_date":null,"end_date":null,"created_at":"2014-08-08T18:34:37Z","updated_at":"2014-11-17T23:03:40Z"}],"meta":{}}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:29:42 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RatesTables/_rates_table/returns_a_single_rates_table.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RatesTables/_rates_table/returns_a_single_rates_table.yml new file mode 100644 index 00000000..73175d64 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RatesTables/_rates_table/returns_a_single_rates_table.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/rates_tables/274 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:36:47 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '932' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"3cc5c74f278143419a0f3440a771c075"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=be1d08b2-074a-41a8-8365-90dca83a4415; path=/; expires=Wed, 16 Sep + 2015 20:36:47 -0000; secure + - ahoy_visitor=a79b6525-df91-4b73-867b-8512a07f5d6e; path=/; expires=Sat, 09 + Sep 2017 20:36:47 -0000; secure + X-Request-Id: + - 1a9f6ed1-02b8-4563-9a41-9ce0452b5fc4 + X-Runtime: + - '0.080432' + body: + encoding: UTF-8 + string: '{"links":{"rates_tables.account":"https://www.bookingsync.com/api/v3/accounts/{rates_tables.account}","rates_tables.seasons":"https://www.bookingsync.com/api/v3/seasons/{rates_tables.seasons}","rates_tables.rates_rules":"https://www.bookingsync.com/api/v3/rates_rules/{rates_tables.rates_rules}","rates_tables.periods":"https://www.bookingsync.com/api/v3/periods/{rates_tables.periods}","rates_tables.rentals":"https://www.bookingsync.com/api/v3/rentals/{rates_tables.rentals}"},"rates_tables":[{"links":{"account":3837,"seasons":[1806,1805,1804,1803,1802],"rates_rules":[13777,252],"periods":[4727,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739],"rentals":[5116,5117]},"id":274,"name":"Saturday","created_at":"2014-08-08T18:29:36Z","updated_at":"2015-09-09T20:36:12Z","shared":true}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:36:48 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RentalAgreements/_rental_agreement/returns_a_single_rental_agreement.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RentalAgreements/_rental_agreement/returns_a_single_rental_agreement.yml new file mode 100644 index 00000000..45cef823 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RentalAgreements/_rental_agreement/returns_a_single_rental_agreement.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/rental_agreements/6905 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:39:06 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '928' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"29c9725e89fd0d39cd8660c5e530cf23"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=c92eb1d4-8ab7-4696-ae43-38300eeeb720; path=/; expires=Wed, 16 Sep + 2015 20:39:06 -0000; secure + - ahoy_visitor=4add8309-6680-4b94-92cd-7b99b8382af9; path=/; expires=Sat, 09 + Sep 2017 20:39:06 -0000; secure + X-Request-Id: + - 7b985ea0-774f-4d06-8453-c432382b13c0 + X-Runtime: + - '0.069653' + body: + encoding: UTF-8 + string: '{"rental_agreements":[{"id":6905,"body":"test","created_at":"2015-09-09T20:38:42Z","updated_at":"2015-09-09T20:38:42Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:39:07 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rental_s_amenity.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rentals_amenity.yml similarity index 54% rename from spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rental_s_amenity.yml rename to spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rentals_amenity.yml index 6622e4b2..cae3913a 100644 --- a/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rental_s_amenity.yml +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rentals_amenity.yml @@ -2,13 +2,13 @@ http_interactions: - request: method: post - uri: https://www.bookingsync.com/api/v3/rentals/38/rentals_amenities + uri: https://www.bookingsync.com/api/v3/rentals/5116/rentals_amenities body: encoding: UTF-8 - string: '{"rentals_amenities":[{"amenity_id":50}]}' + string: '{"rentals_amenities":[{"amenity_id":44,"details_en":"Details"}]}' headers: User-Agent: - - BookingSync API gem v0.0.25 + - BookingSync API gem v0.0.29 Accept: - application/vnd.api+json Content-Type: @@ -22,6 +22,20 @@ http_interactions: code: 201 message: Created headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:46:30 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 201 Created + Strict-Transport-Security: + - max-age=31536000 X-Frame-Options: - SAMEORIGIN X-Xss-Protection: @@ -31,37 +45,31 @@ http_interactions: X-Ratelimit-Limit: - '1000' X-Ratelimit-Reset: - - '1435431600' + - '1441832400' X-Ratelimit-Remaining: - - '976' + - '915' Location: - - https://www.bookingsync.com/api/v3/rentals_amenities/4 - Content-Type: - - application/vnd.api+json; charset=utf-8 + - https://www.bookingsync.com/api/v3/rentals_amenities/32833 Etag: - - '"6d9b1011b538671db8c2e682236f7863"' + - '"aba295b26ac136614052adb7f76ac748"' Cache-Control: - max-age=0, private, must-revalidate P3p: - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi OUR SAMi OTRo UNRo PUBi IND UNI STA" Set-Cookie: - - ahoy_track=true; path=/ - - ahoy_visit=e2e3bec0-5907-49c4-97b9-9a85509464be; path=/; expires=Sat, 04 Jul - 2015 18:35:11 -0000 - - ahoy_visitor=8b59983b-51d4-42b5-9ef2-03bcd60331c7; path=/; expires=Tue, 27 - Jun 2017 18:35:11 -0000 + - ahoy_track=true; path=/; secure + - ahoy_visit=94177a9f-c500-4713-98dd-07bd972b8ea3; path=/; expires=Wed, 16 Sep + 2015 20:46:30 -0000; secure + - ahoy_visitor=341d4e5e-6646-474e-ba90-44b131b3e711; path=/; expires=Sat, 09 + Sep 2017 20:46:30 -0000; secure X-Request-Id: - - d149dc81-8acc-4bb8-a155-277ae02c5c0c + - 07e2f4ed-43f5-46ea-b880-9a49153d0e17 X-Runtime: - - '0.040817' - Date: - - Sat, 27 Jun 2015 18:35:11 GMT - Connection: - - close + - '0.080690' body: encoding: UTF-8 - string: '{"links":{"rentals_amenities.amenity":"https://www.bookingsync.com/api/v3/amenities/{rentals_amenities.amenity}","rentals_amenities.rental":"https://www.bookingsync.com/api/v3/rentals/{rentals_amenities.rental}"},"rentals_amenities":[{"links":{"amenity":50,"rental":38},"id":4,"created_at":"2015-06-27T18:35:11Z","updated_at":"2015-06-27T18:35:11Z"}]}' + string: '{"links":{"rentals_amenities.amenity":"https://www.bookingsync.com/api/v3/amenities/{rentals_amenities.amenity}","rentals_amenities.rental":"https://www.bookingsync.com/api/v3/rentals/{rentals_amenities.rental}"},"rentals_amenities":[{"links":{"amenity":44,"rental":5116},"id":32833,"created_at":"2015-09-09T20:46:30Z","updated_at":"2015-09-09T20:46:30Z","details":{"en":"Details"}}]}' http_version: - recorded_at: Sat, 27 Jun 2015 18:35:11 GMT -recorded_with: VCR 2.9.3 + recorded_at: Wed, 09 Sep 2015 20:46:31 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_delete_rentals_amenity/deletes_given_rentals_amenity.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_delete_rentals_amenity/deletes_given_rentals_amenity.yml new file mode 100644 index 00000000..6ed8abc5 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_delete_rentals_amenity/deletes_given_rentals_amenity.yml @@ -0,0 +1,67 @@ +--- +http_interactions: +- request: + method: delete + uri: https://www.bookingsync.com/api/v3/rentals_amenities/32833 + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:48:42 GMT + Connection: + - keep-alive + Status: + - 204 No Content + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '908' + Cache-Control: + - no-cache + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=1a31893f-d2ee-4133-a050-25799a74f033; path=/; expires=Wed, 16 Sep + 2015 20:48:42 -0000; secure + - ahoy_visitor=92d08fcc-e985-4566-b200-179835716c2c; path=/; expires=Sat, 09 + Sep 2017 20:48:42 -0000; secure + X-Request-Id: + - b112bf2c-f281-4e35-a0e1-6275e6fdc69e + X-Runtime: + - '0.069645' + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Wed, 09 Sep 2015 20:48:43 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/returns_newly_created_rental_s_amenity.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_edit_rentals_amenity/updates_given_rentals_amenity_by_ID.yml similarity index 53% rename from spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/returns_newly_created_rental_s_amenity.yml rename to spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_edit_rentals_amenity/updates_given_rentals_amenity_by_ID.yml index 494928eb..93936668 100644 --- a/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/returns_newly_created_rental_s_amenity.yml +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsAmenities/_edit_rentals_amenity/updates_given_rentals_amenity_by_ID.yml @@ -1,14 +1,14 @@ --- http_interactions: - request: - method: post - uri: https://www.bookingsync.com/api/v3/rentals/38/rentals_amenities + method: put + uri: https://www.bookingsync.com/api/v3/rentals_amenities/6159 body: encoding: UTF-8 - string: '{"rentals_amenities":[{"amenity_id":51}]}' + string: '{"rentals_amenities":[{"details_en":"New Details"}]}' headers: User-Agent: - - BookingSync API gem v0.0.25 + - BookingSync API gem v0.0.29 Accept: - application/vnd.api+json Content-Type: @@ -19,9 +19,23 @@ http_interactions: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 response: status: - code: 201 - message: Created + code: 200 + message: OK headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:48:41 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 X-Frame-Options: - SAMEORIGIN X-Xss-Protection: @@ -31,37 +45,30 @@ http_interactions: X-Ratelimit-Limit: - '1000' X-Ratelimit-Reset: - - '1435431600' + - '1441832400' X-Ratelimit-Remaining: - - '975' - Location: - - https://www.bookingsync.com/api/v3/rentals_amenities/5 - Content-Type: - - application/vnd.api+json; charset=utf-8 + - '909' Etag: - - '"2b241bab5594fc4bd2eda9a5fcc84f0e"' + - '"175931c11ccc557ce07e0c60f043b57e"' Cache-Control: - max-age=0, private, must-revalidate P3p: - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi OUR SAMi OTRo UNRo PUBi IND UNI STA" Set-Cookie: - - ahoy_track=true; path=/ - - ahoy_visit=a59bc2ce-d0e3-4dec-8559-cb68823b655e; path=/; expires=Sat, 04 Jul - 2015 18:35:11 -0000 - - ahoy_visitor=5cfda5da-7916-40d3-aadd-a0e104e1b3a6; path=/; expires=Tue, 27 - Jun 2017 18:35:11 -0000 + - ahoy_track=true; path=/; secure + - ahoy_visit=7f5d1946-ad28-474a-b7ae-d6cf8ed9201b; path=/; expires=Wed, 16 Sep + 2015 20:48:41 -0000; secure + - ahoy_visitor=d01538fc-5903-4680-b1b4-4536d654b562; path=/; expires=Sat, 09 + Sep 2017 20:48:41 -0000; secure X-Request-Id: - - 2c550fed-f678-4ad8-ba0e-f45ba0d0f079 + - ff51e414-9f3f-4cdc-bf4e-da017eedf72c X-Runtime: - - '0.039191' - Date: - - Sat, 27 Jun 2015 18:35:11 GMT - Connection: - - close + - '0.126405' body: encoding: UTF-8 - string: '{"links":{"rentals_amenities.amenity":"https://www.bookingsync.com/api/v3/amenities/{rentals_amenities.amenity}","rentals_amenities.rental":"https://www.bookingsync.com/api/v3/rentals/{rentals_amenities.rental}"},"rentals_amenities":[{"links":{"amenity":51,"rental":38},"id":5,"created_at":"2015-06-27T18:35:11Z","updated_at":"2015-06-27T18:35:11Z"}]}' + string: '{"links":{"rentals_amenities.amenity":"https://www.bookingsync.com/api/v3/amenities/{rentals_amenities.amenity}","rentals_amenities.rental":"https://www.bookingsync.com/api/v3/rentals/{rentals_amenities.rental}"},"rentals_amenities":[{"links":{"amenity":32,"rental":5117},"id":6159,"created_at":"2014-08-08T19:30:20Z","updated_at":"2015-09-09T20:48:41Z","details":{"en":"New + Details"}}]}' http_version: - recorded_at: Sat, 27 Jun 2015 18:35:11 GMT -recorded_with: VCR 2.9.3 + recorded_at: Wed, 09 Sep 2015 20:48:42 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_RentalsFees/_rentals_fee/returns_a_single_rentals_fee.yml b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsFees/_rentals_fee/returns_a_single_rentals_fee.yml new file mode 100644 index 00000000..deb143a7 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_RentalsFees/_rentals_fee/returns_a_single_rentals_fee.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/rentals_fees/3306 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 20:51:43 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441832400' + X-Ratelimit-Remaining: + - '900' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"20bf875091c158d9d10ea716afc6f232"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=2498815e-75fe-46bb-bf92-2d24e383b26e; path=/; expires=Wed, 16 Sep + 2015 20:51:43 -0000; secure + - ahoy_visitor=843a55cc-c8bb-4eea-ab90-b7eb825bba4e; path=/; expires=Sat, 09 + Sep 2017 20:51:43 -0000; secure + X-Request-Id: + - f1130800-18f0-46ed-bd2c-7548ea382bce + X-Runtime: + - '0.074364' + body: + encoding: UTF-8 + string: '{"links":{"rentals_fees.fee":"https://www.bookingsync.com/api/v3/fees/{rentals_fees.fee}","rentals_fees.rental":"https://www.bookingsync.com/api/v3/rentals/{rentals_fees.rental}","rentals_fees.seasons":"https://www.bookingsync.com/api/v3/seasons/{rentals_fees.seasons}"},"rentals_fees":[{"links":{"fee":474,"rental":5116,"seasons":[]},"id":3306,"always_applied":true,"end_date":null,"maximum_bookable":2,"public":false,"required":false,"start_date":null,"created_at":"2015-09-09T20:50:47Z","updated_at":"2015-09-09T20:50:47Z","name":{"en":"test + fee"},"rate":"10.0","rate_kind":"fixed"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 20:51:44 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Reviews/_review/returns_a_single_review.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Reviews/_review/returns_a_single_review.yml new file mode 100644 index 00000000..9d8b13e1 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Reviews/_review/returns_a_single_review.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/reviews/34562 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:10:09 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '984' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"304dc9f7ded9014a0841c748d9c9948c"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=6796c566-1a5d-4b7a-a6ad-a07d71c72eb3; path=/; expires=Wed, 16 Sep + 2015 21:10:09 -0000; secure + - ahoy_visitor=3d63cdd6-bdba-42c5-937d-18492a05ffea; path=/; expires=Sat, 09 + Sep 2017 21:10:09 -0000; secure + X-Request-Id: + - 752f6826-b8ed-4fae-b0ef-d0dd38a6f793 + X-Runtime: + - '0.075921' + body: + encoding: UTF-8 + string: '{"links":{"reviews.booking":"https://www.bookingsync.com/api/v3/bookings/{reviews.booking}","reviews.rental":"https://www.bookingsync.com/api/v3/rentals/{reviews.rental}"},"reviews":[{"links":{"booking":142616,"rental":5116},"id":34562,"rating":5,"comment":"test + test test","name":"Gary S.","created_at":"2015-09-09T21:09:28Z","updated_at":"2015-09-09T21:09:28Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:10:10 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_season/returns_a_single_season.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_season/returns_a_single_season.yml new file mode 100644 index 00000000..560d5912 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_season/returns_a_single_season.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/seasons/1803 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:09:27 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '986' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"e8730bc58fc103ac08f78840527c8287"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=6412148d-2e3b-4698-81d5-7a319e35842a; path=/; expires=Wed, 16 Sep + 2015 21:09:27 -0000; secure + - ahoy_visitor=6302d603-8706-491c-8513-0ff27b087561; path=/; expires=Sat, 09 + Sep 2017 21:09:27 -0000; secure + X-Request-Id: + - 45d7ea62-6e0e-4b79-8634-3df9839ac0b3 + X-Runtime: + - '0.097578' + body: + encoding: UTF-8 + string: '{"links":{"seasons.rates_table":"https://www.bookingsync.com/api/v3/rates_tables/{seasons.rates_table}","seasons.rates_rules":"https://www.bookingsync.com/api/v3/rates_rules/{seasons.rates_rules}","seasons.periods":"https://www.bookingsync.com/api/v3/periods/{seasons.periods}"},"seasons":[{"links":{"rates_table":274,"rates_rules":[],"periods":[4735]},"id":1803,"name":{"en":"High + Season"},"ratio_percentage":"89.0","minimum_stay":3,"color_ratio":"1.656","created_at":"2014-08-08T18:29:54Z","updated_at":"2015-01-20T16:31:55Z","color":"#A0D453"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:09:28 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_source/returns_a_single_source.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_source/returns_a_single_source.yml new file mode 100644 index 00000000..b377704b --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_source/returns_a_single_source.yml @@ -0,0 +1,80 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/sources/1874 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:10:57 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '981' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"4ce8b74edc93740d488e6075723e8ed9"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=363b1b61-78c9-47d9-820c-cd560d9cc776; path=/; expires=Wed, 16 Sep + 2015 21:10:57 -0000; secure + - ahoy_visitor=8a773555-a398-4797-bef2-5447a12e4fe1; path=/; expires=Sat, 09 + Sep 2017 21:10:57 -0000; secure + X-Request-Id: + - 9acf76e1-a335-4996-ac68-6c0da4d8ce7b + X-Runtime: + - '0.078050' + body: + encoding: UTF-8 + string: '{"links":{"sources.account":"https://www.bookingsync.com/api/v3/accounts/{sources.account}","sources.bookings":"https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"},"sources":[{"links":{"account":3837,"bookings":[]},"id":1874,"name":"test","created_at":"2015-09-09T21:10:36Z","updated_at":"2015-09-09T21:10:36Z","position":1}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:10:58 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_special_offer/returns_a_single_special_offer.yml b/spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_special_offer/returns_a_single_special_offer.yml new file mode 100644 index 00000000..f06e5c4d --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_special_offer/returns_a_single_special_offer.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/special_offers/86 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:11:39 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '979' + Link: + - ; rel="first", + ; rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"934e1c4b9a67647ee62971c8273eb180"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=3104e7ff-3a28-49dd-a8de-c3944e27cf3d; path=/; expires=Wed, 16 Sep + 2015 21:11:39 -0000; secure + - ahoy_visitor=39e1cc9b-0d07-4fb6-bc37-8f576f31c6ac; path=/; expires=Sat, 09 + Sep 2017 21:11:39 -0000; secure + X-Request-Id: + - d4aa7ad6-1f73-45cb-8206-011b5e6baf24 + X-Runtime: + - '0.104821' + body: + encoding: UTF-8 + string: '{"links":{"special_offers.rental":"https://www.bookingsync.com/api/v3/rentals/{special_offers.rental}"},"special_offers":[{"links":{"rental":5117},"id":86,"name":{"en":"Super + Discount"},"start_date":"2016-01-01","end_date":"2016-01-07","discount":40.0,"created_at":"2014-08-08T21:30:00Z","updated_at":"2014-08-08T21:30:00Z"}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:11:40 GMT +recorded_with: VCR 2.9.2 diff --git a/spec/fixtures/cassettes/BookingSync_API_Client_Taxes/_tax/returns_a_single_tax.yml b/spec/fixtures/cassettes/BookingSync_API_Client_Taxes/_tax/returns_a_single_tax.yml new file mode 100644 index 00000000..fe433c86 --- /dev/null +++ b/spec/fixtures/cassettes/BookingSync_API_Client_Taxes/_tax/returns_a_single_tax.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bookingsync.com/api/v3/taxes/168 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - BookingSync API gem v0.0.29 + Accept: + - application/vnd.api+json + Content-Type: + - application/vnd.api+json + Authorization: + - Bearer <> + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 09 Sep 2015 21:12:28 GMT + Content-Type: + - application/vnd.api+json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Status: + - 200 OK + Strict-Transport-Security: + - max-age=31536000 + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Ratelimit-Limit: + - '1000' + X-Ratelimit-Reset: + - '1441836000' + X-Ratelimit-Remaining: + - '976' + Link: + - ; rel="first", ; + rel="last" + X-Total-Pages: + - '1' + X-Total-Count: + - '1' + Etag: + - '"6f874b4760262ed2d67047ea9b2ab2df"' + Cache-Control: + - max-age=0, private, must-revalidate + P3p: + - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi + OUR SAMi OTRo UNRo PUBi IND UNI STA" + Set-Cookie: + - ahoy_track=true; path=/; secure + - ahoy_visit=b5f2dc23-162b-41ad-a788-1c5ed1e8fd76; path=/; expires=Wed, 16 Sep + 2015 21:12:28 -0000; secure + - ahoy_visitor=f8af51f8-318d-4a24-b319-2b3f1c3e50d6; path=/; expires=Sat, 09 + Sep 2017 21:12:28 -0000; secure + X-Request-Id: + - d8bb754a-22cd-468c-9975-6bb8c418a707 + X-Runtime: + - '0.110388' + body: + encoding: UTF-8 + string: '{"links":{"taxes.account":"https://www.bookingsync.com/api/v3/accounts/{taxes.account}"},"taxes":[{"links":{"account":3837},"id":168,"percentage":"10.0","created_at":"2015-09-09T20:23:54Z","updated_at":"2015-09-09T20:23:54Z","name":{"en":"test + tax"}}]}' + http_version: + recorded_at: Wed, 09 Sep 2015 21:12:29 GMT +recorded_with: VCR 2.9.2