From 2bbeedb6f47cae48208fc35a2447a79c14f8a6a4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 31 Oct 2023 18:09:39 +0000 Subject: [PATCH] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@df4311c8. --- README.md | 8 ++-- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- .../publicapi/models/GetSourceV1Output.java | 41 ++++++++++++++++++- 5 files changed, 46 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e784f02d..a4e91643 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 37.0.0 +Latest API and SDK version: 37.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 37.0.0 + 37.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:37.0.0" + implementation "com.segment.publicapi:segment-publicapi:37.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-37.0.0.jar` +* `target/segment-publicapi-37.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index e9830938..22254c17 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 37.0.0 + 37.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index cdd44512..4f871acc 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 37.0.0 (Java)"); + setUserAgent("Public API SDK 37.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index b25c2f79..f04b8a8b 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "37.0.0"; + public static final String VERSION = "37.1.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index 33bf8ecd..dbf91a4c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -34,6 +34,11 @@ public class GetSourceV1Output { @SerializedName(SERIALIZED_NAME_SOURCE) private SourceV1 source; + public static final String SERIALIZED_NAME_TRACKING_PLAN_ID = "trackingPlanId"; + + @SerializedName(SERIALIZED_NAME_TRACKING_PLAN_ID) + private String trackingPlanId; + public GetSourceV1Output() {} public GetSourceV1Output source(SourceV1 source) { @@ -56,6 +61,26 @@ public void setSource(SourceV1 source) { this.source = source; } + public GetSourceV1Output trackingPlanId(String trackingPlanId) { + + this.trackingPlanId = trackingPlanId; + return this; + } + + /** + * The id of the Tracking Plan connected to the Source. + * + * @return trackingPlanId + */ + @javax.annotation.Nullable + public String getTrackingPlanId() { + return trackingPlanId; + } + + public void setTrackingPlanId(String trackingPlanId) { + this.trackingPlanId = trackingPlanId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -65,12 +90,13 @@ public boolean equals(Object o) { return false; } GetSourceV1Output getSourceV1Output = (GetSourceV1Output) o; - return Objects.equals(this.source, getSourceV1Output.source); + return Objects.equals(this.source, getSourceV1Output.source) + && Objects.equals(this.trackingPlanId, getSourceV1Output.trackingPlanId); } @Override public int hashCode() { - return Objects.hash(source); + return Objects.hash(source, trackingPlanId); } @Override @@ -78,6 +104,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetSourceV1Output {\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" trackingPlanId: ").append(toIndentedString(trackingPlanId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -100,10 +127,12 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("source"); + openapiFields.add("trackingPlanId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("source"); + openapiRequiredFields.add("trackingPlanId"); } /** @@ -148,6 +177,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `source` SourceV1.validateJsonElement(jsonObj.get("source")); + if ((jsonObj.get("trackingPlanId") != null && !jsonObj.get("trackingPlanId").isJsonNull()) + && !jsonObj.get("trackingPlanId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trackingPlanId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("trackingPlanId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory {