diff --git a/api/openapi.yaml b/api/openapi.yaml index 9f88116..25b7c7f 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1256,7 +1256,7 @@ components: userId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 parentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 referrer: referrer - isAnonymous: true + externalUserId: j0hn closeTime: 1 campaign: name: name @@ -1317,9 +1317,12 @@ components: format: uuid nullable: true type: string - isAnonymous: - description: The flag that indicates whether the user is anonymous. - type: boolean + externalUserId: + description: "The external user ID that is used to identify the user on\ + \ the application side, unique across the workspace. It is always null\ + \ for anonymous users." + nullable: true + type: string window: $ref: '#/components/schemas/Session_window' closeTime: @@ -1361,7 +1364,7 @@ components: userId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 parentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 referrer: referrer - isAnonymous: true + externalUserId: j0hn closeTime: 1 campaign: name: name @@ -1408,7 +1411,7 @@ components: userId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 parentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 referrer: referrer - isAnonymous: true + externalUserId: j0hn closeTime: 1 campaign: name: name diff --git a/src/main/java/com/croct/client/export/model/Session.java b/src/main/java/com/croct/client/export/model/Session.java index 2008709..3b856d4 100644 --- a/src/main/java/com/croct/client/export/model/Session.java +++ b/src/main/java/com/croct/client/export/model/Session.java @@ -45,7 +45,7 @@ Session.JSON_PROPERTY_SESSION_ID, Session.JSON_PROPERTY_USER_ID, Session.JSON_PROPERTY_PARENT_ID, - Session.JSON_PROPERTY_IS_ANONYMOUS, + Session.JSON_PROPERTY_EXTERNAL_USER_ID, Session.JSON_PROPERTY_WINDOW, Session.JSON_PROPERTY_CLOSE_TIME, Session.JSON_PROPERTY_REFERRER, @@ -67,8 +67,8 @@ public class Session { public static final String JSON_PROPERTY_PARENT_ID = "parentId"; private JsonNullable parentId = JsonNullable.undefined(); - public static final String JSON_PROPERTY_IS_ANONYMOUS = "isAnonymous"; - private Boolean isAnonymous; + public static final String JSON_PROPERTY_EXTERNAL_USER_ID = "externalUserId"; + private JsonNullable externalUserId = JsonNullable.undefined(); public static final String JSON_PROPERTY_WINDOW = "window"; private SessionWindow window; @@ -182,31 +182,32 @@ public void setParentId(UUID parentId) { this.parentId = JsonNullable.of(parentId); } + /** + * The external user ID that is used to identify the user on the application side, unique across the workspace. It is always null for anonymous users. + * @return externalUserId + **/ + @javax.annotation.Nullable + @JsonIgnore - public Session isAnonymous(Boolean isAnonymous) { - this.isAnonymous = isAnonymous; - return this; + public String getExternalUserId() { + return externalUserId.orElse(null); } - /** - * The flag that indicates whether the user is anonymous. - * @return isAnonymous - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_ANONYMOUS) + @JsonProperty(JSON_PROPERTY_EXTERNAL_USER_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsAnonymous() { - return isAnonymous; + public JsonNullable getExternalUserId_JsonNullable() { + return externalUserId; } - - @JsonProperty(JSON_PROPERTY_IS_ANONYMOUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsAnonymous(Boolean isAnonymous) { - this.isAnonymous = isAnonymous; + @JsonProperty(JSON_PROPERTY_EXTERNAL_USER_ID) + public void setExternalUserId_JsonNullable(JsonNullable externalUserId) { + this.externalUserId = externalUserId; } + public void setExternalUserId(String externalUserId) { + this.externalUserId = JsonNullable.of(externalUserId); + } public Session window(SessionWindow window) { this.window = window; @@ -472,7 +473,7 @@ public boolean equals(Object o) { return Objects.equals(this.sessionId, session.sessionId) && Objects.equals(this.userId, session.userId) && equalsNullable(this.parentId, session.parentId) && - Objects.equals(this.isAnonymous, session.isAnonymous) && + Objects.equals(this.externalUserId, session.externalUserId) && Objects.equals(this.window, session.window) && Objects.equals(this.closeTime, session.closeTime) && equalsNullable(this.referrer, session.referrer) && @@ -490,7 +491,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(sessionId, userId, hashCodeNullable(parentId), isAnonymous, window, closeTime, hashCodeNullable(referrer), hashCodeNullable(landingPageUrl), campaign, location, client, attributes, statistics); + return Objects.hash(sessionId, userId, hashCodeNullable(parentId), hashCodeNullable(externalUserId), window, closeTime, hashCodeNullable(referrer), hashCodeNullable(landingPageUrl), campaign, location, client, attributes, statistics); } private static int hashCodeNullable(JsonNullable a) { @@ -507,7 +508,7 @@ public String toString() { sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); - sb.append(" isAnonymous: ").append(toIndentedString(isAnonymous)).append("\n"); + sb.append(" externalUserId: ").append(toIndentedString(externalUserId)).append("\n"); sb.append(" window: ").append(toIndentedString(window)).append("\n"); sb.append(" closeTime: ").append(toIndentedString(closeTime)).append("\n"); sb.append(" referrer: ").append(toIndentedString(referrer)).append("\n");