diff --git a/src/main/kotlin/api/SubscribersApi.kt b/src/main/kotlin/api/SubscribersApi.kt index 3be7a9e..5e9c5bf 100644 --- a/src/main/kotlin/api/SubscribersApi.kt +++ b/src/main/kotlin/api/SubscribersApi.kt @@ -77,7 +77,7 @@ interface SubscribersApi { suspend fun markSubscriberMessageFeedAs( @Path("subscriberId") subscriberId: String, @Body request: MarkSubscriberFeedAsRequest - ): Response> + ): Response>> @POST("$ENDPOINT/{subscriberId}/messages/{messageId}/actions/{type}") suspend fun markMessageActionAsSeen( diff --git a/src/main/kotlin/dto/ApiKeys.kt b/src/main/kotlin/dto/ApiKeys.kt index 6ccec84..b349de8 100644 --- a/src/main/kotlin/dto/ApiKeys.kt +++ b/src/main/kotlin/dto/ApiKeys.kt @@ -1,6 +1,9 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class ApiKeys( var key: String? = null, - var _userId: String? = null + @SerializedName("_userId") + var userId: String? = null ) diff --git a/src/main/kotlin/dto/Channel.kt b/src/main/kotlin/dto/Channel.kt index e88ffed..5957dc9 100644 --- a/src/main/kotlin/dto/Channel.kt +++ b/src/main/kotlin/dto/Channel.kt @@ -1,7 +1,10 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Channel( val credentials: ChannelCredentials? = null, val providerId: String? = null, - val _integrationId: String? = null + @SerializedName("_integrationId") + val integrationId: String? = null ) diff --git a/src/main/kotlin/dto/ExecutionDetails.kt b/src/main/kotlin/dto/ExecutionDetails.kt index 5e93b57..7e20484 100644 --- a/src/main/kotlin/dto/ExecutionDetails.kt +++ b/src/main/kotlin/dto/ExecutionDetails.kt @@ -1,14 +1,24 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class ExecutionDetails( - val _id: String? = null, - val _jobId: String? = null, - val _organizationId: String? = null, - val _environmentId: String? = null, - val _notificationId: String? = null, - val _subscriberId: String? = null, - val _notificationTemplateId: String? = null, - val _messageId: String? = null, + @SerializedName("_id") + val id: String? = null, + @SerializedName("_jobId") + val jobId: String? = null, + @SerializedName("_organizationId") + val organizationId: String? = null, + @SerializedName("_environmentId") + val environmentId: String? = null, + @SerializedName("_notificationId") + val notificationId: String? = null, + @SerializedName("_subscriberId") + val subscriberId: String? = null, + @SerializedName("_notificationTemplateId") + val notificationTemplateId: String? = null, + @SerializedName("_messageId") + val messageId: String? = null, val transactionId: String? = null, val providerId: Any? = null, val status: String? = null, diff --git a/src/main/kotlin/dto/Job.kt b/src/main/kotlin/dto/Job.kt index 3b1e9ee..90e630c 100644 --- a/src/main/kotlin/dto/Job.kt +++ b/src/main/kotlin/dto/Job.kt @@ -1,12 +1,16 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Job( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var digest: Any? = null, var status: String? = null, var payload: Any? = null, var step: Step? = null, - var _notificationId: String? = null, + @SerializedName("_notificationId") + var notificationId: String? = null, var type: String? = null, var createdAt: String? = null, var updatedAt: String? = null, diff --git a/src/main/kotlin/dto/Notification.kt b/src/main/kotlin/dto/Notification.kt index f86b847..c728d8e 100644 --- a/src/main/kotlin/dto/Notification.kt +++ b/src/main/kotlin/dto/Notification.kt @@ -1,11 +1,18 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Notification( - val _id: String? = null, - val _templateId: String? = null, - val _environmentId: String? = null, - val _organizationId: String? = null, - val _subscriberId: String? = null, + @SerializedName("_id") + val id: String? = null, + @SerializedName("_templateId") + val templateId: String? = null, + @SerializedName("_environmentId") + val environmentId: String? = null, + @SerializedName("_organizationId") + val organizationId: String? = null, + @SerializedName("_subscriberId") + val subscriberId: String? = null, val transactionId: String? = null, val channels: List? = null, val to: Subscriber? = null, diff --git a/src/main/kotlin/dto/NotificationGroup.kt b/src/main/kotlin/dto/NotificationGroup.kt index e85d469..496d9a9 100644 --- a/src/main/kotlin/dto/NotificationGroup.kt +++ b/src/main/kotlin/dto/NotificationGroup.kt @@ -1,12 +1,19 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class NotificationGroup( - val _id: String? = null, + @SerializedName("_id") + val id: String? = null, val name: String? = null, - val _organizationId: String? = null, - val _environmentId: String? = null, - val _parentId: String? = null, + @SerializedName("_organizationId") + val organizationId: String? = null, + @SerializedName("_environmentId") + val environmentId: String? = null, + @SerializedName("_parentId") + val parentId: String? = null, val createdAt: String? = null, val updatedAt: String? = null, - val __v: String? = null + @SerializedName("__v") + val version: String? = null ) diff --git a/src/main/kotlin/dto/Step.kt b/src/main/kotlin/dto/Step.kt index 7486633..856c46e 100644 --- a/src/main/kotlin/dto/Step.kt +++ b/src/main/kotlin/dto/Step.kt @@ -1,15 +1,20 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Step( - val _id: String? = null, - val _templateId: String? = null, + @SerializedName("_id") + val id: String? = null, + @SerializedName("_templateId") + val templateId: String? = null, val uuid: String? = null, val name: String? = null, val active: Boolean? = null, val shouldStopOnFail: Boolean? = null, val template: Any? = null, val filters: List? = null, - val _parentId: String? = null, + @SerializedName("_parentId") + val parentId: String? = null, val metadata: Metadata? = null, val replyCallback: Any? = null ) diff --git a/src/main/kotlin/dto/Subscriber.kt b/src/main/kotlin/dto/Subscriber.kt index c68a35c..3ed0a75 100644 --- a/src/main/kotlin/dto/Subscriber.kt +++ b/src/main/kotlin/dto/Subscriber.kt @@ -1,6 +1,9 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + open class Subscriber( + @SerializedName("_id") var id: String? = null, var subscriberId: String? = null, var firstName: String? = null, diff --git a/src/main/kotlin/dto/Template.kt b/src/main/kotlin/dto/Template.kt index 20423d2..43749b2 100644 --- a/src/main/kotlin/dto/Template.kt +++ b/src/main/kotlin/dto/Template.kt @@ -1,7 +1,10 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Template( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var name: String? = null, var critical: Boolean? = null, var triggers: List? = null diff --git a/src/main/kotlin/dto/Tenant.kt b/src/main/kotlin/dto/Tenant.kt index 9dc679e..1216cdb 100644 --- a/src/main/kotlin/dto/Tenant.kt +++ b/src/main/kotlin/dto/Tenant.kt @@ -1,8 +1,12 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Tenant( - private var _environmentId: String? = null, - private var _id: String? = null, + @SerializedName("_environmentId") + private var environmentId: String? = null, + @SerializedName("_id") + private var id: String? = null, private var createdAt: String? = null, private var data: Any? = null, private var identifier: String? = null, diff --git a/src/main/kotlin/dto/Token.kt b/src/main/kotlin/dto/Token.kt index 3c85765..f388d47 100644 --- a/src/main/kotlin/dto/Token.kt +++ b/src/main/kotlin/dto/Token.kt @@ -1,7 +1,10 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Token( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var providerId: String? = null, var provider: String? = null, var accessToken: String? = null, diff --git a/src/main/kotlin/dto/Trigger.kt b/src/main/kotlin/dto/Trigger.kt index bdb413d..3bdaf07 100644 --- a/src/main/kotlin/dto/Trigger.kt +++ b/src/main/kotlin/dto/Trigger.kt @@ -1,8 +1,11 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Trigger( val type: String? = null, - val _id: String? = null, + @SerializedName("_id") + val id: String? = null, val identifier: String? = null, val variables: List? = null, val subscriberVariables: List? = null, diff --git a/src/main/kotlin/dto/User.kt b/src/main/kotlin/dto/User.kt index 6e56339..7a8fa42 100644 --- a/src/main/kotlin/dto/User.kt +++ b/src/main/kotlin/dto/User.kt @@ -1,9 +1,11 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName import java.math.BigDecimal data class User( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var firstName: String? = null, var lastName: String? = null, var email: String? = null, @@ -12,6 +14,7 @@ data class User( var token: List, var createdAt: String? = null, var updatedAt: String? = null, - var __v: BigDecimal? = null + @SerializedName("__v") + var version: BigDecimal? = null ) diff --git a/src/main/kotlin/dto/Variables.kt b/src/main/kotlin/dto/Variables.kt index a121494..f383065 100644 --- a/src/main/kotlin/dto/Variables.kt +++ b/src/main/kotlin/dto/Variables.kt @@ -1,6 +1,9 @@ package co.novu.dto +import com.google.gson.annotations.SerializedName + data class Variables( var name: String? = null, - var _id: String? = null + @SerializedName("_id") + var id: String? = null ) diff --git a/src/main/kotlin/dto/blueprints/Blueprint.kt b/src/main/kotlin/dto/blueprints/Blueprint.kt index 00492f5..20760b5 100644 --- a/src/main/kotlin/dto/blueprints/Blueprint.kt +++ b/src/main/kotlin/dto/blueprints/Blueprint.kt @@ -3,28 +3,36 @@ package co.novu.dto.blueprints import co.novu.dto.NotificationGroup import co.novu.dto.PreferenceSettings import co.novu.dto.Trigger +import com.google.gson.annotations.SerializedName data class Blueprint( - private var _id: String? = null, + @SerializedName("_id") + private var id: String? = null, private var name: String? = null, private var description: String? = null, private var active: Boolean? = null, private var draft: Boolean? = null, private var critical: Boolean? = null, private var isBlueprint: Boolean? = null, - private var _notificationGroupId: String? = null, + @SerializedName("_notificationGroupId") + private var notificationGroupId: String? = null, private var blueprintId: String? = null, private var tags: List? = null, private var triggers: List? = null, private var steps: List? = null, private var preferenceSettings: PreferenceSettings? = null, - private var _environmentId: String? = null, - private var _organizationId: String? = null, - private var _creatorId: String? = null, - private var _parentId: String? = null, + @SerializedName("_environmentId") + private var environmentId: String? = null, + @SerializedName("_organizationId") + private var organizationId: String? = null, + @SerializedName("_creatorId") + private var creatorId: String? = null, + @SerializedName("_parentId") + private var parentId: String? = null, private var deleted: Boolean? = null, private var createdAt: String? = null, private var updatedAt: String? = null, - private var __v: Long? = null, + @SerializedName("__v") + private var version: Long? = null, private var notificationGroup: NotificationGroup? = null ) diff --git a/src/main/kotlin/dto/blueprints/Filters.kt b/src/main/kotlin/dto/blueprints/Filters.kt deleted file mode 100644 index a12c581..0000000 --- a/src/main/kotlin/dto/blueprints/Filters.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dto.blueprints - -data class Filters( - private var children: List? = null, - private var _id: String? = null -) diff --git a/src/main/kotlin/dto/blueprints/Step.kt b/src/main/kotlin/dto/blueprints/Step.kt index 5636a40..9f8c332 100644 --- a/src/main/kotlin/dto/blueprints/Step.kt +++ b/src/main/kotlin/dto/blueprints/Step.kt @@ -1,15 +1,20 @@ package co.novu.dto.blueprints +import com.google.gson.annotations.SerializedName + data class Step( - val _id: String? = null, - val _templateId: String? = null, + @SerializedName("_id") + val id: String? = null, + @SerializedName("_templateId") + val templateId: String? = null, val uuid: String? = null, val name: String? = null, val active: Boolean? = null, val shouldStopOnFail: Boolean? = null, val template: Any? = null, val filters: Any? = null, - val _parentId: String? = null, + @SerializedName("_parentId") + val parentId: String? = null, val metadata: Any? = null, val replyCallback: Any? = null ) diff --git a/src/main/kotlin/dto/blueprints/Template.kt b/src/main/kotlin/dto/blueprints/Template.kt deleted file mode 100644 index f9034c0..0000000 --- a/src/main/kotlin/dto/blueprints/Template.kt +++ /dev/null @@ -1,19 +0,0 @@ -package dto.blueprints - -data class Template( - private var _id: String? = null, - private var type: String? = null, - private var active: Boolean? = null, - private var subject: String? = null, - private var content: List? = null, - private var contentType: String? = null, - private var _environmentId: String? = null, - private var _organizationId: String? = null, - private var _creatorId: String? = null, - private var _parentId: String? = null, - private var _layoutId: String? = null, - private var variables: List? = null, - private var createdAt: String? = null, - private var updatedAt: String? = null, - private var __v: Long? = null -) diff --git a/src/main/kotlin/dto/blueprints/Variables.kt b/src/main/kotlin/dto/blueprints/Variables.kt deleted file mode 100644 index edc4668..0000000 --- a/src/main/kotlin/dto/blueprints/Variables.kt +++ /dev/null @@ -1,8 +0,0 @@ -package dto.blueprints - -data class Variables( - private var name: String? = null, - private var type: String? = null, - private var required: Boolean? = null, - private val _id: String? = null -) diff --git a/src/main/kotlin/dto/request/BaseEventRequest.kt b/src/main/kotlin/dto/request/BaseEventRequest.kt index ad319e5..38ef87d 100644 --- a/src/main/kotlin/dto/request/BaseEventRequest.kt +++ b/src/main/kotlin/dto/request/BaseEventRequest.kt @@ -9,18 +9,24 @@ abstract class BaseEventRequest { // Optional fields private var overrides: Map? = null private var transactionId: String? = null + private var actor: String? = null + private var tenant: String? = null protected fun init( - _name: String, - _payload: Map, - _overrides: Map? = null, - _transactionId: String? = null + name: String, + payload: Map, + overrides: Map? = null, + transactionId: String? = null, + actor: String? = null, + tenant: String? = null ): BaseEventRequest { return this.apply { - this.name = _name - this.payload = _payload - this.overrides = _overrides - this.transactionId = _transactionId + this.name = name + this.payload = payload + this.overrides = overrides + this.transactionId = transactionId + this.actor = actor + this.tenant = tenant } } } diff --git a/src/main/kotlin/dto/request/BroadcastEventRequest.kt b/src/main/kotlin/dto/request/BroadcastEventRequest.kt index 76d7e52..1df46b0 100644 --- a/src/main/kotlin/dto/request/BroadcastEventRequest.kt +++ b/src/main/kotlin/dto/request/BroadcastEventRequest.kt @@ -7,8 +7,10 @@ class BroadcastEventRequest private constructor() : BaseEventRequest() { name: String, payload: Map = mapOf(), overrides: Map? = null, - transactionId: String? = null + transactionId: String? = null, + actor: String? = null, + tenant: String? = null ) = - BroadcastEventRequest().apply { init(name, payload, overrides, transactionId) } + BroadcastEventRequest().apply { init(name, payload, overrides, transactionId, actor, tenant) } } } diff --git a/src/main/kotlin/dto/request/MarkSubscriberFeedAsRequest.kt b/src/main/kotlin/dto/request/MarkSubscriberFeedAsRequest.kt index ae2da6e..cbb319c 100644 --- a/src/main/kotlin/dto/request/MarkSubscriberFeedAsRequest.kt +++ b/src/main/kotlin/dto/request/MarkSubscriberFeedAsRequest.kt @@ -1,7 +1,7 @@ package co.novu.dto.request data class MarkSubscriberFeedAsRequest( - val messageId: Any, // Can be either a String or an Array of Strings + val messageId: String, val mark: Mark ) diff --git a/src/main/kotlin/dto/request/TriggerEventRequest.kt b/src/main/kotlin/dto/request/TriggerEventRequest.kt index 0f8bc75..fcc8001 100644 --- a/src/main/kotlin/dto/request/TriggerEventRequest.kt +++ b/src/main/kotlin/dto/request/TriggerEventRequest.kt @@ -11,11 +11,13 @@ class TriggerEventRequest private constructor() : BaseEventRequest() { to: Any, payload: Map, overrides: Map?, - transactionId: String? + transactionId: String?, + actor: String? = null, + tenant: String? = null ) = TriggerEventRequest() .apply { - init(name, payload, overrides, transactionId) + init(name, payload, overrides, transactionId, actor, tenant) this.to = to } @@ -25,8 +27,10 @@ class TriggerEventRequest private constructor() : BaseEventRequest() { to: String, payload: Map = mapOf(), overrides: Map? = null, - transactionId: String? = null - ) = initFields(name, to, payload, overrides, transactionId) + transactionId: String? = null, + actor: String? = null, + tenant: String? = null + ) = initFields(name, to, payload, overrides, transactionId, actor, tenant) @JvmName("fromListOfString") operator fun invoke( @@ -34,8 +38,10 @@ class TriggerEventRequest private constructor() : BaseEventRequest() { to: List, payload: Map = mapOf(), overrides: Map? = null, - transactionId: String? = null - ) = initFields(name, to, payload, overrides, transactionId) + transactionId: String? = null, + actor: String? = null, + tenant: String? = null + ) = initFields(name, to, payload, overrides, transactionId, actor, tenant) @JvmName("fromListOfSubscribers") operator fun invoke( @@ -43,8 +49,10 @@ class TriggerEventRequest private constructor() : BaseEventRequest() { to: List, payload: Map = mapOf(), overrides: Map? = null, - transactionId: String? = null - ) = initFields(name, to, payload, overrides, transactionId) + transactionId: String? = null, + actor: String? = null, + tenant: String? = null + ) = initFields(name, to, payload, overrides, transactionId, actor, tenant) @JvmName("fromSubscriber") operator fun invoke( @@ -52,8 +60,10 @@ class TriggerEventRequest private constructor() : BaseEventRequest() { to: SubscriberRequest, payload: Map = mapOf(), overrides: Map? = null, - transactionId: String? = null - ) = initFields(name, to, payload, overrides, transactionId) + transactionId: String? = null, + actor: String? = null, + tenant: String? = null + ) = initFields(name, to, payload, overrides, transactionId, actor, tenant) @JvmName("fromListOfTopics") operator fun invoke( @@ -61,7 +71,9 @@ class TriggerEventRequest private constructor() : BaseEventRequest() { to: List, payload: Map = mapOf(), overrides: Map? = null, - transactionId: String? = null - ) = initFields(name, to, payload, overrides, transactionId) + transactionId: String? = null, + actor: String? = null, + tenant: String? = null + ) = initFields(name, to, payload, overrides, transactionId, actor, tenant) } } diff --git a/src/main/kotlin/dto/response/ChangesResponse.kt b/src/main/kotlin/dto/response/ChangesResponse.kt index a6be625..55379f3 100644 --- a/src/main/kotlin/dto/response/ChangesResponse.kt +++ b/src/main/kotlin/dto/response/ChangesResponse.kt @@ -1,20 +1,28 @@ package co.novu.dto.response import co.novu.dto.User +import com.google.gson.annotations.SerializedName import java.math.BigDecimal data class ChangesResponse( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var enabled: Boolean? = null, var type: String? = null, var change: Any? = null, - var _creatorId: String? = null, - var _environmentId: String? = null, - var _organizationId: String? = null, - var _entityId: String? = null, - var __v: BigDecimal? = null, + @SerializedName("_creatorId") + var creatorId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_entityId") + var entityId: String? = null, + @SerializedName("__v") + var version: BigDecimal? = null, var user: User? = null, var templateName: String? = null, var createdAt: String? = null, - var _parentId: String? = null + @SerializedName("_parentId") + var parentId: String? = null ) diff --git a/src/main/kotlin/dto/response/CheckTopicSubscriberResponse.kt b/src/main/kotlin/dto/response/CheckTopicSubscriberResponse.kt index 960977d..593c8d5 100644 --- a/src/main/kotlin/dto/response/CheckTopicSubscriberResponse.kt +++ b/src/main/kotlin/dto/response/CheckTopicSubscriberResponse.kt @@ -1,10 +1,16 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName + data class CheckTopicSubscriberResponse( - var _organizationId: String? = null, - var _environmentId: String? = null, - var _subscriberId: String? = null, - var _topicId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_subscriberId") + var subscriberId: String? = null, + @SerializedName("_topicId") + var topicId: String? = null, var topicKey: String? = null, var externalSubscriberId: String? = null ) diff --git a/src/main/kotlin/dto/response/CreateLayoutResponse.kt b/src/main/kotlin/dto/response/CreateLayoutResponse.kt index cdeec15..ebe95e4 100644 --- a/src/main/kotlin/dto/response/CreateLayoutResponse.kt +++ b/src/main/kotlin/dto/response/CreateLayoutResponse.kt @@ -1,5 +1,8 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName + data class CreateLayoutResponse( - var _id: String? = null + @SerializedName("_id") + var id: String? = null ) diff --git a/src/main/kotlin/dto/response/CreateTopicResponse.kt b/src/main/kotlin/dto/response/CreateTopicResponse.kt index 607d239..7590184 100644 --- a/src/main/kotlin/dto/response/CreateTopicResponse.kt +++ b/src/main/kotlin/dto/response/CreateTopicResponse.kt @@ -1,6 +1,9 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName + data class CreateTopicResponse( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var key: String? = null ) diff --git a/src/main/kotlin/dto/response/FeedResponse.kt b/src/main/kotlin/dto/response/FeedResponse.kt index e883e59..75577d3 100644 --- a/src/main/kotlin/dto/response/FeedResponse.kt +++ b/src/main/kotlin/dto/response/FeedResponse.kt @@ -1,15 +1,20 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName import java.math.BigDecimal data class FeedResponse( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var name: String? = null, var identifier: String? = null, - var _environmentId: String? = null, - var _organizationId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, var updatedAt: String? = null, var createdAt: String? = null, - var __v: BigDecimal? = null, + @SerializedName("__v") + var version: BigDecimal? = null, var deleted: Boolean? = null ) diff --git a/src/main/kotlin/dto/response/GetEnvironmentResponse.kt b/src/main/kotlin/dto/response/GetEnvironmentResponse.kt index 3ee70b3..6800634 100644 --- a/src/main/kotlin/dto/response/GetEnvironmentResponse.kt +++ b/src/main/kotlin/dto/response/GetEnvironmentResponse.kt @@ -2,18 +2,23 @@ package co.novu.dto.response import co.novu.dto.ApiKeys import co.novu.dto.Widget +import com.google.gson.annotations.SerializedName import java.math.BigDecimal data class GetEnvironmentResponse( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var name: String? = null, var identifier: String? = null, - var _organizationId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, var apiKeys: List? = null, var widget: Widget? = null, var createdAt: String? = null, var updatedAt: String? = null, - var _parentId: String? = null, - var __v: BigDecimal? = null + @SerializedName("_parentId") + var parentId: String? = null, + @SerializedName("__v") + var version: BigDecimal? = null ) diff --git a/src/main/kotlin/dto/response/GetFeedsResponse.kt b/src/main/kotlin/dto/response/GetFeedsResponse.kt deleted file mode 100644 index 55017eb..0000000 --- a/src/main/kotlin/dto/response/GetFeedsResponse.kt +++ /dev/null @@ -1,9 +0,0 @@ -package co.novu.dto.response - -data class GetFeedsResponse( - var _id: String? = null, - var name: String? = null, - var identifier: String? = null, - var _environmentId: String? = null, - var _organizationId: String? = null -) diff --git a/src/main/kotlin/dto/response/GetLayoutsResponse.kt b/src/main/kotlin/dto/response/GetLayoutsResponse.kt index 2b8951d..fd03bc9 100644 --- a/src/main/kotlin/dto/response/GetLayoutsResponse.kt +++ b/src/main/kotlin/dto/response/GetLayoutsResponse.kt @@ -1,10 +1,16 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName + data class GetLayoutsResponse( - val _id: String? = null, - val _organizationId: String? = null, - val _environmentId: String? = null, - val _creatorId: String? = null, + @SerializedName("_id") + val id: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_creatorId") + val creatorId: String? = null, val name: String? = null, val description: String? = null, val channel: String? = null, @@ -15,5 +21,6 @@ data class GetLayoutsResponse( val isDeleted: Boolean? = null, val createdAt: String? = null, val updatedAt: String? = null, - val _parentId: String? = null + @SerializedName("_parentId") + val parentId: String? = null ) diff --git a/src/main/kotlin/dto/response/IntegrationResponse.kt b/src/main/kotlin/dto/response/IntegrationResponse.kt index 8c58638..682613c 100644 --- a/src/main/kotlin/dto/response/IntegrationResponse.kt +++ b/src/main/kotlin/dto/response/IntegrationResponse.kt @@ -1,11 +1,15 @@ package co.novu.dto.response import co.novu.dto.Credential +import com.google.gson.annotations.SerializedName data class IntegrationResponse( - var _id: String? = null, - var _environmentId: String? = null, - var _organizationId: String? = null, + @SerializedName("_id") + var id: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, var providerId: String? = null, var channel: String? = null, var credentials: Credential? = null, diff --git a/src/main/kotlin/dto/response/Message.kt b/src/main/kotlin/dto/response/Message.kt index 762556a..7e2f5d6 100644 --- a/src/main/kotlin/dto/response/Message.kt +++ b/src/main/kotlin/dto/response/Message.kt @@ -3,17 +3,25 @@ package co.novu.dto.response import co.novu.dto.Job import co.novu.dto.Subscriber import co.novu.dto.Template +import com.google.gson.annotations.SerializedName import java.math.BigDecimal data class Message( - val _id: String? = null, - val _templateId: String? = null, - val _environmentId: String? = null, - val _messageTemplateId: String? = null, + @SerializedName("_id") + val id: String? = null, + @SerializedName("_templateId") + val templateId: String? = null, + @SerializedName("_environmentId") + val environmentId: String? = null, + @SerializedName("_messageTemplateId") + val messageTemplateId: String? = null, val notificationId: String? = null, - val _organizationId: String? = null, - val _subscriberId: String? = null, - val _jobId: String? = null, + @SerializedName("_organizationId") + val organizationId: String? = null, + @SerializedName("_subscriberId") + val subscriberId: String? = null, + @SerializedName("_jobId") + val jobId: String? = null, val templateIdentifier: String? = null, val email: String? = null, val subject: String? = null, @@ -30,7 +38,8 @@ data class Message( val deleted: Boolean? = null, val createdAt: String? = null, val updatedAt: String? = null, - val __v: BigDecimal? = null, + @SerializedName("__v") + val version: BigDecimal? = null, val identifier: String? = null, val subscriber: Subscriber? = null, val template: Template? = null, diff --git a/src/main/kotlin/dto/response/NotificationGraphStatsResponse.kt b/src/main/kotlin/dto/response/NotificationGraphStatsResponse.kt index 16afc5d..8f54643 100644 --- a/src/main/kotlin/dto/response/NotificationGraphStatsResponse.kt +++ b/src/main/kotlin/dto/response/NotificationGraphStatsResponse.kt @@ -1,9 +1,11 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName import java.math.BigInteger data class NotificationGraphStatsResponse( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var count: BigInteger? = null, var templates: List? = null, var channels: List? = null diff --git a/src/main/kotlin/dto/response/NotificationGroupsResponse.kt b/src/main/kotlin/dto/response/NotificationGroupsResponse.kt index 9ff7f15..d37b4be 100644 --- a/src/main/kotlin/dto/response/NotificationGroupsResponse.kt +++ b/src/main/kotlin/dto/response/NotificationGroupsResponse.kt @@ -1,14 +1,20 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName import java.math.BigInteger data class NotificationGroupsResponse( - var _id: String? = null, + @SerializedName("_id") + var id: String? = null, var name: String? = null, - var _environmentId: String? = null, - var _organizationId: String? = null, - var _parentId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_parentId") + var parentId: String? = null, var createdAt: String? = null, var updatedAt: String? = null, - var __v: BigInteger? = null + @SerializedName("__v") + var version: BigInteger? = null ) diff --git a/src/main/kotlin/dto/response/NotificationResponse.kt b/src/main/kotlin/dto/response/NotificationResponse.kt deleted file mode 100644 index 43be8ee..0000000 --- a/src/main/kotlin/dto/response/NotificationResponse.kt +++ /dev/null @@ -1,10 +0,0 @@ -package co.novu.dto.response - -data class NotificationResponse( - var _id: String? = null, - var _environmentId: String? = null, - var _organizationId: String? = null, - var transactionId: String? = null, - var createdAt: String? = null, - var channels: String? = null -) diff --git a/src/main/kotlin/dto/response/NotificationTemplates.kt b/src/main/kotlin/dto/response/NotificationTemplates.kt index 73ca2d3..1260a07 100644 --- a/src/main/kotlin/dto/response/NotificationTemplates.kt +++ b/src/main/kotlin/dto/response/NotificationTemplates.kt @@ -4,9 +4,11 @@ import co.novu.dto.NotificationGroup import co.novu.dto.PreferenceSettings import co.novu.dto.Step import co.novu.dto.Trigger +import com.google.gson.annotations.SerializedName data class NotificationTemplates( - val _id: String? = null, + @SerializedName("_id") + val id: String? = null, val description: String? = null, val active: Boolean? = null, val name: String? = null, @@ -15,9 +17,12 @@ data class NotificationTemplates( val critical: Boolean? = null, val tags: List? = null, val steps: List? = null, - val _organizationId: String? = null, - val _creatorId: String? = null, - val _environmentId: String? = null, + @SerializedName("_organizationId") + val organizationId: String? = null, + @SerializedName("_creatorId") + val creatorId: String? = null, + @SerializedName("_environmentId") + val environmentId: String? = null, val triggers: List? = null, val notificationGroupId: String? = null, val deleted: Boolean? = null, diff --git a/src/main/kotlin/dto/response/SubscriberNotificationResponse.kt b/src/main/kotlin/dto/response/SubscriberNotificationResponse.kt index afe5faa..1ae5b54 100644 --- a/src/main/kotlin/dto/response/SubscriberNotificationResponse.kt +++ b/src/main/kotlin/dto/response/SubscriberNotificationResponse.kt @@ -1,13 +1,22 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName + data class SubscriberNotificationResponse( - var _id: String? = null, - var _templateId: String? = null, - var _environmentId: String? = null, - var _messageTemplateId: String? = null, - var _organizationId: String? = null, - var _notificationId: String? = null, - var _subscriberId: String? = null, + @SerializedName("_id") + var id: String? = null, + @SerializedName("_templateId") + var templateId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, + @SerializedName("_messageTemplateId") + var messageTemplateId: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_notificationId") + var notificationId: String? = null, + @SerializedName("_subscriberId") + var subscriberId: String? = null, var subscriber: Any? = null, var template: Any? = null, var templateIdentifier: String? = null, @@ -24,7 +33,8 @@ data class SubscriberNotificationResponse( var title: String? = null, var lastSeenDate: String? = null, var cta: Any? = null, - var _feedId: String? = null, + @SerializedName("_feedId") + var feedId: String? = null, var status: String? = null, var errorId: String? = null, var errorText: String? = null, diff --git a/src/main/kotlin/dto/response/SubscriberResponse.kt b/src/main/kotlin/dto/response/SubscriberResponse.kt index 6e26e79..6a546de 100644 --- a/src/main/kotlin/dto/response/SubscriberResponse.kt +++ b/src/main/kotlin/dto/response/SubscriberResponse.kt @@ -2,6 +2,7 @@ package co.novu.dto.response import co.novu.dto.Channel import co.novu.dto.Subscriber +import com.google.gson.annotations.SerializedName import java.math.BigInteger class SubscriberResponse( @@ -11,18 +12,22 @@ class SubscriberResponse( email: String? = null, phone: String? = null, avatar: String? = null, - var _id: String? = null, - var _organizationId: String? = null, - var _environmentId: String? = null, + id: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, var deleted: Boolean? = null, var createdAt: String? = null, var updatedAt: String? = null, var channels: List? = null, var locale: Any? = null, - var __v: BigInteger? = null, + @SerializedName("__v") + var version: BigInteger? = null, var isOnline: Boolean? = null, var lastOnlineAt: String? = null ) : Subscriber( + id, subscriberId, firstName, lastName, diff --git a/src/main/kotlin/dto/response/TopicResponse.kt b/src/main/kotlin/dto/response/TopicResponse.kt index 190ada9..34e9020 100644 --- a/src/main/kotlin/dto/response/TopicResponse.kt +++ b/src/main/kotlin/dto/response/TopicResponse.kt @@ -1,9 +1,14 @@ package co.novu.dto.response +import com.google.gson.annotations.SerializedName + data class TopicResponse( - var _id: String? = null, - var _organizationId: String? = null, - var _environmentId: String? = null, + @SerializedName("_id") + var id: String? = null, + @SerializedName("_organizationId") + var organizationId: String? = null, + @SerializedName("_environmentId") + var environmentId: String? = null, var key: String? = null, var name: String? = null, var subscribers: List? = null diff --git a/src/main/kotlin/dto/response/WorkflowResponse.kt b/src/main/kotlin/dto/response/WorkflowResponse.kt index ec9baee..d103391 100644 --- a/src/main/kotlin/dto/response/WorkflowResponse.kt +++ b/src/main/kotlin/dto/response/WorkflowResponse.kt @@ -4,10 +4,12 @@ import co.novu.dto.NotificationGroup import co.novu.dto.PreferenceSettings import co.novu.dto.Step import co.novu.dto.Trigger +import com.google.gson.annotations.SerializedName import dto.WorkflowIntegrationStatus data class WorkflowResponse( - val _id: String? = null, + @SerializedName("_id") + val id: String? = null, val description: String? = null, val active: Boolean? = null, val name: String? = null, @@ -16,9 +18,12 @@ data class WorkflowResponse( val critical: Boolean? = null, val tags: List? = null, val steps: List? = null, - val _organizationId: String? = null, - val _creatorId: String? = null, - val _environmentId: String? = null, + @SerializedName("_organizationId") + val organizationId: String? = null, + @SerializedName("_creatorId") + val creatorId: String? = null, + @SerializedName("_environmentId") + val environmentId: String? = null, val triggers: List? = null, val notificationGroupId: String? = null, val deleted: Boolean? = null, diff --git a/src/main/kotlin/extensions/SubscriberExtensions.kt b/src/main/kotlin/extensions/SubscriberExtensions.kt index fc2bf4d..856d0af 100644 --- a/src/main/kotlin/extensions/SubscriberExtensions.kt +++ b/src/main/kotlin/extensions/SubscriberExtensions.kt @@ -83,7 +83,7 @@ suspend fun Novu.subscriberUnseenNotificationsCount(subscriberId: String): Respo return response.extractResponse(logger) } -suspend fun Novu.markSubscriberFeed(subscriberId: String, request: MarkSubscriberFeedAsRequest): ResponseWrapper? { +suspend fun Novu.markSubscriberFeed(subscriberId: String, request: MarkSubscriberFeedAsRequest): ResponseWrapper>? { val response = subscribersApi.markSubscriberMessageFeedAs(subscriberId, request) return response.extractResponse(logger) } diff --git a/src/test/kotlin/ChangesApiTest.kt b/src/test/kotlin/ChangesApiTest.kt index 293f61f..c80c2a9 100644 --- a/src/test/kotlin/ChangesApiTest.kt +++ b/src/test/kotlin/ChangesApiTest.kt @@ -30,16 +30,16 @@ class ChangesApiTest { data = listOf( ChangesResponse( - _id = "_id", - _creatorId = "_creatorId", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _entityId = "_entityId", + id = "_id", + creatorId = "_creatorId", + environmentId = "_environmentId", + organizationId = "_organizationId", + entityId = "_entityId", enabled = true, type = "type", change = "change", createdAt = "createdAt", - _parentId = "_parentId" + parentId = "_parentId" ) ), totalCount = BigInteger.TEN @@ -81,16 +81,16 @@ class ChangesApiTest { val responseBody = ResponseWrapper( listOf( ChangesResponse( - _id = "_id", - _creatorId = "_creatorId", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _entityId = "_entityId", + id = "_id", + creatorId = "_creatorId", + environmentId = "_environmentId", + organizationId = "_organizationId", + entityId = "_entityId", enabled = true, type = "type", change = "change", createdAt = "createdAt", - _parentId = "_parentId" + parentId = "_parentId" ) ) ) @@ -112,16 +112,16 @@ class ChangesApiTest { val responseBody = ResponseWrapper( listOf( ChangesResponse( - _id = "_id", - _creatorId = "_creatorId", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _entityId = "_entityId", + id = "_id", + creatorId = "_creatorId", + environmentId = "_environmentId", + organizationId = "_organizationId", + entityId = "_entityId", enabled = true, type = "type", change = "change", createdAt = "createdAt", - _parentId = "_parentId" + parentId = "_parentId" ) ) ) diff --git a/src/test/kotlin/EnvironmentsApiTest.kt b/src/test/kotlin/EnvironmentsApiTest.kt index da1593e..049ce17 100644 --- a/src/test/kotlin/EnvironmentsApiTest.kt +++ b/src/test/kotlin/EnvironmentsApiTest.kt @@ -32,20 +32,20 @@ class EnvironmentsApiTest { fun testGetEnvironments() = runTest { val responseBody = ResponseWrapper( GetEnvironmentResponse( - _id = "1234", + id = "1234", name = "name", - _organizationId = "orgId", + organizationId = "orgId", identifier = "identifier", apiKeys = listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ), widget = Widget( notificationCenterEncryption = true ), - _parentId = "parentId" + parentId = "parentId" ) ) @@ -62,20 +62,20 @@ class EnvironmentsApiTest { fun testCreateEnvironment() = runTest { val responseBody = ResponseWrapper( GetEnvironmentResponse( - _id = "1234", + id = "1234", name = "name", - _organizationId = "orgId", + organizationId = "orgId", identifier = "identifier", apiKeys = listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ), widget = Widget( notificationCenterEncryption = true ), - _parentId = "parentId" + parentId = "parentId" ) ) mockWebServer.enqueue(MockResponse().setResponseCode(201).setBody(Gson().toJson(responseBody))) @@ -97,20 +97,20 @@ class EnvironmentsApiTest { val responseBody = ResponseWrapper( listOf( GetEnvironmentResponse( - _id = "1234", + id = "1234", name = "name", - _organizationId = "orgId", + organizationId = "orgId", identifier = "identifier", apiKeys = listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ), widget = Widget( notificationCenterEncryption = true ), - _parentId = "parentId" + parentId = "parentId" ) ) @@ -128,20 +128,20 @@ class EnvironmentsApiTest { fun testUpdateEnvironment() = runTest { val responseBody = ResponseWrapper( GetEnvironmentResponse( - _id = "1234", + id = "1234", name = "name", - _organizationId = "orgId", + organizationId = "orgId", identifier = "identifier", apiKeys = listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ), widget = Widget( notificationCenterEncryption = true ), - _parentId = "parentId" + parentId = "parentId" ) ) @@ -171,7 +171,7 @@ class EnvironmentsApiTest { listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ) ) @@ -190,7 +190,7 @@ class EnvironmentsApiTest { listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ) ) @@ -207,20 +207,20 @@ class EnvironmentsApiTest { fun testUpdateWidgetSettings() = runTest { val responseBody = ResponseWrapper( GetEnvironmentResponse( - _id = "1234", + id = "1234", name = "name", - _organizationId = "orgId", + organizationId = "orgId", identifier = "identifier", apiKeys = listOf( ApiKeys( key = "key", - _userId = "userId" + userId = "userId" ) ), widget = Widget( notificationCenterEncryption = true ), - _parentId = "parentId" + parentId = "parentId" ) ) diff --git a/src/test/kotlin/ExecutionDetailsApiTest.kt b/src/test/kotlin/ExecutionDetailsApiTest.kt index e669c72..7f4d5f8 100644 --- a/src/test/kotlin/ExecutionDetailsApiTest.kt +++ b/src/test/kotlin/ExecutionDetailsApiTest.kt @@ -22,8 +22,8 @@ class ExecutionDetailsApiTest { val responseBody = ResponseWrapper( listOf( ExecutionDetails( - _id = "_id", - _jobId = "_jobId", + id = "_id", + jobId = "_jobId", status = "status", detail = "detail", isRetry = true, @@ -33,12 +33,12 @@ class ExecutionDetailsApiTest { source = "source", transactionId = "transactionId", createdAt = "createdAt", - _organizationId = "_organizationId", - _environmentId = "_environmentId", - _notificationId = "_notificationId", - _subscriberId = "_subscriberId", - _notificationTemplateId = "_notificationTemplateId", - _messageId = "_messageId" + organizationId = "_organizationId", + environmentId = "_environmentId", + notificationId = "_notificationId", + subscriberId = "_subscriberId", + notificationTemplateId = "_notificationTemplateId", + messageId = "_messageId" ) ) ) diff --git a/src/test/kotlin/FeedsApiTest.kt b/src/test/kotlin/FeedsApiTest.kt index fc67323..048dfba 100644 --- a/src/test/kotlin/FeedsApiTest.kt +++ b/src/test/kotlin/FeedsApiTest.kt @@ -24,10 +24,10 @@ class FeedsApiTest { fun testCreateFeed() = runTest { val responseBody = ResponseWrapper( FeedResponse( - _id = "123", + id = "123", name = "test", - _environmentId = "enviromentId", - _organizationId = "organizationId", + environmentId = "enviromentId", + organizationId = "organizationId", identifier = "identifier", deleted = false, createdAt = "createdAt", @@ -52,10 +52,10 @@ class FeedsApiTest { val responseBody = ResponseWrapper( listOf( FeedResponse( - _id = "123", + id = "123", name = "test", - _environmentId = "enviromentId", - _organizationId = "organizationId", + environmentId = "enviromentId", + organizationId = "organizationId", identifier = "identifier" ) ) @@ -73,10 +73,10 @@ class FeedsApiTest { fun testDeleteFeed() = runTest { val responseBody = ResponseWrapper( FeedResponse( - _id = "123", + id = "123", name = "test", - _environmentId = "enviromentId", - _organizationId = "organizationId", + environmentId = "enviromentId", + organizationId = "organizationId", identifier = "identifier", deleted = true ) diff --git a/src/test/kotlin/IntegrationsApiTest.kt b/src/test/kotlin/IntegrationsApiTest.kt index 6948336..531a783 100644 --- a/src/test/kotlin/IntegrationsApiTest.kt +++ b/src/test/kotlin/IntegrationsApiTest.kt @@ -25,9 +25,9 @@ class IntegrationsApiTest { NovuConfig(apiKey = "1245", backendUrl = mockWebServer.url("").toString()) ) private val integrationResponseStub = IntegrationResponse( - _id = "123", - _environmentId = "enviromentId", - _organizationId = "organizationId", + id = "123", + environmentId = "enviromentId", + organizationId = "organizationId", providerId = "providerId", channel = "channel", credentials = Credential( diff --git a/src/test/kotlin/LayoutsApiTest.kt b/src/test/kotlin/LayoutsApiTest.kt index 5ecb980..883a259 100644 --- a/src/test/kotlin/LayoutsApiTest.kt +++ b/src/test/kotlin/LayoutsApiTest.kt @@ -30,7 +30,7 @@ class LayoutsApiTest { fun testCreateLayout() = runTest { val responseBody = ResponseWrapper( CreateLayoutResponse( - _id = "_id" + id = "_id" ) ) mockWebServer.enqueue( @@ -60,7 +60,7 @@ class LayoutsApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( GetLayoutsResponse( - _id = "_id", + id = "_id", name = "name", description = "description", content = "content", @@ -91,10 +91,10 @@ class LayoutsApiTest { fun testGetLayout() = runTest { val responseBody = ResponseWrapper( GetLayoutsResponse( - _id = "_id", - _organizationId = "_organizationId", - _environmentId = "_environmentId", - _creatorId = "_creatorId", + id = "_id", + organizationId = "_organizationId", + environmentId = "_environmentId", + creatorId = "_creatorId", name = "name", description = "description", channel = "channel", @@ -104,7 +104,7 @@ class LayoutsApiTest { isDeleted = true, createdAt = "createdAt", updatedAt = "updatedAt", - _parentId = "_parentId" + parentId = "_parentId" ) ) @@ -133,10 +133,10 @@ class LayoutsApiTest { fun testUpdateLayout() = runTest { val responseBody = ResponseWrapper( GetLayoutsResponse( - _id = "_id", - _organizationId = "_organizationId", - _environmentId = "_environmentId", - _creatorId = "_creatorId", + id = "_id", + organizationId = "_organizationId", + environmentId = "_environmentId", + creatorId = "_creatorId", name = "name", description = "description", channel = "channel", @@ -146,7 +146,7 @@ class LayoutsApiTest { isDeleted = true, createdAt = "createdAt", updatedAt = "updatedAt", - _parentId = "_parentId" + parentId = "_parentId" ) ) diff --git a/src/test/kotlin/MessagesApiTest.kt b/src/test/kotlin/MessagesApiTest.kt index 60af289..056124e 100644 --- a/src/test/kotlin/MessagesApiTest.kt +++ b/src/test/kotlin/MessagesApiTest.kt @@ -35,9 +35,9 @@ class MessagesApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( Message( - _id = "123", - _environmentId = "environmentId", - _organizationId = "organizationId", + id = "123", + environmentId = "environmentId", + organizationId = "organizationId", transactionId = "transactionId", createdAt = "createdAt", subscriber = Subscriber( @@ -49,7 +49,7 @@ class MessagesApiTest { avatar = "avatar" ), template = Template( - _id = "templateId", + id = "templateId", name = "name", triggers = listOf( Trigger( @@ -71,14 +71,14 @@ class MessagesApiTest { ), jobs = listOf( Job( - _id = "jobId", + id = "jobId", type = "type", digest = "digest", executionDetails = listOf( ExecutionDetails( - _id = "executionDetailsId", + id = "executionDetailsId", status = "status", - _jobId = "jobId", + jobId = "jobId", detail = "detail", isRetry = true, isTest = true, @@ -88,7 +88,7 @@ class MessagesApiTest { ) ), step = Step( - _id = "stepId", + id = "stepId", active = true, filters = listOf( Filters( diff --git a/src/test/kotlin/NotificationGroupsApiTest.kt b/src/test/kotlin/NotificationGroupsApiTest.kt index 0f8060d..000b16c 100644 --- a/src/test/kotlin/NotificationGroupsApiTest.kt +++ b/src/test/kotlin/NotificationGroupsApiTest.kt @@ -28,11 +28,11 @@ class NotificationGroupsApiTest { val responseBody = ResponseWrapper( listOf( NotificationGroupsResponse( - _id = "1234", + id = "1234", name = "test", - _environmentId = "environmentId", - _organizationId = "organizationId", - _parentId = "parentId" + environmentId = "environmentId", + organizationId = "organizationId", + parentId = "parentId" ) ) ) @@ -49,11 +49,11 @@ class NotificationGroupsApiTest { fun testCreateNotificationGroup() = runTest { val responseBody = ResponseWrapper( NotificationGroupsResponse( - _id = "1234", + id = "1234", name = "test", - _environmentId = "environmentId", - _organizationId = "organizationId", - _parentId = "parentId" + environmentId = "environmentId", + organizationId = "organizationId", + parentId = "parentId" ) ) mockWebServer.enqueue(MockResponse().setResponseCode(201).setBody(Gson().toJson(responseBody))) @@ -71,11 +71,11 @@ class NotificationGroupsApiTest { fun testGetWorkflowGroup() = runTest { val responseBody = ResponseWrapper( NotificationGroupsResponse( - _id = "1234", + id = "1234", name = "test", - _environmentId = "environmentId", - _organizationId = "organizationId", - _parentId = "parentId" + environmentId = "environmentId", + organizationId = "organizationId", + parentId = "parentId" ) ) mockWebServer.enqueue(MockResponse().setResponseCode(201).setBody(Gson().toJson(responseBody))) @@ -92,11 +92,11 @@ class NotificationGroupsApiTest { fun testUpdateWorkflowGroup() = runTest { val responseBody = ResponseWrapper( NotificationGroupsResponse( - _id = "1234", + id = "1234", name = "test", - _environmentId = "environmentId", - _organizationId = "organizationId", - _parentId = "parentId" + environmentId = "environmentId", + organizationId = "organizationId", + parentId = "parentId" ) ) mockWebServer.enqueue(MockResponse().setResponseCode(201).setBody(Gson().toJson(responseBody))) diff --git a/src/test/kotlin/NotificationTemplatesApiTest.kt b/src/test/kotlin/NotificationTemplatesApiTest.kt index 89d8bb7..4630fa0 100644 --- a/src/test/kotlin/NotificationTemplatesApiTest.kt +++ b/src/test/kotlin/NotificationTemplatesApiTest.kt @@ -38,7 +38,7 @@ class NotificationTemplatesApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( NotificationTemplates( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -54,8 +54,8 @@ class NotificationTemplatesApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -84,13 +84,13 @@ class NotificationTemplatesApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -111,11 +111,11 @@ class NotificationTemplatesApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -137,7 +137,7 @@ class NotificationTemplatesApiTest { fun testCreateNotification() = runTest { val responseBody = ResponseWrapper( NotificationTemplates( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -153,8 +153,8 @@ class NotificationTemplatesApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -183,13 +183,13 @@ class NotificationTemplatesApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -210,11 +210,11 @@ class NotificationTemplatesApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -269,7 +269,7 @@ class NotificationTemplatesApiTest { fun testUpdateNotificationTemplates() = runTest { val responseBody = ResponseWrapper( NotificationTemplates( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -285,8 +285,8 @@ class NotificationTemplatesApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -315,13 +315,13 @@ class NotificationTemplatesApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -342,11 +342,11 @@ class NotificationTemplatesApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -367,8 +367,8 @@ class NotificationTemplatesApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, template = "template", filters = listOf( @@ -396,7 +396,7 @@ class NotificationTemplatesApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), @@ -430,7 +430,7 @@ class NotificationTemplatesApiTest { fun testGetNotificationTemplate() = runTest { val responseBody = ResponseWrapper( NotificationTemplates( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -446,8 +446,8 @@ class NotificationTemplatesApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -476,13 +476,13 @@ class NotificationTemplatesApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -503,11 +503,11 @@ class NotificationTemplatesApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -526,7 +526,7 @@ class NotificationTemplatesApiTest { fun testUpdateNotificationTemplateStatus() = runTest { val responseBody = ResponseWrapper( NotificationTemplates( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -542,8 +542,8 @@ class NotificationTemplatesApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -572,13 +572,13 @@ class NotificationTemplatesApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -599,11 +599,11 @@ class NotificationTemplatesApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) diff --git a/src/test/kotlin/NotificationsApiTest.kt b/src/test/kotlin/NotificationsApiTest.kt index be69784..271a3df 100644 --- a/src/test/kotlin/NotificationsApiTest.kt +++ b/src/test/kotlin/NotificationsApiTest.kt @@ -57,7 +57,7 @@ class NotificationsApiTest { val responseBody = ResponseWrapper( data = listOf( NotificationGraphStatsResponse( - _id = UUID.randomUUID().toString(), + id = UUID.randomUUID().toString(), count = BigInteger.TEN, templates = listOf("email"), channels = emptyList() diff --git a/src/test/kotlin/SubscriberApiTest.kt b/src/test/kotlin/SubscriberApiTest.kt index 3f6bbc6..18df036 100644 --- a/src/test/kotlin/SubscriberApiTest.kt +++ b/src/test/kotlin/SubscriberApiTest.kt @@ -55,14 +55,14 @@ class SubscriberApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( SubscriberResponse( - _id = "123", - _organizationId = "123", - _environmentId = "123", + id = "123", + organizationId = "123", + environmentId = "123", deleted = false, createdAt = "123", updatedAt = "123", locale = "123", - __v = BigInteger.TEN, + version = BigInteger.TEN, isOnline = false, lastOnlineAt = "123", firstName = "123", @@ -96,14 +96,14 @@ class SubscriberApiTest { val responseBody = ResponseWrapper( SubscriberResponse( subscriberId = "123", - _id = "123", - _organizationId = "123", - _environmentId = "123", + id = "123", + organizationId = "123", + environmentId = "123", deleted = false, createdAt = "123", updatedAt = "123", locale = "123", - __v = BigInteger.TEN, + version = BigInteger.TEN, isOnline = false, lastOnlineAt = "123", firstName = "123", @@ -172,14 +172,14 @@ class SubscriberApiTest { val responseBody = ResponseWrapper( SubscriberResponse( subscriberId = "123", - _id = "123", - _organizationId = "123", - _environmentId = "123", + id = "123", + organizationId = "123", + environmentId = "123", deleted = false, createdAt = "123", updatedAt = "123", locale = "123", - __v = BigInteger.TEN, + version = BigInteger.TEN, isOnline = false, lastOnlineAt = "123", firstName = "123", @@ -220,14 +220,14 @@ class SubscriberApiTest { val responseBody = ResponseWrapper( SubscriberResponse( subscriberId = "123", - _id = "123", - _organizationId = "123", - _environmentId = "123", + id = "123", + organizationId = "123", + environmentId = "123", deleted = false, createdAt = "123", updatedAt = "123", locale = "123", - __v = BigInteger.TEN, + version = BigInteger.TEN, isOnline = false, lastOnlineAt = "123", firstName = "123", @@ -276,14 +276,14 @@ class SubscriberApiTest { val responseBody = ResponseWrapper( SubscriberResponse( subscriberId = "123", - _id = "123", - _organizationId = "123", - _environmentId = "123", + id = "123", + organizationId = "123", + environmentId = "123", deleted = false, createdAt = "123", updatedAt = "123", locale = "123", - __v = BigInteger.TEN, + version = BigInteger.TEN, isOnline = false, lastOnlineAt = "123", firstName = "123", @@ -325,14 +325,14 @@ class SubscriberApiTest { val responseBody = ResponseWrapper( SubscriberResponse( subscriberId = "123", - _id = "123", - _organizationId = "123", - _environmentId = "123", + id = "123", + organizationId = "123", + environmentId = "123", deleted = false, createdAt = "123", updatedAt = "123", locale = "123", - __v = BigInteger.TEN, + version = BigInteger.TEN, isOnline = false, lastOnlineAt = "123", firstName = "123", @@ -366,7 +366,7 @@ class SubscriberApiTest { listOf( SubscriberPreferenceResponse( template = Template( - _id = "123", + id = "123", name = "name", critical = true ), @@ -391,7 +391,7 @@ class SubscriberApiTest { val responseBody = ResponseWrapper( SubscriberPreferenceResponse( template = Template( - _id = "123", + id = "123", name = "name", critical = true ), @@ -422,11 +422,11 @@ class SubscriberApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( SubscriberNotificationResponse( - _id = "123", - _organizationId = "_organizationId", - _environmentId = "_environmentId", - _messageTemplateId = "_messageTemplateId", - _subscriberId = "_subscriberId", + id = "123", + organizationId = "_organizationId", + environmentId = "_environmentId", + messageTemplateId = "_messageTemplateId", + subscriberId = "_subscriberId", subscriber = "subscriber", template = "template", templateIdentifier = "templateIdentifier", @@ -444,14 +444,14 @@ class SubscriberApiTest { title = "title", lastSeenDate = "lastSeenDate", cta = "cta", - _feedId = "_feedId", + feedId = "_feedId", errorId = "errorId", errorText = "errorText", payload = "payload", overrides = "overrides", subject = "subject", - _notificationId = "_notificationId", - _templateId = "_templateId" + notificationId = "_notificationId", + templateId = "_templateId" ) ), totalCount = BigInteger.TEN @@ -485,42 +485,44 @@ class SubscriberApiTest { @Test fun testMarkSubscriberFeedAs() = runTest { val responseBody = ResponseWrapper( - SubscriberNotificationResponse( - _id = "123", - _organizationId = "_organizationId", - _environmentId = "_environmentId", - _messageTemplateId = "_messageTemplateId", - _subscriberId = "_subscriberId", - subscriber = "subscriber", - template = "template", - templateIdentifier = "templateIdentifier", - createdAt = "createdAt", - content = "content", - transactionId = "transactionId", - channel = "channel", - seen = true, - email = "email@email.com", - phone = "phone", - status = "status", - directWebhookUrl = "directWebhookUrl", - providerId = "providerId", - deviceTokens = listOf("deviceTokens"), - title = "title", - lastSeenDate = "lastSeenDate", - cta = "cta", - _feedId = "_feedId", - errorId = "errorId", - errorText = "errorText", - payload = "payload", - overrides = "overrides", - subject = "subject", - _notificationId = "_notificationId", - _templateId = "_templateId" + listOf( + SubscriberNotificationResponse( + id = "123", + organizationId = "_organizationId", + environmentId = "_environmentId", + messageTemplateId = "_messageTemplateId", + subscriberId = "_subscriberId", + subscriber = "subscriber", + template = "template", + templateIdentifier = "templateIdentifier", + createdAt = "createdAt", + content = "content", + transactionId = "transactionId", + channel = "channel", + seen = true, + email = "email@email.com", + phone = "phone", + status = "status", + directWebhookUrl = "directWebhookUrl", + providerId = "providerId", + deviceTokens = listOf("deviceTokens"), + title = "title", + lastSeenDate = "lastSeenDate", + cta = "cta", + feedId = "_feedId", + errorId = "errorId", + errorText = "errorText", + payload = "payload", + overrides = "overrides", + subject = "subject", + notificationId = "_notificationId", + templateId = "_templateId" + ) ) ) mockWebServer.enqueue(MockResponse().setResponseCode(201).setBody(Gson().toJson(responseBody))) val requestBody = MarkSubscriberFeedAsRequest( - messageId = listOf("123"), + messageId = "mId", mark = Mark( read = true, seen = true @@ -539,11 +541,11 @@ class SubscriberApiTest { fun testMarkMessageActionAsSeen() = runTest { val responseBody = ResponseWrapper( SubscriberNotificationResponse( - _id = "123", - _organizationId = "_organizationId", - _environmentId = "_environmentId", - _messageTemplateId = "_messageTemplateId", - _subscriberId = "_subscriberId", + id = "123", + organizationId = "_organizationId", + environmentId = "_environmentId", + messageTemplateId = "_messageTemplateId", + subscriberId = "_subscriberId", subscriber = "subscriber", template = "template", templateIdentifier = "templateIdentifier", @@ -561,14 +563,14 @@ class SubscriberApiTest { title = "title", lastSeenDate = "lastSeenDate", cta = "cta", - _feedId = "_feedId", + feedId = "_feedId", errorId = "errorId", errorText = "errorText", payload = "payload", overrides = "overrides", subject = "subject", - _notificationId = "_notificationId", - _templateId = "_templateId" + notificationId = "_notificationId", + templateId = "_templateId" ) ) mockWebServer.enqueue(MockResponse().setResponseCode(201).setBody(Gson().toJson(responseBody))) diff --git a/src/test/kotlin/TenantsApiTest.kt b/src/test/kotlin/TenantsApiTest.kt index 03d1a27..1ee8ae1 100644 --- a/src/test/kotlin/TenantsApiTest.kt +++ b/src/test/kotlin/TenantsApiTest.kt @@ -29,8 +29,8 @@ class TenantsApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( Tenant( - _id = "_id", - _environmentId = "_environmentId", + id = "_id", + environmentId = "_environmentId", name = "name", identifier = "identifier" ) @@ -56,8 +56,8 @@ class TenantsApiTest { fun testCreateTenant() = runTest { val responseBody = ResponseWrapper( Tenant( - _id = "_id", - _environmentId = "_environmentId", + id = "_id", + environmentId = "_environmentId", name = "name", identifier = "identifier" ) @@ -85,8 +85,8 @@ class TenantsApiTest { fun testGetTenant() = runTest { val responseBody = ResponseWrapper( data = Tenant( - _id = "_id", - _environmentId = "_environmentId", + id = "_id", + environmentId = "_environmentId", name = "name", identifier = "identifier" ) @@ -109,8 +109,8 @@ class TenantsApiTest { fun testUpdateTenant() = runTest { val responseBody = ResponseWrapper( data = Tenant( - _id = "_id", - _environmentId = "_environmentId", + id = "_id", + environmentId = "_environmentId", name = "name", identifier = "identifier" ) diff --git a/src/test/kotlin/TopicsApiTest.kt b/src/test/kotlin/TopicsApiTest.kt index 9b268fa..6e92fd8 100644 --- a/src/test/kotlin/TopicsApiTest.kt +++ b/src/test/kotlin/TopicsApiTest.kt @@ -37,9 +37,9 @@ class TopicsApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( TopicResponse( - _id = "_id", - _organizationId = "_organizationId", - _environmentId = "_environmentId", + id = "_id", + organizationId = "_organizationId", + environmentId = "_environmentId", key = "key", name = "name", subscribers = listOf("subscriber") @@ -67,7 +67,7 @@ class TopicsApiTest { fun testCreateTopic() = runTest { val responseBody = ResponseWrapper( CreateTopicResponse( - _id = "_id", + id = "_id", key = "key" ) ) @@ -136,8 +136,8 @@ class TopicsApiTest { fun testCheckSubscriber() = runTest { val responseBody = CheckTopicSubscriberResponse( topicKey = "key", - _topicId = "id", - _subscriberId = "sId" + topicId = "id", + subscriberId = "sId" ) mockWebServer.enqueue( @@ -159,9 +159,9 @@ class TopicsApiTest { fun testGetTopic() = runTest { val responseBody = ResponseWrapper( data = TopicResponse( - _id = "64059e4de5d10c2178aa8078", - _organizationId = "63f71b3cf067290fa6691032", - _environmentId = "63f71b3cf067290fa6691038", + id = "64059e4de5d10c2178aa8078", + organizationId = "63f71b3cf067290fa6691032", + environmentId = "63f71b3cf067290fa6691038", key = "test-topics", name = "yooo", subscribers = listOf("test_shivam") @@ -185,9 +185,9 @@ class TopicsApiTest { fun testRenameTopic() = runTest { val responseBody = ResponseWrapper( data = TopicResponse( - _id = "_id", - _organizationId = "_organizationId", - _environmentId = "_environmentId", + id = "_id", + organizationId = "_organizationId", + environmentId = "_environmentId", key = "key", name = "name", subscribers = listOf("subscriber") diff --git a/src/test/kotlin/WorkflowsApiTest.kt b/src/test/kotlin/WorkflowsApiTest.kt index 60c6cb7..622ceff 100644 --- a/src/test/kotlin/WorkflowsApiTest.kt +++ b/src/test/kotlin/WorkflowsApiTest.kt @@ -40,7 +40,7 @@ class WorkflowsApiTest { val responseBody = PaginatedResponseWrapper( data = listOf( WorkflowResponse( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -56,8 +56,8 @@ class WorkflowsApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -86,13 +86,13 @@ class WorkflowsApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -113,11 +113,11 @@ class WorkflowsApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -139,7 +139,7 @@ class WorkflowsApiTest { fun testCreateWorkflow() = runTest { val responseBody = ResponseWrapper( WorkflowResponse( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -155,8 +155,8 @@ class WorkflowsApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -185,13 +185,13 @@ class WorkflowsApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -212,11 +212,11 @@ class WorkflowsApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -270,7 +270,7 @@ class WorkflowsApiTest { fun testUpdateWorkflow() = runTest { val responseBody = ResponseWrapper( WorkflowResponse( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -286,8 +286,8 @@ class WorkflowsApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -316,13 +316,13 @@ class WorkflowsApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -343,11 +343,11 @@ class WorkflowsApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -417,7 +417,7 @@ class WorkflowsApiTest { fun testGetWorkflow() = runTest { val responseBody = ResponseWrapper( WorkflowResponse( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -433,8 +433,8 @@ class WorkflowsApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -463,13 +463,13 @@ class WorkflowsApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -490,11 +490,11 @@ class WorkflowsApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) ) @@ -513,7 +513,7 @@ class WorkflowsApiTest { fun testUpdateWorkflowStatus() = runTest { val responseBody = ResponseWrapper( WorkflowResponse( - _id = "_id", + id = "_id", name = "name", description = "description", active = true, @@ -529,8 +529,8 @@ class WorkflowsApiTest { tags = listOf("tag1", "tag2"), steps = listOf( Step( - _id = "_id", - _templateId = "_templateId", + id = "_id", + templateId = "_templateId", active = true, shouldStopOnFail = true, template = "template", @@ -559,13 +559,13 @@ class WorkflowsApiTest { backoffAmount = BigInteger.valueOf(10), updateMode = true ), - _parentId = "_parentId", + parentId = "_parentId", replyCallback = "replyCallback" ) ), - _organizationId = "_organizationId", - _creatorId = "_creatorId", - _environmentId = "_environmentId", + organizationId = "_organizationId", + creatorId = "_creatorId", + environmentId = "_environmentId", triggers = listOf( Trigger( type = "type", @@ -586,11 +586,11 @@ class WorkflowsApiTest { deleted = true, deletedBy = "deletedBy", notificationGroup = NotificationGroup( - _id = "_id", + id = "_id", name = "name", - _environmentId = "_environmentId", - _organizationId = "_organizationId", - _parentId = "_parentId" + environmentId = "_environmentId", + organizationId = "_organizationId", + parentId = "_parentId" ) ) )