calendly 0.1.3 → 0.2.0
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 +5 -2
- data/lib/calendly/client.rb +11 -1
- data/lib/calendly/models/event.rb +9 -1
- data/lib/calendly/models/organization.rb +27 -3
- data/lib/calendly/models/organization_membership.rb +9 -1
- data/lib/calendly/models/user.rb +27 -3
- 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: 21eb586917df0301bac9cc14ee37b00f9d2e6775c4980778e8bf6f0194f19c2b
|
4
|
+
data.tar.gz: '0846561057ab9fba60c3e4e20bb141b387f1e75924ed29e8ee5f661f269d2a27'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8436df1c0240bdaf1891feb514bd12aa48d7ba8f24dde0c8687e193b178e74f21a0cb9536b7cca778ede6369b76c5db1510d5db403931a79a2f5760400a6f75
|
7
|
+
data.tar.gz: 011512ae26dda34a724b7ff31e05ea8d2bcc6e2e3750be397953ab435b9f2e42ae556d27b0427075cd686a3ba1ce34d355aa4739869c0b1a8a0eda1bcd75b6ec
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
|
2
1
|
# CHANGELOG
|
3
2
|
|
3
|
+
## 0.2.0
|
4
|
+
|
5
|
+
- save fetched data in cache. (refs #14)
|
6
|
+
|
4
7
|
## 0.1.3
|
5
8
|
|
6
|
-
- support webhook APIs
|
9
|
+
- support webhook APIs (refs #9)
|
7
10
|
- `GET /webhook_subscriptions`
|
8
11
|
- `GET /webhook_subscriptions/{webhook_uuid}`
|
9
12
|
- `POST /webhook_subscriptions`
|
data/lib/calendly/client.rb
CHANGED
@@ -59,11 +59,21 @@ module Calendly
|
|
59
59
|
# @raise [Calendly::ApiError] if the api returns error code.
|
60
60
|
# @since 0.0.1
|
61
61
|
def current_user
|
62
|
-
|
62
|
+
return @cached_current_user if @cached_current_user
|
63
|
+
|
64
|
+
@cached_current_user = user
|
63
65
|
end
|
64
66
|
|
65
67
|
alias me current_user
|
66
68
|
|
69
|
+
# @since 0.2.0
|
70
|
+
def current_user!
|
71
|
+
@cached_current_user = nil
|
72
|
+
current_user
|
73
|
+
end
|
74
|
+
|
75
|
+
alias me! current_user!
|
76
|
+
|
67
77
|
#
|
68
78
|
# Get basic information about a user
|
69
79
|
#
|
@@ -79,8 +79,16 @@ module Calendly
|
|
79
79
|
# @raise [Calendly::ApiError] if the api returns error code.
|
80
80
|
# @since 0.1.0
|
81
81
|
def invitees(opts = {})
|
82
|
+
return @cached_invitees if @cached_invitees
|
83
|
+
|
82
84
|
request_proc = proc { |options| client.event_invitees uuid, options }
|
83
|
-
auto_pagination request_proc, opts
|
85
|
+
@cached_invitees = auto_pagination request_proc, opts
|
86
|
+
end
|
87
|
+
|
88
|
+
# @since 0.2.0
|
89
|
+
def invitees!(opts = {})
|
90
|
+
@cached_invitees = nil
|
91
|
+
invitees opts
|
84
92
|
end
|
85
93
|
|
86
94
|
private
|
@@ -25,8 +25,16 @@ module Calendly
|
|
25
25
|
# @raise [Calendly::ApiError] if the api returns error code.
|
26
26
|
# @since 0.1.0
|
27
27
|
def memberships(opts = {})
|
28
|
+
return @cached_memberships if @cached_memberships
|
29
|
+
|
28
30
|
request_proc = proc { |options| client.memberships uri, options }
|
29
|
-
auto_pagination request_proc, opts
|
31
|
+
@cached_memberships = auto_pagination request_proc, opts
|
32
|
+
end
|
33
|
+
|
34
|
+
# @since 0.2.0
|
35
|
+
def memberships!(opts = {})
|
36
|
+
@cached_memberships = nil
|
37
|
+
memberships opts
|
30
38
|
end
|
31
39
|
|
32
40
|
#
|
@@ -44,8 +52,16 @@ module Calendly
|
|
44
52
|
# @raise [Calendly::ApiError] if the api returns error code.
|
45
53
|
# @since 0.1.0
|
46
54
|
def invitations(opts = {})
|
55
|
+
return @cached_invitations if @cached_invitations
|
56
|
+
|
47
57
|
request_proc = proc { |options| client.invitations uuid, options }
|
48
|
-
auto_pagination request_proc, opts
|
58
|
+
@cached_invitations = auto_pagination request_proc, opts
|
59
|
+
end
|
60
|
+
|
61
|
+
# @since 0.2.0
|
62
|
+
def invitations!(opts = {})
|
63
|
+
@cached_invitations = nil
|
64
|
+
invitations opts
|
49
65
|
end
|
50
66
|
|
51
67
|
#
|
@@ -74,8 +90,16 @@ module Calendly
|
|
74
90
|
# @raise [Calendly::ApiError] if the api returns error code.
|
75
91
|
# @since 0.1.3
|
76
92
|
def webhooks(opts = {})
|
93
|
+
return @cached_webhooks if @cached_webhooks
|
94
|
+
|
77
95
|
request_proc = proc { |options| client.webhooks uri, options }
|
78
|
-
auto_pagination request_proc, opts
|
96
|
+
@cached_webhooks = auto_pagination request_proc, opts
|
97
|
+
end
|
98
|
+
|
99
|
+
# @since 0.2.0
|
100
|
+
def webhooks!(opts = {})
|
101
|
+
@cached_webhooks = nil
|
102
|
+
webhooks opts
|
79
103
|
end
|
80
104
|
|
81
105
|
#
|
@@ -67,10 +67,18 @@ module Calendly
|
|
67
67
|
# @raise [Calendly::ApiError] if the api returns error code.
|
68
68
|
# @since 0.1.3
|
69
69
|
def user_scope_webhooks(opts = {})
|
70
|
+
return @cached_user_scope_webhooks if @cached_user_scope_webhooks
|
71
|
+
|
70
72
|
org_uri = organization.uri if organization
|
71
73
|
user_uri = user.uri if user
|
72
74
|
request_proc = proc { |options| client.user_scope_webhooks org_uri, user_uri, options }
|
73
|
-
auto_pagination request_proc, opts
|
75
|
+
@cached_user_scope_webhooks = auto_pagination request_proc, opts
|
76
|
+
end
|
77
|
+
|
78
|
+
# @since 0.2.0
|
79
|
+
def user_scope_webhooks!(opts = {})
|
80
|
+
@cached_user_scope_webhooks = nil
|
81
|
+
user_scope_webhooks opts
|
74
82
|
end
|
75
83
|
|
76
84
|
#
|
data/lib/calendly/models/user.rb
CHANGED
@@ -57,8 +57,16 @@ module Calendly
|
|
57
57
|
# @raise [Calendly::Error] if the uri is empty.
|
58
58
|
# @since 0.1.0
|
59
59
|
def organization_membership
|
60
|
+
return @cached_organization_membership if @cached_organization_membership
|
61
|
+
|
60
62
|
mems, = client.memberships_by_user uri
|
61
|
-
mems.first
|
63
|
+
@cached_organization_membership = mems.first
|
64
|
+
end
|
65
|
+
|
66
|
+
# @since 0.2.0
|
67
|
+
def organization_membership!
|
68
|
+
@cached_organization_membership = nil
|
69
|
+
organization_membership
|
62
70
|
end
|
63
71
|
|
64
72
|
#
|
@@ -74,8 +82,16 @@ module Calendly
|
|
74
82
|
# @raise [Calendly::ApiError] if the api returns error code.
|
75
83
|
# @since 0.1.0
|
76
84
|
def event_types(opts = {})
|
85
|
+
return @cached_event_types if @cached_event_types
|
86
|
+
|
77
87
|
request_proc = proc { |options| client.event_types uri, options }
|
78
|
-
auto_pagination request_proc, opts
|
88
|
+
@cached_event_types = auto_pagination request_proc, opts
|
89
|
+
end
|
90
|
+
|
91
|
+
# @since 0.2.0
|
92
|
+
def event_types!(opts = {})
|
93
|
+
@cached_event_types = nil
|
94
|
+
event_types opts
|
79
95
|
end
|
80
96
|
|
81
97
|
#
|
@@ -95,8 +111,16 @@ module Calendly
|
|
95
111
|
# @raise [Calendly::ApiError] if the api returns error code.
|
96
112
|
# @since 0.1.0
|
97
113
|
def scheduled_events(opts = {})
|
114
|
+
return @cached_scheduled_events if @cached_scheduled_events
|
115
|
+
|
98
116
|
request_proc = proc { |options| client.scheduled_events uri, options }
|
99
|
-
auto_pagination request_proc, opts
|
117
|
+
@cached_scheduled_events = auto_pagination request_proc, opts
|
118
|
+
end
|
119
|
+
|
120
|
+
# @since 0.2.0
|
121
|
+
def scheduled_events!(opts = {})
|
122
|
+
@cached_scheduled_events = nil
|
123
|
+
scheduled_events opts
|
100
124
|
end
|
101
125
|
end
|
102
126
|
end
|
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.
|
4
|
+
version: 0.2.0
|
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-09-
|
11
|
+
date: 2020-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|
@@ -168,7 +168,7 @@ metadata:
|
|
168
168
|
homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
|
169
169
|
source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
|
170
170
|
changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
|
171
|
-
documentation_uri: https://www.rubydoc.info/gems/calendly/0.
|
171
|
+
documentation_uri: https://www.rubydoc.info/gems/calendly/0.2.0
|
172
172
|
post_install_message:
|
173
173
|
rdoc_options: []
|
174
174
|
require_paths:
|