ruboty-app_annie 0.0.2 → 0.0.3
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/README.md +1 -0
- data/lib/ruboty/app_annie/actions/list_products.rb +27 -0
- data/lib/ruboty/app_annie/version.rb +1 -1
- data/lib/ruboty/app_annie.rb +1 -0
- data/lib/ruboty/handlers/app_annie.rb +10 -0
- 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: 0c12e6413c774ab68051b55a5bd4ec0f47397e0a
|
4
|
+
data.tar.gz: beda80f4a60a7efaa6eaee41502b58442fe40ec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12ceddf1a130947bede8266798301c68b0862a75d5ec4e7b7e9bbec7812266222f72f35b8307e3e51736cfdd8743a97dd4d348bdfa859c2053967b9b64440462
|
7
|
+
data.tar.gz: c585e6bea9dd5f6ad91144127148abf5f13362d23dd279a022797ab2b5e9496ed040349649eae4394858a9b60c709534ef46cf5df0fb1f0ccfd182e223bc0307
|
data/README.md
CHANGED
@@ -15,6 +15,7 @@ gem "ruboty-app_annie"
|
|
15
15
|
|
16
16
|
```
|
17
17
|
@ruboty annie list accounts - Retrieve all account connections available in an App Annie user account
|
18
|
+
@ruboty annie list products of <account_id> - Retrieve the product list of an Analytics Account Connection
|
18
19
|
```
|
19
20
|
|
20
21
|
## ENV
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Ruboty
|
2
|
+
module AppAnnie
|
3
|
+
module Actions
|
4
|
+
class ListProducts < Base
|
5
|
+
def call
|
6
|
+
list_products
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def list_products
|
12
|
+
message.reply(products.join("\n"), code: true)
|
13
|
+
end
|
14
|
+
|
15
|
+
def products
|
16
|
+
client.products(given_account_id).body.products.select{ |p| p.status }.map do |product|
|
17
|
+
"ID: #{product.product_id}, Name: #{product.product_name}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def given_account_id
|
22
|
+
message[:account_id]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/ruboty/app_annie.rb
CHANGED
@@ -9,9 +9,19 @@ module Ruboty
|
|
9
9
|
description: "Retrieve all account connections available in an App Annie user account",
|
10
10
|
)
|
11
11
|
|
12
|
+
on(
|
13
|
+
/annie list products of (?<account_id>.+)\z/,
|
14
|
+
name: "list_products",
|
15
|
+
description: "Retrieve the product list of an Analytics Account Connection",
|
16
|
+
)
|
17
|
+
|
12
18
|
def list_accounts(message)
|
13
19
|
Ruboty::AppAnnie::Actions::ListAccounts.new(message).call
|
14
20
|
end
|
21
|
+
|
22
|
+
def list_products(message)
|
23
|
+
Ruboty::AppAnnie::Actions::ListProducts.new(message).call
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
17
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-app_annie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fakestarbaby
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/ruboty/app_annie.rb
|
86
86
|
- lib/ruboty/app_annie/actions/base.rb
|
87
87
|
- lib/ruboty/app_annie/actions/list_accounts.rb
|
88
|
+
- lib/ruboty/app_annie/actions/list_products.rb
|
88
89
|
- lib/ruboty/app_annie/version.rb
|
89
90
|
- lib/ruboty/handlers/app_annie.rb
|
90
91
|
- ruboty-app_annie.gemspec
|