embulk-input-zendesk 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/input/zendesk/ZendeskInputPlugin.java +3 -1
- data/src/main/java/org/embulk/input/zendesk/services/ZendeskSupportAPIService.java +1 -0
- data/src/main/java/org/embulk/input/zendesk/utils/ZendeskConstants.java +0 -1
- data/src/main/java/org/embulk/input/zendesk/utils/ZendeskValidatorUtils.java +0 -13
- data/src/test/java/org/embulk/input/zendesk/utils/TestZendeskValidatorUtils.java +0 -8
- data/src/test/resources/config/base.yml +1 -1
- data/src/test/resources/config/base_validator.yml +1 -1
- data/src/test/resources/config/incremental.yml +1 -1
- data/src/test/resources/config/non-incremental.yml +1 -1
- data/src/test/resources/config/util.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad84ae4662ea53d03acc90bfa8bb64fa4cbc7d1c
|
4
|
+
data.tar.gz: 64c1ca4a49feb32bc0ee301516462380a4b07e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 746eb9f61b8ec5bd2e9fd4708524cfb0736a3fa37f1869a2fdcfe69a766f7b022a302ca519514ff8bbb84074d84927042910bf58e298ce4c176fb69f02093fb9
|
7
|
+
data.tar.gz: f83290a54accc3a198507d3db5d111cb2f852d72d5000745846a4131d20a99ea94dd6f2a5aa5c2d87174a04131a2ee814c2b079e7092e2b6510e81e2de0fe952
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.3.3 - 2019-04-11
|
2
|
+
* [fixed] Fix trailing slash #55 [#55](https://github.com/treasure-data/embulk-input-zendesk/pull/55)
|
3
|
+
|
1
4
|
## 0.3.2 - 2019-04-10
|
2
5
|
* [fixed] Fix generate config diff based on incremental config #54 [#54](https://github.com/treasure-data/embulk-input-zendesk/pull/54)
|
3
6
|
|
data/build.gradle
CHANGED
@@ -423,7 +423,9 @@ public class ZendeskInputPlugin implements InputPlugin
|
|
423
423
|
// FIXME: if include is not contained in schema, data should be ignore
|
424
424
|
task.getIncludes().forEach(include -> {
|
425
425
|
String relatedObjectName = include.trim();
|
426
|
-
final String url = task.getLoginUrl()
|
426
|
+
final String url = task.getLoginUrl()
|
427
|
+
+ "/"
|
428
|
+
+ ZendeskConstants.Url.API
|
427
429
|
+ "/" + task.getTarget().toString()
|
428
430
|
+ "/" + jsonNode.get(ZendeskConstants.Field.ID).asText()
|
429
431
|
+ "/" + relatedObjectName + ".json";
|
@@ -86,6 +86,7 @@ public class ZendeskSupportAPIService
|
|
86
86
|
boolean isSupportIncremental = ZendeskUtils.isSupportAPIIncremental(task.getTarget());
|
87
87
|
|
88
88
|
StringBuilder urlBuilder = new StringBuilder(task.getLoginUrl())
|
89
|
+
.append("/")
|
89
90
|
.append(isSupportIncremental
|
90
91
|
? ZendeskConstants.Url.API_INCREMENTAL
|
91
92
|
: ZendeskConstants.Url.API)
|
@@ -6,9 +6,6 @@ import org.embulk.input.zendesk.services.ZendeskSupportAPIService;
|
|
6
6
|
import org.embulk.spi.Exec;
|
7
7
|
import org.slf4j.Logger;
|
8
8
|
|
9
|
-
import java.util.regex.Matcher;
|
10
|
-
import java.util.regex.Pattern;
|
11
|
-
|
12
9
|
public class ZendeskValidatorUtils
|
13
10
|
{
|
14
11
|
private ZendeskValidatorUtils(){}
|
@@ -17,7 +14,6 @@ public class ZendeskValidatorUtils
|
|
17
14
|
|
18
15
|
public static void validateInputTask(final ZendeskInputPlugin.PluginTask task, final ZendeskSupportAPIService zendeskSupportAPIService)
|
19
16
|
{
|
20
|
-
validateHost(task.getLoginUrl());
|
21
17
|
validateAppMarketPlace(task.getAppMarketPlaceIntegrationName().isPresent(),
|
22
18
|
task.getAppMarketPlaceAppId().isPresent(),
|
23
19
|
task.getAppMarketPlaceOrgId().isPresent());
|
@@ -25,15 +21,6 @@ public class ZendeskValidatorUtils
|
|
25
21
|
validateIncremental(task);
|
26
22
|
}
|
27
23
|
|
28
|
-
private static void validateHost(final String loginUrl)
|
29
|
-
{
|
30
|
-
final Matcher matcher = Pattern.compile(ZendeskConstants.Regex.HOST).matcher(loginUrl);
|
31
|
-
if (!matcher.matches()) {
|
32
|
-
throw new ConfigException(String.format("Login URL, '%s', is unmatched expectation. " +
|
33
|
-
"It should be followed this format: https://abc.zendesk.com/", loginUrl));
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
24
|
private static void validateCredentials(final ZendeskInputPlugin.PluginTask task)
|
38
25
|
{
|
39
26
|
switch (task.getAuthenticationMethod()) {
|
@@ -44,14 +44,6 @@ public class TestZendeskValidatorUtils
|
|
44
44
|
configSource = getBaseConfigSource();
|
45
45
|
}
|
46
46
|
|
47
|
-
@Test
|
48
|
-
public void validateHostShouldThrowException()
|
49
|
-
{
|
50
|
-
configSource.set("login_url", "dummyhost");
|
51
|
-
final ZendeskInputPlugin.PluginTask task = configSource.loadConfig(ZendeskInputPlugin.PluginTask.class);
|
52
|
-
assertValidation(task, "Login URL, 'dummyhost', is unmatched expectation. It should be followed this format: https://abc.zendesk.com/");
|
53
|
-
}
|
54
|
-
|
55
47
|
@Test
|
56
48
|
public void validateCredentialOauthShouldThrowException()
|
57
49
|
{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-zendesk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hieu.duong
|
@@ -95,8 +95,8 @@ files:
|
|
95
95
|
- src/test/resources/data/tickets_continue.json
|
96
96
|
- src/test/resources/data/util.json
|
97
97
|
- src/test/resources/data/util_page.json
|
98
|
-
- classpath/embulk-input-zendesk-0.3.2.jar
|
99
98
|
- classpath/commons-logging-1.2.jar
|
99
|
+
- classpath/embulk-input-zendesk-0.3.3.jar
|
100
100
|
- classpath/httpcore-4.4.10.jar
|
101
101
|
- classpath/httpclient-4.5.6.jar
|
102
102
|
- classpath/commons-codec-1.10.jar
|