embulk-input-zendesk 0.2.14 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -3
  3. data/.travis.yml +5 -44
  4. data/CHANGELOG.md +3 -0
  5. data/README.md +5 -5
  6. data/build.gradle +123 -0
  7. data/classpath/commons-codec-1.10.jar +0 -0
  8. data/classpath/commons-logging-1.2.jar +0 -0
  9. data/classpath/embulk-input-zendesk-0.3.0.jar +0 -0
  10. data/classpath/httpclient-4.5.6.jar +0 -0
  11. data/classpath/httpcore-4.4.10.jar +0 -0
  12. data/config/checkstyle/checkstyle.xml +128 -0
  13. data/config/checkstyle/default.xml +108 -0
  14. data/gradle/wrapper/gradle-wrapper.jar +0 -0
  15. data/gradle/wrapper/gradle-wrapper.properties +5 -0
  16. data/gradlew +172 -0
  17. data/gradlew.bat +84 -0
  18. data/lib/embulk/guess/zendesk.rb +21 -0
  19. data/lib/embulk/input/zendesk.rb +3 -9
  20. data/src/main/java/org/embulk/input/zendesk/ZendeskInputPlugin.java +471 -0
  21. data/src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java +268 -0
  22. data/src/main/java/org/embulk/input/zendesk/models/AuthenticationMethod.java +23 -0
  23. data/src/main/java/org/embulk/input/zendesk/models/Target.java +46 -0
  24. data/src/main/java/org/embulk/input/zendesk/models/ZendeskException.java +25 -0
  25. data/src/main/java/org/embulk/input/zendesk/services/ZendeskSupportAPIService.java +109 -0
  26. data/src/main/java/org/embulk/input/zendesk/utils/ZendeskConstants.java +61 -0
  27. data/src/main/java/org/embulk/input/zendesk/utils/ZendeskDateUtils.java +51 -0
  28. data/src/main/java/org/embulk/input/zendesk/utils/ZendeskUtils.java +150 -0
  29. data/src/main/java/org/embulk/input/zendesk/utils/ZendeskValidatorUtils.java +92 -0
  30. data/src/test/java/org/embulk/input/zendesk/TestZendeskInputPlugin.java +232 -0
  31. data/src/test/java/org/embulk/input/zendesk/clients/TestZendeskRestClient.java +351 -0
  32. data/src/test/java/org/embulk/input/zendesk/services/TestZendeskSupportAPIService.java +172 -0
  33. data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskDateUtils.java +36 -0
  34. data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskUtil.java +160 -0
  35. data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskValidatorUtils.java +138 -0
  36. data/src/test/java/org/embulk/input/zendesk/utils/ZendeskPluginTestRuntime.java +133 -0
  37. data/src/test/java/org/embulk/input/zendesk/utils/ZendeskTestHelper.java +63 -0
  38. data/src/test/resources/config/base.yml +14 -0
  39. data/src/test/resources/config/base_validator.yml +48 -0
  40. data/src/test/resources/config/incremental.yml +54 -0
  41. data/src/test/resources/config/non-incremental.yml +39 -0
  42. data/src/test/resources/config/util.yml +18 -0
  43. data/src/test/resources/data/client.json +293 -0
  44. data/src/test/resources/data/error_data.json +187 -0
  45. data/src/test/resources/data/expected/ticket_column.json +148 -0
  46. data/src/test/resources/data/expected/ticket_column_with_related_objects.json +152 -0
  47. data/src/test/resources/data/expected/ticket_fields_column.json +92 -0
  48. data/src/test/resources/data/expected/ticket_metrics_column.json +98 -0
  49. data/src/test/resources/data/ticket_fields.json +225 -0
  50. data/src/test/resources/data/ticket_metrics.json +397 -0
  51. data/src/test/resources/data/ticket_with_related_objects.json +67 -0
  52. data/src/test/resources/data/tickets.json +232 -0
  53. data/src/test/resources/data/tickets_continue.json +52 -0
  54. data/src/test/resources/data/util.json +19 -0
  55. data/src/test/resources/data/util_page.json +227 -0
  56. metadata +65 -221
  57. data/.ruby-version +0 -1
  58. data/.travis.yml.erb +0 -43
  59. data/Gemfile +0 -2
  60. data/Rakefile +0 -21
  61. data/embulk-input-zendesk.gemspec +0 -29
  62. data/gemfiles/embulk-0.8.0-latest +0 -4
  63. data/gemfiles/embulk-0.8.1 +0 -4
  64. data/gemfiles/embulk-latest +0 -4
  65. data/gemfiles/template.erb +0 -4
  66. data/lib/embulk/input/zendesk/client.rb +0 -434
  67. data/lib/embulk/input/zendesk/plugin.rb +0 -199
  68. data/test/capture_io.rb +0 -45
  69. data/test/embulk/input/zendesk/test_client.rb +0 -722
  70. data/test/embulk/input/zendesk/test_plugin.rb +0 -628
  71. data/test/fixture_helper.rb +0 -11
  72. data/test/fixtures/invalid_app_marketplace_lack_one_property.yml +0 -13
  73. data/test/fixtures/invalid_app_marketplace_lack_two_property.yml +0 -12
  74. data/test/fixtures/invalid_lack_username.yml +0 -9
  75. data/test/fixtures/invalid_unknown_auth.yml +0 -9
  76. data/test/fixtures/tickets.json +0 -44
  77. data/test/fixtures/valid_app_marketplace.yml +0 -14
  78. data/test/fixtures/valid_auth_basic.yml +0 -11
  79. data/test/fixtures/valid_auth_oauth.yml +0 -10
  80. data/test/fixtures/valid_auth_token.yml +0 -11
  81. data/test/override_assert_raise.rb +0 -21
  82. data/test/run-test.rb +0 -26
metadata CHANGED
@@ -1,246 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-zendesk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
- - uu59
8
- - muga
9
- - sakama
7
+ - hieu.duong
10
8
  autorequire:
11
9
  bindir: bin
12
10
  cert_chain: []
13
- date: 2019-01-25 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
14
12
  dependencies:
15
13
  - !ruby/object:Gem::Dependency
16
14
  requirement: !ruby/object:Gem::Requirement
17
15
  requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '0.5'
21
- name: perfect_retry
22
- prerelease: false
23
- type: :runtime
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: '0.5'
29
- - !ruby/object:Gem::Dependency
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- name: httpclient
36
- prerelease: false
37
- type: :runtime
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
- - !ruby/object:Gem::Dependency
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- name: concurrent-ruby
50
- prerelease: false
51
- type: :runtime
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0'
57
- - !ruby/object:Gem::Dependency
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: 0.8.1
63
- name: embulk
64
- prerelease: false
65
- type: :development
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: 0.8.1
71
- - !ruby/object:Gem::Dependency
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
16
+ - - ~>
75
17
  - !ruby/object:Gem::Version
76
18
  version: '1.0'
77
- - - "<"
78
- - !ruby/object:Gem::Version
79
- version: '2.0'
80
19
  name: bundler
81
20
  prerelease: false
82
21
  type: :development
83
22
  version_requirements: !ruby/object:Gem::Requirement
84
23
  requirements:
85
- - - "~>"
24
+ - - ~>
86
25
  - !ruby/object:Gem::Version
87
26
  version: '1.0'
88
- - - "<"
89
- - !ruby/object:Gem::Version
90
- version: '2.0'
91
27
  - !ruby/object:Gem::Dependency
92
28
  requirement: !ruby/object:Gem::Requirement
93
29
  requirements:
94
- - - ">="
30
+ - - ~>
95
31
  - !ruby/object:Gem::Version
96
- version: '10.0'
32
+ version: '12.0'
97
33
  name: rake
98
34
  prerelease: false
99
35
  type: :development
100
36
  version_requirements: !ruby/object:Gem::Requirement
101
37
  requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '10.0'
105
- - !ruby/object:Gem::Dependency
106
- requirement: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- name: pry
112
- prerelease: false
113
- type: :development
114
- version_requirements: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- - !ruby/object:Gem::Dependency
120
- requirement: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 3.1.5
125
- name: test-unit
126
- prerelease: false
127
- type: :development
128
- version_requirements: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: 3.1.5
133
- - !ruby/object:Gem::Dependency
134
- requirement: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- name: test-unit-rr
140
- prerelease: false
141
- type: :development
142
- version_requirements: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: '0'
147
- - !ruby/object:Gem::Dependency
148
- requirement: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 1.1.2
153
- name: rr
154
- prerelease: false
155
- type: :development
156
- version_requirements: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - "~>"
159
- - !ruby/object:Gem::Version
160
- version: 1.1.2
161
- - !ruby/object:Gem::Dependency
162
- requirement: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- name: simplecov
168
- prerelease: false
169
- type: :development
170
- version_requirements: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: '0'
175
- - !ruby/object:Gem::Dependency
176
- requirement: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '1.0'
181
- name: gem_release_helper
182
- prerelease: false
183
- type: :development
184
- version_requirements: !ruby/object:Gem::Requirement
185
- requirements:
186
- - - "~>"
187
- - !ruby/object:Gem::Version
188
- version: '1.0'
189
- - !ruby/object:Gem::Dependency
190
- requirement: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '0.6'
195
- name: codeclimate-test-reporter
196
- prerelease: false
197
- type: :development
198
- version_requirements: !ruby/object:Gem::Requirement
199
- requirements:
200
- - - "~>"
38
+ - - ~>
201
39
  - !ruby/object:Gem::Version
202
- version: '0.6'
40
+ version: '12.0'
203
41
  description: Loads records from Zendesk.
204
42
  email:
205
- - k@uu59.org
206
- - muga.nishizawa@gmail.com
207
- - satoshiakama@gmail.com
43
+ - hieu.duong@treasure-data.com
208
44
  executables: []
209
45
  extensions: []
210
46
  extra_rdoc_files: []
211
47
  files:
212
- - ".gitignore"
213
- - ".ruby-version"
214
- - ".travis.yml"
215
- - ".travis.yml.erb"
48
+ - .gitignore
49
+ - .travis.yml
216
50
  - CHANGELOG.md
217
- - Gemfile
218
51
  - LICENSE.txt
219
52
  - README.md
220
- - Rakefile
221
- - embulk-input-zendesk.gemspec
222
- - gemfiles/embulk-0.8.0-latest
223
- - gemfiles/embulk-0.8.1
224
- - gemfiles/embulk-latest
225
- - gemfiles/template.erb
53
+ - build.gradle
54
+ - config/checkstyle/checkstyle.xml
55
+ - config/checkstyle/default.xml
56
+ - gradle/wrapper/gradle-wrapper.jar
57
+ - gradle/wrapper/gradle-wrapper.properties
58
+ - gradlew
59
+ - gradlew.bat
60
+ - lib/embulk/guess/zendesk.rb
226
61
  - lib/embulk/input/zendesk.rb
227
- - lib/embulk/input/zendesk/client.rb
228
- - lib/embulk/input/zendesk/plugin.rb
229
- - test/capture_io.rb
230
- - test/embulk/input/zendesk/test_client.rb
231
- - test/embulk/input/zendesk/test_plugin.rb
232
- - test/fixture_helper.rb
233
- - test/fixtures/invalid_app_marketplace_lack_one_property.yml
234
- - test/fixtures/invalid_app_marketplace_lack_two_property.yml
235
- - test/fixtures/invalid_lack_username.yml
236
- - test/fixtures/invalid_unknown_auth.yml
237
- - test/fixtures/tickets.json
238
- - test/fixtures/valid_app_marketplace.yml
239
- - test/fixtures/valid_auth_basic.yml
240
- - test/fixtures/valid_auth_oauth.yml
241
- - test/fixtures/valid_auth_token.yml
242
- - test/override_assert_raise.rb
243
- - test/run-test.rb
62
+ - src/main/java/org/embulk/input/zendesk/ZendeskInputPlugin.java
63
+ - src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java
64
+ - src/main/java/org/embulk/input/zendesk/models/AuthenticationMethod.java
65
+ - src/main/java/org/embulk/input/zendesk/models/Target.java
66
+ - src/main/java/org/embulk/input/zendesk/models/ZendeskException.java
67
+ - src/main/java/org/embulk/input/zendesk/services/ZendeskSupportAPIService.java
68
+ - src/main/java/org/embulk/input/zendesk/utils/ZendeskConstants.java
69
+ - src/main/java/org/embulk/input/zendesk/utils/ZendeskDateUtils.java
70
+ - src/main/java/org/embulk/input/zendesk/utils/ZendeskUtils.java
71
+ - src/main/java/org/embulk/input/zendesk/utils/ZendeskValidatorUtils.java
72
+ - src/test/java/org/embulk/input/zendesk/TestZendeskInputPlugin.java
73
+ - src/test/java/org/embulk/input/zendesk/clients/TestZendeskRestClient.java
74
+ - src/test/java/org/embulk/input/zendesk/services/TestZendeskSupportAPIService.java
75
+ - src/test/java/org/embulk/input/zendesk/utils/TestZendeskDateUtils.java
76
+ - src/test/java/org/embulk/input/zendesk/utils/TestZendeskUtil.java
77
+ - src/test/java/org/embulk/input/zendesk/utils/TestZendeskValidatorUtils.java
78
+ - src/test/java/org/embulk/input/zendesk/utils/ZendeskPluginTestRuntime.java
79
+ - src/test/java/org/embulk/input/zendesk/utils/ZendeskTestHelper.java
80
+ - src/test/resources/config/base.yml
81
+ - src/test/resources/config/base_validator.yml
82
+ - src/test/resources/config/incremental.yml
83
+ - src/test/resources/config/non-incremental.yml
84
+ - src/test/resources/config/util.yml
85
+ - src/test/resources/data/client.json
86
+ - src/test/resources/data/error_data.json
87
+ - src/test/resources/data/expected/ticket_column.json
88
+ - src/test/resources/data/expected/ticket_column_with_related_objects.json
89
+ - src/test/resources/data/expected/ticket_fields_column.json
90
+ - src/test/resources/data/expected/ticket_metrics_column.json
91
+ - src/test/resources/data/ticket_fields.json
92
+ - src/test/resources/data/ticket_metrics.json
93
+ - src/test/resources/data/ticket_with_related_objects.json
94
+ - src/test/resources/data/tickets.json
95
+ - src/test/resources/data/tickets_continue.json
96
+ - src/test/resources/data/util.json
97
+ - src/test/resources/data/util_page.json
98
+ - classpath/commons-logging-1.2.jar
99
+ - classpath/embulk-input-zendesk-0.3.0.jar
100
+ - classpath/httpcore-4.4.10.jar
101
+ - classpath/httpclient-4.5.6.jar
102
+ - classpath/commons-codec-1.10.jar
244
103
  homepage: https://github.com/treasure-data/embulk-input-zendesk
245
104
  licenses:
246
105
  - MIT
@@ -251,33 +110,18 @@ require_paths:
251
110
  - lib
252
111
  required_ruby_version: !ruby/object:Gem::Requirement
253
112
  requirements:
254
- - - ">="
113
+ - - '>='
255
114
  - !ruby/object:Gem::Version
256
115
  version: '0'
257
116
  required_rubygems_version: !ruby/object:Gem::Requirement
258
117
  requirements:
259
- - - ">="
118
+ - - '>='
260
119
  - !ruby/object:Gem::Version
261
120
  version: '0'
262
121
  requirements: []
263
122
  rubyforge_project:
264
- rubygems_version: 2.6.14.1
123
+ rubygems_version: 2.1.9
265
124
  signing_key:
266
125
  specification_version: 4
267
126
  summary: Zendesk input plugin for Embulk
268
- test_files:
269
- - test/capture_io.rb
270
- - test/embulk/input/zendesk/test_client.rb
271
- - test/embulk/input/zendesk/test_plugin.rb
272
- - test/fixture_helper.rb
273
- - test/fixtures/invalid_app_marketplace_lack_one_property.yml
274
- - test/fixtures/invalid_app_marketplace_lack_two_property.yml
275
- - test/fixtures/invalid_lack_username.yml
276
- - test/fixtures/invalid_unknown_auth.yml
277
- - test/fixtures/tickets.json
278
- - test/fixtures/valid_app_marketplace.yml
279
- - test/fixtures/valid_auth_basic.yml
280
- - test/fixtures/valid_auth_oauth.yml
281
- - test/fixtures/valid_auth_token.yml
282
- - test/override_assert_raise.rb
283
- - test/run-test.rb
127
+ test_files: []
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- jruby-9.1.17.0
data/.travis.yml.erb DELETED
@@ -1,43 +0,0 @@
1
- language: ruby
2
-
3
- jdk: oraclejdk8
4
-
5
- before_install:
6
- - rvm list known
7
- - rvm list
8
- - ruby -v
9
- - |
10
- # Currently, Travis can't treat jruby 9.0.4.0
11
- if [[ ${TRAVIS_RUBY_VERSION} != "jruby-9.0.4.0" ]];then
12
- rvm get head
13
- rvm use jruby-9.0.4.0 --install
14
- ruby -v
15
- fi
16
- - gem install bundler -v 1.10.6
17
-
18
- script: bundle exec rake cov
19
-
20
- rvm:
21
- - jruby-9.0.4.0
22
- env:
23
- # Set on Travis
24
- # CODECLIMATE_REPO_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
25
-
26
- gemfile:
27
- <% versions.each do |file| -%>
28
- - gemfiles/<%= file %>
29
- <% end -%>
30
-
31
- matrix:
32
- exclude:
33
- - jdk: oraclejdk8 # Ignore all matrix at first, use `include` to allow build
34
- include:
35
- <% matrix.each do |m| -%>
36
- <%= m.gsub("9.0.0.0", "9.0.4.0") %>
37
- <% end %>
38
-
39
- allow_failures:
40
- # Ignore failure for *-latest
41
- <% versions.find_all{|file| file.to_s.match(/-latest/)}.each do |file| -%>
42
- - gemfile: gemfiles/<%= file %>
43
- <% end %>
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org/'
2
- gemspec
data/Rakefile DELETED
@@ -1,21 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "gem_release_helper/tasks"
3
-
4
- task default: :test
5
-
6
- desc "Run tests"
7
- task :test do
8
- ruby("--debug", "test/run-test.rb", "--use-color=yes", "--collector=dir")
9
- end
10
-
11
- desc "Run tests with coverage"
12
- task :cov do
13
- ENV["COVERAGE"] = "1"
14
- ruby("--debug", "test/run-test.rb", "--use-color=yes", "--collector=dir")
15
- end
16
-
17
-
18
- GemReleaseHelper::Tasks.install(
19
- gemspec: "./embulk-input-zendesk.gemspec",
20
- github_name: "treasure-data/embulk-input-zendesk",
21
- )
@@ -1,29 +0,0 @@
1
-
2
- Gem::Specification.new do |spec|
3
- spec.name = "embulk-input-zendesk"
4
- spec.version = "0.2.14"
5
- spec.authors = ["uu59", "muga", "sakama"]
6
- spec.summary = "Zendesk input plugin for Embulk"
7
- spec.description = "Loads records from Zendesk."
8
- spec.email = ["k@uu59.org", "muga.nishizawa@gmail.com", "satoshiakama@gmail.com"]
9
- spec.licenses = ["MIT"]
10
- spec.homepage = "https://github.com/treasure-data/embulk-input-zendesk"
11
-
12
- spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
13
- spec.test_files = spec.files.grep(%r{^(test|spec)/})
14
- spec.require_paths = ["lib"]
15
-
16
- spec.add_dependency 'perfect_retry', '~> 0.5'
17
- spec.add_dependency 'httpclient'
18
- spec.add_dependency 'concurrent-ruby'
19
- spec.add_development_dependency 'embulk', ['~> 0.8.1']
20
- spec.add_development_dependency 'bundler', ['~> 1.0', '< 2.0']
21
- spec.add_development_dependency 'rake', ['>= 10.0']
22
- spec.add_development_dependency 'pry'
23
- spec.add_development_dependency 'test-unit', '~> 3.1.5'
24
- spec.add_development_dependency 'test-unit-rr'
25
- spec.add_development_dependency 'rr', '~> 1.1.2'
26
- spec.add_development_dependency 'simplecov'
27
- spec.add_development_dependency 'gem_release_helper', "~> 1.0"
28
- spec.add_development_dependency "codeclimate-test-reporter", "~> 0.6"
29
- end