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
@@ -0,0 +1,187 @@
|
|
1
|
+
{
|
2
|
+
"error_target": [
|
3
|
+
{
|
4
|
+
"url": "https://abc.zendesk.com/api/v2/tickets/2.json",
|
5
|
+
"id": 2,
|
6
|
+
"external_id": null,
|
7
|
+
"via": {
|
8
|
+
"channel": "web",
|
9
|
+
"source": {
|
10
|
+
"from": {},
|
11
|
+
"to": {},
|
12
|
+
"rel": null
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"created_at": "2019-02-20T06:51:50Z",
|
16
|
+
"updated_at": "2019-02-20T06:51:50Z",
|
17
|
+
"type": null,
|
18
|
+
"subject": "ticket1",
|
19
|
+
"raw_subject": "ticket1",
|
20
|
+
"description": "ticket1",
|
21
|
+
"priority": null,
|
22
|
+
"status": "open",
|
23
|
+
"recipient": null,
|
24
|
+
"requester_id": 374673563333,
|
25
|
+
"submitter_id": 374673563333,
|
26
|
+
"assignee_id": 374673563333,
|
27
|
+
"organization_id": 360857467053,
|
28
|
+
"group_id": 360003235353,
|
29
|
+
"collaborator_ids": [],
|
30
|
+
"follower_ids": [],
|
31
|
+
"email_cc_ids": [],
|
32
|
+
"forum_topic_id": null,
|
33
|
+
"problem_id": null,
|
34
|
+
"has_incidents": false,
|
35
|
+
"is_public": true,
|
36
|
+
"due_at": null,
|
37
|
+
"tags": [],
|
38
|
+
"custom_fields": [],
|
39
|
+
"satisfaction_rating": null,
|
40
|
+
"sharing_agreement_ids": [],
|
41
|
+
"fields": [],
|
42
|
+
"followup_ids": [],
|
43
|
+
"brand_id": 360001998013,
|
44
|
+
"allow_channelback": false,
|
45
|
+
"allow_attachments": true,
|
46
|
+
"generated_timestamp": 1550645510
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"url": "https://abc.zendesk.com/api/v2/tickets/3.json",
|
50
|
+
"id": 3,
|
51
|
+
"external_id": null,
|
52
|
+
"via": {
|
53
|
+
"channel": "web",
|
54
|
+
"source": {
|
55
|
+
"from": {},
|
56
|
+
"to": {},
|
57
|
+
"rel": null
|
58
|
+
}
|
59
|
+
},
|
60
|
+
"created_at": "2019-02-20T06:52:02Z",
|
61
|
+
"updated_at": "2019-02-20T06:52:02Z",
|
62
|
+
"type": null,
|
63
|
+
"subject": "ticket2",
|
64
|
+
"raw_subject": "ticket2",
|
65
|
+
"description": "ticket2",
|
66
|
+
"priority": null,
|
67
|
+
"status": "open",
|
68
|
+
"recipient": null,
|
69
|
+
"requester_id": 374673563333,
|
70
|
+
"submitter_id": 374673563333,
|
71
|
+
"assignee_id": 374673563333,
|
72
|
+
"organization_id": 360857467053,
|
73
|
+
"group_id": 360003235353,
|
74
|
+
"collaborator_ids": [],
|
75
|
+
"follower_ids": [],
|
76
|
+
"email_cc_ids": [],
|
77
|
+
"forum_topic_id": null,
|
78
|
+
"problem_id": null,
|
79
|
+
"has_incidents": false,
|
80
|
+
"is_public": true,
|
81
|
+
"due_at": null,
|
82
|
+
"tags": [],
|
83
|
+
"custom_fields": [],
|
84
|
+
"satisfaction_rating": null,
|
85
|
+
"sharing_agreement_ids": [],
|
86
|
+
"fields": [],
|
87
|
+
"followup_ids": [],
|
88
|
+
"brand_id": 360001998013,
|
89
|
+
"allow_channelback": false,
|
90
|
+
"allow_attachments": true,
|
91
|
+
"generated_timestamp": 1550645522
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"url": "https://abc.zendesk.com/api/v2/tickets/4.json",
|
95
|
+
"id": 4,
|
96
|
+
"external_id": null,
|
97
|
+
"via": {
|
98
|
+
"channel": "web",
|
99
|
+
"source": {
|
100
|
+
"from": {},
|
101
|
+
"to": {},
|
102
|
+
"rel": null
|
103
|
+
}
|
104
|
+
},
|
105
|
+
"created_at": "2019-02-20T06:52:12Z",
|
106
|
+
"updated_at": "2019-02-20T06:52:12Z",
|
107
|
+
"type": null,
|
108
|
+
"subject": "ticket3",
|
109
|
+
"raw_subject": "ticket3",
|
110
|
+
"description": "ticket3",
|
111
|
+
"priority": null,
|
112
|
+
"status": "open",
|
113
|
+
"recipient": null,
|
114
|
+
"requester_id": 374673563333,
|
115
|
+
"submitter_id": 374673563333,
|
116
|
+
"assignee_id": 374673563333,
|
117
|
+
"organization_id": 360857467053,
|
118
|
+
"group_id": 360003235353,
|
119
|
+
"collaborator_ids": [],
|
120
|
+
"follower_ids": [],
|
121
|
+
"email_cc_ids": [],
|
122
|
+
"forum_topic_id": null,
|
123
|
+
"problem_id": null,
|
124
|
+
"has_incidents": false,
|
125
|
+
"is_public": true,
|
126
|
+
"due_at": null,
|
127
|
+
"tags": [],
|
128
|
+
"custom_fields": [],
|
129
|
+
"satisfaction_rating": null,
|
130
|
+
"sharing_agreement_ids": [],
|
131
|
+
"fields": [],
|
132
|
+
"followup_ids": [],
|
133
|
+
"brand_id": 360001998013,
|
134
|
+
"allow_channelback": false,
|
135
|
+
"allow_attachments": true,
|
136
|
+
"generated_timestamp": 1550645532
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"url": "https://abc.zendesk.com/api/v2/tickets/1002.json",
|
140
|
+
"id": 1002,
|
141
|
+
"external_id": null,
|
142
|
+
"via": {
|
143
|
+
"channel": "api",
|
144
|
+
"source": {
|
145
|
+
"from": {},
|
146
|
+
"to": {},
|
147
|
+
"rel": null
|
148
|
+
}
|
149
|
+
},
|
150
|
+
"created_at": "2019-02-20T07:17:33Z",
|
151
|
+
"updated_at": "2019-02-20T07:17:33Z",
|
152
|
+
"type": null,
|
153
|
+
"subject": "Help!",
|
154
|
+
"raw_subject": "Help!",
|
155
|
+
"description": "Help I need somebody.",
|
156
|
+
"priority": null,
|
157
|
+
"status": "open",
|
158
|
+
"recipient": null,
|
159
|
+
"requester_id": 374673563333,
|
160
|
+
"submitter_id": 374673563333,
|
161
|
+
"assignee_id": 374673563333,
|
162
|
+
"organization_id": 360857467053,
|
163
|
+
"group_id": 360003235353,
|
164
|
+
"collaborator_ids": [],
|
165
|
+
"follower_ids": [],
|
166
|
+
"email_cc_ids": [],
|
167
|
+
"forum_topic_id": null,
|
168
|
+
"problem_id": null,
|
169
|
+
"has_incidents": false,
|
170
|
+
"is_public": true,
|
171
|
+
"due_at": null,
|
172
|
+
"tags": [],
|
173
|
+
"custom_fields": [],
|
174
|
+
"satisfaction_rating": null,
|
175
|
+
"sharing_agreement_ids": [],
|
176
|
+
"fields": [],
|
177
|
+
"followup_ids": [],
|
178
|
+
"brand_id": 360001998013,
|
179
|
+
"allow_channelback": false,
|
180
|
+
"allow_attachments": true,
|
181
|
+
"generated_timestamp": 1550647053
|
182
|
+
}
|
183
|
+
],
|
184
|
+
"count": 1000,
|
185
|
+
"next_page": "https://abc.zendesk.com/api/v2/incremental/tickets.json?sort_by=+updated_at&start_time=1550647053",
|
186
|
+
"end_time": 1550647053
|
187
|
+
}
|
@@ -0,0 +1,148 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "url",
|
4
|
+
"type": "string"
|
5
|
+
},
|
6
|
+
{
|
7
|
+
"name": "id",
|
8
|
+
"type": "long"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"name": "external_id",
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "via",
|
16
|
+
"type": "json"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"name": "created_at",
|
20
|
+
"type": "timestamp",
|
21
|
+
"format": "%Y-%m-%dT%H:%M:%S%z"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"name": "updated_at",
|
25
|
+
"type": "timestamp",
|
26
|
+
"format": "%Y-%m-%dT%H:%M:%S%z"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"name": "type",
|
30
|
+
"type": "string"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "subject",
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"name": "raw_subject",
|
38
|
+
"type": "string"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "description",
|
42
|
+
"type": "string"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "priority",
|
46
|
+
"type": "string"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"name": "status",
|
50
|
+
"type": "string"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name": "recipient",
|
54
|
+
"type": "string"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "requester_id",
|
58
|
+
"type": "string"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"name": "submitter_id",
|
62
|
+
"type": "string"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "assignee_id",
|
66
|
+
"type": "string"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "organization_id",
|
70
|
+
"type": "string"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "group_id",
|
74
|
+
"type": "string"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "collaborator_ids",
|
78
|
+
"type": "json"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"name": "follower_ids",
|
82
|
+
"type": "json"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"name": "email_cc_ids",
|
86
|
+
"type": "json"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"name": "forum_topic_id",
|
90
|
+
"type": "string"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"name": "problem_id",
|
94
|
+
"type": "string"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"name": "has_incidents",
|
98
|
+
"type": "boolean"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"name": "is_public",
|
102
|
+
"type": "boolean"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"name": "due_at",
|
106
|
+
"type": "string"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"name": "tags",
|
110
|
+
"type": "json"
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"name": "custom_fields",
|
114
|
+
"type": "json"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"name": "satisfaction_rating",
|
118
|
+
"type": "string"
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"name": "sharing_agreement_ids",
|
122
|
+
"type": "json"
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"name": "fields",
|
126
|
+
"type": "json"
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"name": "followup_ids",
|
130
|
+
"type": "json"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"name": "brand_id",
|
134
|
+
"type": "string"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"name": "allow_channelback",
|
138
|
+
"type": "boolean"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"name": "allow_attachments",
|
142
|
+
"type": "boolean"
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"name": "generated_timestamp",
|
146
|
+
"type": "long"
|
147
|
+
}
|
148
|
+
]
|
@@ -0,0 +1,152 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "url",
|
4
|
+
"type": "string"
|
5
|
+
},
|
6
|
+
{
|
7
|
+
"name": "id",
|
8
|
+
"type": "long"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"name": "external_id",
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "via",
|
16
|
+
"type": "json"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"name": "created_at",
|
20
|
+
"type": "timestamp",
|
21
|
+
"format": "%Y-%m-%dT%H:%M:%S%z"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"name": "updated_at",
|
25
|
+
"type": "timestamp",
|
26
|
+
"format": "%Y-%m-%dT%H:%M:%S%z"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"name": "type",
|
30
|
+
"type": "string"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "subject",
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"name": "raw_subject",
|
38
|
+
"type": "string"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "description",
|
42
|
+
"type": "string"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "priority",
|
46
|
+
"type": "string"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"name": "status",
|
50
|
+
"type": "string"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name": "recipient",
|
54
|
+
"type": "string"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "requester_id",
|
58
|
+
"type": "string"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"name": "submitter_id",
|
62
|
+
"type": "string"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "assignee_id",
|
66
|
+
"type": "string"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "organization_id",
|
70
|
+
"type": "string"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "group_id",
|
74
|
+
"type": "string"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "collaborator_ids",
|
78
|
+
"type": "json"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"name": "follower_ids",
|
82
|
+
"type": "json"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"name": "email_cc_ids",
|
86
|
+
"type": "json"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"name": "forum_topic_id",
|
90
|
+
"type": "string"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"name": "problem_id",
|
94
|
+
"type": "string"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"name": "has_incidents",
|
98
|
+
"type": "boolean"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"name": "is_public",
|
102
|
+
"type": "boolean"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"name": "due_at",
|
106
|
+
"type": "string"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"name": "tags",
|
110
|
+
"type": "json"
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"name": "custom_fields",
|
114
|
+
"type": "json"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"name": "satisfaction_rating",
|
118
|
+
"type": "string"
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"name": "sharing_agreement_ids",
|
122
|
+
"type": "json"
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"name": "fields",
|
126
|
+
"type": "json"
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"name": "followup_ids",
|
130
|
+
"type": "json"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"name": "brand_id",
|
134
|
+
"type": "string"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"name": "allow_channelback",
|
138
|
+
"type": "boolean"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"name": "allow_attachments",
|
142
|
+
"type": "boolean"
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"name": "generated_timestamp",
|
146
|
+
"type": "long"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"name": "organizations",
|
150
|
+
"type": "json"
|
151
|
+
}
|
152
|
+
]
|