diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml
new file mode 100644
index 0000000..883bbd2
--- /dev/null
+++ b/config/checkstyle/checkstyle-suppressions.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
new file mode 100644
index 0000000..83adbc8
--- /dev/null
+++ b/config/checkstyle/checkstyle.xml
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 14b7871..0b8c8fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -124,15 +124,38 @@
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.0.0
-
-
-
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.3.1
+
+ config/checkstyle/checkstyle.xml
+ config/checkstyle/checkstyle-suppressions.xml
+ checkstyle.suppressions.file
+
+
+
+ lint-check
+ validate
+
+ UTF-8
+ true
+ true
+ false
+
+
+ check
+
+
+
+
+
diff --git a/src/main/java/co/novu/api/blueprints/BlueprintsHandler.java b/src/main/java/co/novu/api/blueprints/BlueprintsHandler.java
index 42cfc30..8c607d5 100644
--- a/src/main/java/co/novu/api/blueprints/BlueprintsHandler.java
+++ b/src/main/java/co/novu/api/blueprints/BlueprintsHandler.java
@@ -8,15 +8,15 @@
import java.io.IOException;
-public class BlueprintsHandler {
+public final class BlueprintsHandler {
private final RestHandler restHandler;
private final BlueprintsApi blueprintsApi;
- public BlueprintsHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.blueprintsApi = restHandler.buildRetrofit().create(BlueprintsApi.class);
+ public BlueprintsHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.blueprintsApi = handler.buildRetrofit().create(BlueprintsApi.class);
}
public BlueprintsByCategoryResponse getBlueprintsByCategory() throws IOException, NovuNetworkException {
@@ -24,8 +24,8 @@ public BlueprintsByCategoryResponse getBlueprintsByCategory() throws IOException
return restHandler.extractResponse(response);
}
- public Blueprint getBlueprint(String templateId) throws IOException, NovuNetworkException {
+ public Blueprint getBlueprint(final String templateId) throws IOException, NovuNetworkException {
Response response = blueprintsApi.getBlueprint(templateId).execute();
return restHandler.extractResponse(response);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Blueprint.java b/src/main/java/co/novu/api/blueprints/pojos/Blueprint.java
index f46c430..febdca3 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Blueprint.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Blueprint.java
@@ -40,4 +40,4 @@ public class Blueprint {
@SerializedName("__v")
private Long version;
private NotificationGroup notificationGroup;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Content.java b/src/main/java/co/novu/api/blueprints/pojos/Content.java
index e60bca3..a8ab2dd 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Content.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Content.java
@@ -7,4 +7,4 @@ public class Content {
private String type;
private String content;
private Styles styles;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Filters.java b/src/main/java/co/novu/api/blueprints/pojos/Filters.java
index 3379a52..75c6d72 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Filters.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Filters.java
@@ -10,4 +10,4 @@ public class Filters {
private List children;
@SerializedName("_id")
private String id;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/General.java b/src/main/java/co/novu/api/blueprints/pojos/General.java
index 71a7e17..06a7614 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/General.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/General.java
@@ -8,4 +8,4 @@
public class General {
private String name;
private List blueprints;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Metadata.java b/src/main/java/co/novu/api/blueprints/pojos/Metadata.java
index 47ce612..f98540e 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Metadata.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Metadata.java
@@ -5,4 +5,4 @@
@Data
public class Metadata {
private Timed timed;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Popular.java b/src/main/java/co/novu/api/blueprints/pojos/Popular.java
index c5648d6..53e2c2b 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Popular.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Popular.java
@@ -8,4 +8,4 @@
public class Popular {
private String name;
private List blueprints;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Styles.java b/src/main/java/co/novu/api/blueprints/pojos/Styles.java
index 88d6971..52929af 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Styles.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Styles.java
@@ -5,4 +5,4 @@
@Data
public class Styles {
private String textAlign;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Template.java b/src/main/java/co/novu/api/blueprints/pojos/Template.java
index e03e7dd..342ef5d 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Template.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Template.java
@@ -29,4 +29,4 @@ public class Template {
private String updatedAt;
@SerializedName("__v")
private Long version;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Timed.java b/src/main/java/co/novu/api/blueprints/pojos/Timed.java
index ee4a3c0..a7da6ce 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Timed.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Timed.java
@@ -8,4 +8,4 @@
public class Timed {
private List weekDays;
private List monthDays;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/pojos/Variables.java b/src/main/java/co/novu/api/blueprints/pojos/Variables.java
index 48b087c..e61f531 100644
--- a/src/main/java/co/novu/api/blueprints/pojos/Variables.java
+++ b/src/main/java/co/novu/api/blueprints/pojos/Variables.java
@@ -8,4 +8,4 @@ public class Variables {
private String type;
private Boolean required;
private String id;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/responses/BlueprintsByCategoryResponse.java b/src/main/java/co/novu/api/blueprints/responses/BlueprintsByCategoryResponse.java
index f698b89..374f451 100644
--- a/src/main/java/co/novu/api/blueprints/responses/BlueprintsByCategoryResponse.java
+++ b/src/main/java/co/novu/api/blueprints/responses/BlueprintsByCategoryResponse.java
@@ -5,4 +5,4 @@
@Data
public class BlueprintsByCategoryResponse {
private BlueprintsResponseData data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/blueprints/responses/BlueprintsResponseData.java b/src/main/java/co/novu/api/blueprints/responses/BlueprintsResponseData.java
index f71ba13..d541542 100644
--- a/src/main/java/co/novu/api/blueprints/responses/BlueprintsResponseData.java
+++ b/src/main/java/co/novu/api/blueprints/responses/BlueprintsResponseData.java
@@ -1,4 +1,5 @@
package co.novu.api.blueprints.responses;
+
import co.novu.api.blueprints.pojos.General;
import co.novu.api.blueprints.pojos.Popular;
import lombok.Data;
@@ -9,4 +10,4 @@
public class BlueprintsResponseData {
private List general;
private Popular popular;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/changes/ChangeHandler.java b/src/main/java/co/novu/api/changes/ChangeHandler.java
index f12f75a..790f57b 100644
--- a/src/main/java/co/novu/api/changes/ChangeHandler.java
+++ b/src/main/java/co/novu/api/changes/ChangeHandler.java
@@ -15,24 +15,25 @@
import java.util.Map;
@RequiredArgsConstructor
-public class ChangeHandler {
+public final class ChangeHandler {
private final RestHandler restHandler;
private final ChangeApi changeApi;
- private static final String ENDPOINT = "changes";
-
- public ChangeHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.changeApi = restHandler.buildRetrofit().create(ChangeApi.class);
+ public ChangeHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.changeApi = handler.buildRetrofit().create(ChangeApi.class);
}
-
- public GetChangesResponse getChanges(GetChangesRequest request) throws IOException, NovuNetworkException {
+ public GetChangesResponse getChanges(final GetChangesRequest request) throws IOException, NovuNetworkException {
Map params = new HashMap<>();
- if (request.getPage() != null) params.put("page", request.getPage());
- if (request.getLimit() != null) params.put("limit", request.getLimit());
+ if (request.getPage() != null) {
+ params.put("page", request.getPage());
+ }
+ if (request.getLimit() != null) {
+ params.put("limit", request.getLimit());
+ }
params.put("promoted", request.getPromoted());
Response response = changeApi.getChanges(params).execute();
return restHandler.extractResponse(response);
@@ -43,15 +44,14 @@ public ChangeCountResponse getChangesCount() throws IOException, NovuNetworkExce
return restHandler.extractResponse(response);
}
- public ApplyChangesResponse applyChanges(ApplyChangesRequest request) throws IOException, NovuNetworkException {
+ public ApplyChangesResponse applyChanges(final ApplyChangesRequest request)
+ throws IOException, NovuNetworkException {
Response response = changeApi.applyChanges(request).execute();
return restHandler.extractResponse(response);
}
- public ApplyChangesResponse applyChange(String changeId) throws IOException, NovuNetworkException {
+ public ApplyChangesResponse applyChange(final String changeId) throws IOException, NovuNetworkException {
Response response = changeApi.applyChange(changeId).execute();
return restHandler.extractResponse(response);
}
-
-
}
diff --git a/src/main/java/co/novu/api/common/Filters.java b/src/main/java/co/novu/api/common/Filters.java
index 837b3be..2c81d17 100644
--- a/src/main/java/co/novu/api/common/Filters.java
+++ b/src/main/java/co/novu/api/common/Filters.java
@@ -11,4 +11,4 @@ public class Filters {
private String type;
private String value;
private List children;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/Metadata.java b/src/main/java/co/novu/api/common/Metadata.java
index 1342680..0bca3e5 100644
--- a/src/main/java/co/novu/api/common/Metadata.java
+++ b/src/main/java/co/novu/api/common/Metadata.java
@@ -12,4 +12,4 @@ public class Metadata {
private String backoffUnit;
private Long backoffAmount;
private Boolean updateMode;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/NotificationGroup.java b/src/main/java/co/novu/api/common/NotificationGroup.java
index 64e8e00..97cea95 100644
--- a/src/main/java/co/novu/api/common/NotificationGroup.java
+++ b/src/main/java/co/novu/api/common/NotificationGroup.java
@@ -6,7 +6,7 @@
@Data
public class NotificationGroup {
- @SerializedName("_id")
+ @SerializedName("_id")
private String id;
private String name;
@SerializedName("_organizationId")
@@ -19,4 +19,4 @@ public class NotificationGroup {
private String updatedAt;
@SerializedName("__v")
private String version;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/PreferenceSettings.java b/src/main/java/co/novu/api/common/PreferenceSettings.java
index 5696d6a..0f5e104 100644
--- a/src/main/java/co/novu/api/common/PreferenceSettings.java
+++ b/src/main/java/co/novu/api/common/PreferenceSettings.java
@@ -11,4 +11,4 @@ public class PreferenceSettings {
private Boolean inApp;
private Boolean chat;
private Boolean push;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/ReplyCallback.java b/src/main/java/co/novu/api/common/ReplyCallback.java
index f814a57..0abe057 100644
--- a/src/main/java/co/novu/api/common/ReplyCallback.java
+++ b/src/main/java/co/novu/api/common/ReplyCallback.java
@@ -5,4 +5,4 @@
@Data
public class ReplyCallback {
private Boolean active;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/Step.java b/src/main/java/co/novu/api/common/Step.java
index 56a8914..cd1c41b 100644
--- a/src/main/java/co/novu/api/common/Step.java
+++ b/src/main/java/co/novu/api/common/Step.java
@@ -3,8 +3,6 @@
import com.google.gson.annotations.SerializedName;
import lombok.Data;
-import java.util.List;
-
@Data
public class Step {
@SerializedName("_id")
@@ -21,4 +19,4 @@ public class Step {
private String parentId;
private Object filters;
private Object metadata;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/SubscriberRequest.java b/src/main/java/co/novu/api/common/SubscriberRequest.java
index 713ccc8..b56f4d6 100644
--- a/src/main/java/co/novu/api/common/SubscriberRequest.java
+++ b/src/main/java/co/novu/api/common/SubscriberRequest.java
@@ -13,4 +13,4 @@ public class SubscriberRequest implements IRequest {
private String avatar;
private String locale;
private Object data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/Template.java b/src/main/java/co/novu/api/common/Template.java
index 0f3fcde..b362565 100644
--- a/src/main/java/co/novu/api/common/Template.java
+++ b/src/main/java/co/novu/api/common/Template.java
@@ -12,4 +12,4 @@ public class Template {
private String name;
private Boolean critical;
private List triggers;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/common/Trigger.java b/src/main/java/co/novu/api/common/Trigger.java
index 8fad97e..d278766 100644
--- a/src/main/java/co/novu/api/common/Trigger.java
+++ b/src/main/java/co/novu/api/common/Trigger.java
@@ -15,4 +15,4 @@ public class Trigger {
private List variables;
private List subscriberVariables;
private List reservedVariables;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/EnvironmentApi.java b/src/main/java/co/novu/api/environments/EnvironmentApi.java
index 769aee5..66bd92d 100644
--- a/src/main/java/co/novu/api/environments/EnvironmentApi.java
+++ b/src/main/java/co/novu/api/environments/EnvironmentApi.java
@@ -14,23 +14,24 @@
public interface EnvironmentApi {
- String ENDPOINT = "environments";
-
- @GET(ENDPOINT + "/me")
- Call getCurrentEnvironment();
-
- @POST(ENDPOINT)
- Call createEnvironment(@Body CreateEnvironmentRequest request);
-
- @GET(ENDPOINT)
- Call getEnvironments();
-
- @PUT(ENDPOINT + "/{environmentId}")
- Call updateEnvironmentById(@Path("environmentId") String environmentId, @Body UpdateEnvironmentRequest request);
-
- @GET(ENDPOINT + "/api-keys")
- Call getApiKeys();
-
- @POST(ENDPOINT + "/api-keys/regenerate")
- Call regenerateApiKeys();
+ String ENDPOINT = "environments";
+
+ @GET(ENDPOINT + "/me")
+ Call getCurrentEnvironment();
+
+ @POST(ENDPOINT)
+ Call createEnvironment(@Body CreateEnvironmentRequest request);
+
+ @GET(ENDPOINT)
+ Call getEnvironments();
+
+ @PUT(ENDPOINT + "/{environmentId}")
+ Call updateEnvironmentById(@Path("environmentId") String environmentId,
+ @Body UpdateEnvironmentRequest request);
+
+ @GET(ENDPOINT + "/api-keys")
+ Call getApiKeys();
+
+ @POST(ENDPOINT + "/api-keys/regenerate")
+ Call regenerateApiKeys();
}
diff --git a/src/main/java/co/novu/api/environments/EnvironmentHandler.java b/src/main/java/co/novu/api/environments/EnvironmentHandler.java
index 14be473..f9aa95a 100644
--- a/src/main/java/co/novu/api/environments/EnvironmentHandler.java
+++ b/src/main/java/co/novu/api/environments/EnvironmentHandler.java
@@ -11,44 +11,48 @@
import co.novu.common.rest.RestHandler;
import retrofit2.Response;
-public class EnvironmentHandler {
+public final class EnvironmentHandler {
private final RestHandler restHandler;
private final EnvironmentApi environmentApi;
-
- public EnvironmentHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.environmentApi = restHandler.buildRetrofit().create(EnvironmentApi.class);
+
+ public EnvironmentHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.environmentApi = handler.buildRetrofit().create(EnvironmentApi.class);
}
public SingleEnvironmentResponse getCurrentEnvironment() throws IOException, NovuNetworkException {
- Response response = environmentApi.getCurrentEnvironment().execute();
+ Response response = environmentApi.getCurrentEnvironment().execute();
return restHandler.extractResponse(response);
}
- public SingleEnvironmentResponse createEnvironment(CreateEnvironmentRequest request) throws IOException, NovuNetworkException {
- Response response = environmentApi.createEnvironment(request).execute();
+ public SingleEnvironmentResponse createEnvironment(final CreateEnvironmentRequest request)
+ throws IOException, NovuNetworkException {
+ Response response = environmentApi.createEnvironment(request).execute();
return restHandler.extractResponse(response);
}
public BulkEnvironmentResponse getEnvironments() throws IOException, NovuNetworkException {
- Response response = environmentApi.getEnvironments().execute();
+ Response response = environmentApi.getEnvironments().execute();
return restHandler.extractResponse(response);
}
- public SingleEnvironmentResponse updateEnvironmentById(String environmentId, UpdateEnvironmentRequest request) throws IOException, NovuNetworkException {
- Response response = environmentApi.updateEnvironmentById(environmentId, request).execute();
+ public SingleEnvironmentResponse updateEnvironmentById(final String environmentId,
+ final UpdateEnvironmentRequest request)
+ throws IOException, NovuNetworkException {
+ Response response =
+ environmentApi.updateEnvironmentById(environmentId, request).execute();
return restHandler.extractResponse(response);
}
public ApiKeyResponse getApiKeys() throws IOException, NovuNetworkException {
- Response response = environmentApi.getApiKeys().execute();
+ Response response = environmentApi.getApiKeys().execute();
return restHandler.extractResponse(response);
}
public ApiKeyResponse regenerateApiKeys() throws IOException, NovuNetworkException {
- Response response = environmentApi.regenerateApiKeys().execute();
+ Response response = environmentApi.regenerateApiKeys().execute();
return restHandler.extractResponse(response);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/pojos/ApiKey.java b/src/main/java/co/novu/api/environments/pojos/ApiKey.java
index 9572769..2fa65d0 100644
--- a/src/main/java/co/novu/api/environments/pojos/ApiKey.java
+++ b/src/main/java/co/novu/api/environments/pojos/ApiKey.java
@@ -9,4 +9,4 @@ public class ApiKey {
private String key;
@SerializedName("_userId")
private String userId;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/pojos/Dns.java b/src/main/java/co/novu/api/environments/pojos/Dns.java
index 6030ad9..72e96e2 100644
--- a/src/main/java/co/novu/api/environments/pojos/Dns.java
+++ b/src/main/java/co/novu/api/environments/pojos/Dns.java
@@ -5,4 +5,4 @@
@Data
public class Dns {
private String inboundParseDomain;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/pojos/Widget.java b/src/main/java/co/novu/api/environments/pojos/Widget.java
index 5426f36..ada08a1 100644
--- a/src/main/java/co/novu/api/environments/pojos/Widget.java
+++ b/src/main/java/co/novu/api/environments/pojos/Widget.java
@@ -5,4 +5,4 @@
@Data
public class Widget {
private Boolean notificationCenterEncryption;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/requests/CreateEnvironmentRequest.java b/src/main/java/co/novu/api/environments/requests/CreateEnvironmentRequest.java
index 385aefd..0078e2f 100644
--- a/src/main/java/co/novu/api/environments/requests/CreateEnvironmentRequest.java
+++ b/src/main/java/co/novu/api/environments/requests/CreateEnvironmentRequest.java
@@ -7,4 +7,4 @@
public class CreateEnvironmentRequest implements IRequest {
private String name;
private String parentId;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/requests/UpdateEnvironmentRequest.java b/src/main/java/co/novu/api/environments/requests/UpdateEnvironmentRequest.java
index aa298f3..518bd73 100644
--- a/src/main/java/co/novu/api/environments/requests/UpdateEnvironmentRequest.java
+++ b/src/main/java/co/novu/api/environments/requests/UpdateEnvironmentRequest.java
@@ -10,4 +10,4 @@ public class UpdateEnvironmentRequest implements IRequest {
private String identifier;
private String parentId;
private Dns dns;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/responses/ApiKeyResponse.java b/src/main/java/co/novu/api/environments/responses/ApiKeyResponse.java
index c2a9a32..a8e2c26 100644
--- a/src/main/java/co/novu/api/environments/responses/ApiKeyResponse.java
+++ b/src/main/java/co/novu/api/environments/responses/ApiKeyResponse.java
@@ -8,4 +8,4 @@
@Data
public class ApiKeyResponse {
private List data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/responses/BulkEnvironmentResponse.java b/src/main/java/co/novu/api/environments/responses/BulkEnvironmentResponse.java
index 17e961f..1e90441 100644
--- a/src/main/java/co/novu/api/environments/responses/BulkEnvironmentResponse.java
+++ b/src/main/java/co/novu/api/environments/responses/BulkEnvironmentResponse.java
@@ -7,4 +7,4 @@
@Data
public class BulkEnvironmentResponse {
private List data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/responses/EnvironmentResponse.java b/src/main/java/co/novu/api/environments/responses/EnvironmentResponse.java
index 6a196b1..13a47bf 100644
--- a/src/main/java/co/novu/api/environments/responses/EnvironmentResponse.java
+++ b/src/main/java/co/novu/api/environments/responses/EnvironmentResponse.java
@@ -21,4 +21,4 @@ public class EnvironmentResponse {
private String updatedAt;
@SerializedName("_parentId")
private String parentId;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/environments/responses/SingleEnvironmentResponse.java b/src/main/java/co/novu/api/environments/responses/SingleEnvironmentResponse.java
index 0c7516c..b01b5b3 100644
--- a/src/main/java/co/novu/api/environments/responses/SingleEnvironmentResponse.java
+++ b/src/main/java/co/novu/api/environments/responses/SingleEnvironmentResponse.java
@@ -5,4 +5,4 @@
@Data
public class SingleEnvironmentResponse {
private EnvironmentResponse data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/events/EventsHandler.java b/src/main/java/co/novu/api/events/EventsHandler.java
index 340ed1b..35fc885 100644
--- a/src/main/java/co/novu/api/events/EventsHandler.java
+++ b/src/main/java/co/novu/api/events/EventsHandler.java
@@ -13,33 +13,37 @@
import java.io.IOException;
@RequiredArgsConstructor
-public class EventsHandler {
+public final class EventsHandler {
private final RestHandler restHandler;
private final EventsApi eventsApi;
- public EventsHandler(RestHandler restHandler){
- this.restHandler = restHandler;
- this.eventsApi = restHandler.buildRetrofit().create(EventsApi.class);
+ public EventsHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.eventsApi = handler.buildRetrofit().create(EventsApi.class);
}
- public TriggerEventResponse triggerEvent(TriggerEventRequest request) throws IOException, NovuNetworkException {
+ public TriggerEventResponse triggerEvent(final TriggerEventRequest request)
+ throws IOException, NovuNetworkException {
Response response = eventsApi.triggerEvent(request).execute();
return restHandler.extractResponse(response);
}
- public BulkTriggerEventResponse bulkTriggerEvent(BulkTriggerEventRequest request) throws IOException, NovuNetworkException {
+ public BulkTriggerEventResponse bulkTriggerEvent(final BulkTriggerEventRequest request)
+ throws IOException, NovuNetworkException {
Response response = eventsApi.bulkTriggerEvent(request).execute();
return restHandler.extractResponse(response);
}
- public TriggerEventResponse broadcastEvent(TriggerEventRequest request) throws IOException, NovuNetworkException {
+ public TriggerEventResponse broadcastEvent(final TriggerEventRequest request)
+ throws IOException, NovuNetworkException {
Response response = eventsApi.broadcastEvent(request).execute();
return restHandler.extractResponse(response);
}
- public CancelEventResponse cancelTriggeredEvent(String transactionId) throws IOException, NovuNetworkException {
+ public CancelEventResponse cancelTriggeredEvent(final String transactionId)
+ throws IOException, NovuNetworkException {
Response response = eventsApi.cancelTriggeredEvent(transactionId).execute();
return restHandler.extractResponse(response);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/events/requests/TriggerEventRequest.java b/src/main/java/co/novu/api/events/requests/TriggerEventRequest.java
index 96fdb73..8e83755 100644
--- a/src/main/java/co/novu/api/events/requests/TriggerEventRequest.java
+++ b/src/main/java/co/novu/api/events/requests/TriggerEventRequest.java
@@ -1,7 +1,5 @@
package co.novu.api.events.requests;
-import co.novu.api.common.SubscriberRequest;
-import co.novu.api.tenants.pojos.Tenant;
import co.novu.common.contracts.IRequest;
import lombok.Data;
@@ -12,7 +10,8 @@ public class TriggerEventRequest implements IRequest {
private String name;
/**
- * Possible types this field accepts are; {@link SubscriberRequest}, list of {@link SubscriberRequest}, {@link Topic} or list of {@link Topic}
+ * Possible types this field accepts are; {@link SubscriberRequest}, list of {@link SubscriberRequest},
+ * {@link Topic} or list of {@link Topic}.
*
*
For example:
*
@@ -30,7 +29,7 @@ public class TriggerEventRequest implements IRequest {
private String transactionId;
/**
- * Possible types this field accepts are; String or {@link Map}
+ * Possible types this field accepts are; String or {@link Map}.
*
*
For example:
*
@@ -49,7 +48,7 @@ public class TriggerEventRequest implements IRequest {
private Object actor;
/**
- * Possible types this field accepts are; String or {@link Tenant}
+ * Possible types this field accepts are; String or {@link Tenant}.
*
*
For example:
*
@@ -61,4 +60,4 @@ public class TriggerEventRequest implements IRequest {
*
*/
private Object tenant;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/events/responses/TriggerEventResponse.java b/src/main/java/co/novu/api/events/responses/TriggerEventResponse.java
index c4d7450..56d4230 100644
--- a/src/main/java/co/novu/api/events/responses/TriggerEventResponse.java
+++ b/src/main/java/co/novu/api/events/responses/TriggerEventResponse.java
@@ -8,4 +8,4 @@
public class TriggerEventResponse {
private TriggerEventResponseData data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsApi.java b/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsApi.java
index 0bf225d..807fefe 100644
--- a/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsApi.java
+++ b/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsApi.java
@@ -8,10 +8,9 @@
import retrofit2.http.QueryMap;
public interface ExecutiveDetailsApi {
-
- String ENDPOINT = "execution-details";
-
- @GET(ENDPOINT)
- Call getExecutionDetails(@QueryMap Map params);
+ String ENDPOINT = "execution-details";
+
+ @GET(ENDPOINT)
+ Call getExecutionDetails(@QueryMap Map params);
}
diff --git a/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsHandler.java b/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsHandler.java
index 0be5b5b..4489eb3 100644
--- a/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsHandler.java
+++ b/src/main/java/co/novu/api/executivedetails/ExecutiveDetailsHandler.java
@@ -9,24 +9,23 @@
import co.novu.common.rest.RestHandler;
import retrofit2.Response;
-
-public class ExecutiveDetailsHandler {
+public final class ExecutiveDetailsHandler {
private final RestHandler restHandler;
private final ExecutiveDetailsApi executiveDetailsApi;
- public ExecutiveDetailsHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.executiveDetailsApi = restHandler.buildRetrofit().create(ExecutiveDetailsApi.class);
+ public ExecutiveDetailsHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.executiveDetailsApi = handler.buildRetrofit().create(ExecutiveDetailsApi.class);
}
-
- public ExecutiveDetailsResponse getExecutionDetails(String notificationId, String subscriberId) throws IOException, NovuNetworkException {
- Map params = new HashMap<>();
+
+ public ExecutiveDetailsResponse getExecutionDetails(final String notificationId, final String subscriberId)
+ throws IOException, NovuNetworkException {
+ Map params = new HashMap<>();
params.put("notificationId", notificationId);
params.put("subscriberId", subscriberId);
- Response response = executiveDetailsApi.getExecutionDetails(params).execute();
- return restHandler.extractResponse(response);
+ Response response = executiveDetailsApi.getExecutionDetails(params).execute();
+ return restHandler.extractResponse(response);
}
-
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/executivedetails/pojos/ExecutiveDetails.java b/src/main/java/co/novu/api/executivedetails/pojos/ExecutiveDetails.java
index 6dba575..a154ead 100644
--- a/src/main/java/co/novu/api/executivedetails/pojos/ExecutiveDetails.java
+++ b/src/main/java/co/novu/api/executivedetails/pojos/ExecutiveDetails.java
@@ -6,21 +6,21 @@
@Data
public class ExecutiveDetails {
- @SerializedName("_id")
+ @SerializedName("_id")
private String id;
- @SerializedName("_jobId")
+ @SerializedName("_jobId")
private String jobId;
- @SerializedName("_organizationId")
+ @SerializedName("_organizationId")
private String organizationId;
- @SerializedName("_environmentId")
+ @SerializedName("_environmentId")
private String environmentId;
- @SerializedName("_notificationId")
+ @SerializedName("_notificationId")
private String notificationId;
- @SerializedName("_subscriberId")
+ @SerializedName("_subscriberId")
private String subscriberId;
- @SerializedName("_notificationTemplateId")
+ @SerializedName("_notificationTemplateId")
private String notificationTemplateId;
- @SerializedName("_messageId")
+ @SerializedName("_messageId")
private String messageId;
private String transactionId;
private String providerId;
@@ -31,4 +31,4 @@ public class ExecutiveDetails {
private String source;
private String createdAt;
private String updatedAt;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/executivedetails/responses/ExecutiveDetailsResponse.java b/src/main/java/co/novu/api/executivedetails/responses/ExecutiveDetailsResponse.java
index 94dce94..bd4ec67 100644
--- a/src/main/java/co/novu/api/executivedetails/responses/ExecutiveDetailsResponse.java
+++ b/src/main/java/co/novu/api/executivedetails/responses/ExecutiveDetailsResponse.java
@@ -8,4 +8,4 @@
@Data
public class ExecutiveDetailsResponse {
private List data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/feeds/FeedsApi.java b/src/main/java/co/novu/api/feeds/FeedsApi.java
index 3875287..dae521e 100644
--- a/src/main/java/co/novu/api/feeds/FeedsApi.java
+++ b/src/main/java/co/novu/api/feeds/FeedsApi.java
@@ -12,14 +12,14 @@
public interface FeedsApi {
- String ENDPOINT = "feeds";
-
- @POST(ENDPOINT)
- Call createFeed(@Body FeedRequest request);
-
- @GET(ENDPOINT)
- Call getFeeds();
-
- @DELETE(ENDPOINT + "/{feedId}")
- Call deleteFeed(@Path("feedId") String feedId);
+ String ENDPOINT = "feeds";
+
+ @POST(ENDPOINT)
+ Call createFeed(@Body FeedRequest request);
+
+ @GET(ENDPOINT)
+ Call getFeeds();
+
+ @DELETE(ENDPOINT + "/{feedId}")
+ Call deleteFeed(@Path("feedId") String feedId);
}
diff --git a/src/main/java/co/novu/api/feeds/FeedsHandler.java b/src/main/java/co/novu/api/feeds/FeedsHandler.java
index 99bc859..1b76988 100644
--- a/src/main/java/co/novu/api/feeds/FeedsHandler.java
+++ b/src/main/java/co/novu/api/feeds/FeedsHandler.java
@@ -9,31 +9,29 @@
import co.novu.common.rest.RestHandler;
import retrofit2.Response;
-public class FeedsHandler {
+public final class FeedsHandler {
private final RestHandler restHandler;
-
+
private final FeedsApi feedsApi;
-
- public FeedsHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.feedsApi = restHandler.buildRetrofit().create(FeedsApi.class);
+
+ public FeedsHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.feedsApi = handler.buildRetrofit().create(FeedsApi.class);
}
- public FeedResponse createFeed(FeedRequest request) throws IOException, NovuNetworkException {
- Response response = feedsApi.createFeed(request).execute();
+ public FeedResponse createFeed(final FeedRequest request) throws IOException, NovuNetworkException {
+ Response response = feedsApi.createFeed(request).execute();
return restHandler.extractResponse(response);
}
public BulkFeedsResponse getFeeds() throws IOException, NovuNetworkException {
- Response response = feedsApi.getFeeds().execute();
- return restHandler.extractResponse(response);
+ Response response = feedsApi.getFeeds().execute();
+ return restHandler.extractResponse(response);
}
-
- public BulkFeedsResponse deleteFeed(String feedId) throws IOException, NovuNetworkException {
- Response response = feedsApi.deleteFeed(feedId).execute();
- return restHandler.extractResponse(response);
+ public BulkFeedsResponse deleteFeed(final String feedId) throws IOException, NovuNetworkException {
+ Response response = feedsApi.deleteFeed(feedId).execute();
+ return restHandler.extractResponse(response);
}
-
}
diff --git a/src/main/java/co/novu/api/feeds/response/FeedResponseData.java b/src/main/java/co/novu/api/feeds/response/FeedResponseData.java
index bd05055..a2fb6e4 100644
--- a/src/main/java/co/novu/api/feeds/response/FeedResponseData.java
+++ b/src/main/java/co/novu/api/feeds/response/FeedResponseData.java
@@ -6,7 +6,7 @@
@Data
public class FeedResponseData {
- @SerializedName("_id")
+ @SerializedName("_id")
private String id;
private String name;
private String identifier;
diff --git a/src/main/java/co/novu/api/inboundparse/InboundParseApi.java b/src/main/java/co/novu/api/inboundparse/InboundParseApi.java
index bb96df0..01ae547 100644
--- a/src/main/java/co/novu/api/inboundparse/InboundParseApi.java
+++ b/src/main/java/co/novu/api/inboundparse/InboundParseApi.java
@@ -5,10 +5,10 @@
import retrofit2.http.GET;
public interface InboundParseApi {
-
- String ENDPOINT = "inbound-parse";
-
- @GET(ENDPOINT + "/mx/status")
- Call validateMxRecordSetupForInboundParse();
+
+ String ENDPOINT = "inbound-parse";
+
+ @GET(ENDPOINT + "/mx/status")
+ Call validateMxRecordSetupForInboundParse();
}
diff --git a/src/main/java/co/novu/api/inboundparse/InboundParseHandler.java b/src/main/java/co/novu/api/inboundparse/InboundParseHandler.java
index 0c68e05..a4224ee 100644
--- a/src/main/java/co/novu/api/inboundparse/InboundParseHandler.java
+++ b/src/main/java/co/novu/api/inboundparse/InboundParseHandler.java
@@ -7,19 +7,19 @@
import co.novu.common.rest.RestHandler;
import retrofit2.Response;
-public class InboundParseHandler {
+public final class InboundParseHandler {
private final RestHandler restHandler;
private final InboundParseApi inboundParseApi;
- public InboundParseHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.inboundParseApi = restHandler.buildRetrofit().create(InboundParseApi.class);
- }
+ public InboundParseHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.inboundParseApi = handler.buildRetrofit().create(InboundParseApi.class);
+ }
- public ValidateMxRecordResponse validateMxRecordSetupForInboundParse() throws IOException, NovuNetworkException {
- Response response = inboundParseApi.validateMxRecordSetupForInboundParse().execute();
+ public ValidateMxRecordResponse validateMxRecordSetupForInboundParse() throws IOException, NovuNetworkException {
+ Response response = inboundParseApi.validateMxRecordSetupForInboundParse().execute();
return restHandler.extractResponse(response);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponse.java b/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponse.java
index d4335d1..153d3a6 100644
--- a/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponse.java
+++ b/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponse.java
@@ -6,4 +6,4 @@
public class ValidateMxRecordResponse {
private ValidateMxRecordResponseData data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponseData.java b/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponseData.java
index d7cf14c..daaaabf 100644
--- a/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponseData.java
+++ b/src/main/java/co/novu/api/inboundparse/responses/ValidateMxRecordResponseData.java
@@ -6,4 +6,4 @@
public class ValidateMxRecordResponseData {
private Boolean mxRecordConfigured;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/IntegrationsApi.java b/src/main/java/co/novu/api/integrations/IntegrationsApi.java
index b793e32..c5147d2 100644
--- a/src/main/java/co/novu/api/integrations/IntegrationsApi.java
+++ b/src/main/java/co/novu/api/integrations/IntegrationsApi.java
@@ -15,25 +15,26 @@
public interface IntegrationsApi {
String ENDPOINT = "integrations";
-
+
@GET(ENDPOINT + "/get-integrations")
- public Call getIntegrations();
+ Call getIntegrations();
@POST(ENDPOINT + "/create-integrations")
- public Call createIntegration(@Body IntegrationRequest request);
+ Call createIntegration(@Body IntegrationRequest request);
@GET(ENDPOINT + "/active")
- public Call getActiveIntegrations();
+ Call getActiveIntegrations();
@GET(ENDPOINT + "/webhook/provider/{providerId}/status")
- public Call getProviderWebhookStatus(@Path("providerId") String providerId);
+ Call getProviderWebhookStatus(@Path("providerId") String providerId);
@PUT(ENDPOINT + "/{integrationId}")
- public Call updateIntegration(@Path("integrationId") String integrationId, @Body IntegrationRequest request);
+ Call updateIntegration(@Path("integrationId") String integrationId,
+ @Body IntegrationRequest request);
@DELETE(ENDPOINT + "/{integrationId}")
- public Call deleteIntegration(@Path("integrationId") String integrationId);
+ Call deleteIntegration(@Path("integrationId") String integrationId);
@PUT(ENDPOINT + "/{integrationId}/set-primary")
- public Call setIntegrationAsPrimary(@Path("integrationId") String integrationId);
-}
\ No newline at end of file
+ Call setIntegrationAsPrimary(@Path("integrationId") String integrationId);
+}
diff --git a/src/main/java/co/novu/api/integrations/IntegrationsHandler.java b/src/main/java/co/novu/api/integrations/IntegrationsHandler.java
index a6ea6e4..d413572 100644
--- a/src/main/java/co/novu/api/integrations/IntegrationsHandler.java
+++ b/src/main/java/co/novu/api/integrations/IntegrationsHandler.java
@@ -11,22 +11,23 @@
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
-public class IntegrationsHandler {
+public final class IntegrationsHandler {
private final RestHandler restHandler;
private final IntegrationsApi integrationsApi;
- public IntegrationsHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.integrationsApi = restHandler.buildRetrofit().create(IntegrationsApi.class);
+ public IntegrationsHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.integrationsApi = handler.buildRetrofit().create(IntegrationsApi.class);
}
public BulkIntegrationResponse getIntegrations() throws NovuNetworkException, IOException {
return restHandler.extractResponse(this.integrationsApi.getIntegrations().execute());
}
-
- public SingleIntegrationResponse createIntegration(IntegrationRequest request) throws NovuNetworkException, IOException {
+
+ public SingleIntegrationResponse createIntegration(final IntegrationRequest request)
+ throws NovuNetworkException, IOException {
return restHandler.extractResponse(this.integrationsApi.createIntegration(request).execute());
}
@@ -34,19 +35,23 @@ public BulkIntegrationResponse getActiveIntegrations() throws NovuNetworkExcepti
return restHandler.extractResponse(this.integrationsApi.getActiveIntegrations().execute());
}
- public ProviderWebhookStatusResponse getProviderWebhookStatus(String providerId) throws NovuNetworkException, IOException {
+ public ProviderWebhookStatusResponse getProviderWebhookStatus(final String providerId)
+ throws NovuNetworkException, IOException {
return restHandler.extractResponse(this.integrationsApi.getProviderWebhookStatus(providerId).execute());
}
- public SingleIntegrationResponse updateIntegration(String integrationId, IntegrationRequest request) throws NovuNetworkException, IOException {
+ public SingleIntegrationResponse updateIntegration(final String integrationId, final IntegrationRequest request)
+ throws NovuNetworkException, IOException {
return restHandler.extractResponse(this.integrationsApi.updateIntegration(integrationId, request).execute());
}
- public BulkIntegrationResponse deleteIntegration(String integrationId) throws NovuNetworkException, IOException {
+ public BulkIntegrationResponse deleteIntegration(final String integrationId)
+ throws NovuNetworkException, IOException {
return restHandler.extractResponse(this.integrationsApi.deleteIntegration(integrationId).execute());
}
- public SingleIntegrationResponse setIntegrationAsPrimary(String integrationId) throws NovuNetworkException, IOException {
+ public SingleIntegrationResponse setIntegrationAsPrimary(final String integrationId)
+ throws NovuNetworkException, IOException {
return restHandler.extractResponse(this.integrationsApi.setIntegrationAsPrimary(integrationId).execute());
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/pojo/Credentials.java b/src/main/java/co/novu/api/integrations/pojo/Credentials.java
index 2fc3ebb..9be31aa 100644
--- a/src/main/java/co/novu/api/integrations/pojo/Credentials.java
+++ b/src/main/java/co/novu/api/integrations/pojo/Credentials.java
@@ -26,4 +26,4 @@ public class Credentials {
private Object tlsOptions;
private String baseUrl;
private String webhookUrl;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/pojo/Integration.java b/src/main/java/co/novu/api/integrations/pojo/Integration.java
index 148d9a7..804d1fc 100644
--- a/src/main/java/co/novu/api/integrations/pojo/Integration.java
+++ b/src/main/java/co/novu/api/integrations/pojo/Integration.java
@@ -24,4 +24,4 @@ public class Integration {
private String identifier;
private String name;
private Boolean primary;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/requests/IntegrationRequest.java b/src/main/java/co/novu/api/integrations/requests/IntegrationRequest.java
index 675acb2..264025a 100644
--- a/src/main/java/co/novu/api/integrations/requests/IntegrationRequest.java
+++ b/src/main/java/co/novu/api/integrations/requests/IntegrationRequest.java
@@ -11,4 +11,4 @@ public class IntegrationRequest implements IRequest {
private Credentials credentials;
private Boolean active;
private Boolean check;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/responses/BulkIntegrationResponse.java b/src/main/java/co/novu/api/integrations/responses/BulkIntegrationResponse.java
index d951346..a6ab5c3 100644
--- a/src/main/java/co/novu/api/integrations/responses/BulkIntegrationResponse.java
+++ b/src/main/java/co/novu/api/integrations/responses/BulkIntegrationResponse.java
@@ -8,4 +8,4 @@
@Data
public class BulkIntegrationResponse {
private List data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/responses/ProviderWebhookStatusResponse.java b/src/main/java/co/novu/api/integrations/responses/ProviderWebhookStatusResponse.java
index 82445fc..4b917c0 100644
--- a/src/main/java/co/novu/api/integrations/responses/ProviderWebhookStatusResponse.java
+++ b/src/main/java/co/novu/api/integrations/responses/ProviderWebhookStatusResponse.java
@@ -5,4 +5,4 @@
@Data
public class ProviderWebhookStatusResponse {
private Boolean data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/integrations/responses/SingleIntegrationResponse.java b/src/main/java/co/novu/api/integrations/responses/SingleIntegrationResponse.java
index 33514eb..47e4cc5 100644
--- a/src/main/java/co/novu/api/integrations/responses/SingleIntegrationResponse.java
+++ b/src/main/java/co/novu/api/integrations/responses/SingleIntegrationResponse.java
@@ -6,4 +6,4 @@
@Data
public class SingleIntegrationResponse {
private Integration data;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/layouts/LayoutApi.java b/src/main/java/co/novu/api/layouts/LayoutApi.java
index 90bb77a..b382308 100644
--- a/src/main/java/co/novu/api/layouts/LayoutApi.java
+++ b/src/main/java/co/novu/api/layouts/LayoutApi.java
@@ -2,10 +2,8 @@
import co.novu.api.layouts.requests.LayoutRequest;
import co.novu.api.layouts.responses.CreateLayoutResponse;
-import co.novu.api.layouts.responses.DeleteLayoutResponse;
import co.novu.api.layouts.responses.FilterLayoutResponse;
import co.novu.api.layouts.responses.GetLayoutResponse;
-import co.novu.api.layouts.responses.SetDefaultLayoutResponse;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
diff --git a/src/main/java/co/novu/api/layouts/LayoutHandler.java b/src/main/java/co/novu/api/layouts/LayoutHandler.java
index c77d6ae..61b66a0 100644
--- a/src/main/java/co/novu/api/layouts/LayoutHandler.java
+++ b/src/main/java/co/novu/api/layouts/LayoutHandler.java
@@ -15,51 +15,59 @@
import java.util.HashMap;
import java.util.Map;
-public class LayoutHandler {
+public final class LayoutHandler {
private final RestHandler restHandler;
- private static final String ENDPOINT = "layouts";
-
private final LayoutApi layoutApi;
- public LayoutHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.layoutApi = restHandler.buildRetrofit().create(LayoutApi.class);
+ public LayoutHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.layoutApi = handler.buildRetrofit().create(LayoutApi.class);
}
- public CreateLayoutResponse createLayout(LayoutRequest request) throws IOException, NovuNetworkException {
+ public CreateLayoutResponse createLayout(final LayoutRequest request) throws IOException, NovuNetworkException {
Response response = layoutApi.createLayout(request).execute();
return restHandler.extractResponse(response);
}
- public FilterLayoutResponse filterLayouts(FilterLayoutRequest request) throws IOException, NovuNetworkException {
+ public FilterLayoutResponse filterLayouts(final FilterLayoutRequest request)
+ throws IOException, NovuNetworkException {
Map params = new HashMap<>();
- if (request.getPage() != null) params.put("page", request.getPage());
- if (request.getPageSize() != null) params.put("pageSize", request.getPageSize());
- if (request.getSortBy() != null) params.put("sortBy", request.getSortBy());
- if (request.getOrderBy() != null) params.put("orderBy", request.getOrderBy());
+ if (request.getPage() != null) {
+ params.put("page", request.getPage());
+ }
+ if (request.getPageSize() != null) {
+ params.put("pageSize", request.getPageSize());
+ }
+ if (request.getSortBy() != null) {
+ params.put("sortBy", request.getSortBy());
+ }
+ if (request.getOrderBy() != null) {
+ params.put("orderBy", request.getOrderBy());
+ }
Response response = layoutApi.filterLayouts(params).execute();
return restHandler.extractResponse(response);
}
- public GetLayoutResponse getLayout(String layoutId) throws IOException, NovuNetworkException {
+ public GetLayoutResponse getLayout(final String layoutId) throws IOException, NovuNetworkException {
Response response = layoutApi.getLayout(layoutId).execute();
return restHandler.extractResponse(response);
}
- public DeleteLayoutResponse deleteLayout(String layoutId) throws IOException, NovuNetworkException {
+ public DeleteLayoutResponse deleteLayout(final String layoutId) throws IOException, NovuNetworkException {
Response response = layoutApi.deleteLayout(layoutId).execute();
return restHandler.extractResponse(response, new DeleteLayoutResponse());
}
- public GetLayoutResponse updateLayout(String layoutId, LayoutRequest request) throws IOException, NovuNetworkException {
+ public GetLayoutResponse updateLayout(final String layoutId, final LayoutRequest request)
+ throws IOException, NovuNetworkException {
Response response = layoutApi.updateLayout(layoutId, request).execute();
return restHandler.extractResponse(response);
}
- public SetDefaultLayoutResponse setDefaultLayout(String layoutId) throws IOException, NovuNetworkException {
+ public SetDefaultLayoutResponse setDefaultLayout(final String layoutId) throws IOException, NovuNetworkException {
Response response = layoutApi.setDefaultLayout(layoutId).execute();
return restHandler.extractResponse(response, new SetDefaultLayoutResponse());
}
diff --git a/src/main/java/co/novu/api/layouts/responses/DeleteLayoutResponse.java b/src/main/java/co/novu/api/layouts/responses/DeleteLayoutResponse.java
index 00f0b80..de76aa7 100644
--- a/src/main/java/co/novu/api/layouts/responses/DeleteLayoutResponse.java
+++ b/src/main/java/co/novu/api/layouts/responses/DeleteLayoutResponse.java
@@ -7,4 +7,4 @@ public class DeleteLayoutResponse {
private Boolean acknowledged = true;
private String status = "Done";
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/layouts/responses/SetDefaultLayoutResponse.java b/src/main/java/co/novu/api/layouts/responses/SetDefaultLayoutResponse.java
index b646977..bb4ab96 100644
--- a/src/main/java/co/novu/api/layouts/responses/SetDefaultLayoutResponse.java
+++ b/src/main/java/co/novu/api/layouts/responses/SetDefaultLayoutResponse.java
@@ -7,4 +7,4 @@ public class SetDefaultLayoutResponse {
private Boolean acknowledged = true;
private String status = "Done";
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/messages/MessageApi.java b/src/main/java/co/novu/api/messages/MessageApi.java
index cee5bfb..a1c7db8 100644
--- a/src/main/java/co/novu/api/messages/MessageApi.java
+++ b/src/main/java/co/novu/api/messages/MessageApi.java
@@ -12,11 +12,11 @@
public interface MessageApi {
- String ENDPOINT = "messages";
-
- @GET(ENDPOINT)
- Call getMessages(@QueryMap Map options);
-
- @DELETE(ENDPOINT + "/{messageId}")
- Call deleteMessage(@Path("messageId") String messageId);
+ String ENDPOINT = "messages";
+
+ @GET(ENDPOINT)
+ Call getMessages(@QueryMap Map options);
+
+ @DELETE(ENDPOINT + "/{messageId}")
+ Call deleteMessage(@Path("messageId") String messageId);
}
diff --git a/src/main/java/co/novu/api/messages/MessageHandler.java b/src/main/java/co/novu/api/messages/MessageHandler.java
index 0ccdce5..72cfb00 100644
--- a/src/main/java/co/novu/api/messages/MessageHandler.java
+++ b/src/main/java/co/novu/api/messages/MessageHandler.java
@@ -11,31 +11,41 @@
import co.novu.common.rest.RestHandler;
import retrofit2.Response;
-public class MessageHandler {
+public final class MessageHandler {
private final RestHandler restHandler;
private final MessageApi messageApi;
- public MessageHandler(RestHandler restHandler) {
- this.restHandler = restHandler;
- this.messageApi = restHandler.buildRetrofit().create(MessageApi.class);
+ public MessageHandler(final RestHandler handler) {
+ this.restHandler = handler;
+ this.messageApi = handler.buildRetrofit().create(MessageApi.class);
}
- public MessageResponse getMessages(MessageRequest request) throws NovuNetworkException, IOException {
+ public MessageResponse getMessages(final MessageRequest request) throws NovuNetworkException, IOException {
Map params = new HashMap<>();
- if (request.getChannel() != null) params.put("channel", request.getChannel());
- if (request.getSubscriberId() != null) params.put("subscriberId", request.getSubscriberId());
- if (request.getTransactionId() != null) params.put("transactionId", request.getTransactionId());
- if (request.getPage() != null) params.put("page", request.getPage());
- if (request.getLimit() != null) params.put("limit", request.getLimit());
+ if (request.getChannel() != null) {
+ params.put("channel", request.getChannel());
+ }
+ if (request.getSubscriberId() != null) {
+ params.put("subscriberId", request.getSubscriberId());
+ }
+ if (request.getTransactionId() != null) {
+ params.put("transactionId", request.getTransactionId());
+ }
+ if (request.getPage() != null) {
+ params.put("page", request.getPage());
+ }
+ if (request.getLimit() != null) {
+ params.put("limit", request.getLimit());
+ }
Response response = messageApi.getMessages(params).execute();
return restHandler.extractResponse(response);
}
- public DeleteMessageResponse deleteMessage(String messageId) throws IOException, NovuNetworkException {
- Response response = messageApi.deleteMessage(messageId).execute();
+ public DeleteMessageResponse deleteMessage(final String messageId) throws IOException, NovuNetworkException {
+ Response response = messageApi.deleteMessage(messageId).execute();
return restHandler.extractResponse(response);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/messages/pojos/Message.java b/src/main/java/co/novu/api/messages/pojos/Message.java
index a7c1fc0..f9b15a3 100644
--- a/src/main/java/co/novu/api/messages/pojos/Message.java
+++ b/src/main/java/co/novu/api/messages/pojos/Message.java
@@ -1,8 +1,6 @@
package co.novu.api.messages.pojos;
import java.util.List;
-
-
import co.novu.api.common.Template;
import co.novu.api.notifications.pojos.Job;
import co.novu.api.notifications.pojos.Subscriber;
@@ -11,11 +9,11 @@
@Data
public class Message {
- @SerializedName("_id")
+ @SerializedName("_id")
private String id;
- @SerializedName("_environmentId")
+ @SerializedName("_environmentId")
private String environmentId;
- @SerializedName("_organizationId")
+ @SerializedName("_organizationId")
private String organizationId;
private String transactionId;
private String createdAt;
@@ -23,4 +21,4 @@ public class Message {
private Subscriber subscriber;
private Template template;
private List jobs;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/co/novu/api/messages/requests/MessageRequest.java b/src/main/java/co/novu/api/messages/requests/MessageRequest.java
index 0fc307c..68a56de 100644
--- a/src/main/java/co/novu/api/messages/requests/MessageRequest.java
+++ b/src/main/java/co/novu/api/messages/requests/MessageRequest.java
@@ -12,4 +12,4 @@ public class MessageRequest implements IRequest {
private List