attune 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/attune.gemspec +3 -3
- data/lib/attune.rb +14 -0
- data/lib/attune/api/anonymous.rb +131 -0
- data/lib/attune/api/entities.rb +195 -0
- data/lib/attune/call_dropping.rb +1 -0
- data/lib/attune/client.rb +20 -170
- data/lib/attune/configurable.rb +1 -0
- data/lib/attune/default.rb +1 -0
- data/lib/attune/json_logger.rb +1 -0
- data/lib/attune/models/anonymousresult.rb +41 -0
- data/lib/attune/models/batchrankingrequest.rb +44 -0
- data/lib/attune/models/batchrankingresult.rb +44 -0
- data/lib/attune/models/blacklist.rb +111 -0
- data/lib/attune/models/blacklistgetresponse.rb +44 -0
- data/lib/attune/models/blacklistparams.rb +87 -0
- data/lib/attune/models/blacklistsaveresponse.rb +41 -0
- data/lib/attune/models/customer.rb +41 -0
- data/lib/attune/models/rankedentities.rb +60 -0
- data/lib/attune/models/rankingparams.rb +103 -0
- data/lib/attune/models/scopeentry.rb +49 -0
- data/lib/attune/net_http_persistent.rb +1 -0
- data/lib/attune/param_flattener.rb +1 -0
- data/lib/attune/version.rb +2 -1
- data/spec/attune/client_spec.rb +51 -59
- data/spec/remote_spec.rb +27 -27
- metadata +40 -25
data/lib/attune/configurable.rb
CHANGED
data/lib/attune/default.rb
CHANGED
data/lib/attune/json_logger.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class AnonymousResult
|
5
|
+
attr_accessor :id
|
6
|
+
|
7
|
+
|
8
|
+
# :internal => :external
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:id => :id
|
12
|
+
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
return if attributes.empty?
|
18
|
+
# Morph attribute keys into undescored rubyish style
|
19
|
+
if self.class.attribute_map[:"id"]
|
20
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
21
|
+
@id = attributes["id"] || attributes[:"id"]
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_body
|
28
|
+
body = {}
|
29
|
+
self.class.attribute_map.each_pair do |key, value|
|
30
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
31
|
+
end
|
32
|
+
body
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json(options = {})
|
36
|
+
to_body.to_json
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class BatchRankingRequest
|
5
|
+
attr_accessor :requests
|
6
|
+
|
7
|
+
|
8
|
+
# :internal => :external
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:requests => :requests
|
12
|
+
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
return if attributes.empty?
|
18
|
+
# Morph attribute keys into undescored rubyish style
|
19
|
+
if self.class.attribute_map[:"requests"]
|
20
|
+
value = attributes["requests"] || attributes[:"requests"]
|
21
|
+
if value.is_a?(Array)
|
22
|
+
@requests = value.map{ |v| RankingParams.new(v) }
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_body
|
31
|
+
body = {}
|
32
|
+
self.class.attribute_map.each_pair do |key, value|
|
33
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
34
|
+
end
|
35
|
+
body
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_json(options = {})
|
39
|
+
to_body.to_json
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class BatchRankingResult
|
5
|
+
attr_accessor :results
|
6
|
+
|
7
|
+
|
8
|
+
# :internal => :external
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:results => :results
|
12
|
+
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
return if attributes.empty?
|
18
|
+
# Morph attribute keys into undescored rubyish style
|
19
|
+
if self.class.attribute_map[:"results"]
|
20
|
+
value = attributes["results"] || attributes[:"results"]
|
21
|
+
if value.is_a?(Array)
|
22
|
+
@results = value.map{ |v| RankedEntities.new(v) }
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_body
|
31
|
+
body = {}
|
32
|
+
self.class.attribute_map.each_pair do |key, value|
|
33
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
34
|
+
end
|
35
|
+
body
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_json(options = {})
|
39
|
+
to_body.to_json
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
@@ -0,0 +1,111 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class Blacklist
|
5
|
+
attr_accessor :id
|
6
|
+
|
7
|
+
|
8
|
+
attr_accessor :ids
|
9
|
+
|
10
|
+
|
11
|
+
attr_accessor :entity_type
|
12
|
+
|
13
|
+
|
14
|
+
attr_accessor :consumer
|
15
|
+
|
16
|
+
|
17
|
+
attr_accessor :created_at
|
18
|
+
|
19
|
+
|
20
|
+
attr_accessor :end_date
|
21
|
+
|
22
|
+
|
23
|
+
attr_accessor :start_date
|
24
|
+
|
25
|
+
|
26
|
+
attr_accessor :disabled
|
27
|
+
|
28
|
+
|
29
|
+
attr_accessor :scope
|
30
|
+
|
31
|
+
|
32
|
+
# :internal => :external
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:id => :id,
|
36
|
+
:ids => :ids,
|
37
|
+
:entity_type => :entityType,
|
38
|
+
:consumer => :consumer,
|
39
|
+
:created_at => :createdAt,
|
40
|
+
:end_date => :endDate,
|
41
|
+
:start_date => :startDate,
|
42
|
+
:disabled => :disabled,
|
43
|
+
:scope => :scope
|
44
|
+
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return if attributes.empty?
|
50
|
+
# Morph attribute keys into undescored rubyish style
|
51
|
+
if self.class.attribute_map[:"id"]
|
52
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
53
|
+
@id = attributes["id"] || attributes[:"id"]
|
54
|
+
end
|
55
|
+
if self.class.attribute_map[:"ids"]
|
56
|
+
value = attributes["ids"] || attributes[:"ids"]
|
57
|
+
if value.is_a?(Array)
|
58
|
+
@ids = value
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if self.class.attribute_map[:"entity_type"]
|
63
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
64
|
+
@entity_type = attributes["entityType"] || attributes[:"entity_type"]
|
65
|
+
end
|
66
|
+
if self.class.attribute_map[:"consumer"]
|
67
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
68
|
+
@consumer = attributes["consumer"] || attributes[:"consumer"]
|
69
|
+
end
|
70
|
+
if self.class.attribute_map[:"created_at"]
|
71
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
72
|
+
@created_at = attributes["createdAt"] || attributes[:"created_at"]
|
73
|
+
end
|
74
|
+
if self.class.attribute_map[:"end_date"]
|
75
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
76
|
+
@end_date = attributes["endDate"] || attributes[:"end_date"]
|
77
|
+
end
|
78
|
+
if self.class.attribute_map[:"start_date"]
|
79
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
80
|
+
@start_date = attributes["startDate"] || attributes[:"start_date"]
|
81
|
+
end
|
82
|
+
if self.class.attribute_map[:"disabled"]
|
83
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
84
|
+
@disabled = attributes["disabled"] || attributes[:"disabled"]
|
85
|
+
end
|
86
|
+
if self.class.attribute_map[:"scope"]
|
87
|
+
value = attributes["scope"] || attributes[:"scope"]
|
88
|
+
if value.is_a?(Array)
|
89
|
+
@scope = value
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
def to_body
|
98
|
+
body = {}
|
99
|
+
self.class.attribute_map.each_pair do |key, value|
|
100
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
101
|
+
end
|
102
|
+
body
|
103
|
+
end
|
104
|
+
|
105
|
+
def to_json(options = {})
|
106
|
+
to_body.to_json
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class BlacklistGetResponse
|
5
|
+
attr_accessor :blacklists
|
6
|
+
|
7
|
+
|
8
|
+
# :internal => :external
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:blacklists => :blacklists
|
12
|
+
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
return if attributes.empty?
|
18
|
+
# Morph attribute keys into undescored rubyish style
|
19
|
+
if self.class.attribute_map[:"blacklists"]
|
20
|
+
value = attributes["blacklists"] || attributes[:"blacklists"]
|
21
|
+
if value.is_a?(Array)
|
22
|
+
@blacklists = value.map{ |v| Blacklist.new(v) }
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_body
|
31
|
+
body = {}
|
32
|
+
self.class.attribute_map.each_pair do |key, value|
|
33
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
34
|
+
end
|
35
|
+
body
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_json(options = {})
|
39
|
+
to_body.to_json
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class BlacklistParams
|
5
|
+
attr_accessor :entity_type
|
6
|
+
|
7
|
+
|
8
|
+
attr_accessor :disabled
|
9
|
+
|
10
|
+
|
11
|
+
attr_accessor :ids
|
12
|
+
|
13
|
+
|
14
|
+
attr_accessor :scope
|
15
|
+
|
16
|
+
|
17
|
+
attr_accessor :active_from
|
18
|
+
|
19
|
+
|
20
|
+
attr_accessor :active_to
|
21
|
+
|
22
|
+
|
23
|
+
# :internal => :external
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:entity_type => :entityType,
|
27
|
+
:disabled => :disabled,
|
28
|
+
:ids => :ids,
|
29
|
+
:scope => :scope,
|
30
|
+
:active_from => :activeFrom,
|
31
|
+
:active_to => :activeTo
|
32
|
+
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return if attributes.empty?
|
38
|
+
# Morph attribute keys into undescored rubyish style
|
39
|
+
if self.class.attribute_map[:"entity_type"]
|
40
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
41
|
+
@entity_type = attributes["entityType"] || attributes[:"entity_type"]
|
42
|
+
end
|
43
|
+
if self.class.attribute_map[:"disabled"]
|
44
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
45
|
+
@disabled = attributes["disabled"] || attributes[:"disabled"]
|
46
|
+
end
|
47
|
+
if self.class.attribute_map[:"ids"]
|
48
|
+
value = attributes["ids"] || attributes[:"ids"]
|
49
|
+
if value.is_a?(Array)
|
50
|
+
@ids = value
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
if self.class.attribute_map[:"scope"]
|
55
|
+
value = attributes["scope"] || attributes[:"scope"]
|
56
|
+
if value.is_a?(Array)
|
57
|
+
@scope = value
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
if self.class.attribute_map[:"active_from"]
|
62
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
63
|
+
@active_from = attributes["activeFrom"] || attributes[:"active_from"]
|
64
|
+
end
|
65
|
+
if self.class.attribute_map[:"active_to"]
|
66
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
67
|
+
@active_to = attributes["activeTo"] || attributes[:"active_to"]
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
def to_body
|
74
|
+
body = {}
|
75
|
+
self.class.attribute_map.each_pair do |key, value|
|
76
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
77
|
+
end
|
78
|
+
body
|
79
|
+
end
|
80
|
+
|
81
|
+
def to_json(options = {})
|
82
|
+
to_body.to_json
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
#
|
4
|
+
class BlacklistSaveResponse
|
5
|
+
attr_accessor :result
|
6
|
+
|
7
|
+
|
8
|
+
# :internal => :external
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:result => :result
|
12
|
+
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
return if attributes.empty?
|
18
|
+
# Morph attribute keys into undescored rubyish style
|
19
|
+
if self.class.attribute_map[:"result"]
|
20
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
21
|
+
@result = attributes["result"] || attributes[:"result"]
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_body
|
28
|
+
body = {}
|
29
|
+
self.class.attribute_map.each_pair do |key, value|
|
30
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
31
|
+
end
|
32
|
+
body
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json(options = {})
|
36
|
+
to_body.to_json
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Attune
|
2
|
+
module Model
|
3
|
+
# customer associated with an anonymous user
|
4
|
+
class Customer
|
5
|
+
attr_accessor :customer
|
6
|
+
|
7
|
+
|
8
|
+
# :internal => :external
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:customer => :customer
|
12
|
+
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
return if attributes.empty?
|
18
|
+
# Morph attribute keys into undescored rubyish style
|
19
|
+
if self.class.attribute_map[:"customer"]
|
20
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
21
|
+
@customer = attributes["customer"] || attributes[:"customer"]
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_body
|
28
|
+
body = {}
|
29
|
+
self.class.attribute_map.each_pair do |key, value|
|
30
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
31
|
+
end
|
32
|
+
body
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json(options = {})
|
36
|
+
to_body.to_json
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|