calendlyr 0.7.4 → 0.7.5
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 +1 -1
- data/calendlyr.gemspec +6 -6
- data/lib/calendlyr/client.rb +14 -43
- data/lib/calendlyr/resources/{event_type.rb → event_types.rb} +1 -1
- data/lib/calendlyr/resources/{event.rb → events.rb} +1 -1
- data/lib/calendlyr/resources/{group.rb → groups.rb} +1 -1
- data/lib/calendlyr/resources/{organization.rb → organizations.rb} +1 -1
- data/lib/calendlyr/resources/{outgoing_communication.rb → outgoing_communications.rb} +1 -1
- data/lib/calendlyr/resources/{routing_form.rb → routing_forms.rb} +1 -1
- data/lib/calendlyr/resources/{scheduling_link.rb → scheduling_links.rb} +1 -1
- data/lib/calendlyr/resources/{share.rb → shares.rb} +1 -1
- data/lib/calendlyr/resources/{user.rb → users.rb} +1 -1
- data/lib/calendlyr/resources/{webhook.rb → webhooks.rb} +1 -1
- data/lib/calendlyr/version.rb +1 -1
- data/lib/calendlyr.rb +13 -12
- data/test/calendlyr/client_test.rb +11 -0
- data/test/calendlyr/resource_test.rb +8 -0
- metadata +29 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d69cdfb2373e6ecbed4936f15670331a83b20816bd77e9aec6c166e43d47cde3
|
4
|
+
data.tar.gz: ebe3df79b6d23e1e6539d63c0bf447396aa80037304f765b04414cf4e862a745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3c733ada27c62a49fd5f2644ae2d0e6861c4c5e50b287b0e4173d7873a5e7f2cb83c37c3cde5509551bdea6c13b2d1c6469922c5a632076423c6f5aa8d26199
|
7
|
+
data.tar.gz: b6554a78bffea8609e5871f1c16e617997bcba34e2c348b285e1b5d27140a22009d91674dece47e37513fe6e7155c035654a49abd7713e211c0a64881e29b44c
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.7.5]
|
6
|
+
* Fix: Calendlyr::TooManyRequests was not included in autoloading list
|
7
|
+
* Fix: Calendlyr::ExternalCalendarError typo in class name
|
8
|
+
|
9
|
+
[0.7.5]: https://github.com/araluce/calendlyr/compare/v0.7.4...v0.7.5
|
10
|
+
|
5
11
|
## [0.7.4]
|
6
12
|
* Fix: Error class name typo `ExternalCalendarEror` -> `ExternalCalendarError`
|
7
13
|
* Fix: Error class name typo `TooManyRequestsEror` -> `TooManyRequests`
|
data/README.md
CHANGED
data/calendlyr.gemspec
CHANGED
@@ -17,10 +17,10 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_development_dependency "rake", "~>
|
21
|
-
spec.add_development_dependency "minitest", "~> 5.
|
22
|
-
spec.add_development_dependency "standard"
|
23
|
-
spec.add_development_dependency "webmock", "~> 3.
|
24
|
-
spec.add_development_dependency "codecov"
|
25
|
-
spec.add_development_dependency "simplecov"
|
20
|
+
spec.add_development_dependency "rake", "~> 13.2"
|
21
|
+
spec.add_development_dependency "minitest", "~> 5.25"
|
22
|
+
spec.add_development_dependency "standard", "~> 1.37" # Max version that supports Ruby 2.7
|
23
|
+
spec.add_development_dependency "webmock", "~> 3.23"
|
24
|
+
spec.add_development_dependency "codecov", "~> 0.6"
|
25
|
+
spec.add_development_dependency "simplecov", "~> 0.21"
|
26
26
|
end
|
data/lib/calendlyr/client.rb
CHANGED
@@ -8,10 +8,6 @@ module Calendlyr
|
|
8
8
|
@token = token
|
9
9
|
end
|
10
10
|
|
11
|
-
def availability
|
12
|
-
AvailabilityResource.new(self)
|
13
|
-
end
|
14
|
-
|
15
11
|
def me(force_reload: false)
|
16
12
|
@me = nil if force_reload
|
17
13
|
@me ||= users.me
|
@@ -21,48 +17,23 @@ module Calendlyr
|
|
21
17
|
me.organization
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
def
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
def events
|
37
|
-
EventResource.new(self)
|
38
|
-
end
|
39
|
-
|
40
|
-
def groups
|
41
|
-
GroupResource.new(self)
|
20
|
+
# Given a client.users, method_missing behaves like this:
|
21
|
+
# def users
|
22
|
+
# UsersResource.new(self)
|
23
|
+
# end
|
24
|
+
def method_missing(method_name, *args, &block)
|
25
|
+
resource_name = method_name.to_s.split("_").collect(&:capitalize).join + "Resource"
|
26
|
+
if Calendlyr.const_defined?(resource_name)
|
27
|
+
Calendlyr.const_get(resource_name).new(self)
|
28
|
+
else
|
29
|
+
super
|
30
|
+
end
|
42
31
|
end
|
43
32
|
|
44
|
-
def
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
def routing_forms
|
49
|
-
RoutingFormResource.new(self)
|
50
|
-
end
|
51
|
-
|
52
|
-
def scheduling_links
|
53
|
-
SchedulingLinkResource.new(self)
|
54
|
-
end
|
55
|
-
|
56
|
-
def shares
|
57
|
-
ShareResource.new(self)
|
58
|
-
end
|
59
|
-
|
60
|
-
def webhooks
|
61
|
-
WebhookResource.new(self)
|
62
|
-
end
|
33
|
+
def respond_to_missing?(method_name, include_private = false)
|
34
|
+
resource_name = method_name.to_s.split("_").collect(&:capitalize).join + "Resource"
|
63
35
|
|
64
|
-
|
65
|
-
DataComplianceResource.new(self)
|
36
|
+
Calendlyr.const_defined?(resource_name) || super
|
66
37
|
end
|
67
38
|
|
68
39
|
# Avoid returning #<Calendlyr::Client @token="token" ...>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calendlyr
|
2
|
-
class
|
2
|
+
class GroupsResource < Resource
|
3
3
|
def list(organization:, **params)
|
4
4
|
response = get_request("groups", params: params.merge(organization: organization))
|
5
5
|
Collection.from_response(response, type: Group, client: client)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calendlyr
|
2
|
-
class
|
2
|
+
class OrganizationsResource < Resource
|
3
3
|
def activity_log(organization: nil, **params)
|
4
4
|
response = get_request("activity_log_entries", params: {organization: organization}.merge(params).compact)
|
5
5
|
Collection.from_response(response, type: ActivityLog, client: client)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calendlyr
|
2
|
-
class
|
2
|
+
class OutgoingCommunicationsResource < Resource
|
3
3
|
def list(**params)
|
4
4
|
response = get_request("outgoing_communications", params: params)
|
5
5
|
Collection.from_response(response, type: Object, client: client)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calendlyr
|
2
|
-
class
|
2
|
+
class RoutingFormsResource < Resource
|
3
3
|
def list(organization:, **params)
|
4
4
|
response = get_request("routing_forms", params: {organization: organization}.merge(params))
|
5
5
|
Collection.from_response(response, type: RoutingForm, client: client)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calendlyr
|
2
|
-
class
|
2
|
+
class SchedulingLinksResource < Resource
|
3
3
|
def create(owner:, max_event_count:, owner_type: "EventType")
|
4
4
|
body = {owner: owner, max_event_count: max_event_count, owner_type: owner_type}
|
5
5
|
SchedulingLink.new post_request("scheduling_links", body: body).dig("resource").merge(client: client)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calendlyr
|
2
|
-
class
|
2
|
+
class WebhooksResource < Resource
|
3
3
|
def list(organization:, scope:, **params)
|
4
4
|
response = get_request("webhook_subscriptions", params: params.merge(organization: organization, scope: scope).compact)
|
5
5
|
Collection.from_response(response, type: Webhooks::Subscription, client: client)
|
data/lib/calendlyr/version.rb
CHANGED
data/lib/calendlyr.rb
CHANGED
@@ -9,27 +9,28 @@ module Calendlyr
|
|
9
9
|
# Errors
|
10
10
|
autoload :BadRequest, "calendlyr/error"
|
11
11
|
autoload :Error, "calendlyr/error"
|
12
|
-
autoload :
|
12
|
+
autoload :ExternalCalendarError, "calendlyr/error"
|
13
13
|
autoload :InternalServerError, "calendlyr/error"
|
14
14
|
autoload :NotFound, "calendlyr/error"
|
15
15
|
autoload :PaymentRequired, "calendlyr/error"
|
16
16
|
autoload :PermissionDenied, "calendlyr/error"
|
17
|
-
autoload :ResponseErrorHandler, "calendlyr/error"
|
18
17
|
autoload :Unauthenticated, "calendlyr/error"
|
18
|
+
autoload :TooManyRequests, "calendlyr/error"
|
19
|
+
autoload :ResponseErrorHandler, "calendlyr/error"
|
19
20
|
|
20
21
|
# High-level categories of Calendly API calls
|
21
22
|
autoload :AvailabilityResource, "calendlyr/resources/availability"
|
22
23
|
autoload :DataComplianceResource, "calendlyr/resources/data_compliance"
|
23
|
-
autoload :
|
24
|
-
autoload :
|
25
|
-
autoload :
|
26
|
-
autoload :
|
27
|
-
autoload :
|
28
|
-
autoload :
|
29
|
-
autoload :
|
30
|
-
autoload :
|
31
|
-
autoload :
|
32
|
-
autoload :
|
24
|
+
autoload :EventsResource, "calendlyr/resources/events"
|
25
|
+
autoload :EventTypesResource, "calendlyr/resources/event_types"
|
26
|
+
autoload :GroupsResource, "calendlyr/resources/groups"
|
27
|
+
autoload :OrganizationsResource, "calendlyr/resources/organizations"
|
28
|
+
autoload :OutgoingCommunicationsResource, "calendlyr/resources/outgoing_communications"
|
29
|
+
autoload :RoutingFormsResource, "calendlyr/resources/routing_forms"
|
30
|
+
autoload :SchedulingLinksResource, "calendlyr/resources/scheduling_links"
|
31
|
+
autoload :SharesResource, "calendlyr/resources/shares"
|
32
|
+
autoload :UsersResource, "calendlyr/resources/users"
|
33
|
+
autoload :WebhooksResource, "calendlyr/resources/webhooks"
|
33
34
|
|
34
35
|
# Classes used to return a nicer object wrapping the response data
|
35
36
|
autoload :ActivityLog, "calendlyr/objects/activity_log"
|
@@ -8,4 +8,15 @@ class ClientTest < Minitest::Test
|
|
8
8
|
def test_inspect
|
9
9
|
assert_equal "#<Calendlyr::Client>", client.inspect
|
10
10
|
end
|
11
|
+
|
12
|
+
def test_method_missing
|
13
|
+
assert_raises NoMethodError do
|
14
|
+
client.useers
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_respond_to_missing?
|
19
|
+
assert client.respond_to?(:users)
|
20
|
+
refute client.respond_to?(:useers)
|
21
|
+
end
|
11
22
|
end
|
@@ -20,4 +20,12 @@ class ResourceTest < Minitest::Test
|
|
20
20
|
client.me
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
def test_handle_response_too_many_requests
|
25
|
+
stub(path: "users/me", response: {body: "", status: 429})
|
26
|
+
|
27
|
+
assert_raises Calendlyr::TooManyRequests do
|
28
|
+
client.me
|
29
|
+
end
|
30
|
+
end
|
23
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calendlyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- araluce
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '13.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '13.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
33
|
+
version: '5.25'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5.
|
40
|
+
version: '5.25'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: standard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.37'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.37'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: webmock
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
61
|
+
version: '3.23'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
68
|
+
version: '3.23'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: codecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '0.6'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '0.6'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '0.21'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '0.21'
|
97
97
|
description: 'Ruby bindings for Calendly API. Calendly APIs can be found here: https://calendly.stoplight.io/docs/api-docs/'
|
98
98
|
email:
|
99
99
|
- araluce11@gmail.com
|
@@ -177,16 +177,16 @@ files:
|
|
177
177
|
- lib/calendlyr/resource.rb
|
178
178
|
- lib/calendlyr/resources/availability.rb
|
179
179
|
- lib/calendlyr/resources/data_compliance.rb
|
180
|
-
- lib/calendlyr/resources/
|
181
|
-
- lib/calendlyr/resources/
|
182
|
-
- lib/calendlyr/resources/
|
183
|
-
- lib/calendlyr/resources/
|
184
|
-
- lib/calendlyr/resources/
|
185
|
-
- lib/calendlyr/resources/
|
186
|
-
- lib/calendlyr/resources/
|
187
|
-
- lib/calendlyr/resources/
|
188
|
-
- lib/calendlyr/resources/
|
189
|
-
- lib/calendlyr/resources/
|
180
|
+
- lib/calendlyr/resources/event_types.rb
|
181
|
+
- lib/calendlyr/resources/events.rb
|
182
|
+
- lib/calendlyr/resources/groups.rb
|
183
|
+
- lib/calendlyr/resources/organizations.rb
|
184
|
+
- lib/calendlyr/resources/outgoing_communications.rb
|
185
|
+
- lib/calendlyr/resources/routing_forms.rb
|
186
|
+
- lib/calendlyr/resources/scheduling_links.rb
|
187
|
+
- lib/calendlyr/resources/shares.rb
|
188
|
+
- lib/calendlyr/resources/users.rb
|
189
|
+
- lib/calendlyr/resources/webhooks.rb
|
190
190
|
- lib/calendlyr/version.rb
|
191
191
|
- test/calendlyr/client_test.rb
|
192
192
|
- test/calendlyr/object_test.rb
|