nylas 4.6.2 → 4.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nylas/http_client.rb +6 -3
- data/lib/nylas/message.rb +18 -0
- data/lib/nylas/physical_address.rb +1 -0
- data/lib/nylas/version.rb +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34f645631bf41230a0c8709c0212c5b83fb24fa44bdf3b7b62429ec72ce92b41
|
4
|
+
data.tar.gz: 2d043ada950f30d03b65f45cb1e0635868cd7c092d919f992b1d9359519c995b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3af07161869273f8fa33a38c97c286ec4c62aebb37b303e2fee348773c7d1c33ddb7c45531a95d792af21c90eca9055e1181b3fca2f5a412fd1809037ec5c70b
|
7
|
+
data.tar.gz: ea27a61dee30fc747b42fd2713e4755ca7f50243bbcf47d2bb8582aec96f1613ae3795206c62a5905ee4fbdc353c69f1c3f191e40f5b5b319728ccdd4cb80085
|
data/lib/nylas/http_client.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nylas
|
4
|
+
require "yajl"
|
5
|
+
|
4
6
|
# Plain HTTP client that can be used to interact with the Nylas API sans any type casting.
|
5
7
|
class HttpClient # rubocop:disable Metrics/ClassLength
|
6
8
|
HTTP_CODE_TO_EXCEPTIONS = {
|
@@ -130,9 +132,10 @@ module Nylas
|
|
130
132
|
end
|
131
133
|
|
132
134
|
def parse_response(response)
|
133
|
-
response.is_a?(Enumerable)
|
134
|
-
|
135
|
-
response
|
135
|
+
return response if response.is_a?(Enumerable)
|
136
|
+
|
137
|
+
json = StringIO.new(response)
|
138
|
+
Yajl::Parser.new(symbolize_names: true).parse(json)
|
136
139
|
end
|
137
140
|
inform_on :parse_response, level: :debug, also_log: { result: true }
|
138
141
|
|
data/lib/nylas/message.rb
CHANGED
@@ -69,5 +69,23 @@ module Nylas
|
|
69
69
|
assign(api.execute(method: :get, path: resource_path, query: { view: "expanded" }))
|
70
70
|
self
|
71
71
|
end
|
72
|
+
|
73
|
+
def save_call
|
74
|
+
handle_folder
|
75
|
+
|
76
|
+
execute(
|
77
|
+
method: :put,
|
78
|
+
payload: attributes.serialize(keys: allowed_keys_for_save),
|
79
|
+
path: resource_path
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def handle_folder
|
84
|
+
return if folder.nil?
|
85
|
+
|
86
|
+
self.folder_id = folder.id if folder_id.nil? && !self.to_h.dig(:folder, :id).nil?
|
87
|
+
|
88
|
+
self.folder = nil
|
89
|
+
end
|
72
90
|
end
|
73
91
|
end
|
data/lib/nylas/version.rb
CHANGED
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.6.
|
4
|
+
version: 4.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -254,6 +254,26 @@ dependencies:
|
|
254
254
|
- - "<"
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: '3.0'
|
257
|
+
- !ruby/object:Gem::Dependency
|
258
|
+
name: yajl-ruby
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - "~>"
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: '1.2'
|
264
|
+
- - ">="
|
265
|
+
- !ruby/object:Gem::Version
|
266
|
+
version: 1.2.1
|
267
|
+
type: :runtime
|
268
|
+
prerelease: false
|
269
|
+
version_requirements: !ruby/object:Gem::Requirement
|
270
|
+
requirements:
|
271
|
+
- - "~>"
|
272
|
+
- !ruby/object:Gem::Version
|
273
|
+
version: '1.2'
|
274
|
+
- - ">="
|
275
|
+
- !ruby/object:Gem::Version
|
276
|
+
version: 1.2.1
|
257
277
|
description: Gem for interacting with the Nylas API.
|
258
278
|
email: support@nylas.com
|
259
279
|
executables: []
|