bookingsync-api 1.1.0 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19a563dd183bbdcdfbceb5be9665ef5a2671e8b3ab48bc2f4ae364ebc263450b
4
- data.tar.gz: 4b816566334c7c60da5433815cb9f8014448914d7f0560aa87b650432c109928
3
+ metadata.gz: 77712b294f809ae4db266f8b9b86b413c37c5930867c41901c28b9ddeada66e4
4
+ data.tar.gz: cf83e35ff3ff5d828eedcc5b7b3a1a4d488365ee5a98ee5705c128742e184a13
5
5
  SHA512:
6
- metadata.gz: c1bbbecf812ca989b599a76062e983f6745f80ca02b74e81ecea4665bbc2736369fa68f3b491c68a913370251c589125ee1ceeceb75fa3e96097567be088d457
7
- data.tar.gz: 8c7236ad450eb3c7c94dba200bcd8458a1bfb157c731f483f8f2ebf09a7611698377f54d4b37fc59b4bec9430aee9843176c9b6a7150d748672f51d1570b5753
6
+ metadata.gz: ea5aa7568560d912b3cb66afa0e5a179797666be9c42562a7408381e9922863afc4883a977a4cff749245e7e72f52608d5d1caeb2f0828f9b787ec9cf6e368a1
7
+ data.tar.gz: 2bf3db0f2b86e119712dac32d7ec3a47c60b1b32363b69d4bb95253f5d92ad6fda666be476bb60771ca8176d58fc76435daffd8548a52b3c904d4b848eacfa28
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  # master
4
4
 
5
+ ## 1.2.0
6
+
7
+ - Add support for `restore` action for `rental_urls`.
8
+
5
9
  ## 1.1.0
6
10
 
7
11
  - Add support for `host_reviews` endpoint.
@@ -62,6 +62,16 @@ module BookingSync::API
62
62
  delete "rental_urls/#{rental_url}"
63
63
  end
64
64
 
65
+ # Restore a RentalUrl
66
+ #
67
+ # @param rental_url [BookingSync::API::Resource|Integer] RentalUrl or ID
68
+ # of the rental_url to be canceled.
69
+ # @return [BookingSync::API::Resource] Restored rental_url on success,
70
+ # exception is raised otherwise.
71
+ def restore_rental_url(rental_url)
72
+ put("rental_urls/#{rental_url}/restore").pop
73
+ end
74
+
65
75
  private
66
76
 
67
77
  def base_64_encode(file_path)
@@ -1,5 +1,5 @@
1
1
  module BookingSync
2
2
  module API
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -80,4 +80,13 @@ describe BookingSync::API::Client::RentalUrls do
80
80
  assert_requested :delete, bs_url("rental_urls/#{created_rental_url_id}")
81
81
  end
82
82
  end
83
+
84
+ describe "#restore_rental_url", :vcr do
85
+ let(:rental_url_id) { "e3511ab6-0976-44a7-befe-3e1e08d6f924" }
86
+
87
+ it "restores given rental_url" do
88
+ client.restore_rental_url(rental_url_id)
89
+ assert_requested :put, bs_url("rental_urls/#{rental_url_id}/restore")
90
+ end
91
+ end
83
92
  end
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://www.bookingsync.com/api/v3/rental_urls/e3511ab6-0976-44a7-befe-3e1e08d6f924/restore
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - BookingSync API gem v1.1.0
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
+ Connection:
21
+ - keep-alive
22
+ Keep-Alive:
23
+ - '30'
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - max-age=0, private, must-revalidate
31
+ Content-Length:
32
+ - '529'
33
+ Content-Type:
34
+ - application/vnd.api+json; charset=utf-8
35
+ Etag:
36
+ - W/"871faa247f344cff8c07babb2402549d"
37
+ Referrer-Policy:
38
+ - strict-origin-when-cross-origin
39
+ Vary:
40
+ - Accept, Origin
41
+ X-Content-Type-Options:
42
+ - nosniff
43
+ X-Download-Options:
44
+ - noopen
45
+ X-Frame-Options:
46
+ - SAMEORIGIN
47
+ X-Permitted-Cross-Domain-Policies:
48
+ - none
49
+ X-Ratelimit-Limit:
50
+ - '1000'
51
+ X-Ratelimit-Remaining:
52
+ - '999'
53
+ X-Ratelimit-Reset:
54
+ - '1718103600'
55
+ X-Request-Id:
56
+ - bdcc44cc-cab4-4d25-afd4-8cbc37642cc4
57
+ X-Runtime:
58
+ - '0.822478'
59
+ X-Updated-Since-Request-Synced-At:
60
+ - 2024-06-11 10:10:21 UTC
61
+ X-Xss-Protection:
62
+ - 1; mode=block
63
+ Date:
64
+ - Tue, 11 Jun 2024 10:10:21 GMT
65
+ body:
66
+ encoding: UTF-8
67
+ string: '{"links":{"rental_urls.rental":"https://www.bookingsync.com/api/v3/api/v3/rentals/{rental_urls.rental}","rental_urls.account":"https://www.bookingsync.com/api/v3/api/v3/accounts/{rental_urls.account}"},"rental_urls":[{"links":{"account":1,"rental":1},"id":"e3511ab6-0976-44a7-befe-3e1e08d6f924","label":"Website
68
+ Builder - Test website","url":"https://1wymanyost.us.example.com/en/rentals/1-rental-in-nevache","lock":{"record":"","attributes":{}},"canceled_at":null,"created_at":"2024-06-05T12:33:13Z","updated_at":"2024-06-11T10:10:21Z"}],"meta":{}}'
69
+ http_version:
70
+ recorded_at: Tue, 11 Jun 2024 10:10:21 GMT
71
+ recorded_with: VCR 5.0.0
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: 1.1.0
4
+ version: 1.2.0
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: 2023-08-02 00:00:00.000000000 Z
11
+ date: 2024-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -425,6 +425,7 @@ files:
425
425
  - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_rental_url/returns_rental_url.yml
426
426
  - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_rental_urls/links/returns_associated_rental.yml
427
427
  - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_rental_urls/returns_rental_urls.yml
428
+ - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_restore_rental_url/restores_given_rental_url.yml
428
429
  - spec/fixtures/cassettes/BookingSync_API_Client_Rentals/_create_rental/creates_a_new_rental.yml
429
430
  - spec/fixtures/cassettes/BookingSync_API_Client_Rentals/_delete_rental/deletes_given_rental.yml
430
431
  - spec/fixtures/cassettes/BookingSync_API_Client_Rentals/_edit_rental/updates_given_rental_by_ID.yml
@@ -505,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
505
506
  - !ruby/object:Gem::Version
506
507
  version: '0'
507
508
  requirements: []
508
- rubygems_version: 3.3.26
509
+ rubygems_version: 3.4.10
509
510
  signing_key:
510
511
  specification_version: 4
511
512
  summary: Ruby interface for accessing https://www.bookingsync.com
@@ -730,6 +731,7 @@ test_files:
730
731
  - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_rental_url/returns_rental_url.yml
731
732
  - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_rental_urls/links/returns_associated_rental.yml
732
733
  - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_rental_urls/returns_rental_urls.yml
734
+ - spec/fixtures/cassettes/BookingSync_API_Client_RentalUrls/_restore_rental_url/restores_given_rental_url.yml
733
735
  - spec/fixtures/cassettes/BookingSync_API_Client_Rentals/_create_rental/creates_a_new_rental.yml
734
736
  - spec/fixtures/cassettes/BookingSync_API_Client_Rentals/_delete_rental/deletes_given_rental.yml
735
737
  - spec/fixtures/cassettes/BookingSync_API_Client_Rentals/_edit_rental/updates_given_rental_by_ID.yml