bookingsync-api 0.0.34 → 0.0.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c042d61d721bdc02c7659bd39f177976d3b78787
4
- data.tar.gz: 166f4da37304fc6600bebcb25b1d224d391f7df4
3
+ metadata.gz: 9d2e50d31a5abaa08bb9d9e801ef634a8bafa785
4
+ data.tar.gz: d7b21a025efe71856e8be1d40540436f8fff3e9e
5
5
  SHA512:
6
- metadata.gz: 817f039bd587b7373b968941e72dfc3f2ba9de1fa4519afa8758fe46f88ac177dea6548641cc620c35ab317919648204e61a818120a5a538a7b0f3ba67923fe5
7
- data.tar.gz: 70ce3a4107f8aaa413de882204277ab78617b1a8d752e27f68ebaf867ab8b5a3b42a85014ec4197648f384e5f39dbc3ea0a3a9c265c8ee7882b6ef2875e90ed9
6
+ metadata.gz: 987a3a2f52d85f257832d3a140e91afbcb34e9fa2dec70d37a8d7922e98a93fc3f7ea7d2472c250dd6c0d4e64e0941da4f75d5953b6eb5544062e164f5d76c10
7
+ data.tar.gz: a307b7b927185016a71cc9403aea23938c96bfb88dc76989ae478d9433a7b058aa493f576689caf8cd99a2057648e7d3aad0faf057a5fbf3cf6ab311fb417b08
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## master
4
+
5
+ ## 0.0.35
6
+
7
+ - Add support for preferences_general_settings reading and updating.
8
+
3
9
  ## 0.0.34
4
10
 
5
11
  - Fixed documentation urls
@@ -15,6 +15,7 @@ require "bookingsync/api/client/inquiries"
15
15
  require "bookingsync/api/client/strict_bookings"
16
16
  require "bookingsync/api/client/periods"
17
17
  require "bookingsync/api/client/payments"
18
+ require "bookingsync/api/client/preferences_general_settings"
18
19
  require "bookingsync/api/client/preferences_payments"
19
20
  require "bookingsync/api/client/photos"
20
21
  require "bookingsync/api/client/rates"
@@ -58,6 +59,7 @@ module BookingSync::API
58
59
  include BookingSync::API::Client::StrictBookings
59
60
  include BookingSync::API::Client::Periods
60
61
  include BookingSync::API::Client::Payments
62
+ include BookingSync::API::Client::PreferencesGeneralSettings
61
63
  include BookingSync::API::Client::PreferencesPayments
62
64
  include BookingSync::API::Client::Photos
63
65
  include BookingSync::API::Client::Rates
@@ -0,0 +1,36 @@
1
+ module BookingSync::API
2
+ class Client
3
+ module PreferencesGeneralSettings
4
+ # List preferences general settings
5
+ #
6
+ # Returns preferences general settings 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 preferences general settings.
10
+ #
11
+ # @example Get the list of preferences general settings for the current account
12
+ # preferences_general_settings = @api.preferences_general_settings
13
+ # preferences_general_settings.first.email # => "test@example.com"
14
+ # @example Get the list of preferences general settings only with email for smaller response
15
+ # @api.preferences_general_settings(fields: [:email])
16
+ def preferences_general_settings(options = {}, &block)
17
+ paginate :preferences_general_settings, options, &block
18
+ end
19
+
20
+ # Edit a preferences general setting
21
+ #
22
+ # @param preferences_general_setting [BookingSync::API::Resource|Integer]
23
+ # PreferencesGeneralSetting or ID of the preferences_general_setting to be updated
24
+ # @param options [Hash] preferences_general_setting attributes to be updated
25
+ # @return [BookingSync::API::Resource] Updated preferences_general_setting on success,
26
+ # exception is raised otherwise
27
+ # @example
28
+ # preferences_general_setting = @api.preferences_general_settings.first
29
+ # @api.edit_preferences_general_setting(preferences_general_setting, { selected_locales: ["fr"] })
30
+ def edit_preferences_general_setting(preferences_general_setting, options = {})
31
+ put("preferences_general_settings/#{preferences_general_setting}",
32
+ preferences_general_settings: [options]).pop
33
+ end
34
+ end
35
+ end
36
+ end
@@ -20,5 +20,3 @@ module BookingSync::API
20
20
  end
21
21
  end
22
22
  end
23
-
24
-
@@ -1,5 +1,5 @@
1
1
  module BookingSync
2
2
  module API
3
- VERSION = "0.0.34"
3
+ VERSION = "0.0.35"
4
4
  end
5
5
  end
@@ -0,0 +1,28 @@
1
+ require "spec_helper"
2
+
3
+ describe BookingSync::API::Client::PreferencesGeneralSettings do
4
+ let(:api) { BookingSync::API::Client.new(test_access_token) }
5
+
6
+ describe ".preferences_general_settings", :vcr do
7
+ it "returns preferences_general_settings" do
8
+ expect(api.preferences_general_settings).not_to be_empty
9
+ assert_requested :get, bs_url("preferences_general_settings")
10
+ end
11
+ end
12
+
13
+ describe ".edit_preferences_general_setting", :vcr do
14
+ it "updates given preferences_general_setting by ID" do
15
+ api.edit_preferences_general_setting(1, selected_locales: ["de"])
16
+ assert_requested :put, bs_url("preferences_general_settings/1"),
17
+ body: { preferences_general_settings: [{ selected_locales: ["de"] }] }.to_json
18
+ end
19
+
20
+ it "returns updated preferences_general_setting" do
21
+ VCR.use_cassette('BookingSync_API_Client_PreferencesGeneralSettings/_edit_preferences_general_setting/updates_given_preferences_general_setting_by_ID') do
22
+ setting = api.edit_preferences_general_setting(1, selected_locales: ["de"])
23
+ expect(setting).to be_kind_of(BookingSync::API::Resource)
24
+ expect(setting.selected_locales).to eq ["en", "de"]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,74 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://bookingsync.dev/api/v3/preferences_general_settings/1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"preferences_general_settings":[{"selected_locales":["de"]}]}'
9
+ headers:
10
+ User-Agent:
11
+ - BookingSync API gem v0.0.34
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
+ Cache-Control:
34
+ - max-age=0, private, must-revalidate
35
+ X-Ratelimit-Limit:
36
+ - '999999999'
37
+ X-Ratelimit-Reset:
38
+ - '1456401600'
39
+ X-Ratelimit-Remaining:
40
+ - '999999993'
41
+ X-Xss-Protection:
42
+ - 1; mode=block
43
+ X-Request-Id:
44
+ - 90077382-397e-4c33-be05-0ffa2cf5b3f9
45
+ P3p:
46
+ - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
47
+ OUR SAMi OTRo UNRo PUBi IND UNI STA"
48
+ Etag:
49
+ - '"e3db2f1a78163e38b740d0d4c8a3a9c5"'
50
+ X-Frame-Options:
51
+ - SAMEORIGIN
52
+ X-Runtime:
53
+ - '0.029907'
54
+ X-Content-Type-Options:
55
+ - nosniff
56
+ Date:
57
+ - Thu, 25 Feb 2016 11:24:20 GMT
58
+ Set-Cookie:
59
+ - ahoy_track=true; path=/
60
+ - ahoy_visit=150f64bd-d424-464d-8ead-e3365016c17e; path=/; expires=Thu, 03 Mar
61
+ 2016 11:24:20 -0000
62
+ - ahoy_visitor=3be0895b-31a9-4663-96ae-52b2bd833103; path=/; expires=Sun, 25
63
+ Feb 2018 11:24:20 -0000
64
+ X-Powered-By:
65
+ - Phusion Passenger 5.0.22
66
+ Server:
67
+ - nginx/1.8.0 + Phusion Passenger 5.0.22
68
+ body:
69
+ encoding: UTF-8
70
+ string: '{"links":{"preferences_general_settings.account":"http://bookingsync.dev/api/v3/accounts/{preferences_general_settings.account}"},"preferences_general_settings":[{"links":{"account":1},"id":1,"email":"demo_en@bookingsync.com","default_arrival_time":16,"default_departure_time":10,"selected_locales":["en","de"],"business_name":"Your
71
+ Business Name","website":"","phone":"","mobile":"","fax":"","address1":"","address2":"","city":"","state":"","zip":"","country":null,"full_address":""}]}'
72
+ http_version:
73
+ recorded_at: Thu, 25 Feb 2016 11:24:20 GMT
74
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://bookingsync.dev/api/v3/preferences_general_settings
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - BookingSync API gem v0.0.34
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-Total-Pages:
34
+ - '1'
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Ratelimit-Limit:
38
+ - '999999999'
39
+ X-Ratelimit-Reset:
40
+ - '1456401600'
41
+ X-Ratelimit-Remaining:
42
+ - '999999996'
43
+ X-Xss-Protection:
44
+ - 1; mode=block
45
+ X-Request-Id:
46
+ - 41dec199-098b-443a-aa44-61f926617b83
47
+ Link:
48
+ - <http://bookingsync.dev/api/v3/preferences_general_settings?page=1>; rel="first",
49
+ <http://bookingsync.dev/api/v3/preferences_general_settings?page=1>; rel="last"
50
+ P3p:
51
+ - CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
52
+ OUR SAMi OTRo UNRo PUBi IND UNI STA"
53
+ Etag:
54
+ - '"21bed650d44806b60fec55a09ea45ff0"'
55
+ X-Frame-Options:
56
+ - SAMEORIGIN
57
+ X-Total-Count:
58
+ - '1'
59
+ X-Content-Type-Options:
60
+ - nosniff
61
+ X-Runtime:
62
+ - '0.054475'
63
+ Date:
64
+ - Thu, 25 Feb 2016 11:20:40 GMT
65
+ Set-Cookie:
66
+ - ahoy_track=true; path=/
67
+ - ahoy_visit=8b082a2b-b28e-45ad-bbf5-280e53f4c83b; path=/; expires=Thu, 03 Mar
68
+ 2016 11:20:40 -0000
69
+ - ahoy_visitor=3e53ffaa-10f1-4b02-b3d6-a80ad1607a56; path=/; expires=Sun, 25
70
+ Feb 2018 11:20:40 -0000
71
+ X-Powered-By:
72
+ - Phusion Passenger 5.0.22
73
+ Server:
74
+ - nginx/1.8.0 + Phusion Passenger 5.0.22
75
+ body:
76
+ encoding: UTF-8
77
+ string: '{"links":{"preferences_general_settings.account":"http://bookingsync.dev/api/v3/accounts/{preferences_general_settings.account}"},"preferences_general_settings":[{"links":{"account":1},"id":1,"email":"demo_en@bookingsync.com","default_arrival_time":16,"default_departure_time":10,"selected_locales":["de"],"business_name":"Your
78
+ Business Name","website":"","phone":"","mobile":"","fax":"","address1":"","address2":"","city":"","state":"","zip":"","country":null,"full_address":""}]}'
79
+ http_version:
80
+ recorded_at: Thu, 25 Feb 2016 11:20:40 GMT
81
+ 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.34
4
+ version: 0.0.35
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: 2016-01-21 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -116,6 +116,7 @@ files:
116
116
  - lib/bookingsync/api/client/payments.rb
117
117
  - lib/bookingsync/api/client/periods.rb
118
118
  - lib/bookingsync/api/client/photos.rb
119
+ - lib/bookingsync/api/client/preferences_general_settings.rb
119
120
  - lib/bookingsync/api/client/preferences_payments.rb
120
121
  - lib/bookingsync/api/client/rates.rb
121
122
  - lib/bookingsync/api/client/rates_rules.rb
@@ -155,6 +156,7 @@ files:
155
156
  - spec/bookingsync/api/client/payments_spec.rb
156
157
  - spec/bookingsync/api/client/periods_spec.rb
157
158
  - spec/bookingsync/api/client/photos_spec.rb
159
+ - spec/bookingsync/api/client/preferences_general_settings_spec.rb
158
160
  - spec/bookingsync/api/client/preferences_payments_spec.rb
159
161
  - spec/bookingsync/api/client/rates_rules_spec.rb
160
162
  - spec/bookingsync/api/client/rates_spec.rb
@@ -239,6 +241,8 @@ files:
239
241
  - spec/fixtures/cassettes/BookingSync_API_Client_Photos/_edit_photo/updates_photo_s_image_file.yml
240
242
  - spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photo/returns_a_single_photo.yml
241
243
  - spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photos/returns_photos.yml
244
+ - spec/fixtures/cassettes/BookingSync_API_Client_PreferencesGeneralSettings/_edit_preferences_general_setting/updates_given_preferences_general_setting_by_ID.yml
245
+ - spec/fixtures/cassettes/BookingSync_API_Client_PreferencesGeneralSettings/_preferences_general_settings/returns_preferences_general_settings.yml
242
246
  - spec/fixtures/cassettes/BookingSync_API_Client_PreferencesPayments/_preferences_payments/returns_preferences_payments.yml
243
247
  - spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rate/returns_a_single_rate.yml
244
248
  - spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rates/returns_rates.yml
@@ -326,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
330
  version: '0'
327
331
  requirements: []
328
332
  rubyforge_project:
329
- rubygems_version: 2.4.3
333
+ rubygems_version: 2.4.8
330
334
  signing_key:
331
335
  specification_version: 4
332
336
  summary: Ruby interface for accessing https://www.bookingsync.com
@@ -347,6 +351,7 @@ test_files:
347
351
  - spec/bookingsync/api/client/payments_spec.rb
348
352
  - spec/bookingsync/api/client/periods_spec.rb
349
353
  - spec/bookingsync/api/client/photos_spec.rb
354
+ - spec/bookingsync/api/client/preferences_general_settings_spec.rb
350
355
  - spec/bookingsync/api/client/preferences_payments_spec.rb
351
356
  - spec/bookingsync/api/client/rates_rules_spec.rb
352
357
  - spec/bookingsync/api/client/rates_spec.rb
@@ -431,6 +436,8 @@ test_files:
431
436
  - spec/fixtures/cassettes/BookingSync_API_Client_Photos/_edit_photo/updates_photo_s_image_file.yml
432
437
  - spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photo/returns_a_single_photo.yml
433
438
  - spec/fixtures/cassettes/BookingSync_API_Client_Photos/_photos/returns_photos.yml
439
+ - spec/fixtures/cassettes/BookingSync_API_Client_PreferencesGeneralSettings/_edit_preferences_general_setting/updates_given_preferences_general_setting_by_ID.yml
440
+ - spec/fixtures/cassettes/BookingSync_API_Client_PreferencesGeneralSettings/_preferences_general_settings/returns_preferences_general_settings.yml
434
441
  - spec/fixtures/cassettes/BookingSync_API_Client_PreferencesPayments/_preferences_payments/returns_preferences_payments.yml
435
442
  - spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rate/returns_a_single_rate.yml
436
443
  - spec/fixtures/cassettes/BookingSync_API_Client_Rates/_rates/returns_rates.yml