Skip to content

Commit bb38044

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@e02d1311.
1 parent 4469e2b commit bb38044

File tree

6 files changed

+493
-25
lines changed

6 files changed

+493
-25
lines changed

docs/AudiencesApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ public class Example {
637637
638638
Remove Audience from Space
639639

640-
Deletes an Audience by id and 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. • When called, this endpoint may generate the `Audience Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 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.
640+
Deletes an Audience by id and 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. • When called, this endpoint may generate the `Audience Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 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.
641641

642642
### Example
643643

@@ -694,7 +694,7 @@ public class Example {
694694
### HTTP request headers
695695

696696
- **Content-Type**: Not defined
697-
- **Accept**: application/vnd.segment.v1alpha+json, application/json
697+
- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json
698698

699699

700700
### HTTP response details

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,9 +1373,15 @@ private static Class getClassByDiscriminator(
13731373
gsonBuilder.registerTypeAdapterFactory(
13741374
new com.segment.publicapi.models.RemoveAudienceFromSpace200Response
13751375
.CustomTypeAdapterFactory());
1376+
gsonBuilder.registerTypeAdapterFactory(
1377+
new com.segment.publicapi.models.RemoveAudienceFromSpace200Response1
1378+
.CustomTypeAdapterFactory());
13761379
gsonBuilder.registerTypeAdapterFactory(
13771380
new com.segment.publicapi.models.RemoveAudienceFromSpaceAlphaOutput
13781381
.CustomTypeAdapterFactory());
1382+
gsonBuilder.registerTypeAdapterFactory(
1383+
new com.segment.publicapi.models.RemoveAudienceFromSpaceBetaOutput
1384+
.CustomTypeAdapterFactory());
13791385
gsonBuilder.registerTypeAdapterFactory(
13801386
new com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response
13811387
.CustomTypeAdapterFactory());

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,9 @@ public okhttp3.Call removeAudienceFromSpaceCall(
18871887
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
18881888

18891889
final String[] localVarAccepts = {
1890-
"application/vnd.segment.v1alpha+json", "application/json"
1890+
"application/vnd.segment.v1beta+json",
1891+
"application/vnd.segment.v1alpha+json",
1892+
"application/json"
18911893
};
18921894
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
18931895
if (localVarAccept != null) {
@@ -1938,14 +1940,14 @@ private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall(
19381940

19391941
/**
19401942
* Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in
1941-
* **Alpha** testing. Please submit any feedback by sending an email to [email protected]. •
1942-
* In order to successfully call this endpoint, the specified Workspace needs to have the
1943-
* Audience feature enabled. Please reach out to your customer success manager for more
1944-
* information. • When called, this endpoint may generate the &#x60;Audience Deleted&#x60; event
1945-
* in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per
1946-
* minute, which is lower than the default due to access pattern restrictions. Once reached,
1947-
* this endpoint will respond with the 429 HTTP status code with headers indicating the limit
1948-
* parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1943+
* **Beta** testing. Please submit any feedback by sending an email to [email protected]. • In
1944+
* order to successfully call this endpoint, the specified Workspace needs to have the Audience
1945+
* feature enabled. Please reach out to your customer success manager for more information. •
1946+
* When called, this endpoint may generate the &#x60;Audience Deleted&#x60; event in the [audit
1947+
* trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which
1948+
* is lower than the default due to access pattern restrictions. Once reached, this endpoint
1949+
* will respond with the 429 HTTP status code with headers indicating the limit parameters. See
1950+
* [Rate Limiting](/#tag/Rate-Limits) for more information.
19491951
*
19501952
* @param spaceId (required)
19511953
* @param id (required)
@@ -1970,14 +1972,14 @@ public RemoveAudienceFromSpace200Response removeAudienceFromSpace(String spaceId
19701972

19711973
/**
19721974
* Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in
1973-
* **Alpha** testing. Please submit any feedback by sending an email to [email protected]. •
1974-
* In order to successfully call this endpoint, the specified Workspace needs to have the
1975-
* Audience feature enabled. Please reach out to your customer success manager for more
1976-
* information. • When called, this endpoint may generate the &#x60;Audience Deleted&#x60; event
1977-
* in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per
1978-
* minute, which is lower than the default due to access pattern restrictions. Once reached,
1979-
* this endpoint will respond with the 429 HTTP status code with headers indicating the limit
1980-
* parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1975+
* **Beta** testing. Please submit any feedback by sending an email to [email protected]. • In
1976+
* order to successfully call this endpoint, the specified Workspace needs to have the Audience
1977+
* feature enabled. Please reach out to your customer success manager for more information. •
1978+
* When called, this endpoint may generate the &#x60;Audience Deleted&#x60; event in the [audit
1979+
* trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which
1980+
* is lower than the default due to access pattern restrictions. Once reached, this endpoint
1981+
* will respond with the 429 HTTP status code with headers indicating the limit parameters. See
1982+
* [Rate Limiting](/#tag/Rate-Limits) for more information.
19811983
*
19821984
* @param spaceId (required)
19831985
* @param id (required)
@@ -2002,7 +2004,7 @@ public ApiResponse<RemoveAudienceFromSpace200Response> removeAudienceFromSpaceWi
20022004

20032005
/**
20042006
* Remove Audience from Space (asynchronously) Deletes an Audience by id and spaceId. • This
2005-
* endpoint is in **Alpha** testing. Please submit any feedback by sending an email to
2007+
* endpoint is in **Beta** testing. Please submit any feedback by sending an email to
20062008
* [email protected]. • In order to successfully call this endpoint, the specified Workspace
20072009
* needs to have the Audience feature enabled. Please reach out to your customer success manager
20082010
* for more information. • When called, this endpoint may generate the &#x60;Audience

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public class RemoveAudienceFromSpace200Response {
3232
public static final String SERIALIZED_NAME_DATA = "data";
3333

3434
@SerializedName(SERIALIZED_NAME_DATA)
35-
private RemoveAudienceFromSpaceAlphaOutput data;
35+
private RemoveAudienceFromSpaceBetaOutput data;
3636

3737
public RemoveAudienceFromSpace200Response() {}
3838

39-
public RemoveAudienceFromSpace200Response data(RemoveAudienceFromSpaceAlphaOutput data) {
39+
public RemoveAudienceFromSpace200Response data(RemoveAudienceFromSpaceBetaOutput data) {
4040

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

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

@@ -140,7 +140,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
140140
JsonObject jsonObj = jsonElement.getAsJsonObject();
141141
// validate the optional field `data`
142142
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
143-
RemoveAudienceFromSpaceAlphaOutput.validateJsonElement(jsonObj.get("data"));
143+
RemoveAudienceFromSpaceBetaOutput.validateJsonElement(jsonObj.get("data"));
144144
}
145145
}
146146

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
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+
/** RemoveAudienceFromSpace200Response1 */
31+
public class RemoveAudienceFromSpace200Response1 {
32+
public static final String SERIALIZED_NAME_DATA = "data";
33+
34+
@SerializedName(SERIALIZED_NAME_DATA)
35+
private RemoveAudienceFromSpaceAlphaOutput data;
36+
37+
public RemoveAudienceFromSpace200Response1() {}
38+
39+
public RemoveAudienceFromSpace200Response1 data(RemoveAudienceFromSpaceAlphaOutput 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 RemoveAudienceFromSpaceAlphaOutput getData() {
52+
return data;
53+
}
54+
55+
public void setData(RemoveAudienceFromSpaceAlphaOutput 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+
RemoveAudienceFromSpace200Response1 removeAudienceFromSpace200Response1 =
68+
(RemoveAudienceFromSpace200Response1) o;
69+
return Objects.equals(this.data, removeAudienceFromSpace200Response1.data);
70+
}
71+
72+
@Override
73+
public int hashCode() {
74+
return Objects.hash(data);
75+
}
76+
77+
@Override
78+
public String toString() {
79+
StringBuilder sb = new StringBuilder();
80+
sb.append("class RemoveAudienceFromSpace200Response1 {\n");
81+
sb.append(" data: ").append(toIndentedString(data)).append("\n");
82+
sb.append("}");
83+
return sb.toString();
84+
}
85+
86+
/**
87+
* Convert the given object to string with each line indented by 4 spaces (except the first
88+
* line).
89+
*/
90+
private String toIndentedString(Object o) {
91+
if (o == null) {
92+
return "null";
93+
}
94+
return o.toString().replace("\n", "\n ");
95+
}
96+
97+
public static HashSet<String> openapiFields;
98+
public static HashSet<String> openapiRequiredFields;
99+
100+
static {
101+
// a set of all properties/fields (JSON key names)
102+
openapiFields = new HashSet<String>();
103+
openapiFields.add("data");
104+
105+
// a set of required properties/fields (JSON key names)
106+
openapiRequiredFields = new HashSet<String>();
107+
}
108+
109+
/**
110+
* Validates the JSON Element and throws an exception if issues found
111+
*
112+
* @param jsonElement JSON Element
113+
* @throws IOException if the JSON Element is invalid with respect to
114+
* RemoveAudienceFromSpace200Response1
115+
*/
116+
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
117+
if (jsonElement == null) {
118+
if (!RemoveAudienceFromSpace200Response1.openapiRequiredFields
119+
.isEmpty()) { // has required fields but JSON element is null
120+
throw new IllegalArgumentException(
121+
String.format(
122+
"The required field(s) %s in RemoveAudienceFromSpace200Response1 is"
123+
+ " not found in the empty JSON string",
124+
RemoveAudienceFromSpace200Response1.openapiRequiredFields
125+
.toString()));
126+
}
127+
}
128+
129+
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
130+
// check to see if the JSON string contains additional fields
131+
for (Map.Entry<String, JsonElement> entry : entries) {
132+
if (!RemoveAudienceFromSpace200Response1.openapiFields.contains(entry.getKey())) {
133+
throw new IllegalArgumentException(
134+
String.format(
135+
"The field `%s` in the JSON string is not defined in the"
136+
+ " `RemoveAudienceFromSpace200Response1` properties. JSON: %s",
137+
entry.getKey(), jsonElement.toString()));
138+
}
139+
}
140+
JsonObject jsonObj = jsonElement.getAsJsonObject();
141+
// validate the optional field `data`
142+
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
143+
RemoveAudienceFromSpaceAlphaOutput.validateJsonElement(jsonObj.get("data"));
144+
}
145+
}
146+
147+
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
148+
@SuppressWarnings("unchecked")
149+
@Override
150+
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
151+
if (!RemoveAudienceFromSpace200Response1.class.isAssignableFrom(type.getRawType())) {
152+
return null; // this class only serializes 'RemoveAudienceFromSpace200Response1' and
153+
// its subtypes
154+
}
155+
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
156+
final TypeAdapter<RemoveAudienceFromSpace200Response1> thisAdapter =
157+
gson.getDelegateAdapter(
158+
this, TypeToken.get(RemoveAudienceFromSpace200Response1.class));
159+
160+
return (TypeAdapter<T>)
161+
new TypeAdapter<RemoveAudienceFromSpace200Response1>() {
162+
@Override
163+
public void write(JsonWriter out, RemoveAudienceFromSpace200Response1 value)
164+
throws IOException {
165+
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
166+
elementAdapter.write(out, obj);
167+
}
168+
169+
@Override
170+
public RemoveAudienceFromSpace200Response1 read(JsonReader in)
171+
throws IOException {
172+
JsonElement jsonElement = elementAdapter.read(in);
173+
validateJsonElement(jsonElement);
174+
return thisAdapter.fromJsonTree(jsonElement);
175+
}
176+
}.nullSafe();
177+
}
178+
}
179+
180+
/**
181+
* Create an instance of RemoveAudienceFromSpace200Response1 given an JSON string
182+
*
183+
* @param jsonString JSON string
184+
* @return An instance of RemoveAudienceFromSpace200Response1
185+
* @throws IOException if the JSON string is invalid with respect to
186+
* RemoveAudienceFromSpace200Response1
187+
*/
188+
public static RemoveAudienceFromSpace200Response1 fromJson(String jsonString)
189+
throws IOException {
190+
return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpace200Response1.class);
191+
}
192+
193+
/**
194+
* Convert an instance of RemoveAudienceFromSpace200Response1 to an JSON string
195+
*
196+
* @return JSON string
197+
*/
198+
public String toJson() {
199+
return JSON.getGson().toJson(this);
200+
}
201+
}

0 commit comments

Comments
 (0)