cronofy 0.40.0 → 0.41.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +8 -8
- data/lib/cronofy/auth.rb +1 -1
- data/lib/cronofy/client.rb +60 -31
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/client_spec.rb +95 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70859d7df67d1abfb03702825b4a304a8e2426f7073d9055343559cb9e41e469
|
4
|
+
data.tar.gz: 0f778ceec16c9a4fd9f25a9cc50f6f7957f643aa8e1980e35d7690483f8cdea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b15136e06190b874efc0d32c1cb4efa16bf093c0473faf1ad2fb59f66511ef44069cad5199f1f63e9d05e25e74c6376cd4534c380073ec59b55ddc8ef7f6b7c
|
7
|
+
data.tar.gz: 65256a5f09863beb7d620746e6d5fb9d79242c9d374adba3161c1439a9bb93ebf96cbde2b65c72a81876d03a7abec218ea60cb43e50506a47f9a98a112da39c1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.41.0]
|
2
|
+
|
3
|
+
* Adds support for the query_slots parameter [#111]
|
4
|
+
|
1
5
|
## [0.40.0]
|
2
6
|
|
3
7
|
* Update version of [OAuth2](https://rubygems.org/gems/oauth2) required [#102]
|
@@ -227,6 +231,7 @@
|
|
227
231
|
[0.38.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/0.38.0
|
228
232
|
[0.39.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/0.39.0
|
229
233
|
[0.40.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.40.0
|
234
|
+
[0.41.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.41.0
|
230
235
|
|
231
236
|
[#13]: https://github.com/cronofy/cronofy-ruby/pull/13
|
232
237
|
[#16]: https://github.com/cronofy/cronofy-ruby/pull/16
|
@@ -278,3 +283,4 @@
|
|
278
283
|
[#102]: https://github.com/cronofy/cronofy-ruby/pull/102
|
279
284
|
[#104]: https://github.com/cronofy/cronofy-ruby/pull/104
|
280
285
|
[#108]: https://github.com/cronofy/cronofy-ruby/pull/108
|
286
|
+
[#111]: https://github.com/cronofy/cronofy-ruby/pull/111
|
data/README.md
CHANGED
@@ -45,8 +45,8 @@ When using a [personal access token](https://app.cronofy.com/oauth/applications/
|
|
45
45
|
you only need to provide the `access_token` argument.
|
46
46
|
|
47
47
|
When working against your own OAuth application you will need to provide the
|
48
|
-
`client_id` and `client_secret` when [going through the authorization process](https://
|
49
|
-
for a user, and when [refreshing an access token](https://
|
48
|
+
`client_id` and `client_secret` when [going through the authorization process](https://docs.cronofy.com/developers/api/authorization/request-authorization/)
|
49
|
+
for a user, and when [refreshing an access token](https://docs.cronofy.com/developers/api/authorization/refresh-token/).
|
50
50
|
|
51
51
|
If `client_id` and `client_secret` are not specified explicitly the values from
|
52
52
|
the environment variables `CRONOFY_CLIENT_ID` and `CRONOFY_CLIENT_SECRET` will
|
@@ -56,7 +56,7 @@ be used if present.
|
|
56
56
|
|
57
57
|
## Authorization
|
58
58
|
|
59
|
-
[API documentation](https://
|
59
|
+
[API documentation](https://docs.cronofy.com/developers/api/authorization/request-authorization/)
|
60
60
|
|
61
61
|
Generate a link for a user to grant access to their calendars:
|
62
62
|
|
@@ -83,7 +83,7 @@ to perform this process.
|
|
83
83
|
|
84
84
|
## List calendars
|
85
85
|
|
86
|
-
[API documentation](https://
|
86
|
+
[API documentation](https://docs.cronofy.com/developers/api/calendars/list-calendars/)
|
87
87
|
|
88
88
|
Get a list of all the user's calendars:
|
89
89
|
|
@@ -93,7 +93,7 @@ calendars = cronofy.list_calendars
|
|
93
93
|
|
94
94
|
## Read events
|
95
95
|
|
96
|
-
[API documentation](https://
|
96
|
+
[API documentation](https://docs.cronofy.com/developers/api/events/read-events/)
|
97
97
|
|
98
98
|
Get a list of events from the user's calendars:
|
99
99
|
|
@@ -105,7 +105,7 @@ Note that the gem handles iterating through the pages on your behalf.
|
|
105
105
|
|
106
106
|
## Create or update events
|
107
107
|
|
108
|
-
[API documentation](https://
|
108
|
+
[API documentation](https://docs.cronofy.com/developers/api/events/upsert-event/)
|
109
109
|
|
110
110
|
To create/update an event in the user's calendar:
|
111
111
|
|
@@ -126,7 +126,7 @@ cronofy.upsert_event(calendar_id, event_data)
|
|
126
126
|
|
127
127
|
## Delete events
|
128
128
|
|
129
|
-
[API documentation](https://
|
129
|
+
[API documentation](https://docs.cronofy.com/developers/api/events/delete-event/)
|
130
130
|
|
131
131
|
To delete an event from user's calendar:
|
132
132
|
|
@@ -145,6 +145,6 @@ If you would like to request a feature is added by our team then please let us k
|
|
145
145
|
|
146
146
|
## Links
|
147
147
|
|
148
|
-
* [API documentation](https://
|
148
|
+
* [API documentation](https://docs.cronofy.com/developers/api/)
|
149
149
|
* [API mailing list](https://groups.google.com/d/forum/cronofy-api)
|
150
150
|
|
data/lib/cronofy/auth.rb
CHANGED
@@ -35,7 +35,7 @@ module Cronofy
|
|
35
35
|
# :state - Array of states to retain during the OAuth
|
36
36
|
# authorization process (optional).
|
37
37
|
#
|
38
|
-
# See
|
38
|
+
# See https://docs.cronofy.com/developers/api/authorization/request-authorization/ for reference.
|
39
39
|
#
|
40
40
|
# Returns the URL as a String.
|
41
41
|
def user_auth_link(redirect_uri, options = {})
|
data/lib/cronofy/client.rb
CHANGED
@@ -54,7 +54,7 @@ module Cronofy
|
|
54
54
|
# (default: {}):
|
55
55
|
# :color - The color to make the calendar (optional).
|
56
56
|
#
|
57
|
-
# See https://
|
57
|
+
# See https://docs.cronofy.com/developers/api/calendars/create-calendar/ for reference.
|
58
58
|
#
|
59
59
|
# Returns the created Calendar
|
60
60
|
#
|
@@ -77,7 +77,7 @@ module Cronofy
|
|
77
77
|
|
78
78
|
# Public: Lists all the calendars for the account.
|
79
79
|
#
|
80
|
-
# See
|
80
|
+
# See https://docs.cronofy.com/developers/api/calendars/list-calendars/ for reference.
|
81
81
|
#
|
82
82
|
# Returns an Array of Calendars
|
83
83
|
#
|
@@ -148,7 +148,7 @@ module Cronofy
|
|
148
148
|
# long: "0.1234"
|
149
149
|
# })
|
150
150
|
#
|
151
|
-
# See
|
151
|
+
# See https://docs.cronofy.com/developers/api/events/upsert-event/ for reference.
|
152
152
|
#
|
153
153
|
# Returns nothing.
|
154
154
|
#
|
@@ -214,7 +214,7 @@ module Cronofy
|
|
214
214
|
# The first page will be retrieved eagerly so that common errors will happen
|
215
215
|
# inline. However, subsequent pages (if any) will be requested lazily.
|
216
216
|
#
|
217
|
-
# See
|
217
|
+
# See https://docs.cronofy.com/developers/api/events/read-events/ for reference.
|
218
218
|
#
|
219
219
|
# Returns a lazily-evaluated Enumerable of Events
|
220
220
|
#
|
@@ -262,7 +262,7 @@ module Cronofy
|
|
262
262
|
# The first page will be retrieved eagerly so that common errors will happen
|
263
263
|
# inline. However, subsequent pages (if any) will be requested lazily.
|
264
264
|
#
|
265
|
-
# See
|
265
|
+
# See https://docs.cronofy.com/developers/api/events/free-busy/ for reference.
|
266
266
|
#
|
267
267
|
# Returns a lazily-evaluated Enumerable of FreeBusy
|
268
268
|
#
|
@@ -293,7 +293,7 @@ module Cronofy
|
|
293
293
|
# event_id - A String uniquely identifying the event for your application
|
294
294
|
# (note: this is NOT an ID generated by Cronofy).
|
295
295
|
#
|
296
|
-
# See
|
296
|
+
# See https://docs.cronofy.com/developers/api/events/delete-event/ for reference.
|
297
297
|
#
|
298
298
|
# Returns nothing.
|
299
299
|
#
|
@@ -425,7 +425,7 @@ module Cronofy
|
|
425
425
|
|
426
426
|
# Public: Deletes all events you are managing for the account.
|
427
427
|
#
|
428
|
-
# See https://
|
428
|
+
# See https://docs.cronofy.com/developers/api/events/bulk-delete-events/ for
|
429
429
|
# reference.
|
430
430
|
#
|
431
431
|
# options - The Hash options used to refine the selection (optional):
|
@@ -469,7 +469,7 @@ module Cronofy
|
|
469
469
|
# trigger notifications
|
470
470
|
# (optional).
|
471
471
|
#
|
472
|
-
# See
|
472
|
+
# See https://docs.cronofy.com/developers/api/push-notifications/create-channel/ for reference.
|
473
473
|
#
|
474
474
|
# Returns a Channel.
|
475
475
|
#
|
@@ -520,7 +520,7 @@ module Cronofy
|
|
520
520
|
|
521
521
|
# Public: Lists all the notification channels for the account.
|
522
522
|
#
|
523
|
-
# See
|
523
|
+
# See https://docs.cronofy.com/developers/api/push-notifications/list-channels/ for reference.
|
524
524
|
#
|
525
525
|
# Returns an Array of Channels.
|
526
526
|
#
|
@@ -540,7 +540,7 @@ module Cronofy
|
|
540
540
|
#
|
541
541
|
# channel_id - The String Cronofy ID for the channel to close.
|
542
542
|
#
|
543
|
-
# See
|
543
|
+
# See https://docs.cronofy.com/developers/api/push-notifications/close-channel/ for reference.
|
544
544
|
#
|
545
545
|
# Returns nothing.
|
546
546
|
#
|
@@ -559,7 +559,7 @@ module Cronofy
|
|
559
559
|
|
560
560
|
# Public: Retrieves the details of the account.
|
561
561
|
#
|
562
|
-
# See
|
562
|
+
# See https://docs.cronofy.com/developers/api/identity/account/ for reference.
|
563
563
|
#
|
564
564
|
# Returns an Account.
|
565
565
|
#
|
@@ -577,7 +577,7 @@ module Cronofy
|
|
577
577
|
|
578
578
|
# Public: Lists all the profiles for the account.
|
579
579
|
#
|
580
|
-
# See https://
|
580
|
+
# See https://docs.cronofy.com/developers/api/identity/profile/ for reference.
|
581
581
|
#
|
582
582
|
# Returns an Array of Profiles
|
583
583
|
#
|
@@ -593,7 +593,7 @@ module Cronofy
|
|
593
593
|
|
594
594
|
# Public: Retrieves the userinfo for the account
|
595
595
|
#
|
596
|
-
# See
|
596
|
+
# See https://docs.cronofy.com/developers/api/identity/userinfo/ for
|
597
597
|
# reference.
|
598
598
|
#
|
599
599
|
# Returns an UserInfo.
|
@@ -621,7 +621,7 @@ module Cronofy
|
|
621
621
|
# invite to
|
622
622
|
#
|
623
623
|
#
|
624
|
-
# See
|
624
|
+
# See https://docs.cronofy.com/developers/api/events/delete-event/ for reference.
|
625
625
|
#
|
626
626
|
# Returns nothing.
|
627
627
|
#
|
@@ -687,7 +687,7 @@ module Cronofy
|
|
687
687
|
# :state - Array of states to retain during the OAuth
|
688
688
|
# authorization process (optional).
|
689
689
|
#
|
690
|
-
# See
|
690
|
+
# See https://docs.cronofy.com/developers/api/authorization/request-authorization/ for reference.
|
691
691
|
#
|
692
692
|
# Returns the URL as a String.
|
693
693
|
def user_auth_link(redirect_url, options = {})
|
@@ -702,7 +702,7 @@ module Cronofy
|
|
702
702
|
# redirect_url - A String specifing the URL the user returned to once they
|
703
703
|
# had completed the authorization steps.
|
704
704
|
#
|
705
|
-
# See
|
705
|
+
# See https://docs.cronofy.com/developers/api/authorization/request-token/ for reference.
|
706
706
|
#
|
707
707
|
# Returns a set of Cronofy::Credentials for the account.
|
708
708
|
#
|
@@ -720,7 +720,7 @@ module Cronofy
|
|
720
720
|
# these usually occur when the access token has expired and needs
|
721
721
|
# refreshing.
|
722
722
|
#
|
723
|
-
# See
|
723
|
+
# See https://docs.cronofy.com/developers/api/authorization/refresh-token/ for reference.
|
724
724
|
#
|
725
725
|
# Returns a set of Cronofy::Credentials for the account.
|
726
726
|
#
|
@@ -735,7 +735,7 @@ module Cronofy
|
|
735
735
|
|
736
736
|
# Public: Obtains access to an application calendar
|
737
737
|
#
|
738
|
-
# See
|
738
|
+
# See https://docs.cronofy.com/developers/api/calendars/application-calendars/ for reference.
|
739
739
|
#
|
740
740
|
# Returns a set of Cronofy::Credentials for the account.
|
741
741
|
#
|
@@ -753,7 +753,7 @@ module Cronofy
|
|
753
753
|
# After making this call the Client will become unusable. You should also
|
754
754
|
# delete the stored credentials used to create this instance.
|
755
755
|
#
|
756
|
-
# See
|
756
|
+
# See https://docs.cronofy.com/developers/api/authorization/revoke/ for
|
757
757
|
# reference.
|
758
758
|
#
|
759
759
|
# Returns nothing.
|
@@ -835,8 +835,10 @@ module Cronofy
|
|
835
835
|
# each must specify a start and end Time.
|
836
836
|
# :start_interval - An Integer representing the start interval
|
837
837
|
# of minutes for the availability query.
|
838
|
-
# :buffer -
|
838
|
+
# :buffer - A Hash containing the buffer to apply to
|
839
839
|
# the availability query.
|
840
|
+
# :query_slots - A Hash containing the query slots to be
|
841
|
+
# used in the availability query.
|
840
842
|
#
|
841
843
|
# Returns an Array of AvailablePeriods.
|
842
844
|
#
|
@@ -861,7 +863,13 @@ module Cronofy
|
|
861
863
|
options[:buffer] = map_availability_buffer(buffer)
|
862
864
|
end
|
863
865
|
|
864
|
-
|
866
|
+
if query_periods = options[:query_periods] || options[:available_periods]
|
867
|
+
translate_available_periods(query_periods)
|
868
|
+
end
|
869
|
+
|
870
|
+
if query_slots = options[:query_slots]
|
871
|
+
translate_query_slots(query_slots)
|
872
|
+
end
|
865
873
|
|
866
874
|
response = availability_post("/v1/availability", options)
|
867
875
|
|
@@ -979,7 +987,7 @@ module Cronofy
|
|
979
987
|
# long: "0.1234"
|
980
988
|
# })
|
981
989
|
#
|
982
|
-
# See
|
990
|
+
# See https://docs.cronofy.com/developers/api/events/upsert-event/ for reference.
|
983
991
|
#
|
984
992
|
# Returns a AddToCalendarResponse.
|
985
993
|
#
|
@@ -1052,7 +1060,9 @@ module Cronofy
|
|
1052
1060
|
# call
|
1053
1061
|
# :required_duration - A hash stating the length of time the event will
|
1054
1062
|
# last for
|
1055
|
-
# :query_periods - A
|
1063
|
+
# :query_periods - A Hash stating the available periods for the event
|
1064
|
+
# :query_slots - A Hash containing the query slots to be
|
1065
|
+
# used in the availability query.
|
1056
1066
|
# :start_interval - An Integer representing the start interval
|
1057
1067
|
# of minutes for the availability query.
|
1058
1068
|
# :buffer - An Hash containing the buffer to apply to
|
@@ -1099,7 +1109,7 @@ module Cronofy
|
|
1099
1109
|
# }]
|
1100
1110
|
# )
|
1101
1111
|
#
|
1102
|
-
# See
|
1112
|
+
# See https://docs.cronofy.com/developers/api/scheduling/real-time-scheduling/ for reference.
|
1103
1113
|
#
|
1104
1114
|
# Returns a AddToCalendarResponse.
|
1105
1115
|
#
|
@@ -1129,7 +1139,14 @@ module Cronofy
|
|
1129
1139
|
end
|
1130
1140
|
end
|
1131
1141
|
|
1132
|
-
|
1142
|
+
if query_periods = availability[:query_periods] || availability[:available_periods]
|
1143
|
+
translate_available_periods(query_periods)
|
1144
|
+
end
|
1145
|
+
|
1146
|
+
if query_slots = availability[:query_slots]
|
1147
|
+
translate_query_slots(query_slots)
|
1148
|
+
end
|
1149
|
+
|
1133
1150
|
body[:availability] = availability
|
1134
1151
|
|
1135
1152
|
response = raw_post("/v1/real_time_scheduling", body)
|
@@ -1278,7 +1295,7 @@ module Cronofy
|
|
1278
1295
|
|
1279
1296
|
# Public: Creates a link_token to allow explicitly linking of an account
|
1280
1297
|
#
|
1281
|
-
# See https://
|
1298
|
+
# See https://docs.cronofy.com/developers/api-alpha/explicit-linking/ for
|
1282
1299
|
# reference.
|
1283
1300
|
#
|
1284
1301
|
# Returns a link token
|
@@ -1295,7 +1312,7 @@ module Cronofy
|
|
1295
1312
|
|
1296
1313
|
# Public: Revokes the authorization to the given profile.
|
1297
1314
|
#
|
1298
|
-
# See https://
|
1315
|
+
# See https://docs.cronofy.com/developers/api/authorization/revoke-profile/ for
|
1299
1316
|
# reference.
|
1300
1317
|
#
|
1301
1318
|
# Returns nothing.
|
@@ -1373,7 +1390,7 @@ module Cronofy
|
|
1373
1390
|
# }
|
1374
1391
|
# )
|
1375
1392
|
#
|
1376
|
-
# See
|
1393
|
+
# See https://docs.cronofy.com/developers/api/smart-invites/create-smart-invite/ for reference.
|
1377
1394
|
#
|
1378
1395
|
# Returns a SmartInviteResponse.
|
1379
1396
|
#
|
@@ -1400,7 +1417,7 @@ module Cronofy
|
|
1400
1417
|
# :email - A String for thee email address you are
|
1401
1418
|
# going to send the Smart Invite to.
|
1402
1419
|
#
|
1403
|
-
# See
|
1420
|
+
# See https://docs.cronofy.com/developers/api/smart-invites/cancel-invite/ for reference.
|
1404
1421
|
#
|
1405
1422
|
# Returns a SmartInviteResponse.
|
1406
1423
|
#
|
@@ -1448,7 +1465,7 @@ module Cronofy
|
|
1448
1465
|
# by Cronofy).
|
1449
1466
|
# recipient_email - The email address for the recipient to get details for.
|
1450
1467
|
#
|
1451
|
-
# See
|
1468
|
+
# See https://docs.cronofy.com/developers/api/smart-invites/invite-status/ for reference.
|
1452
1469
|
#
|
1453
1470
|
# Returns a SmartInviteResponse.
|
1454
1471
|
#
|
@@ -1522,7 +1539,7 @@ module Cronofy
|
|
1522
1539
|
# ]
|
1523
1540
|
# )
|
1524
1541
|
#
|
1525
|
-
# See
|
1542
|
+
# See https://docs.cronofy.com/developers/api/scheduling/availability-rules/ for reference.
|
1526
1543
|
#
|
1527
1544
|
# Returns an AvailabilityRuleResponse.
|
1528
1545
|
#
|
@@ -1717,6 +1734,14 @@ module Cronofy
|
|
1717
1734
|
end
|
1718
1735
|
end
|
1719
1736
|
|
1737
|
+
def translate_query_slots(query_slots)
|
1738
|
+
query_slots.each do |params|
|
1739
|
+
QUERY_SLOTS_TIME_PARAMS.select { |tp| params.key?(tp) }.each do |tp|
|
1740
|
+
params[tp] = to_iso8601(params[tp])
|
1741
|
+
end
|
1742
|
+
end
|
1743
|
+
end
|
1744
|
+
|
1720
1745
|
def map_availability_participants(participants)
|
1721
1746
|
case participants
|
1722
1747
|
when Hash
|
@@ -1847,6 +1872,10 @@ module Cronofy
|
|
1847
1872
|
end
|
1848
1873
|
}.freeze
|
1849
1874
|
|
1875
|
+
QUERY_SLOTS_TIME_PARAMS = %i{
|
1876
|
+
start
|
1877
|
+
}.freeze
|
1878
|
+
|
1850
1879
|
FREE_BUSY_DEFAULT_PARAMS = { tzid: "Etc/UTC" }.freeze
|
1851
1880
|
FREE_BUSY_TIME_PARAMS = %i{
|
1852
1881
|
from
|
data/lib/cronofy/version.rb
CHANGED
@@ -1783,6 +1783,51 @@ describe Cronofy::Client do
|
|
1783
1783
|
it_behaves_like 'a Cronofy request with mapped return value'
|
1784
1784
|
end
|
1785
1785
|
|
1786
|
+
context 'when given query_slots instead of available_periods with start interval' do
|
1787
|
+
let(:participants) do
|
1788
|
+
{ members: %w{acc_567236000909002 acc_678347111010113} }
|
1789
|
+
end
|
1790
|
+
|
1791
|
+
let(:required_duration) { 60 }
|
1792
|
+
|
1793
|
+
let(:query_slots) do
|
1794
|
+
[
|
1795
|
+
{ start: Time.parse("2017-01-03T09:00:00Z")},
|
1796
|
+
{ start: Time.parse("2017-01-04T09:00:00Z") },
|
1797
|
+
]
|
1798
|
+
end
|
1799
|
+
|
1800
|
+
let(:request_body) do
|
1801
|
+
{
|
1802
|
+
"participants" => [
|
1803
|
+
{
|
1804
|
+
"members" => [
|
1805
|
+
{ "sub" => "acc_567236000909002" },
|
1806
|
+
{ "sub" => "acc_678347111010113" }
|
1807
|
+
],
|
1808
|
+
"required" => "all"
|
1809
|
+
}
|
1810
|
+
],
|
1811
|
+
"query_slots" => [
|
1812
|
+
{ "start" => "2017-01-03T09:00:00Z" },
|
1813
|
+
{ "start" => "2017-01-04T09:00:00Z" }
|
1814
|
+
],
|
1815
|
+
"required_duration" => { "minutes" => 60 },
|
1816
|
+
}
|
1817
|
+
end
|
1818
|
+
|
1819
|
+
subject do
|
1820
|
+
client.availability(
|
1821
|
+
participants: participants,
|
1822
|
+
required_duration: required_duration,
|
1823
|
+
query_slots: query_slots
|
1824
|
+
)
|
1825
|
+
end
|
1826
|
+
|
1827
|
+
it_behaves_like 'a Cronofy request'
|
1828
|
+
it_behaves_like 'a Cronofy request with mapped return value'
|
1829
|
+
end
|
1830
|
+
|
1786
1831
|
context "when trying to auth with only an access_token, as originally implemented" do
|
1787
1832
|
let(:access_token) { "access_token_123"}
|
1788
1833
|
let(:client) { Cronofy::Client.new(access_token: access_token) }
|
@@ -2363,6 +2408,56 @@ describe Cronofy::Client do
|
|
2363
2408
|
mapped_availability[:query_periods] = mapped_availability.delete(:available_periods)
|
2364
2409
|
end
|
2365
2410
|
end
|
2411
|
+
|
2412
|
+
context 'when passing query slots' do
|
2413
|
+
let(:availability) do
|
2414
|
+
{
|
2415
|
+
participants: [
|
2416
|
+
{
|
2417
|
+
members: [{
|
2418
|
+
sub: "acc_567236000909002",
|
2419
|
+
calendar_ids: ["cal_n23kjnwrw2_jsdfjksn234"]
|
2420
|
+
}],
|
2421
|
+
required: 'all'
|
2422
|
+
}
|
2423
|
+
],
|
2424
|
+
required_duration: { minutes: 60 },
|
2425
|
+
query_slots: [
|
2426
|
+
{ start: Time.utc(2017, 1, 1, 9, 00) },
|
2427
|
+
{ start: Time.utc(2017, 1, 1, 17, 00) }
|
2428
|
+
],
|
2429
|
+
buffer: {
|
2430
|
+
before: { minutes: 30 },
|
2431
|
+
after: { minutes: 45 },
|
2432
|
+
}
|
2433
|
+
}
|
2434
|
+
end
|
2435
|
+
|
2436
|
+
let(:mapped_availability) do
|
2437
|
+
{
|
2438
|
+
participants: [
|
2439
|
+
{
|
2440
|
+
members: [{
|
2441
|
+
sub: "acc_567236000909002",
|
2442
|
+
calendar_ids: ["cal_n23kjnwrw2_jsdfjksn234"]
|
2443
|
+
}],
|
2444
|
+
required: 'all'
|
2445
|
+
}
|
2446
|
+
],
|
2447
|
+
required_duration: { minutes: 60 },
|
2448
|
+
buffer: {
|
2449
|
+
before: { minutes: 30 },
|
2450
|
+
after: { minutes: 45 },
|
2451
|
+
},
|
2452
|
+
query_slots: [
|
2453
|
+
{ start: Time.utc(2017, 1, 1, 9, 00) },
|
2454
|
+
{ start: Time.utc(2017, 1, 1, 17, 00) }
|
2455
|
+
],
|
2456
|
+
}
|
2457
|
+
it_behaves_like 'a Cronofy request'
|
2458
|
+
it_behaves_like 'a Cronofy request with mapped return value'
|
2459
|
+
end
|
2460
|
+
end
|
2366
2461
|
end
|
2367
2462
|
|
2368
2463
|
describe "#get_real_time_scheduling_status" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronofy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.41.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergii Paryzhskyi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashie
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.2.33
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Cronofy - the scheduling platform for business
|