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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +37 -0
  3. data/.gitignore +11 -2
  4. data/.travis.yml +5 -45
  5. data/LICENSE.txt +21 -0
  6. data/README.md +14 -65
  7. data/build.gradle +102 -0
  8. data/config/checkstyle/checkstyle.xml +128 -0
  9. data/config/checkstyle/default.xml +108 -0
  10. data/gradle/wrapper/gradle-wrapper.jar +0 -0
  11. data/gradle/wrapper/gradle-wrapper.properties +6 -0
  12. data/gradlew +169 -0
  13. data/gradlew.bat +84 -0
  14. data/lib/embulk/input/marketo.rb +3 -0
  15. data/settings.gradle +1 -0
  16. data/src/main/java/org/embulk/input/marketo/CsvTokenizer.java +677 -0
  17. data/src/main/java/org/embulk/input/marketo/MarketoInputPlugin.java +15 -0
  18. data/src/main/java/org/embulk/input/marketo/MarketoInputPluginDelegate.java +77 -0
  19. data/src/main/java/org/embulk/input/marketo/MarketoService.java +30 -0
  20. data/src/main/java/org/embulk/input/marketo/MarketoServiceImpl.java +176 -0
  21. data/src/main/java/org/embulk/input/marketo/MarketoUtils.java +172 -0
  22. data/src/main/java/org/embulk/input/marketo/delegate/ActivityBulkExtractInputPlugin.java +63 -0
  23. data/src/main/java/org/embulk/input/marketo/delegate/CampaignInputPlugin.java +67 -0
  24. data/src/main/java/org/embulk/input/marketo/delegate/LeadBulkExtractInputPlugin.java +61 -0
  25. data/src/main/java/org/embulk/input/marketo/delegate/LeadWithListInputPlugin.java +58 -0
  26. data/src/main/java/org/embulk/input/marketo/delegate/LeadWithProgramInputPlugin.java +56 -0
  27. data/src/main/java/org/embulk/input/marketo/delegate/MarketoBaseBulkExtractInputPlugin.java +260 -0
  28. data/src/main/java/org/embulk/input/marketo/delegate/MarketoBaseInputPluginDelegate.java +69 -0
  29. data/src/main/java/org/embulk/input/marketo/exception/MarketoAPIException.java +30 -0
  30. data/src/main/java/org/embulk/input/marketo/model/MarketoAccessTokenResponse.java +92 -0
  31. data/src/main/java/org/embulk/input/marketo/model/MarketoBulkExtractRequest.java +59 -0
  32. data/src/main/java/org/embulk/input/marketo/model/MarketoError.java +40 -0
  33. data/src/main/java/org/embulk/input/marketo/model/MarketoField.java +91 -0
  34. data/src/main/java/org/embulk/input/marketo/model/MarketoResponse.java +81 -0
  35. data/src/main/java/org/embulk/input/marketo/model/filter/DateRangeFilter.java +31 -0
  36. data/src/main/java/org/embulk/input/marketo/model/filter/ListFilter.java +10 -0
  37. data/src/main/java/org/embulk/input/marketo/model/filter/MarketoFilter.java +8 -0
  38. data/src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java +226 -0
  39. data/src/main/java/org/embulk/input/marketo/rest/MarketoFileResponseEntityReader.java +69 -0
  40. data/src/main/java/org/embulk/input/marketo/rest/MarketoRESTEndpoint.java +44 -0
  41. data/src/main/java/org/embulk/input/marketo/rest/MarketoResponseJetty92EntityReader.java +88 -0
  42. data/src/main/java/org/embulk/input/marketo/rest/MarketoRestClient.java +332 -0
  43. data/src/main/java/org/embulk/input/marketo/rest/RecordPagingIterable.java +130 -0
  44. data/src/test/java/org/embulk/input/marketo/TestMarketoInputPlugin.java +5 -0
  45. data/src/test/java/org/embulk/input/marketo/rest/MarketoBaseRestClientTest.java +220 -0
  46. metadata +65 -222
  47. data/.ruby-version +0 -1
  48. data/.travis.yml.erb +0 -42
  49. data/Gemfile +0 -3
  50. data/LICENSE +0 -13
  51. data/Rakefile +0 -20
  52. data/embulk-input-marketo.gemspec +0 -28
  53. data/gemfiles/embulk-latest +0 -4
  54. data/gemfiles/template.erb +0 -4
  55. data/lib/embulk/input/marketo/activity_log.rb +0 -103
  56. data/lib/embulk/input/marketo/base.rb +0 -139
  57. data/lib/embulk/input/marketo/lead.rb +0 -143
  58. data/lib/embulk/input/marketo_api.rb +0 -22
  59. data/lib/embulk/input/marketo_api/soap/activity_log.rb +0 -103
  60. data/lib/embulk/input/marketo_api/soap/base.rb +0 -135
  61. data/lib/embulk/input/marketo_api/soap/lead.rb +0 -91
  62. data/test/activity_log_fixtures.rb +0 -216
  63. data/test/embulk/input/marketo/test_activity_log.rb +0 -444
  64. data/test/embulk/input/marketo/test_base.rb +0 -76
  65. data/test/embulk/input/marketo/test_lead.rb +0 -605
  66. data/test/embulk/input/marketo_api/soap/test_activity_log.rb +0 -154
  67. data/test/embulk/input/marketo_api/soap/test_base.rb +0 -96
  68. data/test/embulk/input/marketo_api/soap/test_lead.rb +0 -139
  69. data/test/embulk/input/test_marketo_api.rb +0 -28
  70. data/test/lead_fixtures.rb +0 -111
  71. data/test/mute_logger.rb +0 -7
  72. data/test/override_assert_raise.rb +0 -18
  73. data/test/prepare_embulk.rb +0 -15
  74. data/test/run-test.rb +0 -26
  75. data/test/savon_helper.rb +0 -17
data/test/mute_logger.rb DELETED
@@ -1,7 +0,0 @@
1
- module MuteLogger
2
- private
3
-
4
- def mute_logger
5
- stub(Embulk).logger { ::Logger.new(IO::NULL) }
6
- end
7
- end
@@ -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
@@ -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