Skip to content

Commit

Permalink
Automated SDK update
Browse files Browse the repository at this point in the history
This updates the SDK from internal repo commit segmentio/public-api@df4311c8.
  • Loading branch information
APIs and Common Services team committed Oct 31, 2023
1 parent fac50aa commit 2bbeedb
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -28,7 +28,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.segment.publicapi</groupId>
<artifactId>segment-publicapi</artifactId>
<version>37.0.0</version>
<version>37.1.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -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"
}
```

Expand All @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>segment-publicapi</artifactId>
<packaging>jar</packaging>
<name>segment-publicapi</name>
<version>37.0.0</version>
<version>37.1.0</version>
<url>https://segment.com/docs/api/public-api/</url>
<description>Segment Public API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/segment/publicapi/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Authentication>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/segment/publicapi/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
41 changes: 39 additions & 2 deletions src/main/java/com/segment/publicapi/models/GetSourceV1Output.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -65,19 +90,21 @@ 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
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();
}
Expand All @@ -100,10 +127,12 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("source");
openapiFields.add("trackingPlanId");

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("source");
openapiRequiredFields.add("trackingPlanId");
}

/**
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2bbeedb

Please sign in to comment.