calendly 0.7.0 → 0.8.2

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: 7ba1370ffbfb35b34a37f514d94f48879a20a2ee5b33ebb1791969883a7303a7
4
- data.tar.gz: 5deec005ae70cdbf6f864c7ed7eec03d8186ef3127452f4221e9c9e3863f7c8d
3
+ metadata.gz: c72f1c342babfaaadb025cafe9738afd5883312c08b00cc1d2631152539c3a5c
4
+ data.tar.gz: c1e14541f08bfa9f3aaf77cb6a9a6cfb063141775329f1f5dd3acdbe0058dd67
5
5
  SHA512:
6
- metadata.gz: 9de051c920eb9480c7c337829c75d4a81ce8690fb95c30ba0e8a493677886de52581bbae1d4dc926274f1a6ccb0dfcecf6ea184770b358c3fccf948d64a8d459
7
- data.tar.gz: a4f7068f0bbddf86699506133cebbeb1a8871a9f7523eac8e67e443a458367f1f5fc3de10b6d078801f8d502efe31bd20fb6c5d52fcbb0c588024b8ca1625fab
6
+ metadata.gz: 766d16471b9810138706a85cb964341ce8763a3cb79d0e30506221501d61208655fb5ab594d7793b65bb67fbe3a5d2c44759aae8d245ecfb0563f0d24858ad14
7
+ data.tar.gz: 705a7fd917f0502640092c10f8776a572e68cda2824c4fa3ab3df9e2664ea410486ccb6a12db5eeaee08e6c6dc85f7852a7d81ab34a849589f683c436799674d
data/CHANGELOG.md CHANGED
@@ -1,11 +1,60 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 0.7.0
3
+ ## 0.8.2 - 2022-02-26
4
4
 
5
- - supported a signing key parameter when creating webhooks. (#33)
5
+ - support cancellation field in the response of scheduled event endpoints. (#41)
6
+
7
+ ## 0.8.1 - 2021-10-20
8
+
9
+ - support new UUID format like 'bbc4f475-6125-435a-b713-2d1634651e10'. (#38, thanks to jameswilliamiii)
10
+
11
+ ## 0.8.0 - 2021-06-03
12
+
13
+ - used keyword arguments for optional parameters, to be friendly for programmer.
14
+ - changed methods are followings:
15
+ - Client
16
+ - event_types
17
+ - event_types_by_user
18
+ - scheduled_events
19
+ - scheduled_events_by_user
20
+ - event_invitees
21
+ - memberships
22
+ - memberships_by_user
23
+ - invitations
24
+ - webhooks
25
+ - user_scope_webhooks
26
+ - create_schedule_link
27
+ - Event
28
+ - invitees
29
+ - invitees!
30
+ - EventType
31
+ - create_schedule_link
32
+ - Organization
33
+ - memberships
34
+ - memberships!
35
+ - invitations
36
+ - invitations!
37
+ - event_types
38
+ - event_types!
39
+ - scheduled_events
40
+ - scheduled_events!
41
+ - webhooks
42
+ - webhooks!
43
+ - OrganizationMembership
44
+ - user_scope_webhooks
45
+ - user_scope_webhooks!
46
+ - User
47
+ - event_types
48
+ - scheduled_events
49
+ - webhooks
50
+ - webhooks!
51
+
52
+ ## 0.7.0 - 2021-06-03
53
+
54
+ - supported a signing key parameter when creating webhooks. (#33, thanks to ismael-texidor)
6
55
  - changed `user_uri` argument to keyword argument on Client#create_webhook.
7
56
 
8
- ## 0.6.0
57
+ ## 0.6.0 - 2021-05-30
9
58
 
10
59
  - supported new features until April 2021. (#29)
11
60
  - Client
@@ -43,16 +92,16 @@
43
92
  - fixed debug log encoding error. (#30)
44
93
  - improved inspect method to be more readable in CLI.
45
94
 
46
- ## 0.5.2
95
+ ## 0.5.2 - 2020-12-13
47
96
 
48
97
  - started to support a API
49
98
  - `POST /scheduling_links`
50
99
 
51
- ## 0.5.1
100
+ ## 0.5.1 - 2020-12-13
52
101
 
53
102
  - added method EventType#fetch
54
103
 
55
- ## 0.5.0
104
+ ## 0.5.0 - 2020-12-13
56
105
 
57
106
  - changed Calendly::Client#scheduled_events behavior (refs #21)
58
107
  - previous version:
@@ -61,7 +110,7 @@
61
110
  - getting all events belonging to a specific ORGANIZATION
62
111
  - added Calendly::Client#scheduled_events_by_user method instead_of the before behavior
63
112
 
64
- ## 0.4.2
113
+ ## 0.4.2 - 2020-11-26
65
114
 
66
115
  - added new following fields to Invitee model (refs #21)
67
116
  - :rescheduled
@@ -70,24 +119,24 @@
70
119
  - :cancel_url
71
120
  - :reschedule_url
72
121
 
73
- ## 0.4.1
122
+ ## 0.4.1 - 2020-11-22
74
123
 
75
124
  - started to support a API
76
125
  - `GET /event_types/{uuid}`
77
126
 
78
- ## 0.4.0
127
+ ## 0.4.0 - 2020-11-21
79
128
 
80
129
  - fixed a changes for Location fields such as `kind` to `type`. (refs #18)
81
130
 
82
- ## 0.3.0
131
+ ## 0.3.0 - 2020-11-18
83
132
 
84
133
  - removed zeitwerk dependency. (refs #16)
85
134
 
86
- ## 0.2.0
135
+ ## 0.2.0 - 2020-09-18
87
136
 
88
137
  - added caching features in object when fetching data. (refs #14)
89
138
 
90
- ## 0.1.3
139
+ ## 0.1.3 - 2020-09-17
91
140
 
92
141
  - support webhook APIs (refs #9)
93
142
  - `GET /webhook_subscriptions`
@@ -95,34 +144,34 @@
95
144
  - `POST /webhook_subscriptions`
96
145
  - `DELETE /webhook_subscriptions/{webhook_uuid}`
97
146
 
98
- ## 0.1.2
147
+ ## 0.1.2 - 2020-09-03
99
148
 
100
149
  - fixed rubocop warnings.
101
150
 
102
- ## 0.1.1
151
+ ## 0.1.1 - 2020-08-27
103
152
 
104
153
  - added tests to make coverage 100%.
105
154
 
106
- ## 0.1.0
155
+ ## 0.1.0 - 2020-08-25
107
156
 
108
157
  - defined methods to access associated resources with each model.
109
158
  - renamed methods:
110
159
  - `Calendly::Client#events` to `Calendly::Client#scheduled_events`
111
160
 
112
- ## 0.0.7.alpha
161
+ ## 0.0.7.alpha - 2020-08-23
113
162
 
114
163
  - started to support APIs
115
164
  - `POST /organizations/{uuid}/invitations`
116
165
  - `DELETE /organizations/{org_uuid}/invitations/{invitation_uuid}`
117
166
  - `DELETE /organization_memberships/{uuid}`
118
167
 
119
- ## 0.0.6.alpha
168
+ ## 0.0.6.alpha - 2020-08-22
120
169
 
121
170
  - started to support APIs
122
171
  - `GET /organizations/{uuid}/invitations`
123
172
  - `GET /organizations/{organization_uuid}/invitations/{invitation_uuid}`
124
173
 
125
- ## 0.0.5.alpha
174
+ ## 0.0.5.alpha - 2020-08-22
126
175
 
127
176
  - started to support APIs
128
177
  - `GET /organization_memberships`
@@ -131,24 +180,24 @@
131
180
  - Invitee#event to Invitee#event_uri
132
181
  - Event#event_type to Event#event_type_uri
133
182
 
134
- ## 0.0.4.alpha
183
+ ## 0.0.4.alpha - 2020-08-22
135
184
 
136
185
  - started to support APIs
137
186
  - `GET /scheduled_events/{event_uuid}/invitees`
138
187
  - `GET /scheduled_events/{event_uuid}/invitees/{invitee_uuid}`
139
188
 
140
- ## 0.0.3.alpha
189
+ ## 0.0.3.alpha - 2020-08-19
141
190
 
142
191
  - started to support APIs
143
192
  - `GET /scheduled_events`
144
193
  - `GET /scheduled_events/{uuid}`
145
194
 
146
- ## 0.0.2.alpha
195
+ ## 0.0.2.alpha - 2020-08-12
147
196
 
148
197
  - started to support APIs
149
198
  - `GET /event_types`
150
199
 
151
- ## 0.0.1.alpha
200
+ ## 0.0.1.alpha - 2020-08-09
152
201
 
153
202
  - Initial release
154
203
  - started to support a API
data/README.md CHANGED
@@ -145,7 +145,7 @@ This library supports a configurable logger.
145
145
  ```ruby
146
146
  # if the log level set :debug, you can get the request/response information.
147
147
  Calendly.configuration.logger.level = :debug
148
- invitation = my_org.create_invitation('foobar@example.com')
148
+ invitation = org.create_invitation('foobar@example.com')
149
149
  # D, [2020-08-10T10:48:15] DEBUG -- : Request POST https://api.calendly.com/organizations/ORG001/invitations params:, body:{:email=>"foobar@example.com"}
150
150
  # D, [2020-08-10T10:48:16] DEBUG -- : Response status:201, body:{"resource":{"created_at":"2020-08-10T10:48:16.051159Z","email":"foobar@example.com","last_sent_at":"2020-08-10T10:48:16.096518Z","organization":"https://api.calendly.com/organizations/ORG001","status":"pending","updated_at":"2020-08-10T10:48:16.051159Z","uri":"https://api.calendly.com/organizations/ORG001/invitations/INV001"}}
151
151
  ```
@@ -106,22 +106,22 @@ module Calendly
106
106
  # Returns all Event Types associated with a specified organization.
107
107
  #
108
108
  # @param [String] org_uri the specified organization (organization's uri).
109
- # @param [Hash] opts the optional request parameters.
110
- # @option opts [Integer] :count Number of rows to return.
111
- # @option opts [String] :page_token Pass this to get the next portion of collection.
112
- # @option opts [String] :sort Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values.
109
+ # @param [Hash] options the optional request parameters. Optional.
110
+ # @option options [Integer] :count Number of rows to return.
111
+ # @option options [String] :page_token Pass this to get the next portion of collection.
112
+ # @option options [String] :sort Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values.
113
113
  # @return [Array<Array<Calendly::EventType>, Hash>]
114
114
  # - [Array<Calendly::EventType>] event_types
115
115
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
116
116
  # @raise [Calendly::Error] if the org_uri arg is empty.
117
117
  # @raise [Calendly::ApiError] if the api returns error code.
118
118
  # @since 0.6.0
119
- def event_types(org_uri, opts = {})
119
+ def event_types(org_uri, options: nil)
120
120
  check_not_empty org_uri, 'org_uri'
121
121
 
122
122
  opts_keys = %i[count page_token sort]
123
123
  params = {organization: org_uri}
124
- params = merge_options opts, opts_keys, params
124
+ params = merge_options options, opts_keys, params
125
125
  body = request :get, 'event_types', params: params
126
126
 
127
127
  items = body[:collection] || []
@@ -133,22 +133,22 @@ module Calendly
133
133
  # Returns all Event Types associated with a specified user.
134
134
  #
135
135
  # @param [String] user_uri the specified user (user's uri).
136
- # @param [Hash] opts the optional request parameters.
137
- # @option opts [Integer] :count Number of rows to return.
138
- # @option opts [String] :page_token Pass this to get the next portion of collection.
139
- # @option opts [String] :sort Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values.
136
+ # @param [Hash] options the optional request parameters. Optional.
137
+ # @option options [Integer] :count Number of rows to return.
138
+ # @option options [String] :page_token Pass this to get the next portion of collection.
139
+ # @option options [String] :sort Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values.
140
140
  # @return [Array<Array<Calendly::EventType>, Hash>]
141
141
  # - [Array<Calendly::EventType>] event_types
142
142
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
143
143
  # @raise [Calendly::Error] if the user_uri arg is empty.
144
144
  # @raise [Calendly::ApiError] if the api returns error code.
145
145
  # @since 0.0.2
146
- def event_types_by_user(user_uri, opts = {})
146
+ def event_types_by_user(user_uri, options: nil)
147
147
  check_not_empty user_uri, 'user_uri'
148
148
 
149
149
  opts_keys = %i[count page_token sort]
150
150
  params = {user: user_uri}
151
- params = merge_options opts, opts_keys, params
151
+ params = merge_options options, opts_keys, params
152
152
  body = request :get, 'event_types', params: params
153
153
 
154
154
  items = body[:collection] || []
@@ -174,26 +174,26 @@ module Calendly
174
174
  # Get List of scheduled events belonging to a specific organization.
175
175
  #
176
176
  # @param [String] org_uri the specified organization (organization's uri).
177
- # @param [Hash] opts the optional request parameters.
178
- # @option opts [Integer] :count Number of rows to return.
179
- # @option opts [String] :invitee_email Return events scheduled with the specified invitee email.
180
- # @option opts [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
181
- # @option opts [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
182
- # @option opts [String] :page_token Pass this to get the next portion of collection.
183
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
184
- # @option opts [String] :status Whether the scheduled event is active or canceled.
177
+ # @param [Hash] options the optional request parameters. Optional.
178
+ # @option options [Integer] :count Number of rows to return.
179
+ # @option options [String] :invitee_email Return events scheduled with the specified invitee email.
180
+ # @option options [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
181
+ # @option options [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
182
+ # @option options [String] :page_token Pass this to get the next portion of collection.
183
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
184
+ # @option options [String] :status Whether the scheduled event is active or canceled.
185
185
  # @return [Array<Array<Calendly::Event>, Hash>]
186
186
  # - [Array<Calendly::Event>] events
187
187
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
188
188
  # @raise [Calendly::Error] if the org_uri arg is empty.
189
189
  # @raise [Calendly::ApiError] if the api returns error code.
190
190
  # @since 0.5.0
191
- def scheduled_events(org_uri, opts = {})
191
+ def scheduled_events(org_uri, options: nil)
192
192
  check_not_empty org_uri, 'org_uri'
193
193
 
194
194
  opts_keys = %i[count invitee_email max_start_time min_start_time page_token sort status]
195
195
  params = {organization: org_uri}
196
- params = merge_options opts, opts_keys, params
196
+ params = merge_options options, opts_keys, params
197
197
  body = request :get, 'scheduled_events', params: params
198
198
 
199
199
  items = body[:collection] || []
@@ -205,27 +205,27 @@ module Calendly
205
205
  # Get List of scheduled events belonging to a specific user.
206
206
  #
207
207
  # @param [String] user_uri the specified user (user's uri).
208
- # @param [Hash] opts the optional request parameters.
209
- # @option opts [String] :organization the specified organization (organization's uri).
210
- # @option opts [Integer] :count Number of rows to return.
211
- # @option opts [String] :invitee_email Return events scheduled with the specified invitee email.
212
- # @option opts [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
213
- # @option opts [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
214
- # @option opts [String] :page_token Pass this to get the next portion of collection.
215
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
216
- # @option opts [String] :status Whether the scheduled event is active or canceled.
208
+ # @param [Hash] options the optional request parameters. Optional.
209
+ # @option options [String] :organization the specified organization (organization's uri).
210
+ # @option options [Integer] :count Number of rows to return.
211
+ # @option options [String] :invitee_email Return events scheduled with the specified invitee email.
212
+ # @option options [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
213
+ # @option options [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
214
+ # @option options [String] :page_token Pass this to get the next portion of collection.
215
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
216
+ # @option options [String] :status Whether the scheduled event is active or canceled.
217
217
  # @return [Array<Array<Calendly::Event>, Hash>]
218
218
  # - [Array<Calendly::Event>] events
219
219
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
220
220
  # @raise [Calendly::Error] if the user_uri arg is empty.
221
221
  # @raise [Calendly::ApiError] if the api returns error code.
222
222
  # @since 0.0.3
223
- def scheduled_events_by_user(user_uri, opts = {})
223
+ def scheduled_events_by_user(user_uri, options: nil)
224
224
  check_not_empty user_uri, 'user_uri'
225
225
 
226
226
  opts_keys = %i[organization count invitee_email max_start_time min_start_time page_token sort status]
227
227
  params = {user: user_uri}
228
- params = merge_options opts, opts_keys, params
228
+ params = merge_options options, opts_keys, params
229
229
  body = request :get, 'scheduled_events', params: params
230
230
 
231
231
  items = body[:collection] || []
@@ -255,23 +255,23 @@ module Calendly
255
255
  # Get List of Event Invitees.
256
256
  #
257
257
  # @param [String] uuid the specified event (event's uuid).
258
- # @param [Hash] opts the optional request parameters.
259
- # @option opts [Integer] :count Number of rows to return.
260
- # @option opts [String] :email Filter by email.
261
- # @option opts [String] :page_token Pass this to get the next portion of collection.
262
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
263
- # @option opts [String] :status Whether the scheduled event is active or canceled.
258
+ # @param [Hash] options the optional request parameters. Optional.
259
+ # @option options [Integer] :count Number of rows to return.
260
+ # @option options [String] :email Filter by email.
261
+ # @option options [String] :page_token Pass this to get the next portion of collection.
262
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
263
+ # @option options [String] :status Whether the scheduled event is active or canceled.
264
264
  # @return [Array<Array<Calendly::Invitee>, Hash>]
265
265
  # - [Array<Calendly::Invitee>] invitees
266
266
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
267
267
  # @raise [Calendly::Error] if the uuid arg is empty.
268
268
  # @raise [Calendly::ApiError] if the api returns error code.
269
269
  # @since 0.0.4
270
- def event_invitees(uuid, opts = {})
270
+ def event_invitees(uuid, options: nil)
271
271
  check_not_empty uuid, 'uuid'
272
272
 
273
273
  opts_keys = %i[count email page_token sort status]
274
- params = merge_options opts, opts_keys
274
+ params = merge_options options, opts_keys
275
275
  body = request :get, "scheduled_events/#{uuid}/invitees", params: params
276
276
 
277
277
  items = body[:collection] || []
@@ -297,22 +297,22 @@ module Calendly
297
297
  # Get List of memberships belonging to specific an organization.
298
298
  #
299
299
  # @param [String] org_uri the specified organization (organization's uri).
300
- # @param [Hash] opts the optional request parameters.
301
- # @option opts [Integer] :count Number of rows to return.
302
- # @option opts [String] :email Filter by email.
303
- # @option opts [String] :page_token Pass this to get the next portion of collection.
300
+ # @param [Hash] options the optional request parameters. Optional.
301
+ # @option options [Integer] :count Number of rows to return.
302
+ # @option options [String] :email Filter by email.
303
+ # @option options [String] :page_token Pass this to get the next portion of collection.
304
304
  # @return [Array<Array<Calendly::OrganizationMembership>, Hash>]
305
305
  # - [Array<Calendly::OrganizationMembership>] memberships
306
306
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
307
307
  # @raise [Calendly::Error] if the org_uri arg is empty.
308
308
  # @raise [Calendly::ApiError] if the api returns error code.
309
309
  # @since 0.0.5
310
- def memberships(org_uri, opts = {})
310
+ def memberships(org_uri, options: nil)
311
311
  check_not_empty org_uri, 'org_uri'
312
312
 
313
313
  opts_keys = %i[count email page_token]
314
314
  params = {organization: org_uri}
315
- params = merge_options opts, opts_keys, params
315
+ params = merge_options options, opts_keys, params
316
316
  body = request :get, 'organization_memberships', params: params
317
317
 
318
318
  items = body[:collection] || []
@@ -324,22 +324,22 @@ module Calendly
324
324
  # Get List of memberships belonging to specific a user.
325
325
  #
326
326
  # @param [String] user_uri the specified user (user's uri).
327
- # @param [Hash] opts the optional request parameters.
328
- # @option opts [Integer] :count Number of rows to return.
329
- # @option opts [String] :email Filter by email.
330
- # @option opts [String] :page_token Pass this to get the next portion of collection.
327
+ # @param [Hash] options the optional request parameters. Optional.
328
+ # @option options [Integer] :count Number of rows to return.
329
+ # @option options [String] :email Filter by email.
330
+ # @option options [String] :page_token Pass this to get the next portion of collection.
331
331
  # @return [Array<Array<Calendly::OrganizationMembership>, Hash>]
332
332
  # - [Array<Calendly::OrganizationMembership>] memberships
333
333
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
334
334
  # @raise [Calendly::Error] if the user_uri arg is empty.
335
335
  # @raise [Calendly::ApiError] if the api returns error code.
336
336
  # @since 0.0.5
337
- def memberships_by_user(user_uri, opts = {})
337
+ def memberships_by_user(user_uri, options: nil)
338
338
  check_not_empty user_uri, 'user_uri'
339
339
 
340
340
  opts_keys = %i[count email page_token]
341
341
  params = {user: user_uri}
342
- params = merge_options opts, opts_keys, params
342
+ params = merge_options options, opts_keys, params
343
343
  body = request :get, 'organization_memberships', params: params
344
344
 
345
345
  items = body[:collection] || []
@@ -383,23 +383,23 @@ module Calendly
383
383
  # Get Organization Invitations.
384
384
  #
385
385
  # @param [String] uuid the specified organization (organization's uuid).
386
- # @param [Hash] opts the optional request parameters.
387
- # @option opts [Integer] :count Number of rows to return.
388
- # @option opts [String] :email Filter by email.
389
- # @option opts [String] :page_token Pass this to get the next portion of collection.
390
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
391
- # @option opts [String] :status Filter by status.
386
+ # @param [Hash] options the optional request parameters. Optional.
387
+ # @option options [Integer] :count Number of rows to return.
388
+ # @option options [String] :email Filter by email.
389
+ # @option options [String] :page_token Pass this to get the next portion of collection.
390
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
391
+ # @option options [String] :status Filter by status.
392
392
  # @return [<Array<Array<Calendly::OrganizationInvitation>, Hash>]
393
393
  # - [Array<Calendly::OrganizationInvitation>] organizations
394
394
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
395
395
  # @raise [Calendly::Error] if the uuid arg is empty.
396
396
  # @raise [Calendly::ApiError] if the api returns error code.
397
397
  # @since 0.0.6
398
- def invitations(uuid, opts = {})
398
+ def invitations(uuid, options: nil)
399
399
  check_not_empty uuid, 'uuid'
400
400
 
401
401
  opts_keys = %i[count email page_token sort status]
402
- params = merge_options opts, opts_keys
402
+ params = merge_options options, opts_keys
403
403
 
404
404
  body = request :get, "organizations/#{uuid}/invitations", params: params
405
405
  items = body[:collection] || []
@@ -463,22 +463,22 @@ module Calendly
463
463
  # Get List of organization scope Webhooks.
464
464
  #
465
465
  # @param [String] org_uri the specified organization (organization's uri).
466
- # @param [Hash] opts the optional request parameters.
467
- # @option opts [Integer] :count Number of rows to return.
468
- # @option opts [String] :page_token Pass this to get the next portion of collection.
469
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
466
+ # @param [Hash] options the optional request parameters. Optional.
467
+ # @option options [Integer] :count Number of rows to return.
468
+ # @option options [String] :page_token Pass this to get the next portion of collection.
469
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
470
470
  # @return [Array<Array<Calendly::WebhookSubscription>, Hash>]
471
471
  # - [Array<Calendly::WebhookSubscription>] webhooks
472
472
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
473
473
  # @raise [Calendly::Error] if the org_uri arg is empty.
474
474
  # @raise [Calendly::ApiError] if the api returns error code.
475
475
  # @since 0.1.3
476
- def webhooks(org_uri, opts = {})
476
+ def webhooks(org_uri, options: nil)
477
477
  check_not_empty org_uri, 'org_uri'
478
478
 
479
479
  opts_keys = %i[count page_token sort]
480
480
  params = {organization: org_uri, scope: 'organization'}
481
- params = merge_options opts, opts_keys, params
481
+ params = merge_options options, opts_keys, params
482
482
  body = request :get, 'webhook_subscriptions', params: params
483
483
  items = body[:collection] || []
484
484
  evs = items.map { |item| WebhookSubscription.new item, self }
@@ -490,10 +490,10 @@ module Calendly
490
490
  #
491
491
  # @param [String] org_uri the specified organization (organization's uri).
492
492
  # @param [String] user_uri the specified user (user's uri).
493
- # @param [Hash] opts the optional request parameters.
494
- # @option opts [Integer] :count Number of rows to return.
495
- # @option opts [String] :page_token Pass this to get the next portion of collection.
496
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
493
+ # @param [Hash] options the optional request parameters. Optional.
494
+ # @option options [Integer] :count Number of rows to return.
495
+ # @option options [String] :page_token Pass this to get the next portion of collection.
496
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
497
497
  # @return [Array<Array<Calendly::WebhookSubscription>, Hash>]
498
498
  # - [Array<Calendly::WebhookSubscription>] webhooks
499
499
  # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
@@ -501,13 +501,13 @@ module Calendly
501
501
  # @raise [Calendly::Error] if the user_uri arg is empty.
502
502
  # @raise [Calendly::ApiError] if the api returns error code.
503
503
  # @since 0.1.3
504
- def user_scope_webhooks(org_uri, user_uri, opts = {})
504
+ def user_scope_webhooks(org_uri, user_uri, options: nil)
505
505
  check_not_empty org_uri, 'org_uri'
506
506
  check_not_empty user_uri, 'user_uri'
507
507
 
508
508
  opts_keys = %i[count page_token sort]
509
509
  params = {organization: org_uri, user: user_uri, scope: 'user'}
510
- params = merge_options opts, opts_keys, params
510
+ params = merge_options options, opts_keys, params
511
511
  body = request :get, 'webhook_subscriptions', params: params
512
512
  items = body[:collection] || []
513
513
  evs = items.map { |item| WebhookSubscription.new item, self }
@@ -565,7 +565,7 @@ module Calendly
565
565
  #
566
566
  # @param [String] uri A link to the resource that owns this scheduling Link.
567
567
  # @param [String] max_event_count The max number of events that can be scheduled using this scheduling link.
568
- # @param [String] resource_type Resource type.
568
+ # @param [String] owner_type Resource type.
569
569
  # @return [Hash]
570
570
  # e.g.
571
571
  # {
@@ -575,17 +575,17 @@ module Calendly
575
575
  # }
576
576
  # @raise [Calendly::Error] if the uri arg is empty.
577
577
  # @raise [Calendly::Error] if the max_event_count arg is empty.
578
- # @raise [Calendly::Error] if the resource_type arg is empty.
578
+ # @raise [Calendly::Error] if the owner_type arg is empty.
579
579
  # @raise [Calendly::ApiError] if the api returns error code.
580
580
  # @since 0.5.2
581
- def create_schedule_link(uri, max_event_count = 1, resource_type: 'EventType')
581
+ def create_schedule_link(uri, max_event_count: 1, owner_type: 'EventType')
582
582
  check_not_empty uri, 'uri'
583
583
  check_not_empty max_event_count, 'max_event_count'
584
- check_not_empty resource_type, 'resource_type'
584
+ check_not_empty owner_type, 'owner_type'
585
585
  params = {
586
586
  max_event_count: max_event_count,
587
587
  owner: uri,
588
- owner_type: resource_type
588
+ owner_type: owner_type
589
589
  }
590
590
  body = request :post, 'scheduling_links', body: params
591
591
  body[:resource]
@@ -4,6 +4,7 @@ require 'calendly/client'
4
4
  require 'calendly/models/model_utils'
5
5
  require 'calendly/models/event_type'
6
6
  require 'calendly/models/guest'
7
+ require 'calendly/models/invitee_cancellation'
7
8
  require 'calendly/models/invitees_counter'
8
9
  require 'calendly/models/location'
9
10
 
@@ -12,11 +13,12 @@ module Calendly
12
13
  # A meeting that has been scheduled.
13
14
  class Event
14
15
  include ModelUtils
15
- UUID_RE = %r{\A#{Client::API_HOST}/scheduled_events/(\w+)\z}.freeze
16
+ UUID_RE = %r{\A#{Client::API_HOST}/scheduled_events/(#{UUID_FORMAT})\z}.freeze
16
17
  TIME_FIELDS = %i[start_time end_time created_at updated_at].freeze
17
18
  ASSOCIATION = {
18
19
  event_type: EventType,
19
20
  event_guests: Guest,
21
+ cancellation: InviteeCancellation,
20
22
  invitees_counter: InviteesCounter,
21
23
  location: Location
22
24
  }.freeze
@@ -57,14 +59,18 @@ module Calendly
57
59
  # Reference to Event Type associated with this event.
58
60
  attr_accessor :event_type
59
61
 
60
- # @return [Calendly::Location]
61
- # location in this event.
62
- attr_accessor :location
62
+ # @return [InviteeCancellation]
63
+ # Provides data pertaining to the cancellation of the Invitee.
64
+ attr_accessor :cancellation
63
65
 
64
66
  # @return [InviteesCounter]
65
67
  # invitees counter.
66
68
  attr_accessor :invitees_counter
67
69
 
70
+ # @return [Calendly::Location]
71
+ # location in this event.
72
+ attr_accessor :location
73
+
68
74
  # @return [Array<User>]
69
75
  # Event membership list.
70
76
  attr_accessor :event_memberships
@@ -87,10 +93,10 @@ module Calendly
87
93
  #
88
94
  # Returns all Event Invitees associated with self.
89
95
  #
90
- # @param [Hash] opts the optional request parameters.
91
- # @option opts [Integer] :count Number of rows to return.
92
- # @option opts [String] :email Filter by email.
93
- # @option opts [String] :page_token
96
+ # @param [Hash] options the optional request parameters. Optional.
97
+ # @option options [Integer] :count Number of rows to return.
98
+ # @option options [String] :email Filter by email.
99
+ # @option options [String] :page_token
94
100
  # Pass this to get the next portion of collection.
95
101
  # @option opts [String] :sort Order results by the specified field and directin.
96
102
  # Accepts comma-separated list of {field}:{direction} values.
@@ -99,17 +105,17 @@ module Calendly
99
105
  # @raise [Calendly::Error] if the uuid is empty.
100
106
  # @raise [Calendly::ApiError] if the api returns error code.
101
107
  # @since 0.1.0
102
- def invitees(opts = {})
108
+ def invitees(options: nil)
103
109
  return @cached_invitees if defined?(@cached_invitees) && @cached_invitees
104
110
 
105
- request_proc = proc { |options| client.event_invitees uuid, options }
106
- @cached_invitees = auto_pagination request_proc, opts
111
+ request_proc = proc { |opts| client.event_invitees uuid, options: opts }
112
+ @cached_invitees = auto_pagination request_proc, options
107
113
  end
108
114
 
109
115
  # @since 0.2.0
110
- def invitees!(opts = {})
116
+ def invitees!(options: nil)
111
117
  @cached_invitees = nil
112
- invitees opts
118
+ invitees options: options
113
119
  end
114
120
 
115
121
  private
@@ -10,7 +10,7 @@ module Calendly
10
10
  # A configuration for a schedulable event.
11
11
  class EventType
12
12
  include ModelUtils
13
- UUID_RE = %r{\A#{Client::API_HOST}/event_types/(\w+)\z}.freeze
13
+ UUID_RE = %r{\A#{Client::API_HOST}/event_types/(#{UUID_FORMAT})\z}.freeze
14
14
  TIME_FIELDS = %i[created_at updated_at].freeze
15
15
  ASSOCIATION = {profile: EventTypeProfile, custom_questions: EventTypeCustomQuestion}.freeze
16
16
 
@@ -132,8 +132,8 @@ module Calendly
132
132
  # @raise [Calendly::Error] if the max_event_count arg is empty.
133
133
  # @raise [Calendly::ApiError] if the api returns error code.
134
134
  # @since 0.5.2
135
- def create_schedule_link(max_event_count = 1)
136
- client.create_schedule_link uri, max_event_count, resource_type: 'EventType'
135
+ def create_schedule_link(max_event_count: 1)
136
+ client.create_schedule_link uri, max_event_count: max_event_count, owner_type: 'EventType'
137
137
  end
138
138
 
139
139
  private
@@ -13,7 +13,7 @@ module Calendly
13
13
  # An individual who has been invited to meet with a Calendly member.
14
14
  class Invitee
15
15
  include ModelUtils
16
- UUID_RE = %r{\A#{Client::API_HOST}/scheduled_events/\w+/invitees/(\w+)\z}.freeze
16
+ UUID_RE = %r{\A#{Client::API_HOST}/scheduled_events/#{UUID_FORMAT}/invitees/(#{UUID_FORMAT})\z}.freeze
17
17
  TIME_FIELDS = %i[created_at updated_at].freeze
18
18
  ASSOCIATION = {
19
19
  event: Event,
@@ -13,5 +13,8 @@ module Calendly
13
13
 
14
14
  # @return [String] Reason that the cancellation occurred.
15
15
  attr_accessor :reason
16
+
17
+ # @return [String] Allowed values: host or invitee.
18
+ attr_accessor :canceler_type
16
19
  end
17
20
  end
@@ -6,6 +6,10 @@ require 'calendly/error'
6
6
  module Calendly
7
7
  # Calendly model utility.
8
8
  module ModelUtils
9
+ # UUID's format is ASCII.
10
+ # refs to official release note of October 2021.
11
+ UUID_FORMAT = '[[:ascii:]]+'
12
+
9
13
  # @param [Hash] attrs the attributes of the model.
10
14
  # @param [Calendly::Client] the api client.
11
15
  def initialize(attrs = nil, client = nil)
@@ -7,7 +7,7 @@ module Calendly
7
7
  # Calendly's organization model.
8
8
  class Organization
9
9
  include ModelUtils
10
- UUID_RE = %r{\A#{Client::API_HOST}/organizations/(\w+)\z}.freeze
10
+ UUID_RE = %r{\A#{Client::API_HOST}/organizations/(#{UUID_FORMAT})\z}.freeze
11
11
 
12
12
  # @return [String]
13
13
  # unique id of the Organization object.
@@ -20,52 +20,52 @@ module Calendly
20
20
  #
21
21
  # Get List memberships of all users belonging to self.
22
22
  #
23
- # @param [Hash] opts the optional request parameters.
24
- # @option opts [Integer] :count Number of rows to return.
25
- # @option opts [String] :email Filter by email.
26
- # @option opts [String] :page_token Pass this to get the next portion of collection.
23
+ # @param [Hash] options the optional request parameters. Optional.
24
+ # @option options [Integer] :count Number of rows to return.
25
+ # @option options [String] :email Filter by email.
26
+ # @option options [String] :page_token Pass this to get the next portion of collection.
27
27
  # @return [Array<Calendly::OrganizationMembership>]
28
28
  # @raise [Calendly::Error] if the uri is empty.
29
29
  # @raise [Calendly::ApiError] if the api returns error code.
30
30
  # @since 0.1.0
31
- def memberships(opts = {})
31
+ def memberships(options: nil)
32
32
  return @cached_memberships if defined?(@cached_memberships) && @cached_memberships
33
33
 
34
- request_proc = proc { |options| client.memberships uri, options }
35
- @cached_memberships = auto_pagination request_proc, opts
34
+ request_proc = proc { |opts| client.memberships uri, options: opts }
35
+ @cached_memberships = auto_pagination request_proc, options
36
36
  end
37
37
 
38
38
  # @since 0.2.0
39
- def memberships!(opts = {})
39
+ def memberships!(options: nil)
40
40
  @cached_memberships = nil
41
- memberships opts
41
+ memberships options: options
42
42
  end
43
43
 
44
44
  #
45
45
  # Get Organization Invitations.
46
46
  #
47
- # @param [Hash] opts the optional request parameters.
48
- # @option opts [Integer] :count Number of rows to return.
49
- # @option opts [String] :email Filter by email.
50
- # @option opts [String] :page_token Pass this to get the next portion of collection.
51
- # @option opts [String] :sort Order results by the specified field and directin.
47
+ # @param [Hash] options the optional request parameters. Optional.
48
+ # @option options [Integer] :count Number of rows to return.
49
+ # @option options [String] :email Filter by email.
50
+ # @option options [String] :page_token Pass this to get the next portion of collection.
51
+ # @option options [String] :sort Order results by the specified field and directin.
52
52
  # Accepts comma-separated list of {field}:{direction} values.
53
- # @option opts [String] :status Filter by status.
53
+ # @option options [String] :status Filter by status.
54
54
  # @return [Array<Calendly::OrganizationInvitation>]
55
55
  # @raise [Calendly::Error] if the uuid is empty.
56
56
  # @raise [Calendly::ApiError] if the api returns error code.
57
57
  # @since 0.1.0
58
- def invitations(opts = {})
58
+ def invitations(options: nil)
59
59
  return @cached_invitations if defined?(@cached_invitations) && @cached_invitations
60
60
 
61
- request_proc = proc { |options| client.invitations uuid, options }
62
- @cached_invitations = auto_pagination request_proc, opts
61
+ request_proc = proc { |opts| client.invitations uuid, options: opts }
62
+ @cached_invitations = auto_pagination request_proc, options
63
63
  end
64
64
 
65
65
  # @since 0.2.0
66
- def invitations!(opts = {})
66
+ def invitations!(options: nil)
67
67
  @cached_invitations = nil
68
- invitations opts
68
+ invitations options: options
69
69
  end
70
70
 
71
71
  #
@@ -84,80 +84,80 @@ module Calendly
84
84
  #
85
85
  # Returns all Event Types associated with self.
86
86
  #
87
- # @param [Hash] opts the optional request parameters.
88
- # @option opts [Integer] :count Number of rows to return.
89
- # @option opts [String] :page_token Pass this to get the next portion of collection.
90
- # @option opts [String] :sort Order results by the specified field and direction.
87
+ # @param [Hash] options the optional request parameters. Optional.
88
+ # @option options [Integer] :count Number of rows to return.
89
+ # @option options [String] :page_token Pass this to get the next portion of collection.
90
+ # @option options [String] :sort Order results by the specified field and direction.
91
91
  # Accepts comma-separated list of {field}:{direction} values.
92
92
  # @return [Array<Calendly::EventType>]
93
93
  # @raise [Calendly::Error] if the uri is empty.
94
94
  # @raise [Calendly::ApiError] if the api returns error code.
95
95
  # @since 0.6.0
96
- def event_types(opts = {})
96
+ def event_types(options: nil)
97
97
  return @cached_event_types if defined?(@cached_event_types) && @cached_event_types
98
98
 
99
- request_proc = proc { |options| client.event_types uri, options }
100
- @cached_event_types = auto_pagination request_proc, opts
99
+ request_proc = proc { |opts| client.event_types uri, options: opts }
100
+ @cached_event_types = auto_pagination request_proc, options
101
101
  end
102
102
 
103
103
  # @since 0.6.0
104
- def event_types!(opts = {})
104
+ def event_types!(options: nil)
105
105
  @cached_event_types = nil
106
- event_types opts
106
+ event_types options: options
107
107
  end
108
108
 
109
109
  #
110
110
  # Returns all Scheduled Events associated with self.
111
111
  #
112
- # @param [Hash] opts the optional request parameters.
113
- # @option opts [Integer] :count Number of rows to return.
114
- # @option opts [String] :invitee_email Return events scheduled with the specified invitee email
115
- # @option opts [String] :max_start_timeUpper bound (inclusive) for an event's start time to filter by.
116
- # @option opts [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
117
- # @option opts [String] :page_token Pass this to get the next portion of collection.
118
- # @option opts [String] :sort Order results by the specified field and directin.
112
+ # @param [Hash] options the optional request parameters. Optional.
113
+ # @option options [Integer] :count Number of rows to return.
114
+ # @option options [String] :invitee_email Return events scheduled with the specified invitee email
115
+ # @option options [String] :max_start_timeUpper bound (inclusive) for an event's start time to filter by.
116
+ # @option options [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
117
+ # @option options [String] :page_token Pass this to get the next portion of collection.
118
+ # @option options [String] :sort Order results by the specified field and directin.
119
119
  # Accepts comma-separated list of {field}:{direction} values.
120
- # @option opts [String] :status Whether the scheduled event is active or canceled
120
+ # @option options [String] :status Whether the scheduled event is active or canceled
121
121
  # @return [Array<Calendly::Event>]
122
122
  # @raise [Calendly::Error] if the uri is empty.
123
123
  # @raise [Calendly::ApiError] if the api returns error code.
124
124
  # @since 0.5.0
125
- def scheduled_events(opts = {})
125
+ def scheduled_events(options: nil)
126
126
  return @cached_scheduled_events if defined?(@cached_scheduled_events) && @cached_scheduled_events
127
127
 
128
- request_proc = proc { |options| client.scheduled_events uri, options }
129
- @cached_scheduled_events = auto_pagination request_proc, opts
128
+ request_proc = proc { |opts| client.scheduled_events uri, options: opts }
129
+ @cached_scheduled_events = auto_pagination request_proc, options
130
130
  end
131
131
 
132
132
  # @since 0.5.0
133
- def scheduled_events!(opts = {})
133
+ def scheduled_events!(options: nil)
134
134
  @cached_scheduled_events = nil
135
- scheduled_events opts
135
+ scheduled_events options: options
136
136
  end
137
137
 
138
138
  #
139
139
  # Get List of organization scope Webhooks associated with self.
140
140
  #
141
- # @param [Hash] opts the optional request parameters.
142
- # @option opts [Integer] :count Number of rows to return.
143
- # @option opts [String] :page_token Pass this to get the next portion of collection.
144
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
141
+ # @param [Hash] options the optional request parameters. Optional.
142
+ # @option options [Integer] :count Number of rows to return.
143
+ # @option options [String] :page_token Pass this to get the next portion of collection.
144
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
145
145
  # Accepts comma-separated list of {field}:{direction} values.
146
146
  # @return [Array<Calendly::WebhookSubscription>]
147
147
  # @raise [Calendly::Error] if the uri is empty.
148
148
  # @raise [Calendly::ApiError] if the api returns error code.
149
149
  # @since 0.1.3
150
- def webhooks(opts = {})
150
+ def webhooks(options: nil)
151
151
  return @cached_webhooks if defined?(@cached_webhooks) && @cached_webhooks
152
152
 
153
- request_proc = proc { |options| client.webhooks uri, options }
154
- @cached_webhooks = auto_pagination request_proc, opts
153
+ request_proc = proc { |opts| client.webhooks uri, options: opts }
154
+ @cached_webhooks = auto_pagination request_proc, options
155
155
  end
156
156
 
157
157
  # @since 0.2.0
158
- def webhooks!(opts = {})
158
+ def webhooks!(options: nil)
159
159
  @cached_webhooks = nil
160
- webhooks opts
160
+ webhooks options: options
161
161
  end
162
162
 
163
163
  #
@@ -9,7 +9,7 @@ module Calendly
9
9
  # Calendly's organization invitation model.
10
10
  class OrganizationInvitation
11
11
  include ModelUtils
12
- UUID_RE = %r{\A#{Client::API_HOST}/organizations/\w+/invitations/(\w+)\z}.freeze
12
+ UUID_RE = %r{\A#{Client::API_HOST}/organizations/#{UUID_FORMAT}/invitations/(#{UUID_FORMAT})\z}.freeze
13
13
  TIME_FIELDS = %i[created_at updated_at last_sent_at].freeze
14
14
  ASSOCIATION = {user: User, organization: Organization}.freeze
15
15
 
@@ -9,7 +9,7 @@ module Calendly
9
9
  # Calendly's organization membership model.
10
10
  class OrganizationMembership
11
11
  include ModelUtils
12
- UUID_RE = %r{\A#{Client::API_HOST}/organization_memberships/(\w+)\z}.freeze
12
+ UUID_RE = %r{\A#{Client::API_HOST}/organization_memberships/(#{UUID_FORMAT})\z}.freeze
13
13
  TIME_FIELDS = %i[created_at updated_at].freeze
14
14
  ASSOCIATION = {user: User, organization: Organization}.freeze
15
15
 
@@ -65,23 +65,23 @@ module Calendly
65
65
  #
66
66
  # Get List of user scope Webhooks associated with self.
67
67
  #
68
- # @param [Hash] opts the optional request parameters.
69
- # @option opts [Integer] :count Number of rows to return.
70
- # @option opts [String] :page_token Pass this to get the next portion of collection.
71
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
68
+ # @param [Hash] options the optional request parameters. Optional.
69
+ # @option options [Integer] :count Number of rows to return.
70
+ # @option options [String] :page_token Pass this to get the next portion of collection.
71
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
72
72
  # Accepts comma-separated list of {field}:{direction} values.
73
73
  # @return [Array<Calendly::WebhookSubscription>]
74
74
  # @raise [Calendly::Error] if the organization.uri is empty.
75
75
  # @raise [Calendly::Error] if the user.uri is empty.
76
76
  # @raise [Calendly::ApiError] if the api returns error code.
77
77
  # @since 0.1.3
78
- def user_scope_webhooks(opts = {})
79
- user.webhooks(opts)
78
+ def user_scope_webhooks(options: nil)
79
+ user.webhooks options: options
80
80
  end
81
81
 
82
82
  # @since 0.2.0
83
- def user_scope_webhooks!(opts = {})
84
- user.webhooks!(opts)
83
+ def user_scope_webhooks!(options: nil)
84
+ user.webhooks! options: options
85
85
  end
86
86
 
87
87
  #
@@ -7,7 +7,7 @@ module Calendly
7
7
  # Calendly's team model.
8
8
  class Team
9
9
  include ModelUtils
10
- UUID_RE = %r{\A#{Client::API_HOST}/teams/(\w+)\z}.freeze
10
+ UUID_RE = %r{\A#{Client::API_HOST}/teams/(#{UUID_FORMAT})\z}.freeze
11
11
 
12
12
  # @return [String]
13
13
  # unique id of the Team object.
@@ -8,7 +8,7 @@ module Calendly
8
8
  # Primary account details of a specific user.
9
9
  class User
10
10
  include ModelUtils
11
- UUID_RE = %r{\A#{Client::API_HOST}/users/(\w+)\z}.freeze
11
+ UUID_RE = %r{\A#{Client::API_HOST}/users/(#{UUID_FORMAT})\z}.freeze
12
12
  TIME_FIELDS = %i[created_at updated_at].freeze
13
13
  ASSOCIATION = {current_organization: Organization}.freeze
14
14
 
@@ -91,82 +91,82 @@ module Calendly
91
91
  #
92
92
  # Returns all Event Types associated with self.
93
93
  #
94
- # @param [Hash] opts the optional request parameters.
95
- # @option opts [Integer] :count Number of rows to return.
96
- # @option opts [String] :page_token Pass this to get the next portion of collection.
97
- # @option opts [String] :sort Order results by the specified field and direction.
94
+ # @param [Hash] options the optional request parameters. Optional.
95
+ # @option options [Integer] :count Number of rows to return.
96
+ # @option options [String] :page_token Pass this to get the next portion of collection.
97
+ # @option options [String] :sort Order results by the specified field and direction.
98
98
  # Accepts comma-separated list of {field}:{direction} values.
99
99
  # @return [Array<Calendly::EventType>]
100
100
  # @raise [Calendly::Error] if the uri is empty.
101
101
  # @raise [Calendly::ApiError] if the api returns error code.
102
102
  # @since 0.1.0
103
- def event_types(opts = {})
103
+ def event_types(options: nil)
104
104
  return @cached_event_types if defined?(@cached_event_types) && @cached_event_types
105
105
 
106
- request_proc = proc { |options| client.event_types_by_user uri, options }
107
- @cached_event_types = auto_pagination request_proc, opts
106
+ request_proc = proc { |opts| client.event_types_by_user uri, options: opts }
107
+ @cached_event_types = auto_pagination request_proc, options
108
108
  end
109
109
 
110
110
  # @since 0.2.0
111
- def event_types!(opts = {})
111
+ def event_types!(options: nil)
112
112
  @cached_event_types = nil
113
- event_types opts
113
+ event_types options: options
114
114
  end
115
115
 
116
116
  #
117
117
  # Returns all Scheduled Events associated with self.
118
118
  #
119
- # @param [Hash] opts the optional request parameters.
120
- # @option opts [Integer] :count Number of rows to return.
121
- # @option opts [String] :invitee_email Return events scheduled with the specified invitee email
122
- # @option opts [String] :max_start_timeUpper bound (inclusive) for an event's start time to filter by.
123
- # @option opts [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
124
- # @option opts [String] :page_token Pass this to get the next portion of collection.
125
- # @option opts [String] :sort Order results by the specified field and directin.
119
+ # @param [Hash] options the optional request parameters. Optional.
120
+ # @option options [Integer] :count Number of rows to return.
121
+ # @option options [String] :invitee_email Return events scheduled with the specified invitee email
122
+ # @option options [String] :max_start_timeUpper bound (inclusive) for an event's start time to filter by.
123
+ # @option options [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
124
+ # @option options [String] :page_token Pass this to get the next portion of collection.
125
+ # @option options [String] :sort Order results by the specified field and directin.
126
126
  # Accepts comma-separated list of {field}:{direction} values.
127
- # @option opts [String] :status Whether the scheduled event is active or canceled
127
+ # @option options [String] :status Whether the scheduled event is active or canceled
128
128
  # @return [Array<Calendly::Event>]
129
129
  # @raise [Calendly::Error] if the uri is empty.
130
130
  # @raise [Calendly::ApiError] if the api returns error code.
131
131
  # @since 0.1.0
132
- def scheduled_events(opts = {})
132
+ def scheduled_events(options: nil)
133
133
  return @cached_scheduled_events if defined?(@cached_scheduled_events) && @cached_scheduled_events
134
134
 
135
- request_proc = proc { |options| client.scheduled_events_by_user uri, options }
136
- @cached_scheduled_events = auto_pagination request_proc, opts
135
+ request_proc = proc { |opts| client.scheduled_events_by_user uri, options: opts }
136
+ @cached_scheduled_events = auto_pagination request_proc, options
137
137
  end
138
138
 
139
139
  # @since 0.2.0
140
- def scheduled_events!(opts = {})
140
+ def scheduled_events!(options: nil)
141
141
  @cached_scheduled_events = nil
142
- scheduled_events opts
142
+ scheduled_events options: options
143
143
  end
144
144
 
145
145
  #
146
146
  # Get List of user scope Webhooks associated with self.
147
147
  #
148
- # @param [Hash] opts the optional request parameters.
149
- # @option opts [Integer] :count Number of rows to return.
150
- # @option opts [String] :page_token Pass this to get the next portion of collection.
151
- # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
148
+ # @param [Hash] options the optional request parameters. Optional.
149
+ # @option options [Integer] :count Number of rows to return.
150
+ # @option options [String] :page_token Pass this to get the next portion of collection.
151
+ # @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
152
152
  # Accepts comma-separated list of {field}:{direction} values.
153
153
  # @return [Array<Calendly::WebhookSubscription>]
154
154
  # @raise [Calendly::Error] if the organization.uri is empty.
155
155
  # @raise [Calendly::Error] if the uri is empty.
156
156
  # @raise [Calendly::ApiError] if the api returns error code.
157
157
  # @since 0.6.0
158
- def webhooks(opts = {})
158
+ def webhooks(options: nil)
159
159
  return @cached_webhooks if defined?(@cached_webhooks) && @cached_webhooks
160
160
 
161
161
  org_uri = current_organization&.uri
162
- request_proc = proc { |options| client.user_scope_webhooks org_uri, uri, options }
163
- @cached_webhooks = auto_pagination request_proc, opts
162
+ request_proc = proc { |opts| client.user_scope_webhooks org_uri, uri, options: opts }
163
+ @cached_webhooks = auto_pagination request_proc, options
164
164
  end
165
165
 
166
166
  # @since 0.6.0
167
- def webhooks!(opts = {})
167
+ def webhooks!(options: nil)
168
168
  @cached_webhooks = nil
169
- webhooks opts
169
+ webhooks options: options
170
170
  end
171
171
 
172
172
  #
@@ -9,7 +9,7 @@ module Calendly
9
9
  # Calendly's webhook model.
10
10
  class WebhookSubscription
11
11
  include ModelUtils
12
- UUID_RE = %r{\A#{Client::API_HOST}/webhook_subscriptions/(\w+)\z}.freeze
12
+ UUID_RE = %r{\A#{Client::API_HOST}/webhook_subscriptions/(#{UUID_FORMAT})\z}.freeze
13
13
  TIME_FIELDS = %i[created_at updated_at retry_started_at].freeze
14
14
  ASSOCIATION = {organization: Organization, user: User, creator: User}.freeze
15
15
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Calendly
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calendly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Koshikawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-03 00:00:00.000000000 Z
11
+ date: 2022-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -161,7 +161,7 @@ metadata:
161
161
  homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
162
162
  source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
163
163
  changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
164
- documentation_uri: https://www.rubydoc.info/gems/calendly/0.7.0
164
+ documentation_uri: https://www.rubydoc.info/gems/calendly/0.8.2
165
165
  post_install_message:
166
166
  rdoc_options: []
167
167
  require_paths: