Skip to content

Commit e2ad9b0

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@8031567d.
1 parent b40a1b2 commit e2ad9b0

File tree

4 files changed

+302
-125
lines changed

4 files changed

+302
-125
lines changed

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

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
import com.google.gson.stream.JsonWriter;
2323
import com.segment.publicapi.JSON;
2424
import java.io.IOException;
25+
import java.math.BigDecimal;
26+
import java.util.ArrayList;
2527
import java.util.HashSet;
28+
import java.util.List;
2629
import java.util.Map;
2730
import java.util.Objects;
2831
import java.util.Set;
@@ -39,6 +42,16 @@ public class AudienceOptions {
3942
@SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS)
4043
private Boolean includeAnonymousUsers;
4144

45+
public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds";
46+
47+
@SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS)
48+
private List<String> filterByExternalIds;
49+
50+
public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays";
51+
52+
@SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS)
53+
private BigDecimal backfillEventDataDays;
54+
4255
public AudienceOptions() {}
4356

4457
public AudienceOptions includeHistoricalData(Boolean includeHistoricalData) {
@@ -84,6 +97,60 @@ public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) {
8497
this.includeAnonymousUsers = includeAnonymousUsers;
8598
}
8699

100+
public AudienceOptions filterByExternalIds(List<String> filterByExternalIds) {
101+
102+
this.filterByExternalIds = filterByExternalIds;
103+
return this;
104+
}
105+
106+
public AudienceOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) {
107+
if (this.filterByExternalIds == null) {
108+
this.filterByExternalIds = new ArrayList<>();
109+
}
110+
this.filterByExternalIds.add(filterByExternalIdsItem);
111+
return this;
112+
}
113+
114+
/**
115+
* The set of profile external identifiers being used to determine audience membership. Profiles
116+
* will only be considered for audience membership if the profile has at least one external id
117+
* whose key matches a value in this set.
118+
*
119+
* @return filterByExternalIds
120+
*/
121+
@javax.annotation.Nullable
122+
public List<String> getFilterByExternalIds() {
123+
return filterByExternalIds;
124+
}
125+
126+
public void setFilterByExternalIds(List<String> filterByExternalIds) {
127+
this.filterByExternalIds = filterByExternalIds;
128+
}
129+
130+
public AudienceOptions backfillEventDataDays(BigDecimal backfillEventDataDays) {
131+
132+
this.backfillEventDataDays = backfillEventDataDays;
133+
return this;
134+
}
135+
136+
/**
137+
* If specified, the value of this field indicates the number of days, specified from the date
138+
* the audience was created, that event data will be included from when determining audience
139+
* membership. If unspecified, defer to the value of &#x60;includeHistoricalData&#x60; to
140+
* determine whether historical data is either entirely included or entirely excluded when
141+
* determining audience membership.
142+
*
143+
* @return backfillEventDataDays
144+
*/
145+
@javax.annotation.Nullable
146+
public BigDecimal getBackfillEventDataDays() {
147+
return backfillEventDataDays;
148+
}
149+
150+
public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) {
151+
this.backfillEventDataDays = backfillEventDataDays;
152+
}
153+
87154
@Override
88155
public boolean equals(Object o) {
89156
if (this == o) {
@@ -94,13 +161,19 @@ public boolean equals(Object o) {
94161
}
95162
AudienceOptions audienceOptions = (AudienceOptions) o;
96163
return Objects.equals(this.includeHistoricalData, audienceOptions.includeHistoricalData)
164+
&& Objects.equals(this.includeAnonymousUsers, audienceOptions.includeAnonymousUsers)
165+
&& Objects.equals(this.filterByExternalIds, audienceOptions.filterByExternalIds)
97166
&& Objects.equals(
98-
this.includeAnonymousUsers, audienceOptions.includeAnonymousUsers);
167+
this.backfillEventDataDays, audienceOptions.backfillEventDataDays);
99168
}
100169

101170
@Override
102171
public int hashCode() {
103-
return Objects.hash(includeHistoricalData, includeAnonymousUsers);
172+
return Objects.hash(
173+
includeHistoricalData,
174+
includeAnonymousUsers,
175+
filterByExternalIds,
176+
backfillEventDataDays);
104177
}
105178

106179
@Override
@@ -113,6 +186,12 @@ public String toString() {
113186
sb.append(" includeAnonymousUsers: ")
114187
.append(toIndentedString(includeAnonymousUsers))
115188
.append("\n");
189+
sb.append(" filterByExternalIds: ")
190+
.append(toIndentedString(filterByExternalIds))
191+
.append("\n");
192+
sb.append(" backfillEventDataDays: ")
193+
.append(toIndentedString(backfillEventDataDays))
194+
.append("\n");
116195
sb.append("}");
117196
return sb.toString();
118197
}
@@ -136,6 +215,8 @@ private String toIndentedString(Object o) {
136215
openapiFields = new HashSet<String>();
137216
openapiFields.add("includeHistoricalData");
138217
openapiFields.add("includeAnonymousUsers");
218+
openapiFields.add("filterByExternalIds");
219+
openapiFields.add("backfillEventDataDays");
139220

140221
// a set of required properties/fields (JSON key names)
141222
openapiRequiredFields = new HashSet<String>();
@@ -171,6 +252,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
171252
}
172253
}
173254
JsonObject jsonObj = jsonElement.getAsJsonObject();
255+
// ensure the optional json data is an array if present
256+
if (jsonObj.get("filterByExternalIds") != null
257+
&& !jsonObj.get("filterByExternalIds").isJsonNull()
258+
&& !jsonObj.get("filterByExternalIds").isJsonArray()) {
259+
throw new IllegalArgumentException(
260+
String.format(
261+
"Expected the field `filterByExternalIds` to be an array in the JSON"
262+
+ " string but got `%s`",
263+
jsonObj.get("filterByExternalIds").toString()));
264+
}
174265
}
175266

176267
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

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

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ public class AudienceOptionsWithLookback {
3737
@SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS)
3838
private List<String> filterByExternalIds = new ArrayList<>();
3939

40-
public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays";
41-
42-
@SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS)
43-
private BigDecimal backfillEventDataDays;
44-
4540
public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData";
4641

4742
@SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA)
@@ -52,6 +47,11 @@ public class AudienceOptionsWithLookback {
5247
@SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS)
5348
private Boolean includeAnonymousUsers;
5449

50+
public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays";
51+
52+
@SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS)
53+
private BigDecimal backfillEventDataDays;
54+
5555
public AudienceOptionsWithLookback() {}
5656

5757
public AudienceOptionsWithLookback filterByExternalIds(List<String> filterByExternalIds) {
@@ -84,30 +84,6 @@ public void setFilterByExternalIds(List<String> filterByExternalIds) {
8484
this.filterByExternalIds = filterByExternalIds;
8585
}
8686

87-
public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) {
88-
89-
this.backfillEventDataDays = backfillEventDataDays;
90-
return this;
91-
}
92-
93-
/**
94-
* If specified, the value of this field indicates the number of days, specified from the date
95-
* the audience was created, that event data will be included from when determining audience
96-
* membership. If unspecified, defer to the value of &#x60;includeHistoricalData&#x60; to
97-
* determine whether historical data is either entirely included or entirely excluded when
98-
* determining audience membership.
99-
*
100-
* @return backfillEventDataDays
101-
*/
102-
@javax.annotation.Nullable
103-
public BigDecimal getBackfillEventDataDays() {
104-
return backfillEventDataDays;
105-
}
106-
107-
public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) {
108-
this.backfillEventDataDays = backfillEventDataDays;
109-
}
110-
11187
public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) {
11288

11389
this.includeHistoricalData = includeHistoricalData;
@@ -151,6 +127,30 @@ public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) {
151127
this.includeAnonymousUsers = includeAnonymousUsers;
152128
}
153129

130+
public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) {
131+
132+
this.backfillEventDataDays = backfillEventDataDays;
133+
return this;
134+
}
135+
136+
/**
137+
* If specified, the value of this field indicates the number of days, specified from the date
138+
* the audience was created, that event data will be included from when determining audience
139+
* membership. If unspecified, defer to the value of &#x60;includeHistoricalData&#x60; to
140+
* determine whether historical data is either entirely included or entirely excluded when
141+
* determining audience membership.
142+
*
143+
* @return backfillEventDataDays
144+
*/
145+
@javax.annotation.Nullable
146+
public BigDecimal getBackfillEventDataDays() {
147+
return backfillEventDataDays;
148+
}
149+
150+
public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) {
151+
this.backfillEventDataDays = backfillEventDataDays;
152+
}
153+
154154
@Override
155155
public boolean equals(Object o) {
156156
if (this == o) {
@@ -162,24 +162,24 @@ public boolean equals(Object o) {
162162
AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o;
163163
return Objects.equals(
164164
this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds)
165-
&& Objects.equals(
166-
this.backfillEventDataDays,
167-
audienceOptionsWithLookback.backfillEventDataDays)
168165
&& Objects.equals(
169166
this.includeHistoricalData,
170167
audienceOptionsWithLookback.includeHistoricalData)
171168
&& Objects.equals(
172169
this.includeAnonymousUsers,
173-
audienceOptionsWithLookback.includeAnonymousUsers);
170+
audienceOptionsWithLookback.includeAnonymousUsers)
171+
&& Objects.equals(
172+
this.backfillEventDataDays,
173+
audienceOptionsWithLookback.backfillEventDataDays);
174174
}
175175

176176
@Override
177177
public int hashCode() {
178178
return Objects.hash(
179179
filterByExternalIds,
180-
backfillEventDataDays,
181180
includeHistoricalData,
182-
includeAnonymousUsers);
181+
includeAnonymousUsers,
182+
backfillEventDataDays);
183183
}
184184

185185
@Override
@@ -189,15 +189,15 @@ public String toString() {
189189
sb.append(" filterByExternalIds: ")
190190
.append(toIndentedString(filterByExternalIds))
191191
.append("\n");
192-
sb.append(" backfillEventDataDays: ")
193-
.append(toIndentedString(backfillEventDataDays))
194-
.append("\n");
195192
sb.append(" includeHistoricalData: ")
196193
.append(toIndentedString(includeHistoricalData))
197194
.append("\n");
198195
sb.append(" includeAnonymousUsers: ")
199196
.append(toIndentedString(includeAnonymousUsers))
200197
.append("\n");
198+
sb.append(" backfillEventDataDays: ")
199+
.append(toIndentedString(backfillEventDataDays))
200+
.append("\n");
201201
sb.append("}");
202202
return sb.toString();
203203
}
@@ -220,9 +220,9 @@ private String toIndentedString(Object o) {
220220
// a set of all properties/fields (JSON key names)
221221
openapiFields = new HashSet<String>();
222222
openapiFields.add("filterByExternalIds");
223-
openapiFields.add("backfillEventDataDays");
224223
openapiFields.add("includeHistoricalData");
225224
openapiFields.add("includeAnonymousUsers");
225+
openapiFields.add("backfillEventDataDays");
226226

227227
// a set of required properties/fields (JSON key names)
228228
openapiRequiredFields = new HashSet<String>();

0 commit comments

Comments
 (0)