attune 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/blacklist.md +41 -0
- data/lib/attune/models/blacklist.rb +18 -18
- data/lib/attune/models/blacklist_params.rb +9 -9
- data/lib/attune/models/blacklist_save_response.rb +7 -0
- data/lib/attune/models/ranking_params.rb +17 -17
- data/lib/attune/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5867da9248b0bd888009ad61bf369ed4b66e5485
|
4
|
+
data.tar.gz: 9bfa7c8ca1c9b04babbdf5d81ef0017630f3e180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59a091b696135af426afb2cf86afcabacc994f4d4742942853e260d5ab35d029e705a721fd7922f9d820dd2a3c9a6ea83a0d040e92c645153acb838b7fbafc9b
|
7
|
+
data.tar.gz: 3720f7530e58745cbbf2eb059242019cd54ebcefaa60ec172f102ebd453100af74f24d11fa14c35e638714e98e98cc8579faf6f63338c587b708a4eda8b08f99
|
data/README.md
CHANGED
data/blacklist.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Blacklist API
|
2
|
+
|
3
|
+
## Add a blacklist entry
|
4
|
+
|
5
|
+
``` ruby
|
6
|
+
params = Attune::Model::BlacklistParams.new
|
7
|
+
params.ids = [1,2,3]
|
8
|
+
params.entity_type = 'products'
|
9
|
+
scope = Attune::Model::ScopeEntry.new
|
10
|
+
scope.name = 'page'
|
11
|
+
scope.value = 'sale'
|
12
|
+
params.scope = [scope]
|
13
|
+
params.active_from = '2012-06-04 19:00:00'
|
14
|
+
params.active_to = '2012-06-06 19:00:00'
|
15
|
+
client.entities.blacklist_save(params)
|
16
|
+
```
|
17
|
+
|
18
|
+
## Retrieve a blacklist entry
|
19
|
+
|
20
|
+
``` ruby
|
21
|
+
blacklist = client.entities.blacklist_get(blacklist_id)
|
22
|
+
```
|
23
|
+
|
24
|
+
## Update a blacklist entry
|
25
|
+
|
26
|
+
``` ruby
|
27
|
+
params = Attune::Model::BlacklistParams.new
|
28
|
+
params.disabled = true
|
29
|
+
client.entities.blacklist_update(params)
|
30
|
+
```
|
31
|
+
|
32
|
+
## Delete a blacklist entry
|
33
|
+
|
34
|
+
``` ruby
|
35
|
+
client.entities.blacklist_delete(blacklist_id)
|
36
|
+
```
|
37
|
+
|
38
|
+
## Get all blacklists for your account
|
39
|
+
``` ruby
|
40
|
+
all_blacklists = client.entities.blacklist_get_all(blacklist_id)
|
41
|
+
```
|
@@ -5,13 +5,13 @@ module Attune
|
|
5
5
|
# @attr [String] id
|
6
6
|
# @attr [String] entity_type
|
7
7
|
# @attr [String] consumer
|
8
|
-
# @attr [String] end_date
|
9
|
-
# @attr [Boolean] disabled
|
10
|
-
# @attr [String] created_at
|
11
8
|
# @attr [String] start_date
|
9
|
+
# @attr [String] created_date
|
10
|
+
# @attr [String] updated_date
|
11
|
+
# @attr [String] end_date
|
12
12
|
# @attr [Array<String>] scope
|
13
13
|
# @attr [Array<String>] ids
|
14
|
-
# @attr [Boolean]
|
14
|
+
# @attr [Boolean] disabled
|
15
15
|
class Blacklist
|
16
16
|
attr_accessor :id
|
17
17
|
|
@@ -22,16 +22,16 @@ module Attune
|
|
22
22
|
attr_accessor :consumer
|
23
23
|
|
24
24
|
|
25
|
-
attr_accessor :
|
25
|
+
attr_accessor :start_date
|
26
26
|
|
27
27
|
|
28
|
-
attr_accessor :
|
28
|
+
attr_accessor :created_date
|
29
29
|
|
30
30
|
|
31
|
-
attr_accessor :
|
31
|
+
attr_accessor :updated_date
|
32
32
|
|
33
33
|
|
34
|
-
attr_accessor :
|
34
|
+
attr_accessor :end_date
|
35
35
|
|
36
36
|
|
37
37
|
attr_accessor :scope
|
@@ -40,7 +40,7 @@ module Attune
|
|
40
40
|
attr_accessor :ids
|
41
41
|
|
42
42
|
|
43
|
-
attr_accessor :
|
43
|
+
attr_accessor :disabled
|
44
44
|
|
45
45
|
|
46
46
|
def initialize(attributes = {})
|
@@ -52,13 +52,13 @@ module Attune
|
|
52
52
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
53
53
|
@consumer = attributes["consumer"] || attributes[:"consumer"]
|
54
54
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
55
|
-
@
|
55
|
+
@start_date = attributes["startDate"] || attributes[:"start_date"]
|
56
56
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
57
|
-
@
|
57
|
+
@created_date = attributes["createdDate"] || attributes[:"created_date"]
|
58
58
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
59
|
-
@
|
59
|
+
@updated_date = attributes["updatedDate"] || attributes[:"updated_date"]
|
60
60
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
61
|
-
@
|
61
|
+
@end_date = attributes["endDate"] || attributes[:"end_date"]
|
62
62
|
value = attributes["scope"] || attributes[:"scope"]
|
63
63
|
if value.is_a?(Array)
|
64
64
|
@scope = value
|
@@ -70,7 +70,7 @@ module Attune
|
|
70
70
|
|
71
71
|
end
|
72
72
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
73
|
-
@
|
73
|
+
@disabled = attributes["disabled"] || attributes[:"disabled"]
|
74
74
|
|
75
75
|
|
76
76
|
end
|
@@ -92,13 +92,13 @@ module Attune
|
|
92
92
|
:id => :id,
|
93
93
|
:entity_type => :entityType,
|
94
94
|
:consumer => :consumer,
|
95
|
-
:end_date => :endDate,
|
96
|
-
:disabled => :disabled,
|
97
|
-
:created_at => :createdAt,
|
98
95
|
:start_date => :startDate,
|
96
|
+
:created_date => :createdDate,
|
97
|
+
:updated_date => :updatedDate,
|
98
|
+
:end_date => :endDate,
|
99
99
|
:scope => :scope,
|
100
100
|
:ids => :ids,
|
101
|
-
:
|
101
|
+
:disabled => :disabled
|
102
102
|
|
103
103
|
}
|
104
104
|
end
|
@@ -2,20 +2,20 @@ module Attune
|
|
2
2
|
module Model
|
3
3
|
#
|
4
4
|
#
|
5
|
+
# @attr [Array<String>] ids
|
5
6
|
# @attr [Boolean] disabled
|
6
7
|
# @attr [String] entity_type
|
7
|
-
# @attr [Array<String>] ids
|
8
8
|
# @attr [Array<Attune::Model::ScopeEntry>] scope
|
9
9
|
# @attr [String] active_from
|
10
10
|
# @attr [String] active_to
|
11
11
|
class BlacklistParams
|
12
|
-
attr_accessor :
|
12
|
+
attr_accessor :ids
|
13
13
|
|
14
14
|
|
15
|
-
attr_accessor :
|
15
|
+
attr_accessor :disabled
|
16
16
|
|
17
17
|
|
18
|
-
attr_accessor :
|
18
|
+
attr_accessor :entity_type
|
19
19
|
|
20
20
|
|
21
21
|
attr_accessor :scope
|
@@ -29,15 +29,15 @@ module Attune
|
|
29
29
|
|
30
30
|
def initialize(attributes = {})
|
31
31
|
return if attributes.empty?
|
32
|
-
# Workaround since JSON.parse has accessors as strings rather than symbols
|
33
|
-
@disabled = attributes["disabled"] || attributes[:"disabled"]
|
34
|
-
# Workaround since JSON.parse has accessors as strings rather than symbols
|
35
|
-
@entity_type = attributes["entityType"] || attributes[:"entity_type"]
|
36
32
|
value = attributes["ids"] || attributes[:"ids"]
|
37
33
|
if value.is_a?(Array)
|
38
34
|
@ids = value
|
39
35
|
|
40
36
|
end
|
37
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
38
|
+
@disabled = attributes["disabled"] || attributes[:"disabled"]
|
39
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
40
|
+
@entity_type = attributes["entityType"] || attributes[:"entity_type"]
|
41
41
|
value = attributes["scope"] || attributes[:"scope"]
|
42
42
|
if value.is_a?(Array)
|
43
43
|
@scope = value.map{ |v| ScopeEntry.new(v) }
|
@@ -65,9 +65,9 @@ module Attune
|
|
65
65
|
private
|
66
66
|
# :internal => :external
|
67
67
|
ATTRIBUTE_MAP = {
|
68
|
+
:ids => :ids,
|
68
69
|
:disabled => :disabled,
|
69
70
|
:entity_type => :entityType,
|
70
|
-
:ids => :ids,
|
71
71
|
:scope => :scope,
|
72
72
|
:active_from => :activeFrom,
|
73
73
|
:active_to => :activeTo
|
@@ -2,14 +2,20 @@ module Attune
|
|
2
2
|
module Model
|
3
3
|
#
|
4
4
|
#
|
5
|
+
# @attr [String] id
|
5
6
|
# @attr [String] result
|
6
7
|
class BlacklistSaveResponse
|
8
|
+
attr_accessor :id
|
9
|
+
|
10
|
+
|
7
11
|
attr_accessor :result
|
8
12
|
|
9
13
|
|
10
14
|
def initialize(attributes = {})
|
11
15
|
return if attributes.empty?
|
12
16
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
17
|
+
@id = attributes["id"] || attributes[:"id"]
|
18
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
13
19
|
@result = attributes["result"] || attributes[:"result"]
|
14
20
|
|
15
21
|
|
@@ -29,6 +35,7 @@ module Attune
|
|
29
35
|
private
|
30
36
|
# :internal => :external
|
31
37
|
ATTRIBUTE_MAP = {
|
38
|
+
:id => :id,
|
32
39
|
:result => :result
|
33
40
|
|
34
41
|
}
|
@@ -2,31 +2,31 @@ module Attune
|
|
2
2
|
module Model
|
3
3
|
# Inputs for ranking a set of ids for a particular user.
|
4
4
|
#
|
5
|
-
# @attr [String] view
|
6
5
|
# @attr [String] user_agent
|
7
6
|
# @attr [String] ip
|
8
|
-
# @attr [String] customer
|
9
|
-
# @attr [String] entity_type
|
10
7
|
# @attr [Array<String>] ids
|
8
|
+
# @attr [String] view
|
9
|
+
# @attr [String] entity_type
|
10
|
+
# @attr [String] customer
|
11
11
|
# @attr [Array<Attune::Model::ScopeEntry>] scope
|
12
12
|
# @attr [String] anonymous
|
13
13
|
class RankingParams
|
14
|
-
attr_accessor :view
|
15
|
-
|
16
|
-
|
17
14
|
attr_accessor :user_agent
|
18
15
|
|
19
16
|
|
20
17
|
attr_accessor :ip
|
21
18
|
|
22
19
|
|
23
|
-
attr_accessor :
|
20
|
+
attr_accessor :ids
|
21
|
+
|
22
|
+
|
23
|
+
attr_accessor :view
|
24
24
|
|
25
25
|
|
26
26
|
attr_accessor :entity_type
|
27
27
|
|
28
28
|
|
29
|
-
attr_accessor :
|
29
|
+
attr_accessor :customer
|
30
30
|
|
31
31
|
|
32
32
|
attr_accessor :scope
|
@@ -38,20 +38,20 @@ module Attune
|
|
38
38
|
def initialize(attributes = {})
|
39
39
|
return if attributes.empty?
|
40
40
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
41
|
-
@view = attributes["view"] || attributes[:"view"]
|
42
|
-
# Workaround since JSON.parse has accessors as strings rather than symbols
|
43
41
|
@user_agent = attributes["userAgent"] || attributes[:"user_agent"]
|
44
42
|
# Workaround since JSON.parse has accessors as strings rather than symbols
|
45
43
|
@ip = attributes["ip"] || attributes[:"ip"]
|
46
|
-
# Workaround since JSON.parse has accessors as strings rather than symbols
|
47
|
-
@customer = attributes["customer"] || attributes[:"customer"]
|
48
|
-
# Workaround since JSON.parse has accessors as strings rather than symbols
|
49
|
-
@entity_type = attributes["entityType"] || attributes[:"entity_type"]
|
50
44
|
value = attributes["ids"] || attributes[:"ids"]
|
51
45
|
if value.is_a?(Array)
|
52
46
|
@ids = value
|
53
47
|
|
54
48
|
end
|
49
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
50
|
+
@view = attributes["view"] || attributes[:"view"]
|
51
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
52
|
+
@entity_type = attributes["entityType"] || attributes[:"entity_type"]
|
53
|
+
# Workaround since JSON.parse has accessors as strings rather than symbols
|
54
|
+
@customer = attributes["customer"] || attributes[:"customer"]
|
55
55
|
value = attributes["scope"] || attributes[:"scope"]
|
56
56
|
if value.is_a?(Array)
|
57
57
|
@scope = value.map{ |v| ScopeEntry.new(v) }
|
@@ -77,12 +77,12 @@ module Attune
|
|
77
77
|
private
|
78
78
|
# :internal => :external
|
79
79
|
ATTRIBUTE_MAP = {
|
80
|
-
:view => :view,
|
81
80
|
:user_agent => :userAgent,
|
82
81
|
:ip => :ip,
|
83
|
-
:customer => :customer,
|
84
|
-
:entity_type => :entityType,
|
85
82
|
:ids => :ids,
|
83
|
+
:view => :view,
|
84
|
+
:entity_type => :entityType,
|
85
|
+
:customer => :customer,
|
86
86
|
:scope => :scope,
|
87
87
|
:anonymous => :anonymous
|
88
88
|
|
data/lib/attune/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hawthorn
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- README.md
|
141
141
|
- Rakefile
|
142
142
|
- attune.gemspec
|
143
|
+
- blacklist.md
|
143
144
|
- lib/attune.rb
|
144
145
|
- lib/attune/api/anonymous.rb
|
145
146
|
- lib/attune/api/entities.rb
|