nylas 5.9.2 → 5.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nylas/account.rb +1 -0
- data/lib/nylas/calendar_collection.rb +3 -0
- data/lib/nylas/event.rb +16 -6
- data/lib/nylas/time_slot.rb +2 -0
- data/lib/nylas/time_slot_capacity.rb +13 -0
- data/lib/nylas/version.rb +1 -1
- data/lib/nylas.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dfc25b74725b0ba024320c432c69a1318f4b5524f550323d493b59aeb70e181
|
4
|
+
data.tar.gz: 0a50c968682d1b718aecdf7aaacfd32ea324e8d89c8db2c1f9369142189cf350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 439de1cc121378d1438047d4e2399faa5cd3ec3efcf5647a1dbefa4b858191c83bc0d4bcfb58d3795be30cf9627feaa17828b33ed916bb2a310778cbd64c6e91
|
7
|
+
data.tar.gz: 0a5a619c18eadad1a5a81fa85e528303e172bef906746cbde9bd2baba5647213e2ff0e7f5cab634bdfc9adf9dc8489b18e159618348973df452d2a50aa6295f2
|
data/lib/nylas/account.rb
CHANGED
@@ -12,6 +12,7 @@ module Nylas
|
|
12
12
|
# @param emails [Array<String>] Emails on the same domain to check
|
13
13
|
# @param buffer [Integer] The amount of buffer time in minutes that you want around existing meetings
|
14
14
|
# @param round_robin [String] Finds available meeting times in a round-robin style
|
15
|
+
# @param event_collection_id [String] Unique identifier for a collection of events that are created
|
15
16
|
# @param free_busy [Array<Nylas::FreeBusy>] A list of free-busy data for users not in your organization
|
16
17
|
# @param open_hours [Array<Nylas::OpenHours>] Additional times email accounts are available
|
17
18
|
# @param calendars [Array] Check account and calendar IDs for free/busy status
|
@@ -23,6 +24,7 @@ module Nylas
|
|
23
24
|
emails: [],
|
24
25
|
buffer: nil,
|
25
26
|
round_robin: nil,
|
27
|
+
event_collection_id: nil,
|
26
28
|
free_busy: [],
|
27
29
|
open_hours: [],
|
28
30
|
calendars: [])
|
@@ -37,6 +39,7 @@ module Nylas
|
|
37
39
|
emails: emails,
|
38
40
|
buffer: buffer,
|
39
41
|
round_robin: round_robin,
|
42
|
+
event_collection_id: event_collection_id,
|
40
43
|
free_busy: free_busy.map(&:to_h),
|
41
44
|
open_hours: open_hours.map(&:to_h),
|
42
45
|
calendars: calendars)
|
data/lib/nylas/event.rb
CHANGED
@@ -16,7 +16,9 @@ module Nylas
|
|
16
16
|
attribute :master_event_id, :string
|
17
17
|
attribute :message_id, :string
|
18
18
|
attribute :ical_uid, :string
|
19
|
+
attribute :event_collection_id, :string
|
19
20
|
|
21
|
+
attribute :capacity, :integer
|
20
22
|
attribute :busy, :boolean
|
21
23
|
attribute :description, :string
|
22
24
|
attribute :location, :string
|
@@ -30,6 +32,7 @@ module Nylas
|
|
30
32
|
attribute :metadata, :hash
|
31
33
|
attribute :conferencing, :event_conferencing
|
32
34
|
has_n_of_attribute :notifications, :event_notification
|
35
|
+
has_n_of_attribute :round_robin_order, :string
|
33
36
|
attribute :original_start_time, :unix_timestamp
|
34
37
|
attribute :job_status_id, :string, read_only: true
|
35
38
|
|
@@ -44,12 +47,7 @@ module Nylas
|
|
44
47
|
end
|
45
48
|
|
46
49
|
def save
|
47
|
-
|
48
|
-
body = to_h
|
49
|
-
if body.dig(:conferencing, :details) && body.dig(:conferencing, :autocreate)
|
50
|
-
raise ArgumentError, "Cannot set both 'details' and 'autocreate' in conferencing object."
|
51
|
-
end
|
52
|
-
end
|
50
|
+
validate
|
53
51
|
|
54
52
|
super
|
55
53
|
end
|
@@ -81,6 +79,18 @@ module Nylas
|
|
81
79
|
|
82
80
|
private
|
83
81
|
|
82
|
+
def validate
|
83
|
+
if conferencing
|
84
|
+
body = to_h
|
85
|
+
if body.dig(:conferencing, :details) && body.dig(:conferencing, :autocreate)
|
86
|
+
raise ArgumentError, "Cannot set both 'details' and 'autocreate' in conferencing object."
|
87
|
+
end
|
88
|
+
end
|
89
|
+
return unless capacity && capacity != -1 && participants && participants.length > capacity
|
90
|
+
|
91
|
+
raise ArgumentError, "The number of participants in the event exceeds the set capacity."
|
92
|
+
end
|
93
|
+
|
84
94
|
def build_ics_event_payload(ical_uid, method, prodid)
|
85
95
|
payload = {}
|
86
96
|
if id
|
data/lib/nylas/time_slot.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Nylas
|
4
|
+
# Capacity values for a timeslot
|
5
|
+
# @see https://docs.nylas.com/reference#calendars-free-busy
|
6
|
+
class TimeSlotCapacity
|
7
|
+
include Model::Attributable
|
8
|
+
|
9
|
+
attribute :event_id, :string
|
10
|
+
attribute :current_capacity, :integer
|
11
|
+
attribute :max_capacity, :integer
|
12
|
+
end
|
13
|
+
end
|
data/lib/nylas/version.rb
CHANGED
data/lib/nylas.rb
CHANGED
@@ -54,6 +54,7 @@ require_relative "nylas/nylas_date"
|
|
54
54
|
require_relative "nylas/when"
|
55
55
|
require_relative "nylas/free_busy"
|
56
56
|
require_relative "nylas/time_slot"
|
57
|
+
require_relative "nylas/time_slot_capacity"
|
57
58
|
require_relative "nylas/open_hours"
|
58
59
|
require_relative "nylas/event_conferencing"
|
59
60
|
require_relative "nylas/event_conferencing_details"
|
@@ -144,6 +145,7 @@ module Nylas
|
|
144
145
|
Types.registry[:contact_group] = Types::ModelType.new(model: ContactGroup)
|
145
146
|
Types.registry[:when] = Types::ModelType.new(model: When)
|
146
147
|
Types.registry[:time_slot] = Types::ModelType.new(model: TimeSlot)
|
148
|
+
Types.registry[:time_slot_capacity] = Types::ModelType.new(model: TimeSlotCapacity)
|
147
149
|
Types.registry[:event_conferencing] = Types::ModelType.new(model: EventConferencing)
|
148
150
|
Types.registry[:event_conferencing_details] = Types::ModelType.new(model: EventConferencingDetails)
|
149
151
|
Types.registry[:event_conferencing_autocreate] = Types::ModelType.new(model: EventConferencingAutocreate)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nylas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -347,6 +347,7 @@ files:
|
|
347
347
|
- lib/nylas/send_grid_verified_status.rb
|
348
348
|
- lib/nylas/thread.rb
|
349
349
|
- lib/nylas/time_slot.rb
|
350
|
+
- lib/nylas/time_slot_capacity.rb
|
350
351
|
- lib/nylas/timespan.rb
|
351
352
|
- lib/nylas/token_info.rb
|
352
353
|
- lib/nylas/types.rb
|