Skip to content

Commit

Permalink
feat: Modify fields signature
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorJAY committed Feb 11, 2024
1 parent e160358 commit f1204f0
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 37 deletions.
1 change: 1 addition & 0 deletions src/main/java/co/novu/api/blueprints/pojos/Blueprint.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package co.novu.api.blueprints.pojos;

import co.novu.api.common.PreferenceSettings;
import co.novu.api.common.Step;
import co.novu.api.common.Trigger;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/co/novu/api/blueprints/pojos/Filters.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package co.novu.api.blueprints.pojos;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.List;

@Data
public class Filters {
private List<String> children;
private String _id;
@SerializedName("_id")
private String id;
}
1 change: 1 addition & 0 deletions src/main/java/co/novu/api/blueprints/pojos/General.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package co.novu.api.blueprints.pojos;

import lombok.Data;

import java.util.List;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/co/novu/api/blueprints/pojos/Popular.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package co.novu.api.blueprints.pojos;

import lombok.Data;

import java.util.List;
Expand Down
23 changes: 16 additions & 7 deletions src/main/java/co/novu/api/blueprints/pojos/Template.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
package co.novu.api.blueprints.pojos;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.List;

@Data
public class Template {
private String _id;
@SerializedName("_id")
private String id;
private String type;
private Boolean active;
private String subject;
private List<Content> content;
private String contentType;
private String _environmentId;
private String _organizationId;
private String _creatorId;
private String _parentId;
private String _layoutId;
@SerializedName("_environmentId")
private String environmentId;
@SerializedName("_organizationId")
private String organizationId;
@SerializedName("_creatorId")
private String creatorId;
@SerializedName("_parentId")
private String parentId;
@SerializedName("_layoutId")
private String layoutId;
private List<Variables> variables;
private String createdAt;
private String updatedAt;
private Long __v;
@SerializedName("__v")
private Long version;
}
1 change: 1 addition & 0 deletions src/main/java/co/novu/api/blueprints/pojos/Timed.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package co.novu.api.blueprints.pojos;

import lombok.Data;

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/novu/api/blueprints/pojos/Variables.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ public class Variables {
private String name;
private String type;
private Boolean required;
private String Id;
private String id;
}
2 changes: 1 addition & 1 deletion src/main/java/co/novu/api/common/NotificationGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public class NotificationGroup {
private String createdAt;
private String updatedAt;
@SerializedName("__v")
private String v;
private String version;
}
10 changes: 7 additions & 3 deletions src/main/java/co/novu/api/common/Step.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
package co.novu.api.common;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.List;

@Data
public class Step {
private String _id;
private String _templateId;
@SerializedName("_id")
private String id;
@SerializedName("_templateId")
private String templateId;
private Boolean active;
private Boolean shouldStopOnFail;
private Object template;
private Object replyCallback;
private String uuid;
private String name;
private String _parentId;
@SerializedName("_parentId")
private String parentId;
private Object filters;
private Object metadata;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@

import co.novu.api.environments.pojos.ApiKey;
import co.novu.api.environments.pojos.Widget;
import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.List;

@Data
public class EnvironmentResponse {
private String _id;
@SerializedName("_id")
private String id;
private String name;
private String identifier;
private String _organizationId;
@SerializedName("_organizationId")
private String organizationId;
private List<ApiKey> apiKeys;
private Widget widget;
private String createdAt;
private String updatedAt;
private String _parentId;
@SerializedName("_parentId")
private String parentId;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package co.novu.api.layouts.responses;


import com.google.gson.annotations.SerializedName;
import lombok.Data;

@Data
public class CreateLayoutResponseData {
private String _id;
@SerializedName("_id")
private String id;
}
16 changes: 11 additions & 5 deletions src/main/java/co/novu/api/layouts/responses/LayoutResponse.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package co.novu.api.layouts.responses;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.List;

@Data
public class LayoutResponse {
private String _id;
private String _organizationId;
private String _environmentId;
private String _creatorId;
@SerializedName("_id")
private String id;
@SerializedName("_organizationId")
private String organizationId;
@SerializedName("_environmentId")
private String environmentId;
@SerializedName("_creatorId")
private String creatorId;
private String name;
private String description;
private String channel;
Expand All @@ -20,5 +25,6 @@ public class LayoutResponse {
private Boolean isDeleted;
private String createdAt;
private String updatedAt;
private String _parentId;
@SerializedName("_parentId")
private String parentId;
}
7 changes: 5 additions & 2 deletions src/main/java/co/novu/api/notifications/pojos/Job.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package co.novu.api.notifications.pojos;

import co.novu.api.common.Step;
import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.List;

@Data
public class Job {
private String _id;
@SerializedName("_id")
private String id;
private Object digest;
private String status;
private Object payload;
private String _notificationId;
@SerializedName("_notificationId")
private String notificationId;
private String type;
private String createdAt;
private String updatedAt;
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/co/novu/api/tenants/pojos/Tenant.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package co.novu.api.tenants.pojos;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

@Data
public class Tenant {
private String _environmentId;
private String _id;
@SerializedName("_environmentId")
private String environmentId;
@SerializedName("_id")
private String id;
private String createdAt;
private Object data;
private String identifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public void test_getCurrentEnvironment() throws IOException, NovuNetworkExceptio

SingleEnvironmentResponse singleEnvironmentResponse = new SingleEnvironmentResponse();
EnvironmentResponse data = new EnvironmentResponse();
data.set_id("id");
data.setId("id");
data.setName("name");
data.setIdentifier("identifier");
data.set_organizationId("organizationId");
data.setOrganizationId("organizationId");
data.setApiKeys(Collections.singletonList(new ApiKey()));
Widget widget = new Widget();
widget.setNotificationCenterEncryption(false);
data.setWidget(widget);
data.setCreatedAt("createdAt");
data.setUpdatedAt("updatedAt");
data.set_parentId("parentId");
data.setParentId("parentId");
singleEnvironmentResponse.setData(data);

Gson gson = new Gson();
Expand All @@ -72,17 +72,17 @@ public void test_createEnvironment() throws IOException, NovuNetworkException, I

SingleEnvironmentResponse singleEnvironmentResponse = new SingleEnvironmentResponse();
EnvironmentResponse data = new EnvironmentResponse();
data.set_id("id");
data.setId("id");
data.setName("name");
data.setIdentifier("identifier");
data.set_organizationId("organizationId");
data.setOrganizationId("organizationId");
data.setApiKeys(Collections.singletonList(new ApiKey()));
Widget widget = new Widget();
widget.setNotificationCenterEncryption(false);
data.setWidget(widget);
data.setCreatedAt("createdAt");
data.setUpdatedAt("updatedAt");
data.set_parentId("parentId");
data.setParentId("parentId");
singleEnvironmentResponse.setData(data);

Gson gson = new Gson();
Expand Down Expand Up @@ -124,17 +124,17 @@ public void test_updateEnvironmentById() throws IOException, NovuNetworkExceptio

SingleEnvironmentResponse singleEnvironmentResponse = new SingleEnvironmentResponse();
EnvironmentResponse data = new EnvironmentResponse();
data.set_id("id");
data.setId("id");
data.setName("name");
data.setIdentifier("identifier");
data.set_organizationId("organizationId");
data.setOrganizationId("organizationId");
data.setApiKeys(Collections.singletonList(new ApiKey()));
Widget widget = new Widget();
widget.setNotificationCenterEncryption(false);
data.setWidget(widget);
data.setCreatedAt("createdAt");
data.setUpdatedAt("updatedAt");
data.set_parentId("parentId");
data.setParentId("parentId");
singleEnvironmentResponse.setData(data);

Gson gson = new Gson();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/co/novu/api/layouts/LayoutHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void test_createLayout() throws IOException, NovuNetworkException, Interr

CreateLayoutResponse createLayoutResponse = new CreateLayoutResponse();
CreateLayoutResponseData createLayoutResponseData = new CreateLayoutResponseData();
createLayoutResponseData.set_id("id");
createLayoutResponseData.setId("id");
createLayoutResponse.setData(createLayoutResponseData);

Gson gson = new Gson();
Expand Down

0 comments on commit f1204f0

Please sign in to comment.