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.
- checksums.yaml +4 -4
- data/.gitignore +9 -3
- data/.travis.yml +5 -44
- data/CHANGELOG.md +3 -0
- data/README.md +5 -5
- data/build.gradle +123 -0
- data/classpath/commons-codec-1.10.jar +0 -0
- data/classpath/commons-logging-1.2.jar +0 -0
- data/classpath/embulk-input-zendesk-0.3.0.jar +0 -0
- data/classpath/httpclient-4.5.6.jar +0 -0
- data/classpath/httpcore-4.4.10.jar +0 -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 +5 -0
- data/gradlew +172 -0
- data/gradlew.bat +84 -0
- data/lib/embulk/guess/zendesk.rb +21 -0
- data/lib/embulk/input/zendesk.rb +3 -9
- data/src/main/java/org/embulk/input/zendesk/ZendeskInputPlugin.java +471 -0
- data/src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java +268 -0
- data/src/main/java/org/embulk/input/zendesk/models/AuthenticationMethod.java +23 -0
- data/src/main/java/org/embulk/input/zendesk/models/Target.java +46 -0
- data/src/main/java/org/embulk/input/zendesk/models/ZendeskException.java +25 -0
- data/src/main/java/org/embulk/input/zendesk/services/ZendeskSupportAPIService.java +109 -0
- data/src/main/java/org/embulk/input/zendesk/utils/ZendeskConstants.java +61 -0
- data/src/main/java/org/embulk/input/zendesk/utils/ZendeskDateUtils.java +51 -0
- data/src/main/java/org/embulk/input/zendesk/utils/ZendeskUtils.java +150 -0
- data/src/main/java/org/embulk/input/zendesk/utils/ZendeskValidatorUtils.java +92 -0
- data/src/test/java/org/embulk/input/zendesk/TestZendeskInputPlugin.java +232 -0
- data/src/test/java/org/embulk/input/zendesk/clients/TestZendeskRestClient.java +351 -0
- data/src/test/java/org/embulk/input/zendesk/services/TestZendeskSupportAPIService.java +172 -0
- data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskDateUtils.java +36 -0
- data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskUtil.java +160 -0
- data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskValidatorUtils.java +138 -0
- data/src/test/java/org/embulk/input/zendesk/utils/ZendeskPluginTestRuntime.java +133 -0
- data/src/test/java/org/embulk/input/zendesk/utils/ZendeskTestHelper.java +63 -0
- data/src/test/resources/config/base.yml +14 -0
- data/src/test/resources/config/base_validator.yml +48 -0
- data/src/test/resources/config/incremental.yml +54 -0
- data/src/test/resources/config/non-incremental.yml +39 -0
- data/src/test/resources/config/util.yml +18 -0
- data/src/test/resources/data/client.json +293 -0
- data/src/test/resources/data/error_data.json +187 -0
- data/src/test/resources/data/expected/ticket_column.json +148 -0
- data/src/test/resources/data/expected/ticket_column_with_related_objects.json +152 -0
- data/src/test/resources/data/expected/ticket_fields_column.json +92 -0
- data/src/test/resources/data/expected/ticket_metrics_column.json +98 -0
- data/src/test/resources/data/ticket_fields.json +225 -0
- data/src/test/resources/data/ticket_metrics.json +397 -0
- data/src/test/resources/data/ticket_with_related_objects.json +67 -0
- data/src/test/resources/data/tickets.json +232 -0
- data/src/test/resources/data/tickets_continue.json +52 -0
- data/src/test/resources/data/util.json +19 -0
- data/src/test/resources/data/util_page.json +227 -0
- metadata +65 -221
- data/.ruby-version +0 -1
- data/.travis.yml.erb +0 -43
- data/Gemfile +0 -2
- data/Rakefile +0 -21
- data/embulk-input-zendesk.gemspec +0 -29
- data/gemfiles/embulk-0.8.0-latest +0 -4
- data/gemfiles/embulk-0.8.1 +0 -4
- data/gemfiles/embulk-latest +0 -4
- data/gemfiles/template.erb +0 -4
- data/lib/embulk/input/zendesk/client.rb +0 -434
- data/lib/embulk/input/zendesk/plugin.rb +0 -199
- data/test/capture_io.rb +0 -45
- data/test/embulk/input/zendesk/test_client.rb +0 -722
- data/test/embulk/input/zendesk/test_plugin.rb +0 -628
- data/test/fixture_helper.rb +0 -11
- data/test/fixtures/invalid_app_marketplace_lack_one_property.yml +0 -13
- data/test/fixtures/invalid_app_marketplace_lack_two_property.yml +0 -12
- data/test/fixtures/invalid_lack_username.yml +0 -9
- data/test/fixtures/invalid_unknown_auth.yml +0 -9
- data/test/fixtures/tickets.json +0 -44
- data/test/fixtures/valid_app_marketplace.yml +0 -14
- data/test/fixtures/valid_auth_basic.yml +0 -11
- data/test/fixtures/valid_auth_oauth.yml +0 -10
- data/test/fixtures/valid_auth_token.yml +0 -11
- data/test/override_assert_raise.rb +0 -21
- data/test/run-test.rb +0 -26
data/test/fixture_helper.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
in:
|
2
|
-
type: zendesk
|
3
|
-
login_url: "https://example.zendesk.com/"
|
4
|
-
auth_method: basic
|
5
|
-
target: tickets
|
6
|
-
username: foo@example.com
|
7
|
-
password: password
|
8
|
-
app_marketplace_integration_name: App Name for Zendesk
|
9
|
-
app_marketplace_org_id: 12345
|
10
|
-
columns:
|
11
|
-
- {name: id, type: string}
|
12
|
-
out:
|
13
|
-
type: "null"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
in:
|
2
|
-
type: zendesk
|
3
|
-
login_url: "https://example.zendesk.com/"
|
4
|
-
auth_method: basic
|
5
|
-
target: tickets
|
6
|
-
username: foo@example.com
|
7
|
-
password: password
|
8
|
-
app_marketplace_integration_name: App Name for Zendesk
|
9
|
-
columns:
|
10
|
-
- {name: id, type: string}
|
11
|
-
out:
|
12
|
-
type: "null"
|
data/test/fixtures/tickets.json
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
{"tickets":[{
|
2
|
-
"id": 35436,
|
3
|
-
"url": "https://company.zendesk.com/api/v2/tickets/35436.json",
|
4
|
-
"external_id": "ahg35h3jh",
|
5
|
-
"created_at": "2009-07-20T22:55:29Z",
|
6
|
-
"updated_at": "2011-05-05T10:38:52Z",
|
7
|
-
"type": "incident",
|
8
|
-
"subject": "Help, my printer is on fire!",
|
9
|
-
"raw_subject": "{{dc.printer_on_fire}} }{",
|
10
|
-
"description": "The fire is very colorful.",
|
11
|
-
"priority": "high",
|
12
|
-
"status": "open",
|
13
|
-
"recipient": "support@company.com",
|
14
|
-
"requester_id": 20978392,
|
15
|
-
"submitter_id": 76872,
|
16
|
-
"assignee_id": 235323,
|
17
|
-
"organization_id": 509974,
|
18
|
-
"group_id": 21031998,
|
19
|
-
"collaborator_ids": [35334, 234],
|
20
|
-
"forum_topic_id": 72648221,
|
21
|
-
"problem_id": 9873764,
|
22
|
-
"has_incidents": false,
|
23
|
-
"due_at": null,
|
24
|
-
"tags": ["enterprise", "other_tag"],
|
25
|
-
"via": {
|
26
|
-
"channel": "web"
|
27
|
-
},
|
28
|
-
"custom_fields": [
|
29
|
-
{
|
30
|
-
"id": 27642,
|
31
|
-
"value": "745"
|
32
|
-
},
|
33
|
-
{
|
34
|
-
"id": 27648,
|
35
|
-
"value": "yes"
|
36
|
-
}
|
37
|
-
],
|
38
|
-
"satisfaction_rating": {
|
39
|
-
"id": 1234,
|
40
|
-
"score": "good",
|
41
|
-
"comment": "Great support!"
|
42
|
-
},
|
43
|
-
"sharing_agreement_ids": [84432]
|
44
|
-
}]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
in:
|
2
|
-
type: zendesk
|
3
|
-
login_url: "https://example.zendesk.com/"
|
4
|
-
auth_method: basic
|
5
|
-
target: tickets
|
6
|
-
username: foo@example.com
|
7
|
-
password: password
|
8
|
-
app_marketplace_integration_name: App Name for Zendesk
|
9
|
-
app_marketplace_org_id: 12345
|
10
|
-
app_marketplace_app_id: 99999
|
11
|
-
columns:
|
12
|
-
- {name: id, type: string}
|
13
|
-
out:
|
14
|
-
type: "null"
|
@@ -1,21 +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.class => e
|
13
|
-
# https://github.com/test-unit/test-unit/issues/94
|
14
|
-
assert_equal e.message, expected_class.message
|
15
|
-
rescue expected_class
|
16
|
-
assert true # passed
|
17
|
-
rescue => e
|
18
|
-
assert_equal(expected_class, e.class) # not expected one raised
|
19
|
-
end
|
20
|
-
end
|
21
|
-
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
|
-
exit Test::Unit::AutoRunner.run(true, test_dir)
|
26
|
-
|