Skip to content

Commit 9924ee4

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@dfc8dcf1.
1 parent a8707ce commit 9924ee4

File tree

7 files changed

+22
-85
lines changed

7 files changed

+22
-85
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods.
1010

1111
See the next sections for more information on how to use the Segment Public API Java SDK.
1212

13-
Latest API and SDK version: 61.1.0
13+
Latest API and SDK version: 61.1.1
1414

1515
## Requirements
1616

@@ -28,7 +28,7 @@ Add this dependency to your project's POM:
2828
<dependency>
2929
<groupId>com.segment.publicapi</groupId>
3030
<artifactId>segment-publicapi</artifactId>
31-
<version>61.1.0</version>
31+
<version>61.1.1</version>
3232
<scope>compile</scope>
3333
</dependency>
3434
```
@@ -44,7 +44,7 @@ Add this dependency to your project's build file:
4444
}
4545
4646
dependencies {
47-
implementation "com.segment.publicapi:segment-publicapi:61.1.0"
47+
implementation "com.segment.publicapi:segment-publicapi:61.1.1"
4848
}
4949
```
5050

@@ -58,7 +58,7 @@ mvn clean package
5858

5959
Then manually install the following JARs:
6060

61-
* `target/segment-publicapi-61.1.0.jar`
61+
* `target/segment-publicapi-61.1.1.jar`
6262
* `target/lib/*.jar`
6363

6464
You are now ready to start making calls to Public API!

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>segment-publicapi</artifactId>
66
<packaging>jar</packaging>
77
<name>segment-publicapi</name>
8-
<version>61.1.0</version>
8+
<version>61.1.1</version>
99
<url>https://segment.com/docs/api/public-api/</url>
1010
<description>Segment Public API</description>
1111
<scm>

src/main/java/com/segment/publicapi/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void init() {
123123
json = new JSON();
124124

125125
// Set default User-Agent.
126-
setUserAgent("Public API SDK 61.1.0 (Java)");
126+
setUserAgent("Public API SDK 61.1.1 (Java)");
127127

128128
authentications = new HashMap<String, Authentication>();
129129
}

src/main/java/com/segment/publicapi/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package com.segment.publicapi;
1313

1414
public class Configuration {
15-
public static final String VERSION = "61.1.0";
15+
public static final String VERSION = "61.1.1";
1616

1717
private static ApiClient defaultApiClient = new ApiClient();
1818

src/main/java/com/segment/publicapi/models/AddAudienceScheduleToAudienceAlphaInput.java

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,16 @@
2323
import com.google.gson.stream.JsonWriter;
2424
import com.segment.publicapi.JSON;
2525
import java.io.IOException;
26-
import java.util.Arrays;
2726
import java.util.HashSet;
2827
import java.util.Map;
2928
import java.util.Objects;
3029
import java.util.Set;
31-
import org.openapitools.jackson.nullable.JsonNullable;
3230

3331
/** Defines an input for creating an audience schedule. */
3432
public class AddAudienceScheduleToAudienceAlphaInput {
35-
/** Strategy of the audience schedule (manual, periodic, or specific days). */
33+
/** Strategy of the audience schedule (periodic or specific days). */
3634
@JsonAdapter(StrategyEnum.Adapter.class)
3735
public enum StrategyEnum {
38-
MANUAL("MANUAL"),
39-
4036
PERIODIC("PERIODIC"),
4137

4238
SPECIFIC_DAYS("SPECIFIC_DAYS");
@@ -99,7 +95,7 @@ public AddAudienceScheduleToAudienceAlphaInput strategy(StrategyEnum strategy) {
9995
}
10096

10197
/**
102-
* Strategy of the audience schedule (manual, periodic, or specific days).
98+
* Strategy of the audience schedule (periodic or specific days).
10399
*
104100
* @return strategy
105101
*/
@@ -146,27 +142,11 @@ public boolean equals(Object o) {
146142
&& Objects.equals(this.config, addAudienceScheduleToAudienceAlphaInput.config);
147143
}
148144

149-
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
150-
return a == b
151-
|| (a != null
152-
&& b != null
153-
&& a.isPresent()
154-
&& b.isPresent()
155-
&& Objects.deepEquals(a.get(), b.get()));
156-
}
157-
158145
@Override
159146
public int hashCode() {
160147
return Objects.hash(strategy, config);
161148
}
162149

163-
private static <T> int hashCodeNullable(JsonNullable<T> a) {
164-
if (a == null) {
165-
return 1;
166-
}
167-
return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31;
168-
}
169-
170150
@Override
171151
public String toString() {
172152
StringBuilder sb = new StringBuilder();
@@ -200,6 +180,7 @@ private String toIndentedString(Object o) {
200180
// a set of required properties/fields (JSON key names)
201181
openapiRequiredFields = new HashSet<String>();
202182
openapiRequiredFields.add("strategy");
183+
openapiRequiredFields.add("config");
203184
}
204185

205186
/**
@@ -253,10 +234,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
253234
+ " string but got `%s`",
254235
jsonObj.get("strategy").toString()));
255236
}
256-
// validate the optional field `config`
257-
if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) {
258-
Config.validateJsonElement(jsonObj.get("config"));
259-
}
237+
// validate the required field `config`
238+
Config.validateJsonElement(jsonObj.get("config"));
260239
}
261240

262241
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

src/main/java/com/segment/publicapi/models/AudienceSchedule.java

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
import com.google.gson.stream.JsonWriter;
2424
import com.segment.publicapi.JSON;
2525
import java.io.IOException;
26-
import java.util.Arrays;
2726
import java.util.HashSet;
2827
import java.util.Map;
2928
import java.util.Objects;
3029
import java.util.Set;
31-
import org.openapitools.jackson.nullable.JsonNullable;
3230

3331
/** Defines an Audience Schedule. */
3432
public class AudienceSchedule {
@@ -37,11 +35,9 @@ public class AudienceSchedule {
3735
@SerializedName(SERIALIZED_NAME_ID)
3836
private String id;
3937

40-
/** Strategy of the audience schedule (manual, periodic, or specific days). */
38+
/** Strategy of the audience schedule (periodic or specific days). */
4139
@JsonAdapter(StrategyEnum.Adapter.class)
4240
public enum StrategyEnum {
43-
MANUAL("MANUAL"),
44-
4541
PERIODIC("PERIODIC"),
4642

4743
SPECIFIC_DAYS("SPECIFIC_DAYS");
@@ -129,7 +125,7 @@ public AudienceSchedule strategy(StrategyEnum strategy) {
129125
}
130126

131127
/**
132-
* Strategy of the audience schedule (manual, periodic, or specific days).
128+
* Strategy of the audience schedule (periodic or specific days).
133129
*
134130
* @return strategy
135131
*/
@@ -197,27 +193,11 @@ public boolean equals(Object o) {
197193
&& Objects.equals(this.nextExecution, audienceSchedule.nextExecution);
198194
}
199195

200-
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
201-
return a == b
202-
|| (a != null
203-
&& b != null
204-
&& a.isPresent()
205-
&& b.isPresent()
206-
&& Objects.deepEquals(a.get(), b.get()));
207-
}
208-
209196
@Override
210197
public int hashCode() {
211198
return Objects.hash(id, strategy, config, nextExecution);
212199
}
213200

214-
private static <T> int hashCodeNullable(JsonNullable<T> a) {
215-
if (a == null) {
216-
return 1;
217-
}
218-
return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31;
219-
}
220-
221201
@Override
222202
public String toString() {
223203
StringBuilder sb = new StringBuilder();
@@ -256,6 +236,7 @@ private String toIndentedString(Object o) {
256236
openapiRequiredFields = new HashSet<String>();
257237
openapiRequiredFields.add("id");
258238
openapiRequiredFields.add("strategy");
239+
openapiRequiredFields.add("config");
259240
}
260241

261242
/**
@@ -312,10 +293,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
312293
+ " string but got `%s`",
313294
jsonObj.get("strategy").toString()));
314295
}
315-
// validate the optional field `config`
316-
if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) {
317-
Config.validateJsonElement(jsonObj.get("config"));
318-
}
296+
// validate the required field `config`
297+
Config.validateJsonElement(jsonObj.get("config"));
319298
if ((jsonObj.get("nextExecution") != null && !jsonObj.get("nextExecution").isJsonNull())
320299
&& !jsonObj.get("nextExecution").isJsonPrimitive()) {
321300
throw new IllegalArgumentException(

src/main/java/com/segment/publicapi/models/UpdateAudienceScheduleForAudienceAlphaInput.java

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,16 @@
2323
import com.google.gson.stream.JsonWriter;
2424
import com.segment.publicapi.JSON;
2525
import java.io.IOException;
26-
import java.util.Arrays;
2726
import java.util.HashSet;
2827
import java.util.Map;
2928
import java.util.Objects;
3029
import java.util.Set;
31-
import org.openapitools.jackson.nullable.JsonNullable;
3230

3331
/** Input for updating a schedule on an audience. */
3432
public class UpdateAudienceScheduleForAudienceAlphaInput {
35-
/** Strategy of the audience schedule (manual, periodic, or specific days). */
33+
/** Strategy of the audience schedule (periodic or specific days). */
3634
@JsonAdapter(StrategyEnum.Adapter.class)
3735
public enum StrategyEnum {
38-
MANUAL("MANUAL"),
39-
4036
PERIODIC("PERIODIC"),
4137

4238
SPECIFIC_DAYS("SPECIFIC_DAYS");
@@ -99,7 +95,7 @@ public UpdateAudienceScheduleForAudienceAlphaInput strategy(StrategyEnum strateg
9995
}
10096

10197
/**
102-
* Strategy of the audience schedule (manual, periodic, or specific days).
98+
* Strategy of the audience schedule (periodic or specific days).
10399
*
104100
* @return strategy
105101
*/
@@ -146,27 +142,11 @@ public boolean equals(Object o) {
146142
&& Objects.equals(this.config, updateAudienceScheduleForAudienceAlphaInput.config);
147143
}
148144

149-
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
150-
return a == b
151-
|| (a != null
152-
&& b != null
153-
&& a.isPresent()
154-
&& b.isPresent()
155-
&& Objects.deepEquals(a.get(), b.get()));
156-
}
157-
158145
@Override
159146
public int hashCode() {
160147
return Objects.hash(strategy, config);
161148
}
162149

163-
private static <T> int hashCodeNullable(JsonNullable<T> a) {
164-
if (a == null) {
165-
return 1;
166-
}
167-
return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31;
168-
}
169-
170150
@Override
171151
public String toString() {
172152
StringBuilder sb = new StringBuilder();
@@ -200,6 +180,7 @@ private String toIndentedString(Object o) {
200180
// a set of required properties/fields (JSON key names)
201181
openapiRequiredFields = new HashSet<String>();
202182
openapiRequiredFields.add("strategy");
183+
openapiRequiredFields.add("config");
203184
}
204185

205186
/**
@@ -255,10 +236,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
255236
+ " string but got `%s`",
256237
jsonObj.get("strategy").toString()));
257238
}
258-
// validate the optional field `config`
259-
if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) {
260-
Config.validateJsonElement(jsonObj.get("config"));
261-
}
239+
// validate the required field `config`
240+
Config.validateJsonElement(jsonObj.get("config"));
262241
}
263242

264243
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

0 commit comments

Comments
 (0)