Skip to content

Commit bf4872d

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@21dc9641.
1 parent f5fe0d4 commit bf4872d

12 files changed

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

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

docs/AudiencesApi.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All URIs are relative to *https://api.segmentapis.com*
88
| [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience |
99
| [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience |
1010
| [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences |
11+
| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience |
1112
| [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space |
1213
| [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space |
1314

@@ -319,6 +320,81 @@ public class Example {
319320
| **429** | Too many requests | - |
320321

321322

323+
## Operation: previewAudience
324+
325+
> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput)
326+
327+
Preview Audience
328+
329+
Previews Audience. • 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 &#x60;Audience Preview Created&#x60; event in the [audit trail](/tag/Audit-Trail).
330+
331+
### Example
332+
333+
```java
334+
// Import classes:
335+
import com.segment.publicapi.ApiClient;
336+
import com.segment.publicapi.ApiException;
337+
import com.segment.publicapi.Configuration;
338+
import com.segment.publicapi.auth.*;
339+
import com.segment.publicapi.models.*;
340+
import com.segment.publicapi.api.AudiencesApi;
341+
342+
public class Example {
343+
public static void main(String[] args) {
344+
ApiClient defaultClient = Configuration.getDefaultApiClient();
345+
346+
// Configure HTTP bearer authorization: token
347+
HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token");
348+
token.setBearerToken("BEARER TOKEN");
349+
350+
AudiencesApi apiInstance = new AudiencesApi(defaultClient);
351+
String spaceId = "spaceId"; // String |
352+
PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput |
353+
try {
354+
PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput);
355+
System.out.println(result);
356+
} catch (ApiException e) {
357+
System.err.println("Exception when calling AudiencesApi#previewAudience");
358+
System.err.println("Status code: " + e.getCode());
359+
System.err.println("Reason: " + e.getResponseBody());
360+
System.err.println("Response headers: " + e.getResponseHeaders());
361+
e.printStackTrace();
362+
}
363+
}
364+
}
365+
```
366+
367+
### Parameters
368+
369+
370+
| Name | Type | Description | Notes |
371+
|------------- | ------------- | ------------- | -------------|
372+
| **spaceId** | **String**| | |
373+
| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | |
374+
375+
### Return type
376+
377+
[**PreviewAudience200Response**](PreviewAudience200Response.md)
378+
379+
### Authorization
380+
381+
[token](../README.md#token)
382+
383+
### HTTP request headers
384+
385+
- **Content-Type**: application/vnd.segment.v1alpha+json
386+
- **Accept**: application/vnd.segment.v1alpha+json, application/json
387+
388+
389+
### HTTP response details
390+
| Status code | Description | Response headers |
391+
|-------------|-------------|------------------|
392+
| **200** | OK | - |
393+
| **404** | Resource not found | - |
394+
| **422** | Validation failure | - |
395+
| **429** | Too many requests | - |
396+
397+
322398
## Operation: removeAudienceFromSpace
323399

324400
> RemoveAudienceFromSpace200Response removeAudienceFromSpace(spaceId, id)

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.3.0</version>
8+
<version>58.4.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.3.0 (Java)");
126+
setUserAgent("Public API SDK 58.4.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.3.0";
15+
public static final String VERSION = "58.4.0";
1616

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

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ private static Class getClassByDiscriminator(
167167
new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory());
168168
gsonBuilder.registerTypeAdapterFactory(
169169
new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory());
170+
gsonBuilder.registerTypeAdapterFactory(
171+
new com.segment.publicapi.models.AudienceDefinitionWithoutType
172+
.CustomTypeAdapterFactory());
170173
gsonBuilder.registerTypeAdapterFactory(
171174
new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory());
172175
gsonBuilder.registerTypeAdapterFactory(
@@ -1193,6 +1196,15 @@ private static Class getClassByDiscriminator(
11931196
new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory());
11941197
gsonBuilder.registerTypeAdapterFactory(
11951198
new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory());
1199+
gsonBuilder.registerTypeAdapterFactory(
1200+
new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory());
1201+
gsonBuilder.registerTypeAdapterFactory(
1202+
new com.segment.publicapi.models.PreviewAudience200Response
1203+
.CustomTypeAdapterFactory());
1204+
gsonBuilder.registerTypeAdapterFactory(
1205+
new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory());
1206+
gsonBuilder.registerTypeAdapterFactory(
1207+
new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory());
11961208
gsonBuilder.registerTypeAdapterFactory(
11971209
new com.segment.publicapi.models.PreviewDestinationFilter200Response
11981210
.CustomTypeAdapterFactory());

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

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import com.segment.publicapi.models.ListAudiences200Response;
2828
import com.segment.publicapi.models.ListAudiencesPaginationInput;
2929
import com.segment.publicapi.models.PaginationInput;
30+
import com.segment.publicapi.models.PreviewAudience200Response;
31+
import com.segment.publicapi.models.PreviewAudienceInput;
3032
import com.segment.publicapi.models.RemoveAudienceFromSpace200Response;
3133
import com.segment.publicapi.models.UpdateAudienceForSpace200Response;
3234
import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput;
@@ -944,6 +946,199 @@ public okhttp3.Call listAudiencesAsync(
944946
return localVarCall;
945947
}
946948

949+
/**
950+
* Build call for previewAudience
951+
*
952+
* @param spaceId (required)
953+
* @param previewAudienceInput (required)
954+
* @param _callback Callback for upload/download progress
955+
* @return Call to execute
956+
* @throws ApiException If fail to serialize the request body object
957+
* @http.response.details
958+
* <table summary="Response Details" border="1">
959+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
960+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
961+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
962+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
963+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
964+
* </table>
965+
*/
966+
public okhttp3.Call previewAudienceCall(
967+
String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback)
968+
throws ApiException {
969+
String basePath = null;
970+
// Operation Servers
971+
String[] localBasePaths = new String[] {};
972+
973+
// Determine Base Path to Use
974+
if (localCustomBaseUrl != null) {
975+
basePath = localCustomBaseUrl;
976+
} else if (localBasePaths.length > 0) {
977+
basePath = localBasePaths[localHostIndex];
978+
} else {
979+
basePath = null;
980+
}
981+
982+
Object localVarPostBody = previewAudienceInput;
983+
984+
// create path and map variables
985+
String localVarPath =
986+
"/spaces/{spaceId}/audiences/previews"
987+
.replace(
988+
"{" + "spaceId" + "}",
989+
localVarApiClient.escapeString(spaceId.toString()));
990+
991+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
992+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
993+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
994+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
995+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
996+
997+
final String[] localVarAccepts = {
998+
"application/vnd.segment.v1alpha+json", "application/json"
999+
};
1000+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
1001+
if (localVarAccept != null) {
1002+
localVarHeaderParams.put("Accept", localVarAccept);
1003+
}
1004+
1005+
final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"};
1006+
final String localVarContentType =
1007+
localVarApiClient.selectHeaderContentType(localVarContentTypes);
1008+
if (localVarContentType != null) {
1009+
localVarHeaderParams.put("Content-Type", localVarContentType);
1010+
}
1011+
1012+
String[] localVarAuthNames = new String[] {"token"};
1013+
return localVarApiClient.buildCall(
1014+
basePath,
1015+
localVarPath,
1016+
"POST",
1017+
localVarQueryParams,
1018+
localVarCollectionQueryParams,
1019+
localVarPostBody,
1020+
localVarHeaderParams,
1021+
localVarCookieParams,
1022+
localVarFormParams,
1023+
localVarAuthNames,
1024+
_callback);
1025+
}
1026+
1027+
@SuppressWarnings("rawtypes")
1028+
private okhttp3.Call previewAudienceValidateBeforeCall(
1029+
String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback)
1030+
throws ApiException {
1031+
// verify the required parameter 'spaceId' is set
1032+
if (spaceId == null) {
1033+
throw new ApiException(
1034+
"Missing the required parameter 'spaceId' when calling previewAudience(Async)");
1035+
}
1036+
1037+
// verify the required parameter 'previewAudienceInput' is set
1038+
if (previewAudienceInput == null) {
1039+
throw new ApiException(
1040+
"Missing the required parameter 'previewAudienceInput' when calling"
1041+
+ " previewAudience(Async)");
1042+
}
1043+
1044+
return previewAudienceCall(spaceId, previewAudienceInput, _callback);
1045+
}
1046+
1047+
/**
1048+
* Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit
1049+
* any feedback by sending an email to [email protected]. • In order to successfully call this
1050+
* endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach
1051+
* out to your customer success manager for more information. • When called, this endpoint may
1052+
* generate the &#x60;Audience Preview Created&#x60; event in the [audit
1053+
* trail](/tag/Audit-Trail).
1054+
*
1055+
* @param spaceId (required)
1056+
* @param previewAudienceInput (required)
1057+
* @return PreviewAudience200Response
1058+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
1059+
* response body
1060+
* @http.response.details
1061+
* <table summary="Response Details" border="1">
1062+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1063+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
1064+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
1065+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
1066+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1067+
* </table>
1068+
*/
1069+
public PreviewAudience200Response previewAudience(
1070+
String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException {
1071+
ApiResponse<PreviewAudience200Response> localVarResp =
1072+
previewAudienceWithHttpInfo(spaceId, previewAudienceInput);
1073+
return localVarResp.getData();
1074+
}
1075+
1076+
/**
1077+
* Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit
1078+
* any feedback by sending an email to [email protected]. • In order to successfully call this
1079+
* endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach
1080+
* out to your customer success manager for more information. • When called, this endpoint may
1081+
* generate the &#x60;Audience Preview Created&#x60; event in the [audit
1082+
* trail](/tag/Audit-Trail).
1083+
*
1084+
* @param spaceId (required)
1085+
* @param previewAudienceInput (required)
1086+
* @return ApiResponse&lt;PreviewAudience200Response&gt;
1087+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
1088+
* response body
1089+
* @http.response.details
1090+
* <table summary="Response Details" border="1">
1091+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1092+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
1093+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
1094+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
1095+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1096+
* </table>
1097+
*/
1098+
public ApiResponse<PreviewAudience200Response> previewAudienceWithHttpInfo(
1099+
String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException {
1100+
okhttp3.Call localVarCall =
1101+
previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null);
1102+
Type localVarReturnType = new TypeToken<PreviewAudience200Response>() {}.getType();
1103+
return localVarApiClient.execute(localVarCall, localVarReturnType);
1104+
}
1105+
1106+
/**
1107+
* Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing.
1108+
* Please submit any feedback by sending an email to [email protected]. • In order to
1109+
* successfully call this endpoint, the specified Workspace needs to have the Audience feature
1110+
* enabled. Please reach out to your customer success manager for more information. • When
1111+
* called, this endpoint may generate the &#x60;Audience Preview Created&#x60; event in the
1112+
* [audit trail](/tag/Audit-Trail).
1113+
*
1114+
* @param spaceId (required)
1115+
* @param previewAudienceInput (required)
1116+
* @param _callback The callback to be executed when the API call finishes
1117+
* @return The request call
1118+
* @throws ApiException If fail to process the API call, e.g. serializing the request body
1119+
* object
1120+
* @http.response.details
1121+
* <table summary="Response Details" border="1">
1122+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1123+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
1124+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
1125+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
1126+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1127+
* </table>
1128+
*/
1129+
public okhttp3.Call previewAudienceAsync(
1130+
String spaceId,
1131+
PreviewAudienceInput previewAudienceInput,
1132+
final ApiCallback<PreviewAudience200Response> _callback)
1133+
throws ApiException {
1134+
1135+
okhttp3.Call localVarCall =
1136+
previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback);
1137+
Type localVarReturnType = new TypeToken<PreviewAudience200Response>() {}.getType();
1138+
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
1139+
return localVarCall;
1140+
}
1141+
9471142
/**
9481143
* Build call for removeAudienceFromSpace
9491144
*

0 commit comments

Comments
 (0)