calendly 0.13.0 → 0.14.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: f28a38b908de51d9f237545fcf0d59aab6a6d25747c2118b17529380c68c7918
4
- data.tar.gz: 126bbd0048717b51f5c923e48b74928263eaa1f55865dc73ef790ee11f097133
3
+ metadata.gz: b3d543d9baf7e5b5670b90c64e9caef192f1ef4c04c77fe7fe7cd188e0f15f37
4
+ data.tar.gz: a438d7738b377173cefbc501099da081231ed4ffc51cb69425b8ddc569d03121
5
5
  SHA512:
6
- metadata.gz: fad893cae7dbcbf7ab5c7d3aede8da1e7852885b3491eb65cad4ec7253a68d31655233d3308d00460a2a244756e7b4a7b31922381085f97c0e3229f775c50cc2
7
- data.tar.gz: cc9aca55ae9c25bccb69a2a320526d449b2a5b70807bd47e4e4e1db5903ee2618b276065b400c0c60183a4625b82e04840a2620f6180e69577a841350806550c
6
+ metadata.gz: 178a1fcb7611cb0208b62240eb59b0da6db9a34f4a57cf146377e5f2cdb3119640cbbb20c9ce1ee452e22875a589a11cf2652629f2cb2a11a02f268565543344
7
+ data.tar.gz: 5a498df806931cf4aada531d804587ed601e05c14a1b0a52ee94ee13b6443a99290abb4b05c4d3f77a3e68ecda30f8c110ee076868c6d3522fb0612d053e2e38
data/CHANGELOG.md CHANGED
@@ -1,8 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.14.0 - 2022-11-06
4
+
5
+ - supported Activity Log API. (#59, thanks to Calendly gave us a sample JSON file)
6
+ - `GET /activity_log_entries`
7
+ - changed were followings:
8
+ - Client
9
+ - (Add method) activity_log_entries
10
+ - Organization model
11
+ - (Add method) activity_log_entries
12
+
3
13
  ## 0.13.0 - 2022-08-03
4
14
 
5
15
  - supported List Event Type Available Times API. (#57)
16
+ - `GET /event_type_available_times`
6
17
  - changed were followings:
7
18
  - Client
8
19
  - (Add method) event_type_available_times
data/README.md CHANGED
@@ -77,7 +77,7 @@ available_times.map(&:start_time)
77
77
  # => [2022-08-04 01:00:00 UTC, 2022-08-04 01:15:00 UTC, 2022-08-04 01:30:00 UTC]
78
78
 
79
79
  # you can specify the date range
80
- event_type.available_times(start_time: "2022-08-04T10:30:00Z", end_time: "2022-08-05T10:30:00Z")
80
+ event_type.available_times(start_time: '2022-08-04T10:30:00Z', end_time: '2022-08-05T10:30:00Z')
81
81
 
82
82
  #
83
83
  # get scheduled events
@@ -400,6 +400,40 @@ module Calendly
400
400
  true
401
401
  end
402
402
 
403
+ #
404
+ # Returns a list of activity log entries.
405
+ #
406
+ # @param [String] org_uri Return activity log entries from the organization associated with this URI.
407
+ # @param [Hash] options the optional request parameters. Optional.
408
+ # @option options [Array<String>] :action The action(s) associated with the entries.
409
+ # @option options [Array<String>] :actor Return entries from the user(s) associated with the provided URIs.
410
+ # @option options [Integer] :count The number of rows to return.
411
+ # @option options [String] :max_occurred_at include entries that occurred prior to this time.
412
+ # @option options [String] :min_occurred_at Include entries that occurred after this time.
413
+ # @option options [Array<String>] :namespace The categories of the entries.
414
+ # @option options [String] :page_token The token to pass to get the next portion of the collection.
415
+ # @option options [String] :search_term Filters entries based on the search term.
416
+ # @option options [Array<String>] :sort Order results by the specified field and direction. List of {field}:{direction} values.
417
+ # @return [Array<Array<Calendly::ActivityLogEntry>, Hash, Hash>]
418
+ # - [Array<Calendly::ActivityLogEntry>] log_entries
419
+ # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
420
+ # - [Hash] raw_response
421
+ # @raise [Calendly::Error] if the org_uri arg is empty.
422
+ # @raise [Calendly::ApiError] if the api returns error code.
423
+ # @since 0.14.0
424
+ def activity_log_entries(org_uri, options: nil)
425
+ check_not_empty org_uri, 'org_uri'
426
+
427
+ opts_keys = %i[action actor count max_occurred_at min_occurred_at namespace page_token search_term sort]
428
+ params = {organization: org_uri}
429
+ params = merge_options options, opts_keys, params
430
+ body = request :get, 'activity_log_entries', params: params
431
+
432
+ items = body[:collection] || []
433
+ log_entries = items.map { |item| ActivityLogEntry.new item, self }
434
+ [log_entries, next_page_params(body), body]
435
+ end
436
+
403
437
  #
404
438
  # Returns information about a user's organization membership
405
439
  #
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Calendly
4
+ # Calendly's activity log entry model.
5
+ class ActivityLogEntry
6
+ include ModelUtils
7
+ UUID_RE = %r{\A#{Client::API_HOST}/activity_log_entries/(#{UUID_FORMAT})\z}.freeze
8
+ TIME_FIELDS = %i[occurred_at].freeze
9
+
10
+ def self.association
11
+ {
12
+ organization: Organization
13
+ }
14
+ end
15
+
16
+ # @return [String]
17
+ # unique id of the ActivityLogEntry object.
18
+ attr_accessor :uuid
19
+
20
+ # @return [String]
21
+ # Canonical reference (unique identifier) for the activity log entry.
22
+ attr_accessor :uri
23
+
24
+ # @return [Time]
25
+ # The date and time of the entry.
26
+ attr_accessor :occurred_at
27
+
28
+ # @return [Hash]
29
+ # The Calendly actor that took the action creating the activity log entry.
30
+ attr_accessor :actor
31
+
32
+ # @return [Hash]
33
+ attr_accessor :details
34
+
35
+ # @return [String]
36
+ attr_accessor :fully_qualified_name
37
+
38
+ # @return [String]
39
+ # The category associated with the entry.
40
+ attr_accessor :namespace
41
+
42
+ # @return [String]
43
+ # The action associated with the entry.
44
+ attr_accessor :action
45
+
46
+ # @return [Organization]
47
+ # The organization associated with the entry.
48
+ attr_accessor :organization
49
+ end
50
+ end
@@ -193,5 +193,29 @@ module Calendly
193
193
  @cached_routing_forms = nil
194
194
  routing_forms options: options
195
195
  end
196
+
197
+ #
198
+ # Returns a list of activity log entries.
199
+ #
200
+ # @param [Hash] options the optional request parameters. Optional.
201
+ # @option options [Array<String>] :action The action(s) associated with the entries.
202
+ # @option options [Array<String>] :actor Return entries from the user(s) associated with the provided URIs.
203
+ # @option options [Integer] :count The number of rows to return.
204
+ # @option options [String] :max_occurred_at include entries that occurred prior to this time.
205
+ # @option options [String] :min_occurred_at Include entries that occurred after this time.
206
+ # @option options [Array<String>] :namespace The categories of the entries.
207
+ # @option options [String] :page_token The token to pass to get the next portion of the collection.
208
+ # @option options [String] :search_term Filters entries based on the search term.
209
+ # @option options [Array<String>] :sort Order results by the specified field and direction. List of {field}:{direction} values.
210
+ # @return [Array<Array<Calendly::ActivityLogEntry>, Hash, Hash>]
211
+ # - [Array<Calendly::ActivityLogEntry>] log_entries
212
+ # - [Hash] next_params the parameters to get next data. if thre is no next it returns nil.
213
+ # - [Hash] raw_response
214
+ # @raise [Calendly::Error] if the uri is empty.
215
+ # @raise [Calendly::ApiError] if the api returns error code.
216
+ # @since 0.14.0
217
+ def activity_log_entries(options: nil)
218
+ client.activity_log_entries uri, options: options
219
+ end
196
220
  end
197
221
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Calendly
4
- VERSION = '0.13.0'
4
+ VERSION = '0.14.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.13.0
4
+ version: 0.14.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: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2022-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -188,6 +188,7 @@ files:
188
188
  - lib/calendly/configuration.rb
189
189
  - lib/calendly/error.rb
190
190
  - lib/calendly/loggable.rb
191
+ - lib/calendly/models/activity_log_entry.rb
191
192
  - lib/calendly/models/event.rb
192
193
  - lib/calendly/models/event_type.rb
193
194
  - lib/calendly/models/event_type_available_type.rb
@@ -224,7 +225,7 @@ metadata:
224
225
  homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
225
226
  source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
226
227
  changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
227
- documentation_uri: https://www.rubydoc.info/gems/calendly/0.13.0
228
+ documentation_uri: https://www.rubydoc.info/gems/calendly/0.14.0
228
229
  post_install_message:
229
230
  rdoc_options: []
230
231
  require_paths: