nylas 5.12.1 → 5.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1e352b09e650aa0cbc5dff7363b8a0997aab35c94e73a5f4a77b5503de70448
4
- data.tar.gz: a7830ea4cc6a9028669ca6c0e502cba4f2dfc70402a2c00f85cd1f6d315d0594
3
+ metadata.gz: 4c270504996973ab93d5c1cac213a194f776fb27302010be6eee1a41570204ff
4
+ data.tar.gz: 01a2bcc7473080a9fad5c39bd1851487ed1d20f81fab68277a37c6fd5e31c195
5
5
  SHA512:
6
- metadata.gz: 7aeed921859461105491d8394f845b79d6419ecc10a17ae0989f2239382cce8e4ad1fb3936bd7a4cebd730e40bac60b28dafe8e145e63a10d424a9e9b46915f0
7
- data.tar.gz: 47fdeaa77f5e1037934fc421b7b869edc031f956aad054d2888d29aee0a75ecb537c063e4c89e3c30e4f14f2be2da0860b5ec546e39034590f137773b73ef3cc
6
+ metadata.gz: '0485d5539c28e6626cef26ee3b34a3f61eab8c0436f6abddb017ead7034b644efac6502f32fc40236446d04fa7562d615c1fcfc732afbeeee852118874281492'
7
+ data.tar.gz: 63229ee0942e29703d6a4a2fd6feafd3f7ce639f13e5fd7387c01c195cd549e6b6cd6a6d931fa2ccf98871c1929b4c3c7cacfe46e1fa3d22ed454c8978f8810f
@@ -29,6 +29,7 @@ module Nylas
29
29
  attribute :read_only, :boolean
30
30
  attribute :metadata, :hash
31
31
  attribute :job_status_id, :string, read_only: true
32
+ attribute :hex_color, :string, read_only: true
32
33
 
33
34
  def read_only?
34
35
  read_only == true
data/lib/nylas/event.rb CHANGED
@@ -43,6 +43,7 @@ module Nylas
43
43
  attribute :reminder_minutes, :string
44
44
  attribute :reminder_method, :string
45
45
  attribute :job_status_id, :string, read_only: true
46
+ attribute :visibility, :string
46
47
 
47
48
  attr_accessor :notify_participants
48
49
 
data/lib/nylas/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nylas
4
- VERSION = "5.12.1"
4
+ VERSION = "5.13.0"
5
5
  end
data/lib/nylas/when.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nylas
4
+ require "tzinfo"
5
+
4
6
  # Structure to represent all the Nylas time types.
5
7
  # @see https://docs.nylas.com/reference#section-time
6
8
  class When
@@ -19,10 +21,15 @@ module Nylas
19
21
 
20
22
  # when object == 'time'
21
23
  attribute :time, :unix_timestamp
24
+ # Timezone must be set to a valid IANA database timezone name
25
+ attribute :timezone, :string
22
26
 
23
27
  # when object == 'timespan'
24
28
  attribute :start_time, :unix_timestamp
25
29
  attribute :end_time, :unix_timestamp
30
+ # Both timezone fields must be set to a valid IANA database timezone name
31
+ attribute :start_timezone, :string
32
+ attribute :end_timezone, :string
26
33
 
27
34
  def_delegators :range, :cover?
28
35
 
@@ -44,5 +51,25 @@ module Nylas
44
51
  Range.new(time, time)
45
52
  end
46
53
  end
54
+
55
+ # Validates the When object
56
+ # @return [Boolean] True if the When is valid
57
+ # @raise [ArgumentError] If any of the timezone fields are not valid IANA database names
58
+ def valid?
59
+ validate_timezone(timezone) if timezone
60
+ validate_timezone(start_timezone) if start_timezone
61
+ validate_timezone(end_timezone) if end_timezone
62
+
63
+ true
64
+ end
65
+
66
+ private
67
+
68
+ def validate_timezone(timezone_var)
69
+ return if TZInfo::Timezone.all_identifiers.include?(timezone_var)
70
+
71
+ raise ArgumentError,
72
+ format("The timezone provided (%s) is not a valid IANA timezone database name", timezone_var)
73
+ end
47
74
  end
48
75
  end
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.12.1
4
+ version: 5.13.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-08-12 00:00:00.000000000 Z
11
+ date: 2022-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.7.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: tzinfo
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.5
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.0.5
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: overcommit
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +226,28 @@ dependencies:
212
226
  requirements:
213
227
  - - "~>"
214
228
  - !ruby/object:Gem::Version
215
- version: '0.15'
229
+ version: 0.21.2
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: 0.21.2
237
+ - !ruby/object:Gem::Dependency
238
+ name: simplecov-cobertura
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: 2.1.0
216
244
  type: :development
217
245
  prerelease: false
218
246
  version_requirements: !ruby/object:Gem::Requirement
219
247
  requirements:
220
248
  - - "~>"
221
249
  - !ruby/object:Gem::Version
222
- version: '0.15'
250
+ version: 2.1.0
223
251
  - !ruby/object:Gem::Dependency
224
252
  name: rest-client
225
253
  requirement: !ruby/object:Gem::Requirement
@@ -380,7 +408,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
408
  - !ruby/object:Gem::Version
381
409
  version: '0'
382
410
  requirements: []
383
- rubygems_version: 3.3.7
411
+ rubygems_version: 3.0.9
384
412
  signing_key:
385
413
  specification_version: 4
386
414
  summary: Gem for interacting with the Nylas API