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 +4 -4
- data/lib/eloqua_api_service/folder.rb +28 -0
- data/lib/infunnel_cli/cli.rb +4 -0
- data/lib/infunnel_cli/cli/base.rb +1 -0
- data/lib/infunnel_cli/cli/email.rb +1 -0
- data/lib/infunnel_cli/cli/folder.rb +62 -0
- data/lib/infunnel_cli/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00817b36922f8a95cdd3e02af6e116f660e32752
|
4
|
+
data.tar.gz: 463deb009bf43afca1eee54de1a2c1d2b88c4e86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/infunnel_cli/cli.rb
CHANGED
@@ -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
|
@@ -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
|
data/lib/infunnel_cli/version.rb
CHANGED
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.
|
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
|
+
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
|