Skip to content

Commit 4250a33

Browse files
committed
Core functionality
1 parent a1900eb commit 4250a33

30 files changed

+2003
-36
lines changed

docs/SendGrid-batchsource.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22

33
Description
44
-----------
5-
This plugin used to query SendGrid v3 API.
6-
5+
Plugin fetches data from SendGrid. SendGrid is a cloud-based service that assists businesses with email delivery. For
6+
the end user SendGrid provides information about existing Marketing Campaigns, Email Analytics, Bounces, Spam Reports.
7+
78
Properties
89
----------
910
### General
1011

1112
**Reference Name:** Name used to uniquely identify this source for lineage, annotating metadata, etc.
1213

13-
**Authentication type:** The way, how user would like to be authenticated to the SendGrid acoount
14+
**Authentication type:** The way, how user would like to be authenticated to the SendGrid account
1415

1516
**API Key:** The SendGrid API Key taken from the SendGrid account
1617

17-
**Username:** Login name for SendGrid
18+
**Username:** Login name for the SendGrid account
1819

19-
**Password:** Login password for the username specified above
20+
**Password:** Password for the SendGrid account
2021

2122
**Data Source Types:** List of data source groups
2223

@@ -25,7 +26,7 @@ Available:
2526
- Stats Fields
2627
- Suppressions Fields
2728

28-
**Data Source:** One of the above sources picked from list
29+
**Data Source:** SendGrid source object
2930

3031
Available:
3132
- Marketing Campaigns Fields
@@ -42,7 +43,18 @@ Available:
4243
- Bounces
4344
- Global Unsubscribes
4445
- Group Unsubscribes
45-
**Data Source Fields:**
46+
47+
**Data Source Fields:** The list of fields available for the retrieval
48+
49+
- *Automation:* id, name, status, type, message_count, created_at, updated_at, live_at
50+
- *SingleSends:* id, name, status, created_at, updated_at,
51+
- *Senders:* id, nickname, address, address_2, city, country, state, zip, locked, created_at, updated_at, from(email, name), verified(status, reason), reply_to(name, email)
52+
- *Contacts:* id, first_name, last_name, list_ids, created_at, updated_at, email, Segments, id, name, parent_list_id, created_at, updated_at, sample_updated_at, contacts_count
53+
- *GlobalStats:* date ,blocks ,bounce_drops ,bounces ,clicks ,deferred ,invalid_emails ,opens ,processed ,requests ,spam_report_drops ,spam_reports ,unique_clicks ,unique_opens ,unsubscribe_drops ,unsubscribes
54+
- *CategoryStats:* name, type, date, blocks, bounce_drops, bounces, clicks, deferred, delivered, invalid_emails, opens, processed, requests, spam_report_drops, spam_reports, unique_clicks, unique_opens, unsubscribe_drops, unsubscribes
55+
- *AdvancedStats:* name, type, date, clicks, opens, unique_clicks, unique_opens
56+
- *Bounces:* created, email, reason, status
57+
- *GroupUnsubscribes:* id ,name ,description ,is_default ,last_email_send_at ,unsubscribes
4658

4759
**Start Date:** The date in format YYYY-MM-DD, starting from which the data is requested
4860

pom.xml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,29 @@
2828
<properties>
2929
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3030
<cdap.version>6.1.0-SNAPSHOT</cdap.version>
31-
<cdap.plugin.version>2.2.0-SNAPSHOT</cdap.plugin.version>
32-
<hadoop.version>2.3.0</hadoop.version>
33-
<hydrator.version>2.2.0</hydrator.version>
31+
<hadoop.version>2.8.0</hadoop.version>
32+
<hydrator.version>2.3.0-SNAPSHOT</hydrator.version>
3433
<gson.version>2.2.4</gson.version>
3534
<common.logging.version>1.2</common.logging.version>
3635
</properties>
3736

37+
<repositories>
38+
<repository>
39+
<id>sonatype</id>
40+
<url>https://oss.sonatype.org/content/groups/public</url>
41+
</repository>
42+
<repository>
43+
<id>sonatype-snapshots</id>
44+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
45+
</repository>
46+
</repositories>
47+
<pluginRepositories>
48+
<pluginRepository>
49+
<id>sonatype</id>
50+
<url>https://oss.sonatype.org/content/groups/public/</url>
51+
</pluginRepository>
52+
</pluginRepositories>
53+
3854

3955
<dependencies>
4056
<dependency>
@@ -84,7 +100,7 @@
84100
<dependency>
85101
<groupId>io.cdap.plugin</groupId>
86102
<artifactId>hydrator-common</artifactId>
87-
<version>${cdap.plugin.version}</version>
103+
<version>${hydrator.version}</version>
88104
</dependency>
89105
<dependency>
90106
<groupId>org.apache.hadoop</groupId>
@@ -213,11 +229,7 @@
213229
<extensions>true</extensions>
214230
<configuration>
215231
<instructions>
216-
<_exportcontents>
217-
io.cdap.plugin.*;
218-
org.apache.commons.lang;
219-
org.apache.commons.logging.*;
220-
</_exportcontents>
232+
<_exportcontents>io.cdap.plugin.sendgrid.*</_exportcontents>
221233
<Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
222234
<Embed-Transitive>true</Embed-Transitive>
223235
<Embed-Directory>lib</Embed-Directory>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright © 2019 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package io.cdap.plugin.sendgrid.common;
18+
19+
/**
20+
* The way, how SendGrid API return the objects
21+
*
22+
*/
23+
public enum APIResponseType {
24+
/**
25+
* Objects come to the response as part of the list
26+
*/
27+
LIST,
28+
29+
/**
30+
* Objects come as part of wrapper, which consists from the metadata and the result
31+
*/
32+
RESULT,
33+
34+
/**
35+
* Same as {@link APIResponseType#RESULT}
36+
*/
37+
RESULTS
38+
}

0 commit comments

Comments
 (0)