embulk-input-marketo 0.5.6 → 0.5.7.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +37 -0
- data/.gitignore +11 -2
- data/.travis.yml +5 -45
- data/LICENSE.txt +21 -0
- data/README.md +14 -65
- data/build.gradle +102 -0
- data/config/checkstyle/checkstyle.xml +128 -0
- data/config/checkstyle/default.xml +108 -0
- data/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/gradlew +169 -0
- data/gradlew.bat +84 -0
- data/lib/embulk/input/marketo.rb +3 -0
- data/settings.gradle +1 -0
- data/src/main/java/org/embulk/input/marketo/CsvTokenizer.java +677 -0
- data/src/main/java/org/embulk/input/marketo/MarketoInputPlugin.java +15 -0
- data/src/main/java/org/embulk/input/marketo/MarketoInputPluginDelegate.java +77 -0
- data/src/main/java/org/embulk/input/marketo/MarketoService.java +30 -0
- data/src/main/java/org/embulk/input/marketo/MarketoServiceImpl.java +176 -0
- data/src/main/java/org/embulk/input/marketo/MarketoUtils.java +172 -0
- data/src/main/java/org/embulk/input/marketo/delegate/ActivityBulkExtractInputPlugin.java +63 -0
- data/src/main/java/org/embulk/input/marketo/delegate/CampaignInputPlugin.java +67 -0
- data/src/main/java/org/embulk/input/marketo/delegate/LeadBulkExtractInputPlugin.java +61 -0
- data/src/main/java/org/embulk/input/marketo/delegate/LeadWithListInputPlugin.java +58 -0
- data/src/main/java/org/embulk/input/marketo/delegate/LeadWithProgramInputPlugin.java +56 -0
- data/src/main/java/org/embulk/input/marketo/delegate/MarketoBaseBulkExtractInputPlugin.java +260 -0
- data/src/main/java/org/embulk/input/marketo/delegate/MarketoBaseInputPluginDelegate.java +69 -0
- data/src/main/java/org/embulk/input/marketo/exception/MarketoAPIException.java +30 -0
- data/src/main/java/org/embulk/input/marketo/model/MarketoAccessTokenResponse.java +92 -0
- data/src/main/java/org/embulk/input/marketo/model/MarketoBulkExtractRequest.java +59 -0
- data/src/main/java/org/embulk/input/marketo/model/MarketoError.java +40 -0
- data/src/main/java/org/embulk/input/marketo/model/MarketoField.java +91 -0
- data/src/main/java/org/embulk/input/marketo/model/MarketoResponse.java +81 -0
- data/src/main/java/org/embulk/input/marketo/model/filter/DateRangeFilter.java +31 -0
- data/src/main/java/org/embulk/input/marketo/model/filter/ListFilter.java +10 -0
- data/src/main/java/org/embulk/input/marketo/model/filter/MarketoFilter.java +8 -0
- data/src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java +226 -0
- data/src/main/java/org/embulk/input/marketo/rest/MarketoFileResponseEntityReader.java +69 -0
- data/src/main/java/org/embulk/input/marketo/rest/MarketoRESTEndpoint.java +44 -0
- data/src/main/java/org/embulk/input/marketo/rest/MarketoResponseJetty92EntityReader.java +88 -0
- data/src/main/java/org/embulk/input/marketo/rest/MarketoRestClient.java +332 -0
- data/src/main/java/org/embulk/input/marketo/rest/RecordPagingIterable.java +130 -0
- data/src/test/java/org/embulk/input/marketo/TestMarketoInputPlugin.java +5 -0
- data/src/test/java/org/embulk/input/marketo/rest/MarketoBaseRestClientTest.java +220 -0
- metadata +65 -222
- data/.ruby-version +0 -1
- data/.travis.yml.erb +0 -42
- data/Gemfile +0 -3
- data/LICENSE +0 -13
- data/Rakefile +0 -20
- data/embulk-input-marketo.gemspec +0 -28
- data/gemfiles/embulk-latest +0 -4
- data/gemfiles/template.erb +0 -4
- data/lib/embulk/input/marketo/activity_log.rb +0 -103
- data/lib/embulk/input/marketo/base.rb +0 -139
- data/lib/embulk/input/marketo/lead.rb +0 -143
- data/lib/embulk/input/marketo_api.rb +0 -22
- data/lib/embulk/input/marketo_api/soap/activity_log.rb +0 -103
- data/lib/embulk/input/marketo_api/soap/base.rb +0 -135
- data/lib/embulk/input/marketo_api/soap/lead.rb +0 -91
- data/test/activity_log_fixtures.rb +0 -216
- data/test/embulk/input/marketo/test_activity_log.rb +0 -444
- data/test/embulk/input/marketo/test_base.rb +0 -76
- data/test/embulk/input/marketo/test_lead.rb +0 -605
- data/test/embulk/input/marketo_api/soap/test_activity_log.rb +0 -154
- data/test/embulk/input/marketo_api/soap/test_base.rb +0 -96
- data/test/embulk/input/marketo_api/soap/test_lead.rb +0 -139
- data/test/embulk/input/test_marketo_api.rb +0 -28
- data/test/lead_fixtures.rb +0 -111
- data/test/mute_logger.rb +0 -7
- data/test/override_assert_raise.rb +0 -18
- data/test/prepare_embulk.rb +0 -15
- data/test/run-test.rb +0 -26
- data/test/savon_helper.rb +0 -17
data/test/mute_logger.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module OverrideAssertRaise
|
2
|
-
# NOTE: Embulk 0.7.1+ required to raise ConfigError to do as `ConfigError.new("message")`,
|
3
|
-
# original `assert_raise` method can't catch that, but `begin .. rescue` can.
|
4
|
-
# So we override assert_raise as below.
|
5
|
-
def assert_raise(expected_class = StandardError, &block)
|
6
|
-
begin
|
7
|
-
block.call
|
8
|
-
assert_equal expected_class, nil
|
9
|
-
rescue ::Test::Unit::AssertionFailedError => e
|
10
|
-
# failed assert raises this Error and that extends StandardError, so rescue it first
|
11
|
-
raise e
|
12
|
-
rescue expected_class
|
13
|
-
assert true # passed
|
14
|
-
rescue => e
|
15
|
-
assert_equal(expected_class, e.class) # not expected one raised
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/test/prepare_embulk.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require "embulk/command/embulk_run"
|
2
|
-
|
3
|
-
if Embulk.respond_to?(:home)
|
4
|
-
# keep compatibility for Embulk 0.6.x
|
5
|
-
classpath_dir = Embulk.home("classpath")
|
6
|
-
jars = Dir.entries(classpath_dir).select{|f| f =~ /\.jar$/ }.sort
|
7
|
-
jars.each do |jar|
|
8
|
-
require File.join(classpath_dir, jar)
|
9
|
-
end
|
10
|
-
require "embulk/java/bootstrap"
|
11
|
-
require "embulk"
|
12
|
-
else
|
13
|
-
require "embulk"
|
14
|
-
Embulk.setup
|
15
|
-
end
|
data/test/run-test.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
4
|
-
lib_dir = File.join(base_dir, "lib")
|
5
|
-
test_dir = File.join(base_dir, "test")
|
6
|
-
|
7
|
-
require "test-unit"
|
8
|
-
require "test/unit/rr"
|
9
|
-
|
10
|
-
$LOAD_PATH.unshift(lib_dir)
|
11
|
-
$LOAD_PATH.unshift(test_dir)
|
12
|
-
|
13
|
-
ENV["TEST_UNIT_MAX_DIFF_TARGET_STRING_SIZE"] ||= "5000"
|
14
|
-
|
15
|
-
if ENV["COVERAGE"]
|
16
|
-
if ENV["CI"]
|
17
|
-
require "codeclimate-test-reporter"
|
18
|
-
CodeClimate::TestReporter.start
|
19
|
-
else
|
20
|
-
require 'simplecov'
|
21
|
-
SimpleCov.start 'test_frameworks'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
|
-
exit Test::Unit::AutoRunner.run(true, test_dir)
|
data/test/savon_helper.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module SavonHelper
|
2
|
-
private
|
3
|
-
|
4
|
-
def savon_response(body)
|
5
|
-
globals = {
|
6
|
-
namespace_identifier: :ns1,
|
7
|
-
env_namespace: 'SOAP-ENV',
|
8
|
-
|
9
|
-
# https://github.com/savonrb/savon/blob/v2.11.1/lib/savon/options.rb#L75-L94
|
10
|
-
strip_namespaces: true,
|
11
|
-
convert_response_tags_to: lambda { |tag| tag.snakecase.to_sym},
|
12
|
-
convert_attributes_to: lambda { |k,v| [k,v] },
|
13
|
-
}
|
14
|
-
httpi = HTTPI::Response.new(200, {}, body)
|
15
|
-
Savon::Response.new(httpi, globals, {advanced_typecasting: false})
|
16
|
-
end
|
17
|
-
end
|