infunnel_cli 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e34b2dc4706b8649d977ce34a229e534ac8dfe77
4
- data.tar.gz: c3486c33a5e8279003fda21cd902126e7e731828
3
+ metadata.gz: 00817b36922f8a95cdd3e02af6e116f660e32752
4
+ data.tar.gz: 463deb009bf43afca1eee54de1a2c1d2b88c4e86
5
5
  SHA512:
6
- metadata.gz: 9286e23d960b0270a15a23d985a4c38b5ea5e43d67971231837e17bb0eabb10c1e9ac7b0caca2ccf576b3d48c0b576c27d77f6a966797443978b0cee7bfcfe79
7
- data.tar.gz: 829fee62b94ec55e8e8728949cf664a87fb632d4a3f37699e9c9ce538e8627d7b9039850f20bdb85313e4d3f7487577e1bc4a1ef2ae50c6b7d582fe3c441020b
6
+ metadata.gz: c1f7b2655b0252f8324e93dc24ddd3c64d7faebc17745e99cc08f085c578ef3c508280dba5105b5291411e95372de9402453090c5b7ec23bc065486a5522482d
7
+ data.tar.gz: 5e705bb59ab8eeeacd93f8cc9b85b7f9e70cd70d25a6bd6fd995a5c4bf4b875573e4485c4dd732d6533f5ee3c8789dacf1625c2977ca0eb0996d2f37c7f6c15d
@@ -0,0 +1,28 @@
1
+ require 'eloqua_api_service/service'
2
+
3
+ module EloquaApiService
4
+ class Folder < Service
5
+
6
+ def segments
7
+ response = self.class.get("/API/REST/1.0/assets/contact/segment/folders", @options)
8
+ parsed_response = JSON.parse(response.body, symbolize_names: true) rescue nil
9
+ end
10
+
11
+
12
+ def emails
13
+ response = self.class.get("/API/REST/1.0/assets/email/folders", @options)
14
+ parsed_response = JSON.parse(response.body, symbolize_names: true) rescue nil
15
+ end
16
+
17
+ def campaigns
18
+ response = self.class.get("/API/REST/1.0/assets/campaign/folders", @options)
19
+ parsed_response = JSON.parse(response.body, symbolize_names: true) rescue nil
20
+ end
21
+
22
+ def contact_lists
23
+ response = self.class.get("/API/REST/1.0/assets/contact/list/folders", @options)
24
+ parsed_response = JSON.parse(response.body, symbolize_names: true) rescue nil
25
+ end
26
+
27
+ end
28
+ end
@@ -11,6 +11,7 @@ require 'infunnel_cli/cli/user'
11
11
  require 'infunnel_cli/cli/custom_object'
12
12
  require 'infunnel_cli/cli/contact_segment'
13
13
  require 'infunnel_cli/cli/contact_list'
14
+ require 'infunnel_cli/cli/folder'
14
15
  require 'keychain'
15
16
  #require 'ruby-keychain'
16
17
 
@@ -53,5 +54,8 @@ module InfunnelCli
53
54
  desc "contact_list", ""
54
55
  subcommand "contact_list", InfunnelCli::CLI::ContactList
55
56
 
57
+ desc "folders", ""
58
+ subcommand "folders", InfunnelCli::CLI::Folder
59
+
56
60
  end
57
61
  end
@@ -14,6 +14,7 @@ require 'eloqua_api_service/user'
14
14
  require 'eloqua_api_service/custom_object'
15
15
  require 'eloqua_api_service/contact_segment'
16
16
  require 'eloqua_api_service/contact_list'
17
+ require 'eloqua_api_service/folder'
17
18
 
18
19
  module InfunnelCli
19
20
  module CLI
@@ -13,6 +13,7 @@ module InfunnelCli
13
13
 
14
14
  email = EloquaApiService::Email.new(account: options[:account])
15
15
  body = email.find(id: id)
16
+ puts body
16
17
 
17
18
  if body.nil?
18
19
  puts "\e[31m" + "#{id} not found"
@@ -0,0 +1,62 @@
1
+ require 'infunnel_cli/cli/base'
2
+
3
+ module InfunnelCli
4
+ module CLI
5
+ class Folder < Base
6
+ #class_option :account
7
+
8
+ desc "segment", "Segment folders"
9
+ option :account, aliases: :a
10
+ def segment
11
+ segment = EloquaApiService::Folder.new(account: options[:account]).segments
12
+ puts segment[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
13
+ end
14
+
15
+ desc "email", "Email folders"
16
+ option :account, aliases: :a
17
+ def email
18
+ email = EloquaApiService::Folder.new(account: options[:account]).emails
19
+ puts email[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
20
+ end
21
+
22
+ desc "campaign", "campaign folders"
23
+ option :account, aliases: :a
24
+ def campaign
25
+ campaign = EloquaApiService::Folder.new(account: options[:account]).campaigns
26
+ puts campaign[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
27
+ end
28
+
29
+ desc "contact_list", "contact_list folders"
30
+ option :account, aliases: :a
31
+ def contact_list
32
+ contact_list = EloquaApiService::Folder.new(account: options[:account]).contact_lists
33
+ puts contact_list[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
34
+ end
35
+
36
+
37
+ desc "all", "all folders"
38
+ option :account, aliases: :a
39
+ def all
40
+ folders = {}
41
+ contact_lists = EloquaApiService::Folder.new(account: options[:account]).contact_lists
42
+ folders[:contact_lists] = contact_lists[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
43
+
44
+ emails = EloquaApiService::Folder.new(account: options[:account]).emails
45
+ folders[:enmails] = emails[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
46
+
47
+ campaigns = EloquaApiService::Folder.new(account: options[:account]).campaigns
48
+ folders[:campaigns] = campaigns[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
49
+
50
+ segments = EloquaApiService::Folder.new(account: options[:account]).segments
51
+ folders[:segments] = segments[:elements].map{ |e| {e[:name] => {id: e[:id]} } }
52
+
53
+ folders.each do |k, v|
54
+ puts black on_white k
55
+ v.each do |e|
56
+ puts e
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -1,3 +1,3 @@
1
1
  module InfunnelCli
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infunnel_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - lundevallan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-11 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -137,6 +137,7 @@ files:
137
137
  - lib/eloqua_api_service/credential.rb
138
138
  - lib/eloqua_api_service/custom_object.rb
139
139
  - lib/eloqua_api_service/email.rb
140
+ - lib/eloqua_api_service/folder.rb
140
141
  - lib/eloqua_api_service/form.rb
141
142
  - lib/eloqua_api_service/lead_score.rb
142
143
  - lib/eloqua_api_service/login.rb
@@ -155,6 +156,7 @@ files:
155
156
  - lib/infunnel_cli/cli/custom_object.rb
156
157
  - lib/infunnel_cli/cli/eloqua.rb
157
158
  - lib/infunnel_cli/cli/email.rb
159
+ - lib/infunnel_cli/cli/folder.rb
158
160
  - lib/infunnel_cli/cli/form.rb
159
161
  - lib/infunnel_cli/cli/option_list.rb
160
162
  - lib/infunnel_cli/cli/program.rb