calendly 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06ba574d911ff7447d87b9dafe93105da126e1b78cc054d1e2d220e1403961e0
4
- data.tar.gz: 7cd7c74bd6ad8679c0f83d8832fc3da0ef81013d677186a207890194116f69eb
3
+ metadata.gz: ed9a6a6603eff87ea16541bd352c82516ca1fb69b1e517d7e08b2a433c9a2764
4
+ data.tar.gz: 502ddb8c46807e459f0b3ee4179e853912ea1eab1091a0526decda51f4b1ee6a
5
5
  SHA512:
6
- metadata.gz: 0d95d23f7acfea8d1f5884930125f9f6489fb7ab7515090a39571712d994893b6de66a880bba72425cd090dae26a3cd07bb4a12266e8de48d347a8e334ce6604
7
- data.tar.gz: b7b7902adf506e3498d32161794f7dc871e3797e6ed307aa72d35378cd8f1837feb8ea732e79d9f21d80adb45886c1e8611fcc33d8d244987a338bfca6dd5eae
6
+ metadata.gz: 9c2dd02c24e48b0db78ff0e687c6934700d30392e382d8dd8f0559aeb2a4caa00e76351b80575b086ecb95e2d6d33ae339e70e623b1831463ff71ae956d46b4e
7
+ data.tar.gz: 256e9711d23191ec8dc5cfbc5893f31deb98975d85fcdaccf74d2c86cca1537922848f64443474614345a3b283e24d205c3d0408c396dffd1e7e75c89812e91a
@@ -1,8 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.5.0
4
+
5
+ - changed Calendly::Client#scheduled_events behavior (refs #21)
6
+ - previous version:
7
+ - getting events belonging to a specific USER
8
+ - current version:
9
+ - getting all events belonging to a specific ORGANIZATION
10
+ - added Calendly::Client#scheduled_events_by_user method instead_of the before behavior
11
+
3
12
  ## 0.4.2
4
13
 
5
- - add new following fields to Invitee model (refs #21)
14
+ - added new following fields to Invitee model (refs #21)
6
15
  - :rescheduled
7
16
  - :old_invitee
8
17
  - :new_invitee
@@ -11,20 +20,20 @@
11
20
 
12
21
  ## 0.4.1
13
22
 
14
- - support API
23
+ - started to support a API
15
24
  - `GET /event_types/{uuid}`
16
25
 
17
26
  ## 0.4.0
18
27
 
19
- - fix changed Location fields such as `kind` to `type`. (refs #18)
28
+ - fixed a changes for Location fields such as `kind` to `type`. (refs #18)
20
29
 
21
30
  ## 0.3.0
22
31
 
23
- - remove zeitwerk dependency. (refs #16)
32
+ - removed zeitwerk dependency. (refs #16)
24
33
 
25
34
  ## 0.2.0
26
35
 
27
- - save fetched data in cache. (refs #14)
36
+ - added caching features in object when fetching data. (refs #14)
28
37
 
29
38
  ## 0.1.3
30
39
 
@@ -36,59 +45,59 @@
36
45
 
37
46
  ## 0.1.2
38
47
 
39
- - fix rubocop warnings.
48
+ - fixed rubocop warnings.
40
49
 
41
50
  ## 0.1.1
42
51
 
43
- - add tests to make coverage 100%.
52
+ - added tests to make coverage 100%.
44
53
 
45
54
  ## 0.1.0
46
55
 
47
- - define methods to access associated resources with each model.
48
- - rename methods:
56
+ - defined methods to access associated resources with each model.
57
+ - renamed methods:
49
58
  - `Calendly::Client#events` to `Calendly::Client#scheduled_events`
50
59
 
51
60
  ## 0.0.7.alpha
52
61
 
53
- - support APIs
62
+ - started to support APIs
54
63
  - `POST /organizations/{uuid}/invitations`
55
64
  - `DELETE /organizations/{org_uuid}/invitations/{invitation_uuid}`
56
65
  - `DELETE /organization_memberships/{uuid}`
57
66
 
58
67
  ## 0.0.6.alpha
59
68
 
60
- - support APIs
69
+ - started to support APIs
61
70
  - `GET /organizations/{uuid}/invitations`
62
71
  - `GET /organizations/{organization_uuid}/invitations/{invitation_uuid}`
63
72
 
64
73
  ## 0.0.5.alpha
65
74
 
66
- - support APIs
75
+ - started to support APIs
67
76
  - `GET /organization_memberships`
68
77
  - `GET /organization_memberships/{uuid}`
69
- - rename fields
78
+ - renamed fields
70
79
  - Invitee#event to Invitee#event_uri
71
80
  - Event#event_type to Event#event_type_uri
72
81
 
73
82
  ## 0.0.4.alpha
74
83
 
75
- - support APIs
84
+ - started to support APIs
76
85
  - `GET /scheduled_events/{event_uuid}/invitees`
77
86
  - `GET /scheduled_events/{event_uuid}/invitees/{invitee_uuid}`
78
87
 
79
88
  ## 0.0.3.alpha
80
89
 
81
- - support APIs
90
+ - started to support APIs
82
91
  - `GET /scheduled_events`
83
92
  - `GET /scheduled_events/{uuid}`
84
93
 
85
94
  ## 0.0.2.alpha
86
95
 
87
- - support APIs
96
+ - started to support APIs
88
97
  - `GET /event_types`
89
98
 
90
99
  ## 0.0.1.alpha
91
100
 
92
101
  - Initial release
93
- - support APIs
102
+ - started to support a API
94
103
  - `GET /users/{uuid}`
@@ -144,10 +144,42 @@ module Calendly
144
144
  end
145
145
 
146
146
  #
147
- # Get List of User Events.
147
+ # Get List of scheduled events belonging to a specific organization.
148
+ #
149
+ # @param [String] org_uri the specified organization (organization's uri).
150
+ # @param [Hash] opts the optional request parameters.
151
+ # @option opts [Integer] :count Number of rows to return.
152
+ # @option opts [String] :invitee_email Return events scheduled with the specified invitee email.
153
+ # @option opts [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
154
+ # @option opts [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
155
+ # @option opts [String] :page_token Pass this to get the next portion of collection.
156
+ # @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values.
157
+ # @option opts [String] :status Whether the scheduled event is active or canceled.
158
+ # @return [Array<Array<Calendly::Event>, Hash>]
159
+ # - [Array<Calendly::Event>] events
160
+ # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
161
+ # @raise [Calendly::Error] if the org_uri arg is empty.
162
+ # @raise [Calendly::ApiError] if the api returns error code.
163
+ # @since 0.5.0
164
+ def scheduled_events(org_uri, opts = {})
165
+ check_not_empty org_uri, 'org_uri'
166
+
167
+ opts_keys = %i[count invitee_email max_start_time min_start_time page_token sort status]
168
+ params = {organization: org_uri}
169
+ params = merge_options opts, opts_keys, params
170
+ body = request :get, 'scheduled_events', params: params
171
+
172
+ items = body[:collection] || []
173
+ evs = items.map { |item| Event.new item, self }
174
+ [evs, next_page_params(body)]
175
+ end
176
+
177
+ #
178
+ # Get List of scheduled events belonging to a specific user.
148
179
  #
149
180
  # @param [String] user_uri the specified user (user's uri).
150
181
  # @param [Hash] opts the optional request parameters.
182
+ # @option opts [String] :organization the specified organization (organization's uri).
151
183
  # @option opts [Integer] :count Number of rows to return.
152
184
  # @option opts [String] :invitee_email Return events scheduled with the specified invitee email.
153
185
  # @option opts [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
@@ -161,10 +193,10 @@ module Calendly
161
193
  # @raise [Calendly::Error] if the user_uri arg is empty.
162
194
  # @raise [Calendly::ApiError] if the api returns error code.
163
195
  # @since 0.0.3
164
- def scheduled_events(user_uri, opts = {})
196
+ def scheduled_events_by_user(user_uri, opts = {})
165
197
  check_not_empty user_uri, 'user_uri'
166
198
 
167
- opts_keys = %i[count invitee_email max_start_time min_start_time page_token sort status]
199
+ opts_keys = %i[organization count invitee_email max_start_time min_start_time page_token sort status]
168
200
  params = {user: user_uri}
169
201
  params = merge_options opts, opts_keys, params
170
202
  body = request :get, 'scheduled_events', params: params
@@ -235,7 +267,7 @@ module Calendly
235
267
  end
236
268
 
237
269
  #
238
- # Get List memberships of all users belonging to an organization.
270
+ # Get List of memberships belonging to specific an organization.
239
271
  #
240
272
  # @param [String] org_uri the specified organization (organization's uri).
241
273
  # @param [Hash] opts the optional request parameters.
@@ -262,7 +294,7 @@ module Calendly
262
294
  end
263
295
 
264
296
  #
265
- # Get List memberships of all users belonging to an organization by user.
297
+ # Get List of memberships belonging to specific a user.
266
298
  #
267
299
  # @param [String] user_uri the specified user (user's uri).
268
300
  # @param [Hash] opts the optional request parameters.
@@ -80,6 +80,35 @@ module Calendly
80
80
  client.create_invitation uuid, email
81
81
  end
82
82
 
83
+ #
84
+ # Returns all Scheduled Events associated with self.
85
+ #
86
+ # @param [Hash] opts the optional request parameters.
87
+ # @option opts [Integer] :count Number of rows to return.
88
+ # @option opts [String] :invitee_email Return events scheduled with the specified invitee email
89
+ # @option opts [String] :max_start_timeUpper bound (inclusive) for an event's start time to filter by.
90
+ # @option opts [String] :min_start_time Lower bound (inclusive) for an event's start time to filter by.
91
+ # @option opts [String] :page_token Pass this to get the next portion of collection.
92
+ # @option opts [String] :sort Order results by the specified field and directin.
93
+ # Accepts comma-separated list of {field}:{direction} values.
94
+ # @option opts [String] :status Whether the scheduled event is active or canceled
95
+ # @return [Array<Calendly::Event>]
96
+ # @raise [Calendly::Error] if the uri is empty.
97
+ # @raise [Calendly::ApiError] if the api returns error code.
98
+ # @since 0.5.0
99
+ def scheduled_events(opts = {})
100
+ return @cached_scheduled_events if @cached_scheduled_events
101
+
102
+ request_proc = proc { |options| client.scheduled_events uri, options }
103
+ @cached_scheduled_events = auto_pagination request_proc, opts
104
+ end
105
+
106
+ # @since 0.5.0
107
+ def scheduled_events!(opts = {})
108
+ @cached_scheduled_events = nil
109
+ scheduled_events opts
110
+ end
111
+
83
112
  #
84
113
  # Get List of organization scope Webhooks associated with self.
85
114
  #
@@ -116,7 +116,7 @@ module Calendly
116
116
  def scheduled_events(opts = {})
117
117
  return @cached_scheduled_events if @cached_scheduled_events
118
118
 
119
- request_proc = proc { |options| client.scheduled_events uri, options }
119
+ request_proc = proc { |options| client.scheduled_events_by_user uri, options }
120
120
  @cached_scheduled_events = auto_pagination request_proc, opts
121
121
  end
122
122
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Calendly
4
- VERSION = '0.4.2'
4
+ VERSION = '0.5.0'
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.4.2
4
+ version: 0.5.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-11-26 00:00:00.000000000 Z
11
+ date: 2020-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -154,7 +154,7 @@ metadata:
154
154
  homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
155
155
  source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
156
156
  changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
157
- documentation_uri: https://www.rubydoc.info/gems/calendly/0.4.2
157
+ documentation_uri: https://www.rubydoc.info/gems/calendly/0.5.0
158
158
  post_install_message:
159
159
  rdoc_options: []
160
160
  require_paths: