calendly 0.2.0 → 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: 21eb586917df0301bac9cc14ee37b00f9d2e6775c4980778e8bf6f0194f19c2b
4
- data.tar.gz: '0846561057ab9fba60c3e4e20bb141b387f1e75924ed29e8ee5f661f269d2a27'
3
+ metadata.gz: ed9a6a6603eff87ea16541bd352c82516ca1fb69b1e517d7e08b2a433c9a2764
4
+ data.tar.gz: 502ddb8c46807e459f0b3ee4179e853912ea1eab1091a0526decda51f4b1ee6a
5
5
  SHA512:
6
- metadata.gz: d8436df1c0240bdaf1891feb514bd12aa48d7ba8f24dde0c8687e193b178e74f21a0cb9536b7cca778ede6369b76c5db1510d5db403931a79a2f5760400a6f75
7
- data.tar.gz: 011512ae26dda34a724b7ff31e05ea8d2bcc6e2e3750be397953ab435b9f2e42ae556d27b0427075cd686a3ba1ce34d355aa4739869c0b1a8a0eda1bcd75b6ec
6
+ metadata.gz: 9c2dd02c24e48b0db78ff0e687c6934700d30392e382d8dd8f0559aeb2a4caa00e76351b80575b086ecb95e2d6d33ae339e70e623b1831463ff71ae956d46b4e
7
+ data.tar.gz: 256e9711d23191ec8dc5cfbc5893f31deb98975d85fcdaccf74d2c86cca1537922848f64443474614345a3b283e24d205c3d0408c396dffd1e7e75c89812e91a
@@ -1,8 +1,39 @@
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
+
12
+ ## 0.4.2
13
+
14
+ - added new following fields to Invitee model (refs #21)
15
+ - :rescheduled
16
+ - :old_invitee
17
+ - :new_invitee
18
+ - :cancel_url
19
+ - :reschedule_url
20
+
21
+ ## 0.4.1
22
+
23
+ - started to support a API
24
+ - `GET /event_types/{uuid}`
25
+
26
+ ## 0.4.0
27
+
28
+ - fixed a changes for Location fields such as `kind` to `type`. (refs #18)
29
+
30
+ ## 0.3.0
31
+
32
+ - removed zeitwerk dependency. (refs #16)
33
+
3
34
  ## 0.2.0
4
35
 
5
- - save fetched data in cache. (refs #14)
36
+ - added caching features in object when fetching data. (refs #14)
6
37
 
7
38
  ## 0.1.3
8
39
 
@@ -14,59 +45,59 @@
14
45
 
15
46
  ## 0.1.2
16
47
 
17
- - fix rubocop warnings.
48
+ - fixed rubocop warnings.
18
49
 
19
50
  ## 0.1.1
20
51
 
21
- - add tests to make coverage 100%.
52
+ - added tests to make coverage 100%.
22
53
 
23
54
  ## 0.1.0
24
55
 
25
- - define methods to access associated resources with each model.
26
- - rename methods:
56
+ - defined methods to access associated resources with each model.
57
+ - renamed methods:
27
58
  - `Calendly::Client#events` to `Calendly::Client#scheduled_events`
28
59
 
29
60
  ## 0.0.7.alpha
30
61
 
31
- - support APIs
62
+ - started to support APIs
32
63
  - `POST /organizations/{uuid}/invitations`
33
64
  - `DELETE /organizations/{org_uuid}/invitations/{invitation_uuid}`
34
65
  - `DELETE /organization_memberships/{uuid}`
35
66
 
36
67
  ## 0.0.6.alpha
37
68
 
38
- - support APIs
69
+ - started to support APIs
39
70
  - `GET /organizations/{uuid}/invitations`
40
71
  - `GET /organizations/{organization_uuid}/invitations/{invitation_uuid}`
41
72
 
42
73
  ## 0.0.5.alpha
43
74
 
44
- - support APIs
75
+ - started to support APIs
45
76
  - `GET /organization_memberships`
46
77
  - `GET /organization_memberships/{uuid}`
47
- - rename fields
78
+ - renamed fields
48
79
  - Invitee#event to Invitee#event_uri
49
80
  - Event#event_type to Event#event_type_uri
50
81
 
51
82
  ## 0.0.4.alpha
52
83
 
53
- - support APIs
84
+ - started to support APIs
54
85
  - `GET /scheduled_events/{event_uuid}/invitees`
55
86
  - `GET /scheduled_events/{event_uuid}/invitees/{invitee_uuid}`
56
87
 
57
88
  ## 0.0.3.alpha
58
89
 
59
- - support APIs
90
+ - started to support APIs
60
91
  - `GET /scheduled_events`
61
92
  - `GET /scheduled_events/{uuid}`
62
93
 
63
94
  ## 0.0.2.alpha
64
95
 
65
- - support APIs
96
+ - started to support APIs
66
97
  - `GET /event_types`
67
98
 
68
99
  ## 0.0.1.alpha
69
100
 
70
101
  - Initial release
71
- - support APIs
102
+ - started to support a API
72
103
  - `GET /users/{uuid}`
data/README.md CHANGED
@@ -5,40 +5,7 @@
5
5
  [![Gem Version](https://badge.fury.io/rb/calendly.svg)](http://badge.fury.io/rb/calendly)
6
6
  [![license](https://img.shields.io/github/license/koshilife/calendly-api-ruby-client)](https://github.com/koshilife/calendly-api-ruby-client/blob/master/LICENSE.txt)
7
7
 
8
- ## About
9
-
10
- These client libraries are created for [Calendly v2 APIs](https://calendly.stoplight.io/docs/gh/calendly/api-docs).
11
-
12
- As of August 2020, Calendly v2 API is currently undergoing an upgrade.
13
- This library is trying to follow and support for the upgrade.
14
-
15
- As of now the supported statuses each Calendly API are as below.
16
-
17
- ## Supported statuses each Calendly API
18
-
19
- - User
20
- - [x] Get basic information about a user
21
- - EventType
22
- - [ ] Get Event Type (This endpoint hasn't been released yet.)
23
- - [x] User Event Types
24
- - Organization
25
- - [x] Get Organization Invitation
26
- - [x] Get Organization Invitations
27
- - [x] Get Organization Membership
28
- - [x] Get a list of Organization Memberships
29
- - [x] Invite a person to Organization
30
- - [x] Remove a User from an Organization
31
- - [x] Revoke Organization Invitation
32
- - ScheduledEvent
33
- - [x] Get Event
34
- - [x] Get Invitee of an Event
35
- - [x] Get List of Event Invitees
36
- - [x] Get List of User Events
37
- - Webhook V2
38
- - [x] Create Webhook Subscription
39
- - [x] Delete Webhook Subscription
40
- - [x] Get Webhook Subscription
41
- - [x] List Webhook Subscriptions
8
+ These client libraries are created for [Calendly v2 APIs](https://calendly.stoplight.io/).
42
9
 
43
10
  ## Installation
44
11
 
@@ -172,6 +139,8 @@ invitation = my_org.create_invitation('foobar@example.com')
172
139
  # 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"}}
173
140
  ```
174
141
 
142
+ More in-depth method documentation can be found at [RubyDoc.info](https://www.rubydoc.info/gems/calendly/).
143
+
175
144
  ## Contributing
176
145
 
177
146
  Bug reports and pull requests are welcome on [GitHub](https://github.com/koshilife/calendly-api-ruby-client). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ['lib']
30
30
 
31
31
  spec.add_runtime_dependency 'oauth2', '>= 1.4.4'
32
- spec.add_runtime_dependency 'zeitwerk', '>= 2.3.0'
33
32
 
34
33
  spec.add_development_dependency 'bundler'
35
34
  spec.add_development_dependency 'codecov'
@@ -1,9 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'zeitwerk'
4
- loader = Zeitwerk::Loader.for_gem
5
- loader.collapse('**/models')
6
- loader.setup
3
+ Dir[
4
+ File.join(
5
+ File.dirname(__FILE__),
6
+ 'calendly',
7
+ '**',
8
+ '*'
9
+ )
10
+ ].sort.each do |f|
11
+ next if File.directory? f
12
+
13
+ require f
14
+ end
7
15
 
8
16
  # module for Calendly apis client
9
17
  module Calendly
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/error'
4
+
3
5
  module Calendly
4
6
  # Calendly apis client error object.
5
- class ApiError < Calendly::Error
7
+ class ApiError < Error
6
8
  # @return [Faraday::Response]
7
9
  attr_reader :response
8
10
  # @return [Integer]
@@ -88,6 +88,20 @@ module Calendly
88
88
  User.new body[:resource], self
89
89
  end
90
90
 
91
+ #
92
+ # Returns a single Event Type by its UUID.
93
+ #
94
+ # @param [String] uuid the specified event type (event type's uuid).
95
+ # @return [Calendly::EventType]
96
+ # @raise [Calendly::Error] if the uuid arg is empty.
97
+ # @raise [Calendly::ApiError] if the api returns error code.
98
+ # @since 0.4.1
99
+ def event_type(uuid)
100
+ check_not_empty uuid, 'uuid'
101
+ body = request :get, "event_types/#{uuid}"
102
+ EventType.new body[:resource], self
103
+ end
104
+
91
105
  #
92
106
  # Returns all Event Types associated with a specified User.
93
107
  #
@@ -130,10 +144,42 @@ module Calendly
130
144
  end
131
145
 
132
146
  #
133
- # 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.
134
179
  #
135
180
  # @param [String] user_uri the specified user (user's uri).
136
181
  # @param [Hash] opts the optional request parameters.
182
+ # @option opts [String] :organization the specified organization (organization's uri).
137
183
  # @option opts [Integer] :count Number of rows to return.
138
184
  # @option opts [String] :invitee_email Return events scheduled with the specified invitee email.
139
185
  # @option opts [String] :max_start_time Upper bound (inclusive) for an event's start time to filter by.
@@ -147,10 +193,10 @@ module Calendly
147
193
  # @raise [Calendly::Error] if the user_uri arg is empty.
148
194
  # @raise [Calendly::ApiError] if the api returns error code.
149
195
  # @since 0.0.3
150
- def scheduled_events(user_uri, opts = {})
196
+ def scheduled_events_by_user(user_uri, opts = {})
151
197
  check_not_empty user_uri, 'user_uri'
152
198
 
153
- 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]
154
200
  params = {user: user_uri}
155
201
  params = merge_options opts, opts_keys, params
156
202
  body = request :get, 'scheduled_events', params: params
@@ -221,7 +267,7 @@ module Calendly
221
267
  end
222
268
 
223
269
  #
224
- # Get List memberships of all users belonging to an organization.
270
+ # Get List of memberships belonging to specific an organization.
225
271
  #
226
272
  # @param [String] org_uri the specified organization (organization's uri).
227
273
  # @param [Hash] opts the optional request parameters.
@@ -248,7 +294,7 @@ module Calendly
248
294
  end
249
295
 
250
296
  #
251
- # Get List memberships of all users belonging to an organization by user.
297
+ # Get List of memberships belonging to specific a user.
252
298
  #
253
299
  # @param [String] user_uri the specified user (user's uri).
254
300
  # @param [Hash] opts the optional request parameters.
@@ -505,7 +551,7 @@ module Calendly
505
551
  end
506
552
 
507
553
  def check_not_empty(value, name)
508
- raise Calendly::Error.new("#{name} is required.") if blank? value
554
+ raise Error.new("#{name} is required.") if blank? value
509
555
  end
510
556
 
511
557
  def blank?(value)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/loggable'
4
+
3
5
  module Calendly
4
6
  # calendly module's base error object
5
7
  class Error < StandardError
@@ -19,7 +19,7 @@ module Calendly
19
19
  log msg, :debug
20
20
  end
21
21
 
22
- private
22
+ private
23
23
 
24
24
  def log(msg, level = :info)
25
25
  logger = Calendly.configuration.logger
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+ require 'calendly/models/event_type'
6
+
3
7
  module Calendly
4
8
  # Calendly's event model.
5
9
  # A meeting that has been scheduled
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+
3
6
  module Calendly
4
7
  # Calendly's event type model.
5
8
  # A configuration for a schedulable event
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+ require 'calendly/models/event'
6
+
3
7
  module Calendly
4
8
  # Calendly's Invitee model.
5
9
  # An individual who has been invited to meet with a Calendly member.
@@ -30,6 +34,22 @@ module Calendly
30
34
  # @return [String]
31
35
  # Text (SMS) reminder phone number.
32
36
  attr_accessor :text_reminder_number
37
+ # @return [Boolean]
38
+ # Indicates if this invitee has rescheduled.
39
+ # If true, a reference to the new Invitee instance is provided in the new_invitee field.
40
+ attr_accessor :rescheduled
41
+ # @return [String, nil]
42
+ # Reference to old Invitee instance that got rescheduled.
43
+ attr_accessor :old_invitee
44
+ # @return [String, nil]
45
+ # Link to new invitee, after reschedule.
46
+ attr_accessor :new_invitee
47
+ # @return [String]
48
+ # Link to cancelling the event for the invitee.
49
+ attr_accessor :cancel_url
50
+ # @return [String]
51
+ # Link to rescheduling the event for the invitee.
52
+ attr_accessor :reschedule_url
33
53
  # @return [Time]
34
54
  # Moment when user record was first created.
35
55
  attr_accessor :created_at
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/models/model_utils'
4
+
3
5
  module Calendly
4
6
  # Calendly's InviteeQuestionAndAnswer model.
5
7
  # An individual form question and response.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/models/model_utils'
4
+
3
5
  module Calendly
4
6
  # Calendly's InviteeTracking model.
5
7
  # Object that represents UTM and Salesforce tracking parameters associated with the invitee.
@@ -1,52 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/models/model_utils'
4
+
3
5
  module Calendly
4
6
  # Calendly's location model.
5
- # Polymorphic base type for the various supported meeting locations.
7
+ # The polymorphic base type for an event location that Calendly supports
6
8
  class Location
7
9
  include ModelUtils
8
10
 
11
+ #
9
12
  # data patterns is below:
10
- # - 1. A meeting at a pre-specified physical location
11
- # - [String] :kind
12
- # - [String] :location A physical location specified by the meeting publisher.
13
- # - 2. Meeting publisher will call the invitee
14
- # - [String] :kind
15
- # - 3. Invitee will call meeting publisher at the specified phone number.
16
- # - [String] :kind
17
- # - [String] :phone_number Phone number invitee should use to reach meeting publisher.
18
- # - 4. Meeting will take place in a Google Meet / Hangout conference.
19
- # - [String] :kind
20
- # - 5. Meeting will take place in a Zoom conference.
21
- # - [String] :kind
22
- # - 6. Meeting will take place in a GotoMeeting conference.
23
- # - [String] :kind
24
- # - [String] :external_id Zoom-supplied conference id.
25
- # - [String] :state Current state of the conference in Zoom.
26
- # - [Hash] :data Arbitrary conference metadata supplied by Zoom.
27
- # - 7. Arbitrary conference metadata supplied by GotoMeeting.
28
- # - [String] :kind
29
- # - [String] :external_id GotoMeeting-supplied conference id.
30
- # - [String] :state Current state of the conference in GotoMeeting.
31
- # - [String] :data Arbitrary conference metadata supplied by GotoMeeting.
32
- # - 8. Meeting location does not fall in a standard category, and is as described by the meeting publisher.
33
- # - [String] :kind
34
- # - [String] :location Location description provided by meeting publisher.
35
- # - 9. Meeting location was specified by invitee.
36
- # - [String] :kind
37
- # - [String] :location Meeting location was specified by invitee.
13
+ #
14
+ # 1. In-Person Meeting: Information about the physical (in-person) event location.
15
+ # @param [String] type Indicates that the event host (publisher) will call the invitee.
16
+ # @param [String] location The physical location specified by the event host (publisher).
17
+ #
18
+ # 2. Outbound Call: Meeting publisher will call the Invitee
19
+ # @param [String] type Indicates that the event host (publisher) will call the invitee.
20
+ # @param [String] location The phone number the event host (publisher) will use to call the invitee.
21
+ #
22
+ # 3. Inbound Call: Invitee will call meeting publisher at the specified phone number.
23
+ # @param [String] type Indicates that the invitee will call the event host.
24
+ # @param [String] location The phone number the invitee will use to call the event host (publisher).
25
+ #
26
+ # 4. Google Conference: Details about an Event that will take place using a Google Meet / Hangout conference.
27
+ # @param [String] type The event location is a Google Meet or Hangouts conference.
28
+ # @param [String] status Indicates the current status of the Google conference.
29
+ # @param [String] join_url Google conference meeting url.
30
+ #
31
+ # 5. Zoom Conference: Meeting will take place in a Zoom conference.
32
+ # @param [String] type The event location is a Zoom conference
33
+ # @param [String] status Indicates the current status of the Zoom conference.
34
+ # @param [String] join_url Zoom meeting url.
35
+ # @param [Hash] data The conference metadata supplied by Zoom.
36
+ #
37
+ # 6. GoToMeeting Conference: Details about an Event that will take place using a GotoMeeting conference
38
+ # @param [String] type The event location is a GoToMeeting conference.
39
+ # @param [String] status Indicates the current status of the GoToMeeting conference.
40
+ # @param [String] join_url GoToMeeting conference meeting url.
41
+ # @param [Hash] data The conference metadata supplied by GoToMeeting.
42
+ #
43
+ # 7. Microsoft Teams Conference:
44
+ # @param [String] type The event location is a Zoom conference.
45
+ # @param [String] status Indicates the current status of the Microsoft Teams conference.
46
+ # @param [String] join_url Microsoft Teams meeting url.
47
+ # @param [Hash] data The conference metadata supplied by Microsoft Teams.
48
+ #
49
+ # 8. Custom Location:
50
+ # Use this to describe an existing Calendly-supported event location.
51
+ # @param [String] type The event location doesn't fall into a standard category defined by the event host (publisher).
52
+ # @param [String] location The event location description provided by the invitee.
53
+ #
54
+ # 9. Invitee Specified Location:
55
+ # Information about an event location that’s specified by the invitee.
56
+ # @param [String] type The event location selected by the invitee.
57
+ # @param [String] location The event location description provided by the invitee.
38
58
  #
39
59
 
40
60
  # @return [String]
41
- attr_accessor :kind
61
+ attr_accessor :type
42
62
  # @return [String]
43
63
  attr_accessor :location
44
64
  # @return [String]
45
- attr_accessor :phone_number
46
- # @return [String]
47
- attr_accessor :external_id
65
+ attr_accessor :status
48
66
  # @return [String]
49
- attr_accessor :state
67
+ attr_accessor :join_url
50
68
  # @return [Hash]
51
69
  attr_accessor :data
52
70
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'time'
4
+ require 'calendly/error'
4
5
 
5
6
  module Calendly
6
7
  # Calendly model utility.
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+
3
6
  module Calendly
4
7
  # Calendly's organization model.
5
8
  class Organization
@@ -77,6 +80,35 @@ module Calendly
77
80
  client.create_invitation uuid, email
78
81
  end
79
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
+
80
112
  #
81
113
  # Get List of organization scope Webhooks associated with self.
82
114
  #
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+ require 'calendly/models/organization'
6
+ require 'calendly/models/user'
7
+
3
8
  module Calendly
4
9
  # Calendly's organization invitation model.
5
10
  class OrganizationInvitation
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+ require 'calendly/models/organization'
6
+ require 'calendly/models/user'
7
+
3
8
  module Calendly
4
9
  # Calendly's organization membership model.
5
10
  class OrganizationMembership
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+
3
6
  module Calendly
4
7
  # Calendly's user model.
5
8
  # Primary account details of a specific user.
@@ -113,7 +116,7 @@ module Calendly
113
116
  def scheduled_events(opts = {})
114
117
  return @cached_scheduled_events if @cached_scheduled_events
115
118
 
116
- request_proc = proc { |options| client.scheduled_events uri, options }
119
+ request_proc = proc { |options| client.scheduled_events_by_user uri, options }
117
120
  @cached_scheduled_events = auto_pagination request_proc, opts
118
121
  end
119
122
 
@@ -1,7 +1,10 @@
1
- # Get a webhook subscription matching the provided UUID for the webhook subscription
2
-
3
1
  # frozen_string_literal: true
4
2
 
3
+ require 'calendly/client'
4
+ require 'calendly/models/model_utils'
5
+ require 'calendly/models/organization'
6
+ require 'calendly/models/user'
7
+
5
8
  module Calendly
6
9
  # Calendly's webhook model.
7
10
  class WebhookSubscription
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Calendly
4
- VERSION = '0.2.0'
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.2.0
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-09-18 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
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.4.4
27
- - !ruby/object:Gem::Dependency
28
- name: zeitwerk
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.3.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 2.3.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +154,7 @@ metadata:
168
154
  homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
169
155
  source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
170
156
  changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
171
- documentation_uri: https://www.rubydoc.info/gems/calendly/0.2.0
157
+ documentation_uri: https://www.rubydoc.info/gems/calendly/0.5.0
172
158
  post_install_message:
173
159
  rdoc_options: []
174
160
  require_paths: