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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee21877f0981b41ef08c156aeaf81d45d6220990
4
- data.tar.gz: 6663ba3272fc11b3143e4b3832e6e98927f99143
3
+ metadata.gz: 0c12e6413c774ab68051b55a5bd4ec0f47397e0a
4
+ data.tar.gz: beda80f4a60a7efaa6eaee41502b58442fe40ec3
5
5
  SHA512:
6
- metadata.gz: e1d1a7e6fb0468d720796d34c5c2557262b1956746fe716237c66a1e843b9e02d2c22006716e83af7f2ae924f5c457408c81933856aa15e88549cbba5207cbdb
7
- data.tar.gz: dce1b16e69b05483060d2b8531addbee07b2c828b231ca40daf87b1284b03d310e7c3b962bd047d49cd1f5c01bfd3ed2105cd2889841150d520eea822743e4f6
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
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module AppAnnie
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -3,5 +3,6 @@ require "anego"
3
3
  require "ruboty"
4
4
  require "ruboty/app_annie/actions/base"
5
5
  require "ruboty/app_annie/actions/list_accounts"
6
+ require "ruboty/app_annie/actions/list_products"
6
7
  require "ruboty/app_annie/version"
7
8
  require "ruboty/handlers/app_annie"
@@ -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.2
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