bookingsync-api 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/bookingsync/api/client.rb +2 -0
- data/lib/bookingsync/api/client/bookings.rb +9 -0
- data/lib/bookingsync/api/client/rentals.rb +10 -10
- data/lib/bookingsync/api/client/sources.rb +44 -0
- data/lib/bookingsync/api/version.rb +1 -1
- data/spec/bookingsync/api/client/bookings_spec.rb +7 -0
- data/spec/bookingsync/api/client/sources_spec.rb +52 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_booking/returns_a_single_booking.yml +70 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_create_source/creates_a_new_source.yml +72 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_edit_source/updates_given_source_by_ID.yml +69 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_sources/returns_sources.yml +72 -0
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f68b038f70e4a6ed18872606dec27cb0a157299b
|
4
|
+
data.tar.gz: c39304fb24cbc4f7b6037758cdd7c79d3de6d673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cdf5afc116ad99e6266ac917828634039df44ccadd0fe65a7ccac0b98a74879c594a286d9a6e1580532c423ecf05db8c7036f2f04ad79e5cd99f88a33800dbd
|
7
|
+
data.tar.gz: 36bde532b7e2d19e6e542eeb0fc5ce0ca63af998b601a6b8edeedb20c9efa33c25a76dc40e5e3d29da28842547308323b3e5f6eae2227d44e8508433c438742e
|
data/README.md
CHANGED
@@ -51,7 +51,7 @@ Some endpoints return additional info about resource in meta section. To fetch i
|
|
51
51
|
access last response.
|
52
52
|
|
53
53
|
api.rentals(updated_since: "2014-01-01 15:43:96 UTC") # => [BookingSync::API::Resource, BookingSync::API::Resource, ...]
|
54
|
-
api.last_response.meta # => {"
|
54
|
+
api.last_response.meta # => {"deleted_ids" => [1, 3, 4]}
|
55
55
|
|
56
56
|
### Logging
|
57
57
|
|
@@ -20,6 +20,7 @@ require "bookingsync/api/client/rental_agreements"
|
|
20
20
|
require "bookingsync/api/client/reviews"
|
21
21
|
require "bookingsync/api/client/seasons"
|
22
22
|
require "bookingsync/api/client/special_offers"
|
23
|
+
require "bookingsync/api/client/sources"
|
23
24
|
require "bookingsync/api/error"
|
24
25
|
require "bookingsync/api/relation"
|
25
26
|
require "bookingsync/api/response"
|
@@ -50,6 +51,7 @@ module BookingSync::API
|
|
50
51
|
include BookingSync::API::Client::Reviews
|
51
52
|
include BookingSync::API::Client::Seasons
|
52
53
|
include BookingSync::API::Client::SpecialOffers
|
54
|
+
include BookingSync::API::Client::Sources
|
53
55
|
|
54
56
|
MEDIA_TYPE = "application/vnd.api+json"
|
55
57
|
|
@@ -30,6 +30,15 @@ module BookingSync::API
|
|
30
30
|
paginate :bookings, options, &block
|
31
31
|
end
|
32
32
|
|
33
|
+
# Get a single booking
|
34
|
+
#
|
35
|
+
# @param booking [BookingSync::API::Resource|Integer] Booking or ID
|
36
|
+
# of the booking.
|
37
|
+
# @return [BookingSync::API::Resource]
|
38
|
+
def booking(booking)
|
39
|
+
get("bookings/#{booking}").pop
|
40
|
+
end
|
41
|
+
|
33
42
|
# Create a booking
|
34
43
|
#
|
35
44
|
# @param rental [BookingSync::API::Resource|Integer] Rental or ID of
|
@@ -34,6 +34,15 @@ module BookingSync::API
|
|
34
34
|
paginate path, options, &block
|
35
35
|
end
|
36
36
|
|
37
|
+
# Get a single rental
|
38
|
+
#
|
39
|
+
# @param rental [BookingSync::API::Resource|Integer] Rental or ID
|
40
|
+
# of the rental.
|
41
|
+
# @return [BookingSync::API::Resource]
|
42
|
+
def rental(rental)
|
43
|
+
get("rentals/#{rental}").pop
|
44
|
+
end
|
45
|
+
|
37
46
|
# Create a new rental
|
38
47
|
#
|
39
48
|
# @param options [Hash] rental attributes
|
@@ -64,15 +73,6 @@ module BookingSync::API
|
|
64
73
|
delete "rentals/#{rental}"
|
65
74
|
end
|
66
75
|
|
67
|
-
# Get a single rental
|
68
|
-
#
|
69
|
-
# @param rental [BookingSync::API::Resource|Integer] Rental or ID
|
70
|
-
# of the rental.
|
71
|
-
# @return [BookingSync::API::Resource]
|
72
|
-
def rental(rental)
|
73
|
-
get("rentals/#{rental}").pop
|
74
|
-
end
|
75
|
-
|
76
76
|
# Get meta information about rentals.
|
77
77
|
#
|
78
78
|
# @param rentals [Array] IDs of Rentals, leave empty for all account's rentals
|
@@ -82,4 +82,4 @@ module BookingSync::API
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
85
|
-
end
|
85
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module BookingSync::API
|
2
|
+
class Client
|
3
|
+
module Sources
|
4
|
+
# List sources
|
5
|
+
#
|
6
|
+
# Returns sources for the account user is authenticated with.
|
7
|
+
# @param options [Hash] A customizable set of options.
|
8
|
+
# @option options [Array] fields: List of fields to be fetched.
|
9
|
+
# @return [Array<BookingSync::API::Resource>] Array of sources.
|
10
|
+
#
|
11
|
+
# @example Get the list of sources for the current account
|
12
|
+
# sources = @api.sources
|
13
|
+
# sources.first.name # => "HomeAway.com"
|
14
|
+
# @example Get the list of sources only with name and account_id for smaller response
|
15
|
+
# @api.sources(fields: [:name, :account_id])
|
16
|
+
# @see http://docs.api.bookingsync.com/reference/endpoints/sources/#list-sources
|
17
|
+
def sources(options = {}, &block)
|
18
|
+
paginate :sources, options, &block
|
19
|
+
end
|
20
|
+
|
21
|
+
# Create a new source
|
22
|
+
#
|
23
|
+
# @param options [Hash] source attributes
|
24
|
+
# @return [BookingSync::API::Resource] Newly created source
|
25
|
+
def create_source(options = {})
|
26
|
+
post(:sources, sources: [options]).pop
|
27
|
+
end
|
28
|
+
|
29
|
+
# Edit a source
|
30
|
+
#
|
31
|
+
# @param source [BookingSync::API::Resource|Integer] source or
|
32
|
+
# ID of the source to be updated
|
33
|
+
# @param options [Hash] source attributes to be updated
|
34
|
+
# @return [BookingSync::API::Resource] Updated source on success,
|
35
|
+
# exception is raised otherwise
|
36
|
+
# @example
|
37
|
+
# source = @api.sources.first
|
38
|
+
# @api.edit_source(source, { name: "Lorem" })
|
39
|
+
def edit_source(source, options = {})
|
40
|
+
put("sources/#{source}", sources: [options]).pop
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -37,6 +37,13 @@ describe BookingSync::API::Client::Bookings do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe ".booking", :vcr do
|
41
|
+
it "returns a single booking" do
|
42
|
+
booking = client.booking(20)
|
43
|
+
expect(booking.status).to eq "Booked"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
40
47
|
describe ".create_booking", :vcr do
|
41
48
|
let(:attributes) {
|
42
49
|
{start_at: '2014-01-03', end_at: '2014-01-04',
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe BookingSync::API::Client::Sources do
|
4
|
+
|
5
|
+
let(:client) { BookingSync::API::Client.new(test_access_token) }
|
6
|
+
|
7
|
+
describe ".sources", :vcr do
|
8
|
+
it "returns sources" do
|
9
|
+
expect(client.sources).not_to be_empty
|
10
|
+
assert_requested :get, bs_url("sources")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe ".create_source", :vcr do
|
15
|
+
let(:attributes) {
|
16
|
+
{ name: 'New source' }
|
17
|
+
}
|
18
|
+
|
19
|
+
it "creates a new source" do
|
20
|
+
client.create_source(attributes)
|
21
|
+
assert_requested :post, bs_url("sources"),
|
22
|
+
body: { sources: [attributes] }.to_json
|
23
|
+
end
|
24
|
+
|
25
|
+
it "returns newly created source" do
|
26
|
+
VCR.use_cassette('BookingSync_API_Client_Sources/_create_source/creates_a_new_source') do
|
27
|
+
source = client.create_source(attributes)
|
28
|
+
expect(source.name).to eql(attributes[:name])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe ".edit_source", :vcr do
|
34
|
+
let(:attributes) {
|
35
|
+
{ name: 'HomeAway.com' }
|
36
|
+
}
|
37
|
+
|
38
|
+
it "updates given source by ID" do
|
39
|
+
client.edit_source(4, attributes)
|
40
|
+
assert_requested :put, bs_url("sources/4"),
|
41
|
+
body: { sources: [attributes] }.to_json
|
42
|
+
end
|
43
|
+
|
44
|
+
it "returns updated source" do
|
45
|
+
VCR.use_cassette('BookingSync_API_Client_Sources/_edit_source/updates_given_source_by_ID') do
|
46
|
+
source = client.edit_source(4, attributes)
|
47
|
+
expect(source).to be_kind_of(BookingSync::API::Resource)
|
48
|
+
expect(source.name).to eql(attributes[:name])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_booking/returns_a_single_booking.yml
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.bookingsync.com/api/v3/bookings/20
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- BookingSync API gem v0.0.20
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
X-Frame-Options:
|
26
|
+
- SAMEORIGIN
|
27
|
+
X-Xss-Protection:
|
28
|
+
- 1; mode=block
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
X-Ua-Compatible:
|
32
|
+
- chrome=1
|
33
|
+
X-Ratelimit-Limit:
|
34
|
+
- '1000'
|
35
|
+
X-Ratelimit-Reset:
|
36
|
+
- '1410710400'
|
37
|
+
X-Ratelimit-Remaining:
|
38
|
+
- '996'
|
39
|
+
Link:
|
40
|
+
- <https://www.bookingsync.com/api/v3/bookings/20?page=1>; rel="first", <https://www.bookingsync.com/api/v3/bookings/20?page=1>;
|
41
|
+
rel="last"
|
42
|
+
X-Total-Pages:
|
43
|
+
- '1'
|
44
|
+
Access-Control-Allow-Origin:
|
45
|
+
- "*"
|
46
|
+
Access-Control-Request-Method:
|
47
|
+
- "*"
|
48
|
+
Content-Type:
|
49
|
+
- application/vnd.api+json; charset=utf-8
|
50
|
+
Etag:
|
51
|
+
- '"90e551291052efcb67155a7388ec2377"'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
P3p:
|
55
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
56
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
57
|
+
X-Request-Id:
|
58
|
+
- d7277cf4-544a-4324-9bef-7552098e01b2
|
59
|
+
X-Runtime:
|
60
|
+
- '0.050735'
|
61
|
+
Date:
|
62
|
+
- Sun, 14 Sep 2014 15:08:06 GMT
|
63
|
+
Connection:
|
64
|
+
- close
|
65
|
+
body:
|
66
|
+
encoding: UTF-8
|
67
|
+
string: '{"links":{"bookings.account":"http:\/\/www.bookingsync.com\/api\/v3\/accounts\/{bookings.account}","bookings.rental":"http:\/\/www.bookingsync.com\/api\/v3\/rentals\/{bookings.rental}","bookings.client":"http:\/\/www.bookingsync.com\/api\/v3\/clients\/{bookings.client}","bookings.rental_agreement":"http:\/\/www.bookingsync.com\/api\/v3\/rental_agreements\/{bookings.rental_agreement}","bookings.source":"http:\/\/www.bookingsync.com\/api\/v3\/sources\/{bookings.source}"},"bookings":[{"links":{"account":1,"rental":1,"client":15,"rental_agreement":null,"source":null},"id":20,"start_at":"2014-09-14T16:00:00Z","end_at":"2014-09-28T10:00:00Z","status":"Booked","updated_at":"2014-06-12T22:25:02Z","booked":true,"unavailable":false,"tentative_expires_at":null,"initial_price":"3000.0","discount":null,"final_price":"3000.0","deposit":null,"currency":"USD","notes":"","adults":5,"children":null,"bookings_payments_count":0,"review_requests_count":0,"locked":null,"created_at":"2014-06-12T22:25:02Z","canceled_at":null}],"meta":{}}'
|
68
|
+
http_version:
|
69
|
+
recorded_at: Sun, 14 Sep 2014 15:08:06 GMT
|
70
|
+
recorded_with: VCR 2.9.0
|
data/spec/fixtures/cassettes/BookingSync_API_Client_Sources/_create_source/creates_a_new_source.yml
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://www.bookingsync.com/api/v3/sources
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sources":[{"name":"New source"}]}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- BookingSync API gem v0.0.20
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Content-Type:
|
26
|
+
- application/vnd.api+json; charset=utf-8
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Status:
|
32
|
+
- 201 Created
|
33
|
+
X-Ratelimit-Limit:
|
34
|
+
- '1000'
|
35
|
+
X-Ratelimit-Reset:
|
36
|
+
- '1407834000'
|
37
|
+
X-Ratelimit-Remaining:
|
38
|
+
- '986'
|
39
|
+
Location:
|
40
|
+
- https://www.bookingsync.com/api/v3/sources/5
|
41
|
+
Access-Control-Allow-Origin:
|
42
|
+
- "*"
|
43
|
+
Access-Control-Request-Method:
|
44
|
+
- "*"
|
45
|
+
X-Ua-Compatible:
|
46
|
+
- IE=Edge
|
47
|
+
Etag:
|
48
|
+
- '"278b3f3a81462353f1306a2d10a8139e"'
|
49
|
+
Cache-Control:
|
50
|
+
- max-age=0, private, must-revalidate
|
51
|
+
P3p:
|
52
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
53
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
54
|
+
Set-Cookie:
|
55
|
+
- _BookingSync_session=5925a3849a5b36467db4f17172d86080; path=/; secure; HttpOnly
|
56
|
+
X-Request-Id:
|
57
|
+
- 7e6e678dda873c57f8422af75fca84f0
|
58
|
+
X-Runtime:
|
59
|
+
- '0.064200'
|
60
|
+
X-Powered-By:
|
61
|
+
- Phusion Passenger 4.0.45
|
62
|
+
Date:
|
63
|
+
- Tue, 12 Aug 2014 08:19:30 GMT
|
64
|
+
Server:
|
65
|
+
- nginx/1.6.0 + Phusion Passenger 4.0.45
|
66
|
+
body:
|
67
|
+
encoding: UTF-8
|
68
|
+
string: '{"links":{"sources.account":"https:\/\/www.bookingsync.com\/api\/v3\/accounts\/{sources.account}"},"sources":[{"links":{"account":1},"id":5,"name":"New
|
69
|
+
source","created_at":"2014-08-12T08:19:30Z","updated_at":"2014-08-12T08:19:30Z"}]}'
|
70
|
+
http_version:
|
71
|
+
recorded_at: Tue, 12 Aug 2014 08:19:30 GMT
|
72
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,69 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://www.bookingsync.com/api/v3/sources/4
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sources":[{"name":"HomeAway.com"}]}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- BookingSync API gem v0.0.20
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Content-Type:
|
26
|
+
- application/vnd.api+json; charset=utf-8
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Status:
|
32
|
+
- 200 OK
|
33
|
+
X-Ratelimit-Limit:
|
34
|
+
- '1000'
|
35
|
+
X-Ratelimit-Reset:
|
36
|
+
- '1407834000'
|
37
|
+
X-Ratelimit-Remaining:
|
38
|
+
- '985'
|
39
|
+
Access-Control-Allow-Origin:
|
40
|
+
- "*"
|
41
|
+
Access-Control-Request-Method:
|
42
|
+
- "*"
|
43
|
+
X-Ua-Compatible:
|
44
|
+
- IE=Edge
|
45
|
+
Etag:
|
46
|
+
- '"a64025ec46c4a7a989b9908f693c4655"'
|
47
|
+
Cache-Control:
|
48
|
+
- max-age=0, private, must-revalidate
|
49
|
+
P3p:
|
50
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
51
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
52
|
+
Set-Cookie:
|
53
|
+
- _BookingSync_session=0f043d2d78d818d2fe076b2c49de6d81; path=/; secure; HttpOnly
|
54
|
+
X-Request-Id:
|
55
|
+
- 994d008624497efc0687ab76902292ac
|
56
|
+
X-Runtime:
|
57
|
+
- '0.067016'
|
58
|
+
X-Powered-By:
|
59
|
+
- Phusion Passenger 4.0.45
|
60
|
+
Date:
|
61
|
+
- Tue, 12 Aug 2014 08:19:30 GMT
|
62
|
+
Server:
|
63
|
+
- nginx/1.6.0 + Phusion Passenger 4.0.45
|
64
|
+
body:
|
65
|
+
encoding: UTF-8
|
66
|
+
string: '{"links":{"sources.account":"https:\/\/www.bookingsync.com\/api\/v3\/accounts\/{sources.account}"},"sources":[{"links":{"account":1},"id":4,"name":"HomeAway.com","created_at":"2014-08-12T08:15:25Z","updated_at":"2014-08-12T08:19:30Z"}]}'
|
67
|
+
http_version:
|
68
|
+
recorded_at: Tue, 12 Aug 2014 08:19:30 GMT
|
69
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,72 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.bookingsync.com/api/v3/sources
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- BookingSync API gem v0.0.20
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Content-Type:
|
26
|
+
- application/vnd.api+json; charset=utf-8
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Status:
|
32
|
+
- 200 OK
|
33
|
+
X-Ratelimit-Limit:
|
34
|
+
- '1000'
|
35
|
+
X-Ratelimit-Reset:
|
36
|
+
- '1407834000'
|
37
|
+
X-Ratelimit-Remaining:
|
38
|
+
- '987'
|
39
|
+
Link:
|
40
|
+
- <https://www.bookingsync.com/api/v3/sources?page=1>; rel="first", <https://www.bookingsync.com/api/v3/sources?page=1>;
|
41
|
+
rel="last"
|
42
|
+
X-Total-Pages:
|
43
|
+
- '1'
|
44
|
+
Access-Control-Allow-Origin:
|
45
|
+
- "*"
|
46
|
+
Access-Control-Request-Method:
|
47
|
+
- "*"
|
48
|
+
X-Ua-Compatible:
|
49
|
+
- IE=Edge
|
50
|
+
Etag:
|
51
|
+
- '"171b714f1005a07e3d0419b2b28c3bd1"'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
P3p:
|
55
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
56
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
57
|
+
X-Request-Id:
|
58
|
+
- 5b3e8f255c918fbb7c83908330bb0939
|
59
|
+
X-Runtime:
|
60
|
+
- '0.117154'
|
61
|
+
X-Powered-By:
|
62
|
+
- Phusion Passenger 4.0.45
|
63
|
+
Date:
|
64
|
+
- Tue, 12 Aug 2014 08:19:30 GMT
|
65
|
+
Server:
|
66
|
+
- nginx/1.6.0 + Phusion Passenger 4.0.45
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"links":{"sources.account":"https:\/\/www.bookingsync.com\/api\/v3\/accounts\/{sources.account}"},"sources":[{"links":{"account":1},"id":4,"name":"test","created_at":"2014-08-12T08:15:25Z","updated_at":"2014-08-12T08:18:47Z"}]}'
|
70
|
+
http_version:
|
71
|
+
recorded_at: Tue, 12 Aug 2014 08:19:30 GMT
|
72
|
+
recorded_with: VCR 2.9.2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookingsync-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sébastien Grosjean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/bookingsync/api/client/rentals_amenities.rb
|
119
119
|
- lib/bookingsync/api/client/reviews.rb
|
120
120
|
- lib/bookingsync/api/client/seasons.rb
|
121
|
+
- lib/bookingsync/api/client/sources.rb
|
121
122
|
- lib/bookingsync/api/client/special_offers.rb
|
122
123
|
- lib/bookingsync/api/error.rb
|
123
124
|
- lib/bookingsync/api/middleware/authentication.rb
|
@@ -146,6 +147,7 @@ files:
|
|
146
147
|
- spec/bookingsync/api/client/rentals_spec.rb
|
147
148
|
- spec/bookingsync/api/client/reviews_spec.rb
|
148
149
|
- spec/bookingsync/api/client/seasons_spec.rb
|
150
|
+
- spec/bookingsync/api/client/sources_spec.rb
|
149
151
|
- spec/bookingsync/api/client/special_offers_spec.rb
|
150
152
|
- spec/bookingsync/api/client_spec.rb
|
151
153
|
- spec/bookingsync/api/error_spec.rb
|
@@ -157,6 +159,7 @@ files:
|
|
157
159
|
- spec/fixtures/cassettes/BookingSync_API_Client_Amenities/_amenity/returns_amenity.yml
|
158
160
|
- spec/fixtures/cassettes/BookingSync_API_Client_Availabilities/_availabilities/returns_availabilities.yml
|
159
161
|
- spec/fixtures/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml
|
162
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_booking/returns_a_single_booking.yml
|
160
163
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_a_block/yields_block_with_batch_of_bookings.yml
|
161
164
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_auto_paginate_true/returns_all_bookings_joined_from_many_requests.yml
|
162
165
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_per_page_setting/returns_limited_number_of_bookings.yml
|
@@ -219,6 +222,9 @@ files:
|
|
219
222
|
- spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_delete_season/deletes_given_season.yml
|
220
223
|
- spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_edit_season/updates_given_season_by_ID.yml
|
221
224
|
- spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_seasons/returns_seasons.yml
|
225
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Sources/_create_source/creates_a_new_source.yml
|
226
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Sources/_edit_source/updates_given_source_by_ID.yml
|
227
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Sources/_sources/returns_sources.yml
|
222
228
|
- spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_create_special_offer/creates_a_new_special_offer.yml
|
223
229
|
- spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_delete_special_offer/deletes_given_special_offer.yml
|
224
230
|
- spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_edit_special_offer/updates_given_special_offer_by_ID.yml
|
@@ -270,6 +276,7 @@ test_files:
|
|
270
276
|
- spec/bookingsync/api/client/rentals_spec.rb
|
271
277
|
- spec/bookingsync/api/client/reviews_spec.rb
|
272
278
|
- spec/bookingsync/api/client/seasons_spec.rb
|
279
|
+
- spec/bookingsync/api/client/sources_spec.rb
|
273
280
|
- spec/bookingsync/api/client/special_offers_spec.rb
|
274
281
|
- spec/bookingsync/api/client_spec.rb
|
275
282
|
- spec/bookingsync/api/error_spec.rb
|
@@ -281,6 +288,7 @@ test_files:
|
|
281
288
|
- spec/fixtures/cassettes/BookingSync_API_Client_Amenities/_amenity/returns_amenity.yml
|
282
289
|
- spec/fixtures/cassettes/BookingSync_API_Client_Availabilities/_availabilities/returns_availabilities.yml
|
283
290
|
- spec/fixtures/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml
|
291
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_booking/returns_a_single_booking.yml
|
284
292
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_a_block/yields_block_with_batch_of_bookings.yml
|
285
293
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_auto_paginate_true/returns_all_bookings_joined_from_many_requests.yml
|
286
294
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_per_page_setting/returns_limited_number_of_bookings.yml
|
@@ -343,6 +351,9 @@ test_files:
|
|
343
351
|
- spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_delete_season/deletes_given_season.yml
|
344
352
|
- spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_edit_season/updates_given_season_by_ID.yml
|
345
353
|
- spec/fixtures/cassettes/BookingSync_API_Client_Seasons/_seasons/returns_seasons.yml
|
354
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Sources/_create_source/creates_a_new_source.yml
|
355
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Sources/_edit_source/updates_given_source_by_ID.yml
|
356
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Sources/_sources/returns_sources.yml
|
346
357
|
- spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_create_special_offer/creates_a_new_special_offer.yml
|
347
358
|
- spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_delete_special_offer/deletes_given_special_offer.yml
|
348
359
|
- spec/fixtures/cassettes/BookingSync_API_Client_SpecialOffers/_edit_special_offer/updates_given_special_offer_by_ID.yml
|