Skip to content

Commit 2114953

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@ed3c8598.
1 parent 76afad9 commit 2114953

File tree

7 files changed

+862
-15
lines changed

7 files changed

+862
-15
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ private static Class getClassByDiscriminator(
201201
gsonBuilder.registerTypeAdapterFactory(
202202
new com.segment.publicapi.models.AudiencePreviewAccountResult
203203
.CustomTypeAdapterFactory());
204+
gsonBuilder.registerTypeAdapterFactory(
205+
new com.segment.publicapi.models.AudiencePreviewEntitiesResult
206+
.CustomTypeAdapterFactory());
204207
gsonBuilder.registerTypeAdapterFactory(
205208
new com.segment.publicapi.models.AudiencePreviewIdentifier
206209
.CustomTypeAdapterFactory());
@@ -1317,6 +1320,8 @@ private static Class getClassByDiscriminator(
13171320
gsonBuilder.registerTypeAdapterFactory(
13181321
new com.segment.publicapi.models.PreviewDestinationFilterV1Output
13191322
.CustomTypeAdapterFactory());
1323+
gsonBuilder.registerTypeAdapterFactory(
1324+
new com.segment.publicapi.models.Profile.CustomTypeAdapterFactory());
13201325
gsonBuilder.registerTypeAdapterFactory(
13211326
new com.segment.publicapi.models.ProfilesWarehouseAlpha.CustomTypeAdapterFactory());
13221327
gsonBuilder.registerTypeAdapterFactory(

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException {
8888
@SerializedName(SERIALIZED_NAME_QUERY)
8989
private String query;
9090

91+
public static final String SERIALIZED_NAME_TARGET_ENTITY = "targetEntity";
92+
93+
@SerializedName(SERIALIZED_NAME_TARGET_ENTITY)
94+
private String targetEntity;
95+
9196
public AudienceDefinition() {}
9297

9398
public AudienceDefinition type(TypeEnum type) {
@@ -132,6 +137,26 @@ public void setQuery(String query) {
132137
this.query = query;
133138
}
134139

140+
public AudienceDefinition targetEntity(String targetEntity) {
141+
142+
this.targetEntity = targetEntity;
143+
return this;
144+
}
145+
146+
/**
147+
* The target entity slug.
148+
*
149+
* @return targetEntity
150+
*/
151+
@javax.annotation.Nullable
152+
public String getTargetEntity() {
153+
return targetEntity;
154+
}
155+
156+
public void setTargetEntity(String targetEntity) {
157+
this.targetEntity = targetEntity;
158+
}
159+
135160
@Override
136161
public boolean equals(Object o) {
137162
if (this == o) {
@@ -142,12 +167,13 @@ public boolean equals(Object o) {
142167
}
143168
AudienceDefinition audienceDefinition = (AudienceDefinition) o;
144169
return Objects.equals(this.type, audienceDefinition.type)
145-
&& Objects.equals(this.query, audienceDefinition.query);
170+
&& Objects.equals(this.query, audienceDefinition.query)
171+
&& Objects.equals(this.targetEntity, audienceDefinition.targetEntity);
146172
}
147173

148174
@Override
149175
public int hashCode() {
150-
return Objects.hash(type, query);
176+
return Objects.hash(type, query, targetEntity);
151177
}
152178

153179
@Override
@@ -156,6 +182,7 @@ public String toString() {
156182
sb.append("class AudienceDefinition {\n");
157183
sb.append(" type: ").append(toIndentedString(type)).append("\n");
158184
sb.append(" query: ").append(toIndentedString(query)).append("\n");
185+
sb.append(" targetEntity: ").append(toIndentedString(targetEntity)).append("\n");
159186
sb.append("}");
160187
return sb.toString();
161188
}
@@ -179,6 +206,7 @@ private String toIndentedString(Object o) {
179206
openapiFields = new HashSet<String>();
180207
openapiFields.add("type");
181208
openapiFields.add("query");
209+
openapiFields.add("targetEntity");
182210

183211
// a set of required properties/fields (JSON key names)
184212
openapiRequiredFields = new HashSet<String>();
@@ -240,6 +268,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
240268
+ " but got `%s`",
241269
jsonObj.get("query").toString()));
242270
}
271+
if ((jsonObj.get("targetEntity") != null && !jsonObj.get("targetEntity").isJsonNull())
272+
&& !jsonObj.get("targetEntity").isJsonPrimitive()) {
273+
throw new IllegalArgumentException(
274+
String.format(
275+
"Expected the field `targetEntity` to be a primitive type in the JSON"
276+
+ " string but got `%s`",
277+
jsonObj.get("targetEntity").toString()));
278+
}
243279
}
244280

245281
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public class AudienceDefinitionWithoutType {
3434
@SerializedName(SERIALIZED_NAME_QUERY)
3535
private String query;
3636

37+
public static final String SERIALIZED_NAME_TARGET_ENTITY = "targetEntity";
38+
39+
@SerializedName(SERIALIZED_NAME_TARGET_ENTITY)
40+
private String targetEntity;
41+
3742
public AudienceDefinitionWithoutType() {}
3843

3944
public AudienceDefinitionWithoutType query(String query) {
@@ -58,6 +63,26 @@ public void setQuery(String query) {
5863
this.query = query;
5964
}
6065

66+
public AudienceDefinitionWithoutType targetEntity(String targetEntity) {
67+
68+
this.targetEntity = targetEntity;
69+
return this;
70+
}
71+
72+
/**
73+
* The target entity slug.
74+
*
75+
* @return targetEntity
76+
*/
77+
@javax.annotation.Nullable
78+
public String getTargetEntity() {
79+
return targetEntity;
80+
}
81+
82+
public void setTargetEntity(String targetEntity) {
83+
this.targetEntity = targetEntity;
84+
}
85+
6186
@Override
6287
public boolean equals(Object o) {
6388
if (this == o) {
@@ -68,19 +93,21 @@ public boolean equals(Object o) {
6893
}
6994
AudienceDefinitionWithoutType audienceDefinitionWithoutType =
7095
(AudienceDefinitionWithoutType) o;
71-
return Objects.equals(this.query, audienceDefinitionWithoutType.query);
96+
return Objects.equals(this.query, audienceDefinitionWithoutType.query)
97+
&& Objects.equals(this.targetEntity, audienceDefinitionWithoutType.targetEntity);
7298
}
7399

74100
@Override
75101
public int hashCode() {
76-
return Objects.hash(query);
102+
return Objects.hash(query, targetEntity);
77103
}
78104

79105
@Override
80106
public String toString() {
81107
StringBuilder sb = new StringBuilder();
82108
sb.append("class AudienceDefinitionWithoutType {\n");
83109
sb.append(" query: ").append(toIndentedString(query)).append("\n");
110+
sb.append(" targetEntity: ").append(toIndentedString(targetEntity)).append("\n");
84111
sb.append("}");
85112
return sb.toString();
86113
}
@@ -103,6 +130,7 @@ private String toIndentedString(Object o) {
103130
// a set of all properties/fields (JSON key names)
104131
openapiFields = new HashSet<String>();
105132
openapiFields.add("query");
133+
openapiFields.add("targetEntity");
106134

107135
// a set of required properties/fields (JSON key names)
108136
openapiRequiredFields = new HashSet<String>();
@@ -157,6 +185,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
157185
+ " but got `%s`",
158186
jsonObj.get("query").toString()));
159187
}
188+
if ((jsonObj.get("targetEntity") != null && !jsonObj.get("targetEntity").isJsonNull())
189+
&& !jsonObj.get("targetEntity").isJsonPrimitive()) {
190+
throw new IllegalArgumentException(
191+
String.format(
192+
"Expected the field `targetEntity` to be a primitive type in the JSON"
193+
+ " string but got `%s`",
194+
jsonObj.get("targetEntity").toString()));
195+
}
160196
}
161197

162198
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

0 commit comments

Comments
 (0)