nylas 4.0.0.rc3 → 4.0.1

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
- SHA256:
3
- metadata.gz: fac446793677a8c9ae9f69d5d70e1ef43cb5a452e600f590665afa2f6d82f0de
4
- data.tar.gz: d42bf8cf84bf85be8e4a3b6bf896492da0e3e6795f6eb5afb538d6cdc55cad78
2
+ SHA1:
3
+ metadata.gz: bdbb6c150d3f86323edbef1c476fc87932507baa
4
+ data.tar.gz: 7d27d792c1967e0662148f2ed7073f49eb8a35a3
5
5
  SHA512:
6
- metadata.gz: 7fe7bdd1b56c7fb1e37ce318c28ed419bf38124e052c8a5a5de61c609d1132cdeff7a728126d549e3e0da0388303585e63701fdc37f01cab6b0c773d7587729c
7
- data.tar.gz: 33d014b9b2cbc74fc1d52a5b203017d9272952baa207ada25e89aef029051539f4d1f9066b72a055e319783b13dee6bb4a5f0130c69f9de1a675de0b1bc0e11a
6
+ metadata.gz: 73bfcdb6f6928a95d9183110e756547abc046e4e39ebe1b4a3ef7d63a2b91950f494b469c04ba7ca785d1abaa43d282a415da44c3e7f2efaacf4695915b9e4ba
7
+ data.tar.gz: 0e29d71b4c0a61f81fa4f5cd3da8712fdc37f396ee50e52a08e983c7865e784f69ef5f223ecc053719e3b8d5e47ba9f2d69367ef7b71843b5e68ef60bbe0936b
data/lib/nylas.rb CHANGED
@@ -42,6 +42,7 @@ require_relative "nylas/deltas_collection"
42
42
  require_relative "nylas/account"
43
43
  require_relative "nylas/calendar"
44
44
  require_relative "nylas/contact"
45
+ require_relative "nylas/contact_group"
45
46
  require_relative "nylas/current_account"
46
47
  require_relative "nylas/deltas"
47
48
  require_relative "nylas/delta"
@@ -82,4 +83,5 @@ module Nylas
82
83
  Types.registry[:timespan] = Types::ModelType.new(model: Timespan)
83
84
  Types.registry[:web_page] = Types::ModelType.new(model: WebPage)
84
85
  Types.registry[:nylas_date] = NylasDateType.new
86
+ Types.registry[:contact_group] = Types::ModelType.new(model: ContactGroup)
85
87
  end
data/lib/nylas/contact.rb CHANGED
@@ -19,7 +19,7 @@ module Nylas
19
19
  attribute :middle_name, :string
20
20
  attribute :picture_url, :string
21
21
  attribute :surname, :string
22
- attribute :birthday, :nylas_date
22
+ attribute :birthday, :string
23
23
  attribute :suffix, :string
24
24
  attribute :nickname, :string
25
25
  attribute :company_name, :string
@@ -29,10 +29,21 @@ module Nylas
29
29
  attribute :notes, :string
30
30
  attribute :web_page, :web_page
31
31
 
32
- has_n_of_attribute :email_addresses, :email_address
32
+ has_n_of_attribute :groups, :contact_group
33
+ has_n_of_attribute :emails, :email_address
33
34
  has_n_of_attribute :im_addresses, :im_address
34
35
  has_n_of_attribute :physical_addresses, :physical_address
35
36
  has_n_of_attribute :phone_numbers, :phone_number
36
37
  has_n_of_attribute :web_pages, :web_page
38
+
39
+ # @returns [Tempfile] path to the retrieved picture. It is preferrable to cache this in your system than
40
+ # to retrieve it from nylas every time.
41
+ def picture
42
+ return @picture_tempfile if @picture_tempfile
43
+ @picture_tempfile = Tempfile.new
44
+ @picture_tempfile.write(api.get(path: "#{resource_path}/picture"))
45
+ @picture_tempfile.close
46
+ @picture_tempfile
47
+ end
37
48
  end
38
49
  end
@@ -0,0 +1,12 @@
1
+ module Nylas
2
+ # Structure to represent the Contact Group schema
3
+ # @see https://docs.nylas.com/reference#contactsid
4
+ class ContactGroup
5
+ include Model::Attributable
6
+ attribute :id, :string
7
+ attribute :object, :string
8
+ attribute :account_id, :string
9
+ attribute :name, :string
10
+ attribute :path, :string
11
+ end
12
+ end
@@ -16,5 +16,6 @@ module Nylas
16
16
  attribute :organization_unit, :string
17
17
  attribute :provider, :string
18
18
  attribute :sync_state, :string
19
+ attribute :linked_at, :unix_timestamp
19
20
  end
20
21
  end
data/lib/nylas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nylas
2
- VERSION = "4.0.0.rc3".freeze
2
+ VERSION = "4.0.1".freeze
3
3
  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: 4.0.0.rc3
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nylas, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -253,6 +253,7 @@ files:
253
253
  - lib/nylas/collection.rb
254
254
  - lib/nylas/constraints.rb
255
255
  - lib/nylas/contact.rb
256
+ - lib/nylas/contact_group.rb
256
257
  - lib/nylas/current_account.rb
257
258
  - lib/nylas/delta.rb
258
259
  - lib/nylas/deltas.rb
@@ -314,12 +315,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
314
315
  version: '2.2'
315
316
  required_rubygems_version: !ruby/object:Gem::Requirement
316
317
  requirements:
317
- - - ">"
318
+ - - ">="
318
319
  - !ruby/object:Gem::Version
319
- version: 1.3.1
320
+ version: '0'
320
321
  requirements: []
321
322
  rubyforge_project:
322
- rubygems_version: 2.7.4
323
+ rubygems_version: 2.5.2
323
324
  signing_key:
324
325
  specification_version: 4
325
326
  summary: Gem for interacting with the Nylas API