Skip to content

Commit 59b0a89

Browse files
authored
Merge pull request #6 from sendinblue/feature_mixed-updates
Delete single contact method added + get account response fix for reseller
2 parents 4fc4a72 + be892cc commit 59b0a89

File tree

164 files changed

+384
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+384
-174
lines changed

README.md

+4-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>2.0.0</version>
25+
<version>2.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:2.0.0"
35+
compile "com.sendinblue:sib-api-v3-sdk:2.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-2.0.0.jar
48+
* target/sib-api-v3-sdk-2.0.1.jar
4949
* target/lib/*.jar
5050

5151
## Getting Started
@@ -103,6 +103,7 @@ Class | Method | HTTP request | Description
103103
*ContactsApi* | [**createFolder**](docs/ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder
104104
*ContactsApi* | [**createList**](docs/ContactsApi.md#createList) | **POST** /contacts/lists | Create a list
105105
*ContactsApi* | [**deleteAttribute**](docs/ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
106+
*ContactsApi* | [**deleteContact**](docs/ContactsApi.md#deleteContact) | **DELETE** /contacts/{email} | Deletes a contact
106107
*ContactsApi* | [**deleteFolder**](docs/ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
107108
*ContactsApi* | [**deleteList**](docs/ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
108109
*ContactsApi* | [**getAttributes**](docs/ContactsApi.md#getAttributes) | **GET** /contacts/attributes | Lists all attributes

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'com.sendinblue'
5-
version = '2.0.0'
5+
version = '2.0.1'
66

77
buildscript {
88
repositories {

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.sendinblue",
44
name := "sib-api-v3-sdk",
5-
version := "2.0.0",
5+
version := "2.0.1",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/ContactsApi.md

+53
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Method | HTTP request | Description
1010
[**createFolder**](ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder
1111
[**createList**](ContactsApi.md#createList) | **POST** /contacts/lists | Create a list
1212
[**deleteAttribute**](ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
13+
[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /contacts/{email} | Deletes a contact
1314
[**deleteFolder**](ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
1415
[**deleteList**](ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
1516
[**getAttributes**](ContactsApi.md#getAttributes) | **GET** /contacts/attributes | Lists all attributes
@@ -350,6 +351,58 @@ null (empty response body)
350351

351352
[api-key](../README.md#api-key)
352353

354+
### HTTP request headers
355+
356+
- **Content-Type**: application/json
357+
- **Accept**: application/json
358+
359+
<a name="deleteContact"></a>
360+
# **deleteContact**
361+
> deleteContact(email)
362+
363+
Deletes a contact
364+
365+
### Example
366+
```java
367+
// Import classes:
368+
//import sendinblue.ApiClient;
369+
//import sendinblue.ApiException;
370+
//import sendinblue.Configuration;
371+
//import sendinblue.auth.*;
372+
//import sibApi.ContactsApi;
373+
374+
ApiClient defaultClient = Configuration.getDefaultApiClient();
375+
376+
// Configure API key authorization: api-key
377+
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
378+
apiKey.setApiKey("YOUR API KEY");
379+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
380+
//apiKey.setApiKeyPrefix("Token");
381+
382+
ContactsApi apiInstance = new ContactsApi();
383+
String email = "email_example"; // String | Email (urlencoded) of the contact
384+
try {
385+
apiInstance.deleteContact(email);
386+
} catch (ApiException e) {
387+
System.err.println("Exception when calling ContactsApi#deleteContact");
388+
e.printStackTrace();
389+
}
390+
```
391+
392+
### Parameters
393+
394+
Name | Type | Description | Notes
395+
------------- | ------------- | ------------- | -------------
396+
**email** | **String**| Email (urlencoded) of the contact |
397+
398+
### Return type
399+
400+
null (empty response body)
401+
402+
### Authorization
403+
404+
[api-key](../README.md#api-key)
405+
353406
### HTTP request headers
354407

355408
- **Content-Type**: application/json

docs/GetAccountPlan.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**type** | [**TypeEnum**](#TypeEnum) | Displays the plan type of the user |
8-
**creditsType** | [**CreditsTypeEnum**](#CreditsTypeEnum) | This is the type of the credit, \&quot;User Limit\&quot; or \&quot;Send Limit\&quot; are two possible types of credit of a user. \&quot;User Limit\&quot; implies the total number of subscribers you can add to your account, and \&quot;Send Limit\&quot; implies the total number of emails you can send to the subscribers in your account. |
9-
**credits** | **Float** | Remaining credits of the user. This can either be \&quot;User Limit\&quot; or \&quot;Send Limit\&quot; depending on the plan. |
8+
**creditsType** | [**CreditsTypeEnum**](#CreditsTypeEnum) | This is the type of the credit, \&quot;Send Limit\&quot; is one of the possible types of credit of a user. \&quot;Send Limit\&quot; implies the total number of emails you can send to the subscribers in your account. |
9+
**credits** | **Float** | Remaining credits of the user |
1010
**startDate** | **LocalDate** | Date of the period from which the plan will start (only available for \&quot;subscription\&quot;, \&quot;unlimited\&quot; and \&quot;reseller\&quot; plan type) | [optional]
1111
**endDate** | **LocalDate** | Date of the period from which the plan will end (only available for \&quot;subscription\&quot;, \&quot;unlimited\&quot; and \&quot;reseller\&quot; plan type) | [optional]
12+
**userLimit** | **Integer** | Only in case of reseller account. It implies the total number of child accounts you can add to your account. | [optional]
1213

1314

1415
<a name="TypeEnum"></a>
@@ -27,7 +28,6 @@ RESELLER | &quot;reseller&quot;
2728
## Enum: CreditsTypeEnum
2829
Name | Value
2930
---- | -----
30-
USERLIMIT | &quot;userLimit&quot;
3131
SENDLIMIT | &quot;sendLimit&quot;
3232

3333

pom.xml

+1-1
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>2.0.0</version>
8+
<version>2.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>

src/main/java/sendinblue/ApiClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public ApiClient() {
8585
json = new Json();
8686

8787
// Set default User-Agent.
88-
setUserAgent("Swagger-Codegen/2.0.0/java");
88+
setUserAgent("Swagger-Codegen/2.0.1/java");
8989

9090
// Setup authentications (key: authentication name, value: authentication).
9191
authentications = new HashMap<String, Authentication>();

src/main/java/sendinblue/ApiException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.util.Map;
1717
import java.util.List;
1818

19-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
19+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
2020
public class ApiException extends Exception {
2121
private int code = 0;
2222
private Map<String, List<String>> responseHeaders = null;

src/main/java/sendinblue/Configuration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
package sendinblue;
1515

16-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
16+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
1717
public class Configuration {
1818
private static ApiClient defaultApiClient = new ApiClient();
1919

src/main/java/sendinblue/Pair.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
package sendinblue;
1515

16-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
16+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
1717
public class Pair {
1818
private String name = "";
1919
private String value = "";

src/main/java/sendinblue/StringUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
package sendinblue;
1515

16-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
16+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
1717
public class StringUtil {
1818
/**
1919
* Check if the given array contains the given value (with case-insensitive comparison).

src/main/java/sendinblue/auth/ApiKeyAuth.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.Map;
1919
import java.util.List;
2020

21-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
21+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
2222
public class ApiKeyAuth implements Authentication {
2323
private final String location;
2424
private final String paramName;

src/main/java/sendinblue/auth/OAuth.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.Map;
1919
import java.util.List;
2020

21-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
21+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
2222
public class OAuth implements Authentication {
2323
private String accessToken;
2424

src/main/java/sibApi/ContactsApi.java

+119
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,125 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
843843
apiClient.executeAsync(call, callback);
844844
return call;
845845
}
846+
/**
847+
* Build call for deleteContact
848+
* @param email Email (urlencoded) of the contact (required)
849+
* @param progressListener Progress listener
850+
* @param progressRequestListener Progress request listener
851+
* @return Call to execute
852+
* @throws ApiException If fail to serialize the request body object
853+
*/
854+
public com.squareup.okhttp.Call deleteContactCall(String email, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
855+
Object localVarPostBody = null;
856+
857+
// create path and map variables
858+
String localVarPath = "/contacts/{email}"
859+
.replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString()));
860+
861+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
862+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
863+
864+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
865+
866+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
867+
868+
final String[] localVarAccepts = {
869+
"application/json"
870+
};
871+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
872+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
873+
874+
final String[] localVarContentTypes = {
875+
"application/json"
876+
};
877+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
878+
localVarHeaderParams.put("Content-Type", localVarContentType);
879+
880+
if(progressListener != null) {
881+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
882+
@Override
883+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
884+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
885+
return originalResponse.newBuilder()
886+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
887+
.build();
888+
}
889+
});
890+
}
891+
892+
String[] localVarAuthNames = new String[] { "api-key" };
893+
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
894+
}
895+
896+
@SuppressWarnings("rawtypes")
897+
private com.squareup.okhttp.Call deleteContactValidateBeforeCall(String email, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
898+
899+
// verify the required parameter 'email' is set
900+
if (email == null) {
901+
throw new ApiException("Missing the required parameter 'email' when calling deleteContact(Async)");
902+
}
903+
904+
905+
com.squareup.okhttp.Call call = deleteContactCall(email, progressListener, progressRequestListener);
906+
return call;
907+
908+
}
909+
910+
/**
911+
* Deletes a contact
912+
*
913+
* @param email Email (urlencoded) of the contact (required)
914+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
915+
*/
916+
public void deleteContact(String email) throws ApiException {
917+
deleteContactWithHttpInfo(email);
918+
}
919+
920+
/**
921+
* Deletes a contact
922+
*
923+
* @param email Email (urlencoded) of the contact (required)
924+
* @return ApiResponse&lt;Void&gt;
925+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
926+
*/
927+
public ApiResponse<Void> deleteContactWithHttpInfo(String email) throws ApiException {
928+
com.squareup.okhttp.Call call = deleteContactValidateBeforeCall(email, null, null);
929+
return apiClient.execute(call);
930+
}
931+
932+
/**
933+
* Deletes a contact (asynchronously)
934+
*
935+
* @param email Email (urlencoded) of the contact (required)
936+
* @param callback The callback to be executed when the API call finishes
937+
* @return The request call
938+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
939+
*/
940+
public com.squareup.okhttp.Call deleteContactAsync(String email, final ApiCallback<Void> callback) throws ApiException {
941+
942+
ProgressResponseBody.ProgressListener progressListener = null;
943+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
944+
945+
if (callback != null) {
946+
progressListener = new ProgressResponseBody.ProgressListener() {
947+
@Override
948+
public void update(long bytesRead, long contentLength, boolean done) {
949+
callback.onDownloadProgress(bytesRead, contentLength, done);
950+
}
951+
};
952+
953+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
954+
@Override
955+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
956+
callback.onUploadProgress(bytesWritten, contentLength, done);
957+
}
958+
};
959+
}
960+
961+
com.squareup.okhttp.Call call = deleteContactValidateBeforeCall(email, progressListener, progressRequestListener);
962+
apiClient.executeAsync(call, callback);
963+
return call;
964+
}
846965
/**
847966
* Build call for deleteFolder
848967
* @param folderId Id of the folder (required)

src/main/java/sibModel/AddContactToList.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* AddContactToList
3030
*/
31-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
31+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
3232
public class AddContactToList {
3333
@SerializedName("emails")
3434
private List<String> emails = null;

src/main/java/sibModel/AddCredits.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* AddCredits
2828
*/
29-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
29+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
3030
public class AddCredits {
3131
@SerializedName("sms")
3232
private Long sms = null;

src/main/java/sibModel/CreateAttribute.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* CreateAttribute
3131
*/
32-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
32+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
3333
public class CreateAttribute {
3434
@SerializedName("value")
3535
private String value = null;

src/main/java/sibModel/CreateAttributeEnumeration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* CreateAttributeEnumeration
2828
*/
29-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
29+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
3030
public class CreateAttributeEnumeration {
3131
@SerializedName("value")
3232
private Integer value = null;

src/main/java/sibModel/CreateChild.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* CreateChild
2828
*/
29-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
29+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
3030
public class CreateChild {
3131
@SerializedName("email")
3232
private String email = null;

src/main/java/sibModel/CreateContact.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* CreateContact
3030
*/
31-
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-23T10:53:13.078+05:30")
31+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-13T14:27:50.128+05:30")
3232
public class CreateContact {
3333
@SerializedName("email")
3434
private String email = null;

0 commit comments

Comments
 (0)