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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15e3e4b9f188fa73d3cdea696d1fac21c02ce00f1f67ada372fd328e0b1f1fac
4
- data.tar.gz: 5d12461918e68ef048dc8ac0b7111d8a1337000c1815d2273fbe15409b0fd732
3
+ metadata.gz: 44bfc4eff4a138fc21a6058eb634d08e8be4bca032b43807c15fea355dfa5fe1
4
+ data.tar.gz: 414e83652f42d05171fc1413c17d9a817ab02bcd49d340164338e682b886d028
5
5
  SHA512:
6
- metadata.gz: 3610cb024f1fcfaddd1d26fcfa82052bd43431a1890d2bed429c9eb0c8e1a7622a4be507bd57cec0c14c0cb08c03eda72f0d45a4acf97884b13c8b57004ed7f6
7
- data.tar.gz: a0c5144d0e2458ec4830814d0689cf24a8cc3ce00915ba2c6649795fc3a45e6c5325c2f8a52ab650af03b522d73a92e1aca2efe93ffb11ded2b80855216704df
6
+ metadata.gz: c64946b9ea2609929eb2b89b241dc93fa221df17c081e3548357eb94187d3d58215c59a6522a27d248c53c9009c5df7ec2fe64047b53367748be71988e653d60
7
+ data.tar.gz: 917f9edb608a9488bd95896fad8e11803494f5598236f8271abc08853159b5a6821c328d99c4db5c9f5fcb138fb4632c99fa5349569e87355edc2a09f013d45f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [3.1.0] - 2025-01-11
2
+
3
+ - Add Client.find(id)
4
+
1
5
  ## [3.0.1] - 2025-01-10
2
6
 
3
7
  - Make Contact.edited_since lazy
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '3.0.1'
2
+ VERSION = '3.1.0'
3
3
  end
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.1
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