vng 3.0.1 → 3.1.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/vng/client.rb +28 -0
- data/lib/vng/mock_request.rb +12 -1
- data/lib/vng/version.rb +1 -1
- data/lib/vng.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44bfc4eff4a138fc21a6058eb634d08e8be4bca032b43807c15fea355dfa5fe1
|
4
|
+
data.tar.gz: 414e83652f42d05171fc1413c17d9a817ab02bcd49d340164338e682b886d028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c64946b9ea2609929eb2b89b241dc93fa221df17c081e3548357eb94187d3d58215c59a6522a27d248c53c9009c5df7ec2fe64047b53367748be71988e653d60
|
7
|
+
data.tar.gz: 917f9edb608a9488bd95896fad8e11803494f5598236f8271abc08853159b5a6821c328d99c4db5c9f5fcb138fb4632c99fa5349569e87355edc2a09f013d45f
|
data/CHANGELOG.md
CHANGED
data/lib/vng/client.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'vng/availability'
|
2
|
+
|
3
|
+
module Vng
|
4
|
+
# Provides methods to interact with Vonigo clients.
|
5
|
+
class Client < Resource
|
6
|
+
PATH = '/api/v1/data/Clients/'
|
7
|
+
|
8
|
+
attr_reader :id, :email
|
9
|
+
|
10
|
+
def initialize(id:, email:)
|
11
|
+
@id = id
|
12
|
+
@email = email
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
def self.find(contact_id)
|
17
|
+
body = {
|
18
|
+
method: '1',
|
19
|
+
objectID: contact_id,
|
20
|
+
}
|
21
|
+
|
22
|
+
data = request path: PATH, body: body
|
23
|
+
|
24
|
+
email = value_for_field data, 238
|
25
|
+
new id: contact_id, email: email
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/vng/mock_request.rb
CHANGED
@@ -130,7 +130,14 @@ module Vng
|
|
130
130
|
{"fieldID"=>96, "fieldValue"=>"8648648640" },
|
131
131
|
], "Relations" => [
|
132
132
|
{"objectID" => 915738, "relationType" => "client", "isActive" => "true"},
|
133
|
-
]}
|
133
|
+
]},
|
134
|
+
{"objectID" => "2201008", "dateLastEdited" => "1736479081", "isActive" => "true", "Fields" => [
|
135
|
+
{"fieldID"=>127, "fieldValue"=>"No" },
|
136
|
+
{"fieldID"=>128, "fieldValue"=>"Email" },
|
137
|
+
{"fieldID"=>96, "fieldValue"=>"8648648640" },
|
138
|
+
], "Relations" => [
|
139
|
+
{"objectID" => 916758, "relationType" => "client", "isActive" => "true"},
|
140
|
+
]},
|
134
141
|
]}
|
135
142
|
elsif @body[:pageNo].nil?
|
136
143
|
{ "Contact"=>{ "objectID"=>"2201007" }, "Fields"=> [
|
@@ -144,6 +151,10 @@ module Vng
|
|
144
151
|
end
|
145
152
|
when '/api/v1/data/Locations/'
|
146
153
|
{ "Location"=>{ "objectID"=>995681 } }
|
154
|
+
when '/api/v1/data/Clients/'
|
155
|
+
{ "Client" => { "objectID" => "916758" }, "Fields" => [
|
156
|
+
{ "fieldID" => 238, "fieldValue" => "vng@example.com", "optionID" => 0 }
|
157
|
+
] }
|
147
158
|
when '/api/v1/data/Assets/'
|
148
159
|
if @body[:method].eql? '3'
|
149
160
|
if @body[:Fields].find{|field| field[:fieldID] == 1014}[:optionID].eql? 304
|
data/lib/vng/version.rb
CHANGED
data/lib/vng.rb
CHANGED
@@ -10,6 +10,7 @@ require_relative 'vng/availability'
|
|
10
10
|
require_relative 'vng/breed'
|
11
11
|
require_relative 'vng/case'
|
12
12
|
require_relative 'vng/connection_error'
|
13
|
+
require_relative 'vng/client'
|
13
14
|
require_relative 'vng/contact'
|
14
15
|
require_relative 'vng/franchise'
|
15
16
|
require_relative 'vng/lead'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/vng/availability.rb
|
70
70
|
- lib/vng/breed.rb
|
71
71
|
- lib/vng/case.rb
|
72
|
+
- lib/vng/client.rb
|
72
73
|
- lib/vng/config.rb
|
73
74
|
- lib/vng/configuration.rb
|
74
75
|
- lib/vng/connection_error.rb
|