Skip to content

Commit 32c9519

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@0543f35f.
1 parent 909403e commit 32c9519

10 files changed

+102
-23
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: 58.13.0
13+
Latest API and SDK version: 58.14.0
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>58.13.0</version>
31+
<version>58.14.0</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:58.13.0"
47+
implementation "com.segment.publicapi:segment-publicapi:58.14.0"
4848
}
4949
```
5050

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

5959
Then manually install the following JARs:
6060

61-
* `target/segment-publicapi-58.13.0.jar`
61+
* `target/segment-publicapi-58.14.0.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>58.13.0</version>
8+
<version>58.14.0</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 58.13.0 (Java)");
126+
setUserAgent("Public API SDK 58.14.0 (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 = "58.13.0";
15+
public static final String VERSION = "58.14.0";
1616

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public AudienceDefinition type(TypeEnum type) {
106106
*
107107
* @return type
108108
*/
109-
@javax.annotation.Nonnull
109+
@javax.annotation.Nullable
110110
public TypeEnum getType() {
111111
return type;
112112
}
@@ -210,7 +210,6 @@ private String toIndentedString(Object o) {
210210

211211
// a set of required properties/fields (JSON key names)
212212
openapiRequiredFields = new HashSet<String>();
213-
openapiRequiredFields.add("type");
214213
openapiRequiredFields.add("query");
215214
}
216215

@@ -254,7 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
254253
}
255254
}
256255
JsonObject jsonObj = jsonElement.getAsJsonObject();
257-
if (!jsonObj.get("type").isJsonPrimitive()) {
256+
if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull())
257+
&& !jsonObj.get("type").isJsonPrimitive()) {
258258
throw new IllegalArgumentException(
259259
String.format(
260260
"Expected the field `type` to be a primitive type in the JSON string"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class AudiencePreview {
3838
@SerializedName(SERIALIZED_NAME_ID)
3939
private String id;
4040

41-
/** The audience type of the preview. */
41+
/** The audience type of the preview. Possible values: USERS, ACCOUNTS, LINKED. */
4242
@JsonAdapter(AudienceTypeEnum.Adapter.class)
4343
public enum AudienceTypeEnum {
4444
ACCOUNTS("ACCOUNTS"),
@@ -198,7 +198,7 @@ public AudiencePreview audienceType(AudienceTypeEnum audienceType) {
198198
}
199199

200200
/**
201-
* The audience type of the preview.
201+
* The audience type of the preview. Possible values: USERS, ACCOUNTS, LINKED.
202202
*
203203
* @return audienceType
204204
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class AudienceSummary {
9090
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
9191
private String updatedAt;
9292

93-
/** Discriminator denoting the audience&#39;s product type. */
93+
/** Denotes the type of audience product. */
9494
@JsonAdapter(AudienceTypeEnum.Adapter.class)
9595
public enum AudienceTypeEnum {
9696
ACCOUNTS("ACCOUNTS"),
@@ -398,7 +398,7 @@ public AudienceSummary audienceType(AudienceTypeEnum audienceType) {
398398
}
399399

400400
/**
401-
* Discriminator denoting the audience&#39;s product type.
401+
* Denotes the type of audience product.
402402
*
403403
* @return audienceType
404404
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public class AudienceSummaryWithAudienceTypeAndLookback {
113113
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
114114
private String updatedAt;
115115

116-
/** Discriminator denoting the audience&#39;s product type. */
116+
/** Denotes the type of audience product. */
117117
@JsonAdapter(AudienceTypeEnum.Adapter.class)
118118
public enum AudienceTypeEnum {
119119
ACCOUNTS("ACCOUNTS"),
@@ -506,7 +506,7 @@ public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum
506506
}
507507

508508
/**
509-
* Discriminator denoting the audience&#39;s product type.
509+
* Denotes the type of audience product.
510510
*
511511
* @return audienceType
512512
*/

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

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.google.gson.JsonObject;
1717
import com.google.gson.TypeAdapter;
1818
import com.google.gson.TypeAdapterFactory;
19+
import com.google.gson.annotations.JsonAdapter;
1920
import com.google.gson.annotations.SerializedName;
2021
import com.google.gson.reflect.TypeToken;
2122
import com.google.gson.stream.JsonReader;
@@ -49,6 +50,57 @@ public class CreateAudienceAlphaInput {
4950
@SerializedName(SERIALIZED_NAME_DEFINITION)
5051
private AudienceDefinition definition;
5152

53+
/** Denotes the type of audience product. Possible values: USERS, ACCOUNTS. */
54+
@JsonAdapter(AudienceTypeEnum.Adapter.class)
55+
public enum AudienceTypeEnum {
56+
ACCOUNTS("ACCOUNTS"),
57+
58+
USERS("USERS");
59+
60+
private String value;
61+
62+
AudienceTypeEnum(String value) {
63+
this.value = value;
64+
}
65+
66+
public String getValue() {
67+
return value;
68+
}
69+
70+
@Override
71+
public String toString() {
72+
return String.valueOf(value);
73+
}
74+
75+
public static AudienceTypeEnum fromValue(String value) {
76+
for (AudienceTypeEnum b : AudienceTypeEnum.values()) {
77+
if (b.value.equals(value)) {
78+
return b;
79+
}
80+
}
81+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
82+
}
83+
84+
public static class Adapter extends TypeAdapter<AudienceTypeEnum> {
85+
@Override
86+
public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration)
87+
throws IOException {
88+
jsonWriter.value(enumeration.getValue());
89+
}
90+
91+
@Override
92+
public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException {
93+
String value = jsonReader.nextString();
94+
return AudienceTypeEnum.fromValue(value);
95+
}
96+
}
97+
}
98+
99+
public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType";
100+
101+
@SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE)
102+
private AudienceTypeEnum audienceType;
103+
52104
public static final String SERIALIZED_NAME_OPTIONS = "options";
53105

54106
@SerializedName(SERIALIZED_NAME_OPTIONS)
@@ -136,6 +188,26 @@ public void setDefinition(AudienceDefinition definition) {
136188
this.definition = definition;
137189
}
138190

191+
public CreateAudienceAlphaInput audienceType(AudienceTypeEnum audienceType) {
192+
193+
this.audienceType = audienceType;
194+
return this;
195+
}
196+
197+
/**
198+
* Denotes the type of audience product. Possible values: USERS, ACCOUNTS.
199+
*
200+
* @return audienceType
201+
*/
202+
@javax.annotation.Nullable
203+
public AudienceTypeEnum getAudienceType() {
204+
return audienceType;
205+
}
206+
207+
public void setAudienceType(AudienceTypeEnum audienceType) {
208+
this.audienceType = audienceType;
209+
}
210+
139211
public CreateAudienceAlphaInput options(AudienceOptions options) {
140212

141213
this.options = options;
@@ -169,12 +241,13 @@ public boolean equals(Object o) {
169241
&& Objects.equals(this.enabled, createAudienceAlphaInput.enabled)
170242
&& Objects.equals(this.description, createAudienceAlphaInput.description)
171243
&& Objects.equals(this.definition, createAudienceAlphaInput.definition)
244+
&& Objects.equals(this.audienceType, createAudienceAlphaInput.audienceType)
172245
&& Objects.equals(this.options, createAudienceAlphaInput.options);
173246
}
174247

175248
@Override
176249
public int hashCode() {
177-
return Objects.hash(name, enabled, description, definition, options);
250+
return Objects.hash(name, enabled, description, definition, audienceType, options);
178251
}
179252

180253
@Override
@@ -185,6 +258,7 @@ public String toString() {
185258
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
186259
sb.append(" description: ").append(toIndentedString(description)).append("\n");
187260
sb.append(" definition: ").append(toIndentedString(definition)).append("\n");
261+
sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n");
188262
sb.append(" options: ").append(toIndentedString(options)).append("\n");
189263
sb.append("}");
190264
return sb.toString();
@@ -211,6 +285,7 @@ private String toIndentedString(Object o) {
211285
openapiFields.add("enabled");
212286
openapiFields.add("description");
213287
openapiFields.add("definition");
288+
openapiFields.add("audienceType");
214289
openapiFields.add("options");
215290

216291
// a set of required properties/fields (JSON key names)
@@ -276,6 +351,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
276351
}
277352
// validate the required field `definition`
278353
AudienceDefinition.validateJsonElement(jsonObj.get("definition"));
354+
if ((jsonObj.get("audienceType") != null && !jsonObj.get("audienceType").isJsonNull())
355+
&& !jsonObj.get("audienceType").isJsonPrimitive()) {
356+
throw new IllegalArgumentException(
357+
String.format(
358+
"Expected the field `audienceType` to be a primitive type in the JSON"
359+
+ " string but got `%s`",
360+
jsonObj.get("audienceType").toString()));
361+
}
279362
// validate the optional field `options`
280363
if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) {
281364
AudienceOptions.validateJsonElement(jsonObj.get("options"));

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ public class CreateAudiencePreviewAlphaInput {
3535
@SerializedName(SERIALIZED_NAME_DEFINITION)
3636
private AudienceDefinitionWithoutType definition;
3737

38-
/**
39-
* Discriminator denoting the audience&#39;s product type. Possible values: USERS, ACCOUNTS,
40-
* LINKED.
41-
*/
38+
/** Denotes the type of audience product. Possible values: USERS, ACCOUNTS, LINKED. */
4239
@JsonAdapter(AudienceTypeEnum.Adapter.class)
4340
public enum AudienceTypeEnum {
4441
ACCOUNTS("ACCOUNTS"),
@@ -125,8 +122,7 @@ public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceTyp
125122
}
126123

127124
/**
128-
* Discriminator denoting the audience&#39;s product type. Possible values: USERS, ACCOUNTS,
129-
* LINKED.
125+
* Denotes the type of audience product. Possible values: USERS, ACCOUNTS, LINKED.
130126
*
131127
* @return audienceType
132128
*/

0 commit comments

Comments
 (0)