From 069d9c506311e1bd0bd835ba46a4809658b107ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 27 Feb 2024 14:46:08 +0800 Subject: [PATCH] feat: make identification field `tag` required BREAKING CHANGE: make identification field `confidence` optional --- docs/ProductsResponseIdentificationData.md | 6 ++--- docs/ResponseVisits.md | 4 +-- docs/Visit.md | 2 +- docs/WebhookVisit.md | 6 ++--- .../ProductsResponseIdentificationData.java | 25 ++++++++----------- .../com/fingerprint/model/ResponseVisits.java | 12 ++++----- .../java/com/fingerprint/model/Visit.java | 19 ++++++-------- .../com/fingerprint/model/WebhookVisit.java | 25 ++++++++----------- 8 files changed, 45 insertions(+), 54 deletions(-) diff --git a/docs/ProductsResponseIdentificationData.md b/docs/ProductsResponseIdentificationData.md index 68753d5..a96a811 100644 --- a/docs/ProductsResponseIdentificationData.md +++ b/docs/ProductsResponseIdentificationData.md @@ -14,10 +14,10 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which identification request was sent. | | -|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | [optional] | +|**url** | **URI** | Page URL from which the identification request was sent. | | +|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | -|**confidence** | [**Confidence**](Confidence.md) | | | +|**confidence** | [**Confidence**](Confidence.md) | | [optional] | |**visitorFound** | **Boolean** | Attribute represents if a visitor had been identified before. | | |**firstSeenAt** | [**SeenAt**](SeenAt.md) | | | |**lastSeenAt** | [**SeenAt**](SeenAt.md) | | | diff --git a/docs/ResponseVisits.md b/docs/ResponseVisits.md index fddaba0..0465daa 100644 --- a/docs/ResponseVisits.md +++ b/docs/ResponseVisits.md @@ -14,10 +14,10 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which identification request was sent. | | +|**url** | **URI** | Page URL from which the identification request was sent. | | |**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | -|**confidence** | [**Confidence**](Confidence.md) | | | +|**confidence** | [**Confidence**](Confidence.md) | | [optional] | |**visitorFound** | **Boolean** | Attribute represents if a visitor had been identified before. | | |**firstSeenAt** | [**SeenAt**](SeenAt.md) | | | |**lastSeenAt** | [**SeenAt**](SeenAt.md) | | | diff --git a/docs/Visit.md b/docs/Visit.md index 0f2378c..09fa664 100644 --- a/docs/Visit.md +++ b/docs/Visit.md @@ -17,7 +17,7 @@ |**url** | **URI** | Page URL from which the identification request was sent. | | |**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | -|**confidence** | [**Confidence**](Confidence.md) | | | +|**confidence** | [**Confidence**](Confidence.md) | | [optional] | |**visitorFound** | **Boolean** | Attribute represents if a visitor had been identified before. | | |**firstSeenAt** | [**SeenAt**](SeenAt.md) | | | |**lastSeenAt** | [**SeenAt**](SeenAt.md) | | | diff --git a/docs/WebhookVisit.md b/docs/WebhookVisit.md index 26553f8..40e8099 100644 --- a/docs/WebhookVisit.md +++ b/docs/WebhookVisit.md @@ -36,10 +36,10 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which identification request was sent. | | -|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | [optional] | +|**url** | **URI** | Page URL from which the identification request was sent. | | +|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | -|**confidence** | [**Confidence**](Confidence.md) | | | +|**confidence** | [**Confidence**](Confidence.md) | | [optional] | |**visitorFound** | **Boolean** | Attribute represents if a visitor had been identified before. | | |**firstSeenAt** | [**SeenAt**](SeenAt.md) | | | |**lastSeenAt** | [**SeenAt**](SeenAt.md) | | | diff --git a/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java b/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java index 69a46aa..1b683c4 100644 --- a/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java +++ b/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java @@ -83,7 +83,7 @@ public class ProductsResponseIdentificationData { private URI url; public static final String JSON_PROPERTY_TAG = "tag"; - private Map tag = null; + private Map tag = new HashMap<>(); public static final String JSON_PROPERTY_LINKED_ID = "linkedId"; private String linkedId; @@ -296,11 +296,11 @@ public ProductsResponseIdentificationData url(URI url) { } /** - * Page URL from which identification request was sent. + * Page URL from which the identification request was sent. * @return url **/ @javax.annotation.Nonnull - @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which identification request was sent.") + @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which the identification request was sent.") @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -322,9 +322,6 @@ public ProductsResponseIdentificationData tag(Map tag) { } public ProductsResponseIdentificationData putTagItem(String key, Object tagItem) { - if (this.tag == null) { - this.tag = new HashMap<>(); - } this.tag.put(key, tagItem); return this; } @@ -333,10 +330,10 @@ public ProductsResponseIdentificationData putTagItem(String key, Object tagItem) * A customer-provided value or an object that was sent with identification request. * @return tag **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A customer-provided value or an object that was sent with identification request.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A customer-provided value or an object that was sent with identification request.") @JsonProperty(JSON_PROPERTY_TAG) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) public Map getTag() { return tag; @@ -344,7 +341,7 @@ public Map getTag() { @JsonProperty(JSON_PROPERTY_TAG) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) public void setTag(Map tag) { this.tag = tag; } @@ -385,10 +382,10 @@ public ProductsResponseIdentificationData confidence(Confidence confidence) { * Get confidence * @return confidence **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Confidence getConfidence() { return confidence; @@ -396,7 +393,7 @@ public Confidence getConfidence() { @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfidence(Confidence confidence) { this.confidence = confidence; } diff --git a/src/main/java/com/fingerprint/model/ResponseVisits.java b/src/main/java/com/fingerprint/model/ResponseVisits.java index 4608064..8070602 100644 --- a/src/main/java/com/fingerprint/model/ResponseVisits.java +++ b/src/main/java/com/fingerprint/model/ResponseVisits.java @@ -292,11 +292,11 @@ public ResponseVisits url(URI url) { } /** - * Page URL from which identification request was sent. + * Page URL from which the identification request was sent. * @return url **/ @javax.annotation.Nonnull - @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which identification request was sent.") + @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which the identification request was sent.") @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -378,10 +378,10 @@ public ResponseVisits confidence(Confidence confidence) { * Get confidence * @return confidence **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Confidence getConfidence() { return confidence; @@ -389,7 +389,7 @@ public Confidence getConfidence() { @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfidence(Confidence confidence) { this.confidence = confidence; } diff --git a/src/main/java/com/fingerprint/model/Visit.java b/src/main/java/com/fingerprint/model/Visit.java index da9ef4f..32bd23d 100644 --- a/src/main/java/com/fingerprint/model/Visit.java +++ b/src/main/java/com/fingerprint/model/Visit.java @@ -82,7 +82,7 @@ public class Visit { private URI url; public static final String JSON_PROPERTY_TAG = "tag"; - private Map tag = null; + private Map tag = new HashMap<>(); public static final String JSON_PROPERTY_LINKED_ID = "linkedId"; private String linkedId; @@ -292,11 +292,11 @@ public Visit url(URI url) { } /** - * Page URL from which identification request was sent. + * Page URL from which the identification request was sent. * @return url **/ @javax.annotation.Nonnull - @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which identification request was sent.") + @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which the identification request was sent.") @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -318,9 +318,6 @@ public Visit tag(Map tag) { } public Visit putTagItem(String key, Object tagItem) { - if (this.tag == null) { - this.tag = new HashMap<>(); - } this.tag.put(key, tagItem); return this; } @@ -340,7 +337,7 @@ public Map getTag() { @JsonProperty(JSON_PROPERTY_TAG) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) public void setTag(Map tag) { this.tag = tag; } @@ -381,10 +378,10 @@ public Visit confidence(Confidence confidence) { * Get confidence * @return confidence **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Confidence getConfidence() { return confidence; @@ -392,7 +389,7 @@ public Confidence getConfidence() { @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfidence(Confidence confidence) { this.confidence = confidence; } diff --git a/src/main/java/com/fingerprint/model/WebhookVisit.java b/src/main/java/com/fingerprint/model/WebhookVisit.java index 24f8cfc..36964fb 100644 --- a/src/main/java/com/fingerprint/model/WebhookVisit.java +++ b/src/main/java/com/fingerprint/model/WebhookVisit.java @@ -193,7 +193,7 @@ public class WebhookVisit { private URI url; public static final String JSON_PROPERTY_TAG = "tag"; - private Map tag = null; + private Map tag = new HashMap<>(); public static final String JSON_PROPERTY_LINKED_ID = "linkedId"; private String linkedId; @@ -983,11 +983,11 @@ public WebhookVisit url(URI url) { } /** - * Page URL from which identification request was sent. + * Page URL from which the identification request was sent. * @return url **/ @javax.annotation.Nonnull - @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which identification request was sent.") + @ApiModelProperty(example = "https://some.website/path?query=params", required = true, value = "Page URL from which the identification request was sent.") @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -1009,9 +1009,6 @@ public WebhookVisit tag(Map tag) { } public WebhookVisit putTagItem(String key, Object tagItem) { - if (this.tag == null) { - this.tag = new HashMap<>(); - } this.tag.put(key, tagItem); return this; } @@ -1020,10 +1017,10 @@ public WebhookVisit putTagItem(String key, Object tagItem) { * A customer-provided value or an object that was sent with identification request. * @return tag **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A customer-provided value or an object that was sent with identification request.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A customer-provided value or an object that was sent with identification request.") @JsonProperty(JSON_PROPERTY_TAG) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) public Map getTag() { return tag; @@ -1031,7 +1028,7 @@ public Map getTag() { @JsonProperty(JSON_PROPERTY_TAG) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) public void setTag(Map tag) { this.tag = tag; } @@ -1072,10 +1069,10 @@ public WebhookVisit confidence(Confidence confidence) { * Get confidence * @return confidence **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Confidence getConfidence() { return confidence; @@ -1083,7 +1080,7 @@ public Confidence getConfidence() { @JsonProperty(JSON_PROPERTY_CONFIDENCE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfidence(Confidence confidence) { this.confidence = confidence; }