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@8415a57.
  • Loading branch information
APIs and Common Services team committed Jun 30, 2023
1 parent eedc610 commit c5eeefe
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 16 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: 34.3.6
Latest API and SDK version: 35.0.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>34.3.6</version>
<version>35.0.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:34.3.6"
implementation "com.segment.publicapi:segment-publicapi:35.0.0"
}
```

Expand All @@ -58,7 +58,7 @@ mvn clean package

Then manually install the following JARs:

* `target/segment-publicapi-34.3.6.jar`
* `target/segment-publicapi-35.0.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>34.3.6</version>
<version>35.0.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 @@ -124,7 +124,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("Public API SDK 34.3.6 (Java)");
setUserAgent("Public API SDK 35.0.0 (Java)");

authentications = new HashMap<String, Authentication>();
}
Expand Down
26 changes: 21 additions & 5 deletions src/main/java/com/segment/publicapi/models/RuleV1.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import org.openapitools.jackson.nullable.JsonNullable;

/** Represents a rule from a Tracking Plan. */
@ApiModel(description = "Represents a rule from a Tracking Plan.")
Expand Down Expand Up @@ -180,7 +182,7 @@ public RuleV1 jsonSchema(Object jsonSchema) {
* @return jsonSchema
*/
@javax.annotation.Nullable
@ApiModelProperty(required = true, value = "JSON Schema of this rule.")
@ApiModelProperty(value = "JSON Schema of this rule.")
public Object getJsonSchema() {
return jsonSchema;
}
Expand All @@ -200,8 +202,8 @@ public RuleV1 version(BigDecimal version) {
*
* @return version
*/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Version of this rule.")
@javax.annotation.Nullable
@ApiModelProperty(value = "Version of this rule.")
public BigDecimal getVersion() {
return version;
}
Expand Down Expand Up @@ -291,11 +293,27 @@ public boolean equals(Object o) {
&& Objects.equals(this.deprecatedAt, ruleV1.deprecatedAt);
}

private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b
|| (a != null
&& b != null
&& a.isPresent()
&& b.isPresent()
&& Objects.deepEquals(a.get(), b.get()));
}

@Override
public int hashCode() {
return Objects.hash(type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt);
}

private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -339,8 +357,6 @@ private String toIndentedString(Object o) {
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("type");
openapiRequiredFields.add("jsonSchema");
openapiRequiredFields.add("version");
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/segment/publicapi/models/TrackingPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class TrackingPlan {
/** The Tracking Plan&#39;s type. */
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
ENGAGE("ENGAGE"),

LIVE("LIVE"),

PROPERTY_LIBRARY("PROPERTY_LIBRARY"),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/segment/publicapi/models/TrackingPlan1.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class TrackingPlan1 {
/** The Tracking Plan&#39;s type. */
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
ENGAGE("ENGAGE"),

LIVE("LIVE"),

PROPERTY_LIBRARY("PROPERTY_LIBRARY"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class TrackingPlanV1 {
/** The Tracking Plan&#39;s type. */
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
ENGAGE("ENGAGE"),

LIVE("LIVE"),

PROPERTY_LIBRARY("PROPERTY_LIBRARY"),
Expand Down
26 changes: 21 additions & 5 deletions src/main/java/com/segment/publicapi/models/UpsertRuleV1.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import org.openapitools.jackson.nullable.JsonNullable;

/** UpsertRuleV1 */
public class UpsertRuleV1 {
Expand Down Expand Up @@ -204,7 +206,7 @@ public UpsertRuleV1 jsonSchema(Object jsonSchema) {
* @return jsonSchema
*/
@javax.annotation.Nullable
@ApiModelProperty(required = true, value = "JSON Schema of this rule.")
@ApiModelProperty(value = "JSON Schema of this rule.")
public Object getJsonSchema() {
return jsonSchema;
}
Expand All @@ -224,8 +226,8 @@ public UpsertRuleV1 version(BigDecimal version) {
*
* @return version
*/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Version of this rule.")
@javax.annotation.Nullable
@ApiModelProperty(value = "Version of this rule.")
public BigDecimal getVersion() {
return version;
}
Expand Down Expand Up @@ -316,12 +318,28 @@ public boolean equals(Object o) {
&& Objects.equals(this.deprecatedAt, upsertRuleV1.deprecatedAt);
}

private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b
|| (a != null
&& b != null
&& a.isPresent()
&& b.isPresent()
&& Objects.deepEquals(a.get(), b.get()));
}

@Override
public int hashCode() {
return Objects.hash(
newKey, type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt);
}

private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -367,8 +385,6 @@ private String toIndentedString(Object o) {
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("type");
openapiRequiredFields.add("jsonSchema");
openapiRequiredFields.add("version");
}

/**
Expand Down

0 comments on commit c5eeefe

Please sign in to comment.