Skip to content

Commit 0c20b3c

Browse files
authoredMar 7, 2018
Merge pull request #4 from sendinblue/hotfix-byteattachment
Fix sending with attachment API through Json Serializer
2 parents 6783e9d + 00e9427 commit 0c20b3c

14 files changed

+202
-125
lines changed
 

‎README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add this dependency to your project's POM:
2222
<dependency>
2323
<groupId>com.sendinblue</groupId>
2424
<artifactId>sib-api-v3-sdk</artifactId>
25-
<version>1.0.0</version>
25+
<version>1.0.1</version>
2626
<scope>compile</scope>
2727
</dependency>
2828
```
@@ -32,7 +32,7 @@ Add this dependency to your project's POM:
3232
Add this dependency to your project's build file:
3333

3434
```groovy
35-
compile "com.sendinblue:sib-api-v3-sdk:1.0.0"
35+
compile "com.sendinblue:sib-api-v3-sdk:1.0.1"
3636
```
3737

3838
### Others
@@ -45,7 +45,7 @@ At first generate the JAR by executing:
4545

4646
Then manually install the following JARs:
4747

48-
* target/sib-api-v3-sdk-1.0.0.jar
48+
* target/sib-api-v3-sdk-1.0.1.jar
4949
* target/lib/*.jar
5050

5151
## Getting Started

‎docs/SendEmail.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**emailCc** | **List&lt;String&gt;** | Email addresses of the recipients in cc | [optional]
1010
**replyTo** | **String** | Email on which campaign recipients will be able to reply to | [optional]
1111
**attachmentUrl** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
12-
**attachment** | [**List&lt;SendEmailAttachment&gt;**](SendEmailAttachment.md) | Pass the base64 content of the attachment. Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
12+
**attachment** | [**List&lt;SendEmailAttachment&gt;**](SendEmailAttachment.md) | Pass the byte array of the attachment ( Encoded to base64 chunk data at our end ). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1313
**headers** | **Map&lt;String, String&gt;** | | [optional]
1414
**attributes** | **Map&lt;String, String&gt;** | | [optional]
1515

‎docs/SendEmailAttachment.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**content** | **byte[]** | Base64 encoded chunk data of the attachment generated on the fly | [optional]
8-
**name** | **String** | Required for content. Name of the attachment | [optional]
9-
10-
11-
7+
**content** | **byte[]** | Byte array of the attachment generated on the fly ( Encoded to base64 chunk data at our end ) | [optional]
8+
**name** | **String** | Required for content. Name of the attachment | [optional]

‎docs/SendSmtpEmail.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
1212
**textContent** | **String** | Plain Text body of the message ( Ignored if templateId is passed ) | [optional]
1313
**subject** | **String** | Subject of the message |
1414
**replyTo** | [**SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
15-
**attachment** | [**List&lt;SendSmtpEmailAttachment&gt;**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment. Name can be used in both cases to define the attachment name. It is mandatory in case of content. Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
15+
**attachment** | [**List&lt;SendSmtpEmailAttachment&gt;**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the byte array of the attachment. Name can be used in both cases to define the attachment name. It is mandatory in case of content. Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1616
**headers** | **Map&lt;String, String&gt;** | | [optional]
1717
**templateId** | **Long** | Id of the template | [optional]
1818
**params** | **Map&lt;String, String&gt;** | | [optional]

‎docs/SendSmtpEmailAttachment.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**url** | **String** | Absolute url of the attachment (no local file). | [optional]
8-
**content** | **byte[]** | Base64 encoded chunk data of the attachment generated on the fly | [optional]
9-
**name** | **String** | Required for content. Name of the attachment | [optional]
10-
11-
12-
8+
**content** | **byte[]** | Byte array of the attachment generated on the fly ( Encoded to base64 chunk data at our end ) | [optional]
9+
**name** | **String** | Required for content. Name of the attachment | [optional]

‎pom.xml

+18-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>sib-api-v3-sdk</artifactId>
66
<packaging>jar</packaging>
77
<name>sib-api-v3-sdk</name>
8-
<version>1.0.0</version>
8+
<version>1.0.1</version>
99
<url>https://github.com/sendinblue/APIv3-java-library</url>
1010
<description>SendinBlue&#39;s API v3 Java Library</description>
1111
<scm>
@@ -126,7 +126,7 @@
126126
<configuration>
127127
<sources>
128128
<source>
129-
src/main/java</source>
129+
src/main/java</source>
130130
</sources>
131131
</configuration>
132132
</execution>
@@ -139,7 +139,7 @@
139139
<configuration>
140140
<sources>
141141
<source>
142-
src/test/java</source>
142+
src/test/java</source>
143143
</sources>
144144
</configuration>
145145
</execution>
@@ -209,6 +209,11 @@
209209
<artifactId>okhttp</artifactId>
210210
<version>${okhttp-version}</version>
211211
</dependency>
212+
<dependency>
213+
<groupId>com.squareup.okio</groupId>
214+
<artifactId>okio</artifactId>
215+
<version>${okio-version}</version>
216+
</dependency>
212217
<dependency>
213218
<groupId>com.squareup.okhttp</groupId>
214219
<artifactId>logging-interceptor</artifactId>
@@ -224,11 +229,11 @@
224229
<artifactId>gson-fire</artifactId>
225230
<version>${gson-fire-version}</version>
226231
</dependency>
227-
<dependency>
228-
<groupId>org.threeten</groupId>
229-
<artifactId>threetenbp</artifactId>
230-
<version>${threetenbp-version}</version>
231-
</dependency>
232+
<dependency>
233+
<groupId>org.threeten</groupId>
234+
<artifactId>threetenbp</artifactId>
235+
<version>${threetenbp-version}</version>
236+
</dependency>
232237
<!-- test dependencies -->
233238
<dependency>
234239
<groupId>junit</groupId>
@@ -243,14 +248,15 @@
243248
</dependency>
244249
</dependencies>
245250
<properties>
246-
<java.version>1.7</java.version>
251+
<java.version>1.8</java.version>
247252
<maven.compiler.source>${java.version}</maven.compiler.source>
248253
<maven.compiler.target>${java.version}</maven.compiler.target>
249-
<gson-fire-version>1.8.0</gson-fire-version>
254+
<gson-fire-version>1.8.2</gson-fire-version>
250255
<swagger-core-version>1.5.15</swagger-core-version>
251256
<okhttp-version>2.7.5</okhttp-version>
252-
<gson-version>2.8.1</gson-version>
253-
<threetenbp-version>1.3.5</threetenbp-version>
257+
<okio-version>1.14.0</okio-version>
258+
<gson-version>2.8.2</gson-version>
259+
<threetenbp-version>1.3.5</threetenbp-version>
254260
<maven-plugin-version>1.0.0</maven-plugin-version>
255261
<junit-version>4.12</junit-version>
256262
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

‎src/main/java/sendinblue/ApiClient.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class ApiClient {
6969
private KeyManager[] keyManagers;
7070

7171
private OkHttpClient httpClient;
72-
private JSON json;
72+
private Json json;
7373

7474
private HttpLoggingInterceptor loggingInterceptor;
7575

@@ -82,7 +82,7 @@ public ApiClient() {
8282

8383
verifyingSsl = true;
8484

85-
json = new JSON();
85+
json = new Json();
8686

8787
// Set default User-Agent.
8888
setUserAgent("Swagger-Codegen/1.0.0/java");
@@ -139,7 +139,7 @@ public ApiClient setHttpClient(OkHttpClient httpClient) {
139139
*
140140
* @return JSON object
141141
*/
142-
public JSON getJSON() {
142+
public Json getJSON() {
143143
return json;
144144
}
145145

@@ -149,7 +149,7 @@ public JSON getJSON() {
149149
* @param json JSON object
150150
* @return Api client
151151
*/
152-
public ApiClient setJSON(JSON json) {
152+
public ApiClient setJSON(Json json) {
153153
this.json = json;
154154
return this;
155155
}

0 commit comments

Comments
 (0)