oeh-client 2.2.8 → 2.2.9
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/lib/oehclient.rb +2 -0
- data/lib/oehclient/meta/entity.rb +1 -0
- data/lib/oehclient/meta/workspace.rb +1 -0
- data/lib/oehclient/realtime/interaction.rb +10 -5
- data/lib/oehclient/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba90500a20250f69c5a451d1875be749feb8e3f0
|
4
|
+
data.tar.gz: 385ac1a2a5f4cf2aa699128afb4f35ab95a11350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d35d4a6350cdd7002b0513804e621eeaf6adace1c58c1e5a65abc8b91b4aa8a4da82b86da4b440a3524cb11d2b907b2045f5de7083d0602eba360709f47a38
|
7
|
+
data.tar.gz: 43c80f52ef2e62fbed7fc837849caed992f72297446af80f3013004d8f47f78fa18aad0e41e8cf153974aaf7ada9d31377feec4cdd31839803767eb3abff6a50
|
data/lib/oehclient.rb
CHANGED
@@ -83,6 +83,8 @@ module OEHClient
|
|
83
83
|
# merge parameters into the header if they are passed
|
84
84
|
header.merge!(:params => options[:params] ) if (options.has_key?(:params))
|
85
85
|
|
86
|
+
puts "-----] payload: #{options[:payload]}\n"
|
87
|
+
|
86
88
|
# send the POST request, manage the returned response, and return the body of the response to the
|
87
89
|
# calling method
|
88
90
|
RestClient::Request.execute(method: :post, url: url, payload: options[:payload], headers: header, verify_ssl: OpenSSL::SSL::VERIFY_PEER) { | response, request, result | OEHClient::Helper::Response.handle(response)}
|
@@ -73,6 +73,7 @@ module OEHClient::Meta::Entity
|
|
73
73
|
entity_instance = Hash.new
|
74
74
|
# Get the collection of objects requested
|
75
75
|
get_collection(session, **args).each do | collection_instance |
|
76
|
+
puts "-----] Collection Instance: #{collection_instance}"
|
76
77
|
# find the matching entry and assign the entity instance
|
77
78
|
entity_instance = collection_instance if (collection_instance[attribute_nvp[:name]].casecmp(attribute_nvp[:value]) == 0)
|
78
79
|
end # Each OEHClient::Meta::Entity.get_collection
|
@@ -25,6 +25,7 @@ class OEHClient::Meta::Workspace < OEHClient::Data::Node
|
|
25
25
|
# get the list of workspaces from the thinstance
|
26
26
|
workspace_data = get(active_session, {:name => ONE_WORKSPACE_SITE_KEY, :value => site_key}, **args)
|
27
27
|
unless (workspace_data.blank?)
|
28
|
+
puts "-----] Workspace Data: #{workspace_data}"
|
28
29
|
# convert the the workspace instance into a NEW instance of the OEHClient::Meta::Workspace instance
|
29
30
|
workspace_instance = OEHClient::Meta::Workspace.new(workspace_data)
|
30
31
|
# set the session object
|
@@ -11,6 +11,7 @@ class OEHClient::Realtime::Interaction
|
|
11
11
|
API_OFFLINE = "/offline"
|
12
12
|
# ONE attributes that are either in the request and/or returned in the response
|
13
13
|
ONE_PARAM_URI = "uri"
|
14
|
+
ONE_PARAM_DEVICE = "device"
|
14
15
|
ONE_PARAM_CK = "customerKey"
|
15
16
|
ONE_PARAM_TID = "tid"
|
16
17
|
ONE_PARAM_SESSION = "session"
|
@@ -34,6 +35,7 @@ class OEHClient::Realtime::Interaction
|
|
34
35
|
|
35
36
|
attr_accessor :uri, # The full touchpoint/interaction URI used to post the interaction
|
36
37
|
:space, # The configured OEHClient::Config::Space object that represents the OEH workspace
|
38
|
+
:device, # The device information
|
37
39
|
|
38
40
|
:timestamp, # A millisecond value representing a Time value of the interaction
|
39
41
|
:keyname, # The customer keyname to use based on multi-key configuration. Default is customerKey
|
@@ -55,7 +57,7 @@ class OEHClient::Realtime::Interaction
|
|
55
57
|
|
56
58
|
# class-level wrapper to post a new interaction to the OEH server using either the realtime or offline
|
57
59
|
# API for an anonymous or known prospects/customer
|
58
|
-
def post(site_key, uri, timestamp=nil, tid=nil, customer_key=nil, properties={})
|
60
|
+
def post(site_key, uri, timestamp=nil, tid=nil, customer_key=nil, properties={}, device={})
|
59
61
|
|
60
62
|
# setup the baseline attributes hash with the site_key and interaction URI, which are the
|
61
63
|
# minimal values needed for an interaction
|
@@ -67,6 +69,7 @@ class OEHClient::Realtime::Interaction
|
|
67
69
|
# conditionally merge the rest of the attributes if they are passed
|
68
70
|
attributes.merge!(:timestamp => OEHClient::Helper::Timestamp.to_one_timestamp(timestamp)) unless(timestamp.blank?)
|
69
71
|
attributes.merge!(:tid => tid) unless(timestamp.blank?)
|
72
|
+
attributes.merge!(:device => device)
|
70
73
|
|
71
74
|
if (customer_key.is_a?(Hash))
|
72
75
|
attributes.merge!(:ck => customer_key[:value]) if (customer_key.has_key?(:value))
|
@@ -132,6 +135,7 @@ class OEHClient::Realtime::Interaction
|
|
132
135
|
@timestamp = OEHClient::Helper::Timestamp.to_one_timestamp(attributes[:timestamp]) if (attributes.has_key?(:timestamp))
|
133
136
|
|
134
137
|
@space = OEHClient::Config::SpaceManager.instance.get(attributes[:sk]) if (attributes.has_key?(:sk))
|
138
|
+
@device = attributes[:device] if (attributes.has_key?(:device))
|
135
139
|
|
136
140
|
end
|
137
141
|
|
@@ -328,13 +332,14 @@ class OEHClient::Realtime::Interaction
|
|
328
332
|
# merge in the different parts of the request data if the values currently exist within
|
329
333
|
# the instance of the class
|
330
334
|
parameters.merge!({ONE_PARAM_URI => @uri}) if (!@uri.nil? && @uri.length > 0)
|
335
|
+
parameters.merge!({ONE_PARAM_DEVICE => @device}) if (!@device.nil? && !@device.empty?)
|
331
336
|
|
332
|
-
parameters.merge!({"customerKeyName" => @keyname})
|
333
|
-
parameters.merge!({"customerKey" => @customer_key})
|
337
|
+
parameters.merge!({"customerKeyName" => @keyname}) if (!@keyname.nil? && @keyname.length > 0)
|
338
|
+
parameters.merge!({"customerKey" => @customer_key}) if (!@customer_key.nil? && @customer_key.length > 0)
|
334
339
|
|
335
340
|
|
336
|
-
parameters.merge!({ONE_PARAM_SESSION => @session})
|
337
|
-
|
341
|
+
parameters.merge!({ONE_PARAM_SESSION => @session}) if (!@session.nil? && @session.length > 0)
|
342
|
+
parameters.merge!({ONE_PARAM_TS => @timestamp}) if (!@timestamp.nil?)
|
338
343
|
|
339
344
|
# for each of the properties hash entry, build a name/value pair in the properties collection
|
340
345
|
properties = Array.new
|
data/lib/oehclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oeh-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Balliet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|