calendly 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/calendly/client.rb +12 -25
- data/lib/calendly/version.rb +1 -1
- 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: fa6443944ba1a41d6f868879ddd4aac837f09ce9285eb210d7b61acd5c644615
|
4
|
+
data.tar.gz: efccf9e1c02314b14447e2d99ee9b67cb599f7eff3f9cd37d2b1396dd96d5bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be6f91ef55bc88c7a7b925d80de73028f3390b6077765ad91648a486992845db1137778ddbe048cc08e861f025a2fcb653699289f0698a6fd6706144e00638e2
|
7
|
+
data.tar.gz: 490abe0dc221919393b84d23c1eab5dfc776779df1b8f1c52206fd3251e36e09a8d8e8d6324cfad622540ea91d0a433283ca2cbff6f38fbd07ff49801a4851de
|
data/CHANGELOG.md
CHANGED
data/lib/calendly/client.rb
CHANGED
@@ -38,8 +38,8 @@ module Calendly
|
|
38
38
|
#
|
39
39
|
# Refresh access token.
|
40
40
|
#
|
41
|
-
# @raise [Calendly::Error] if
|
42
|
-
# @raise [Calendly::Error] if
|
41
|
+
# @raise [Calendly::Error] if Calendly.configuration.client_id is empty.
|
42
|
+
# @raise [Calendly::Error] if Calendly.configuration.client_secret is empty.
|
43
43
|
# @raise [Calendly::ApiError] if the api returns error code.
|
44
44
|
# @since 0.0.7
|
45
45
|
def refresh!
|
@@ -273,15 +273,15 @@ module Calendly
|
|
273
273
|
# @since 0.0.7
|
274
274
|
def delete_membership(uuid)
|
275
275
|
check_not_empty uuid, 'uuid'
|
276
|
-
request :delete, "organization_memberships/#{uuid}"
|
276
|
+
request :delete, "organization_memberships/#{uuid}"
|
277
277
|
true
|
278
278
|
end
|
279
279
|
|
280
280
|
#
|
281
281
|
# Returns an Organization Invitation.
|
282
282
|
#
|
283
|
-
# @param [String] org_uuid the specified organization (organization's
|
284
|
-
# @param [String] inv_uuid the specified invitation (organization invitation's
|
283
|
+
# @param [String] org_uuid the specified organization (organization's uuid).
|
284
|
+
# @param [String] inv_uuid the specified invitation (organization invitation's uuid).
|
285
285
|
# @return [Calendly::OrganizationInvitation]
|
286
286
|
# @raise [Calendly::Error] if the org_uuid arg is empty.
|
287
287
|
# @raise [Calendly::Error] if the inv_uuid arg is empty.
|
@@ -298,7 +298,7 @@ module Calendly
|
|
298
298
|
#
|
299
299
|
# Get Organization Invitations.
|
300
300
|
#
|
301
|
-
# @param [String] uuid the specified organization (organization's
|
301
|
+
# @param [String] uuid the specified organization (organization's uuid).
|
302
302
|
# @param [Hash] opts the optional request parameters.
|
303
303
|
# @option opts [Integer] :count Number of rows to return.
|
304
304
|
# @option opts [String] :email Filter by email.
|
@@ -326,7 +326,7 @@ module Calendly
|
|
326
326
|
#
|
327
327
|
# Invite a person to an Organization.
|
328
328
|
#
|
329
|
-
# @param [String] uuid the specified organization (organization's
|
329
|
+
# @param [String] uuid the specified organization (organization's uuid).
|
330
330
|
# @param [String] email Email of the person being invited.
|
331
331
|
# @return [Calendly::OrganizationInvitation]
|
332
332
|
# @raise [Calendly::Error] if the uuid arg is empty.
|
@@ -339,8 +339,7 @@ module Calendly
|
|
339
339
|
body = request(
|
340
340
|
:post,
|
341
341
|
"organizations/#{uuid}/invitations",
|
342
|
-
body: { email: email }
|
343
|
-
expected_status: 201
|
342
|
+
body: { email: email }
|
344
343
|
)
|
345
344
|
OrganizationInvitation.new body[:resource], self
|
346
345
|
end
|
@@ -348,8 +347,8 @@ module Calendly
|
|
348
347
|
#
|
349
348
|
# Revoke Organization Invitation.
|
350
349
|
#
|
351
|
-
# @param [String] org_uuid the specified organization (organization's
|
352
|
-
# @param [String] inv_uuid the specified invitation (organization invitation's
|
350
|
+
# @param [String] org_uuid the specified organization (organization's uuid).
|
351
|
+
# @param [String] inv_uuid the specified invitation (organization invitation's uuid).
|
353
352
|
# @return [true]
|
354
353
|
# @raise [Calendly::Error] if the org_uuid arg is empty.
|
355
354
|
# @raise [Calendly::Error] if the inv_uuid arg is empty.
|
@@ -358,11 +357,7 @@ module Calendly
|
|
358
357
|
def delete_invitation(org_uuid, inv_uuid)
|
359
358
|
check_not_empty org_uuid, 'org_uuid'
|
360
359
|
check_not_empty inv_uuid, 'inv_uuid'
|
361
|
-
request
|
362
|
-
:delete,
|
363
|
-
"organizations/#{org_uuid}/invitations/#{inv_uuid}",
|
364
|
-
expected_status: 204
|
365
|
-
)
|
360
|
+
request :delete, "organizations/#{org_uuid}/invitations/#{inv_uuid}"
|
366
361
|
true
|
367
362
|
end
|
368
363
|
|
@@ -374,24 +369,16 @@ module Calendly
|
|
374
369
|
@logger.debug msg
|
375
370
|
end
|
376
371
|
|
377
|
-
def request(method, path, params: nil, body: nil
|
372
|
+
def request(method, path, params: nil, body: nil)
|
378
373
|
debug_log "Request #{method.to_s.upcase} #{API_HOST}/#{path} params:#{params}, body:#{body}"
|
379
374
|
res = access_token.request(method, path, params: params, body: body)
|
380
375
|
debug_log "Response status:#{res.status}, body:#{res.body}"
|
381
|
-
validate_status_code res, expected_status
|
382
376
|
parse_as_json res
|
383
377
|
rescue OAuth2::Error => e
|
384
378
|
res = e.response.response
|
385
379
|
raise ApiError.new res, e
|
386
380
|
end
|
387
381
|
|
388
|
-
def validate_status_code(res, expected_status)
|
389
|
-
return unless expected_status
|
390
|
-
return if expected_status == res.status
|
391
|
-
|
392
|
-
raise ApiError.new res, message: 'unexpected http status returned.'
|
393
|
-
end
|
394
|
-
|
395
382
|
def parse_as_json(res)
|
396
383
|
return if blank? res.body
|
397
384
|
|
data/lib/calendly/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenji Koshikawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|
@@ -166,7 +166,7 @@ metadata:
|
|
166
166
|
homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
|
167
167
|
source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
|
168
168
|
changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
|
169
|
-
documentation_uri: https://www.rubydoc.info/gems/calendly/0.1.
|
169
|
+
documentation_uri: https://www.rubydoc.info/gems/calendly/0.1.1
|
170
170
|
post_install_message:
|
171
171
|
rdoc_options: []
|
172
172
|
require_paths:
|