Skip to content

Commit e88040d

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@f0209419.
1 parent 3de8203 commit e88040d

10 files changed

+478
-18
lines changed

README.md

+4-4
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.1.1
13+
Latest API and SDK version: 58.2.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.1.1</version>
31+
<version>58.2.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.1.1"
47+
implementation "com.segment.publicapi:segment-publicapi:58.2.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.1.1.jar`
61+
* `target/segment-publicapi-58.2.0.jar`
6262
* `target/lib/*.jar`
6363

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

docs/AudiencesApi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public class Example {
250250
251251
List Audiences
252252

253-
Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
253+
Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to [email protected]. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
254254

255255
### Example
256256

@@ -307,7 +307,7 @@ public class Example {
307307
### HTTP request headers
308308

309309
- **Content-Type**: Not defined
310-
- **Accept**: application/vnd.segment.v1alpha+json, application/json
310+
- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json
311311

312312

313313
### HTTP response details

pom.xml

+1-1
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.1.1</version>
8+
<version>58.2.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

+1-1
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.1.1 (Java)");
126+
setUserAgent("Public API SDK 58.2.0 (Java)");
127127

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

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

+1-1
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.1.1";
15+
public static final String VERSION = "58.2.0";
1616

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

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

+6
Original file line numberDiff line numberDiff line change
@@ -895,9 +895,15 @@ private static Class getClassByDiscriminator(
895895
gsonBuilder.registerTypeAdapterFactory(
896896
new com.segment.publicapi.models.ListAudiences200Response
897897
.CustomTypeAdapterFactory());
898+
gsonBuilder.registerTypeAdapterFactory(
899+
new com.segment.publicapi.models.ListAudiences200Response1
900+
.CustomTypeAdapterFactory());
898901
gsonBuilder.registerTypeAdapterFactory(
899902
new com.segment.publicapi.models.ListAudiencesAlphaOutput
900903
.CustomTypeAdapterFactory());
904+
gsonBuilder.registerTypeAdapterFactory(
905+
new com.segment.publicapi.models.ListAudiencesBetaOutput
906+
.CustomTypeAdapterFactory());
901907
gsonBuilder.registerTypeAdapterFactory(
902908
new com.segment.publicapi.models.ListAuditEvents200Response
903909
.CustomTypeAdapterFactory());

src/main/java/com/segment/publicapi/api/AudiencesApi.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,9 @@ public okhttp3.Call listAudiencesCall(
794794
}
795795

796796
final String[] localVarAccepts = {
797-
"application/vnd.segment.v1alpha+json", "application/json"
797+
"application/vnd.segment.v1beta+json",
798+
"application/vnd.segment.v1alpha+json",
799+
"application/json"
798800
};
799801
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
800802
if (localVarAccept != null) {
@@ -837,7 +839,7 @@ private okhttp3.Call listAudiencesValidateBeforeCall(
837839
}
838840

839841
/**
840-
* List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please
842+
* List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please
841843
* submit any feedback by sending an email to [email protected]. • In order to successfully
842844
* call this endpoint, the specified Workspace needs to have the Audience feature enabled.
843845
* Please reach out to your customer success manager for more information. The rate limit for
@@ -870,7 +872,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa
870872
}
871873

872874
/**
873-
* List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please
875+
* List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please
874876
* submit any feedback by sending an email to [email protected]. • In order to successfully
875877
* call this endpoint, the specified Workspace needs to have the Audience feature enabled.
876878
* Please reach out to your customer success manager for more information. The rate limit for
@@ -903,7 +905,7 @@ public ApiResponse<ListAudiences200Response> listAudiencesWithHttpInfo(
903905
}
904906

905907
/**
906-
* List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Alpha**
908+
* List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Beta**
907909
* testing. Please submit any feedback by sending an email to [email protected]. • In order to
908910
* successfully call this endpoint, the specified Workspace needs to have the Audience feature
909911
* enabled. Please reach out to your customer success manager for more information. The rate

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public class ListAudiences200Response {
3232
public static final String SERIALIZED_NAME_DATA = "data";
3333

3434
@SerializedName(SERIALIZED_NAME_DATA)
35-
private ListAudiencesAlphaOutput data;
35+
private ListAudiencesBetaOutput data;
3636

3737
public ListAudiences200Response() {}
3838

39-
public ListAudiences200Response data(ListAudiencesAlphaOutput data) {
39+
public ListAudiences200Response data(ListAudiencesBetaOutput data) {
4040

4141
this.data = data;
4242
return this;
@@ -48,11 +48,11 @@ public ListAudiences200Response data(ListAudiencesAlphaOutput data) {
4848
* @return data
4949
*/
5050
@javax.annotation.Nullable
51-
public ListAudiencesAlphaOutput getData() {
51+
public ListAudiencesBetaOutput getData() {
5252
return data;
5353
}
5454

55-
public void setData(ListAudiencesAlphaOutput data) {
55+
public void setData(ListAudiencesBetaOutput data) {
5656
this.data = data;
5757
}
5858

@@ -137,7 +137,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
137137
JsonObject jsonObj = jsonElement.getAsJsonObject();
138138
// validate the optional field `data`
139139
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
140-
ListAudiencesAlphaOutput.validateJsonElement(jsonObj.get("data"));
140+
ListAudiencesBetaOutput.validateJsonElement(jsonObj.get("data"));
141141
}
142142
}
143143

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
/*
2+
* Segment Public API
3+
* The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API.
4+
*
5+
* Contact: [email protected]
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
package com.segment.publicapi.models;
13+
14+
import com.google.gson.Gson;
15+
import com.google.gson.JsonElement;
16+
import com.google.gson.JsonObject;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.TypeAdapterFactory;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.reflect.TypeToken;
21+
import com.google.gson.stream.JsonReader;
22+
import com.google.gson.stream.JsonWriter;
23+
import com.segment.publicapi.JSON;
24+
import java.io.IOException;
25+
import java.util.HashSet;
26+
import java.util.Map;
27+
import java.util.Objects;
28+
import java.util.Set;
29+
30+
/** ListAudiences200Response1 */
31+
public class ListAudiences200Response1 {
32+
public static final String SERIALIZED_NAME_DATA = "data";
33+
34+
@SerializedName(SERIALIZED_NAME_DATA)
35+
private ListAudiencesAlphaOutput data;
36+
37+
public ListAudiences200Response1() {}
38+
39+
public ListAudiences200Response1 data(ListAudiencesAlphaOutput data) {
40+
41+
this.data = data;
42+
return this;
43+
}
44+
45+
/**
46+
* Get data
47+
*
48+
* @return data
49+
*/
50+
@javax.annotation.Nullable
51+
public ListAudiencesAlphaOutput getData() {
52+
return data;
53+
}
54+
55+
public void setData(ListAudiencesAlphaOutput data) {
56+
this.data = data;
57+
}
58+
59+
@Override
60+
public boolean equals(Object o) {
61+
if (this == o) {
62+
return true;
63+
}
64+
if (o == null || getClass() != o.getClass()) {
65+
return false;
66+
}
67+
ListAudiences200Response1 listAudiences200Response1 = (ListAudiences200Response1) o;
68+
return Objects.equals(this.data, listAudiences200Response1.data);
69+
}
70+
71+
@Override
72+
public int hashCode() {
73+
return Objects.hash(data);
74+
}
75+
76+
@Override
77+
public String toString() {
78+
StringBuilder sb = new StringBuilder();
79+
sb.append("class ListAudiences200Response1 {\n");
80+
sb.append(" data: ").append(toIndentedString(data)).append("\n");
81+
sb.append("}");
82+
return sb.toString();
83+
}
84+
85+
/**
86+
* Convert the given object to string with each line indented by 4 spaces (except the first
87+
* line).
88+
*/
89+
private String toIndentedString(Object o) {
90+
if (o == null) {
91+
return "null";
92+
}
93+
return o.toString().replace("\n", "\n ");
94+
}
95+
96+
public static HashSet<String> openapiFields;
97+
public static HashSet<String> openapiRequiredFields;
98+
99+
static {
100+
// a set of all properties/fields (JSON key names)
101+
openapiFields = new HashSet<String>();
102+
openapiFields.add("data");
103+
104+
// a set of required properties/fields (JSON key names)
105+
openapiRequiredFields = new HashSet<String>();
106+
}
107+
108+
/**
109+
* Validates the JSON Element and throws an exception if issues found
110+
*
111+
* @param jsonElement JSON Element
112+
* @throws IOException if the JSON Element is invalid with respect to ListAudiences200Response1
113+
*/
114+
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
115+
if (jsonElement == null) {
116+
if (!ListAudiences200Response1.openapiRequiredFields
117+
.isEmpty()) { // has required fields but JSON element is null
118+
throw new IllegalArgumentException(
119+
String.format(
120+
"The required field(s) %s in ListAudiences200Response1 is not found"
121+
+ " in the empty JSON string",
122+
ListAudiences200Response1.openapiRequiredFields.toString()));
123+
}
124+
}
125+
126+
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
127+
// check to see if the JSON string contains additional fields
128+
for (Map.Entry<String, JsonElement> entry : entries) {
129+
if (!ListAudiences200Response1.openapiFields.contains(entry.getKey())) {
130+
throw new IllegalArgumentException(
131+
String.format(
132+
"The field `%s` in the JSON string is not defined in the"
133+
+ " `ListAudiences200Response1` properties. JSON: %s",
134+
entry.getKey(), jsonElement.toString()));
135+
}
136+
}
137+
JsonObject jsonObj = jsonElement.getAsJsonObject();
138+
// validate the optional field `data`
139+
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
140+
ListAudiencesAlphaOutput.validateJsonElement(jsonObj.get("data"));
141+
}
142+
}
143+
144+
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
145+
@SuppressWarnings("unchecked")
146+
@Override
147+
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
148+
if (!ListAudiences200Response1.class.isAssignableFrom(type.getRawType())) {
149+
return null; // this class only serializes 'ListAudiences200Response1' and its
150+
// subtypes
151+
}
152+
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
153+
final TypeAdapter<ListAudiences200Response1> thisAdapter =
154+
gson.getDelegateAdapter(this, TypeToken.get(ListAudiences200Response1.class));
155+
156+
return (TypeAdapter<T>)
157+
new TypeAdapter<ListAudiences200Response1>() {
158+
@Override
159+
public void write(JsonWriter out, ListAudiences200Response1 value)
160+
throws IOException {
161+
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
162+
elementAdapter.write(out, obj);
163+
}
164+
165+
@Override
166+
public ListAudiences200Response1 read(JsonReader in) throws IOException {
167+
JsonElement jsonElement = elementAdapter.read(in);
168+
validateJsonElement(jsonElement);
169+
return thisAdapter.fromJsonTree(jsonElement);
170+
}
171+
}.nullSafe();
172+
}
173+
}
174+
175+
/**
176+
* Create an instance of ListAudiences200Response1 given an JSON string
177+
*
178+
* @param jsonString JSON string
179+
* @return An instance of ListAudiences200Response1
180+
* @throws IOException if the JSON string is invalid with respect to ListAudiences200Response1
181+
*/
182+
public static ListAudiences200Response1 fromJson(String jsonString) throws IOException {
183+
return JSON.getGson().fromJson(jsonString, ListAudiences200Response1.class);
184+
}
185+
186+
/**
187+
* Convert an instance of ListAudiences200Response1 to an JSON string
188+
*
189+
* @return JSON string
190+
*/
191+
public String toJson() {
192+
return JSON.getGson().toJson(this);
193+
}
194+
}

0 commit comments

Comments
 (0)