Skip to content

Commit fd8492f

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@32694df2.
1 parent b3a4ecc commit fd8492f

File tree

10 files changed

+908
-7
lines changed

10 files changed

+908
-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: 59.6.1
13+
Latest API and SDK version: 59.7.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>59.6.1</version>
31+
<version>59.7.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:59.6.1"
47+
implementation "com.segment.publicapi:segment-publicapi:59.7.0"
4848
}
4949
```
5050

@@ -58,7 +58,7 @@ mvn clean package
5858

5959
Then manually install the following JARs:
6060

61-
* `target/segment-publicapi-59.6.1.jar`
61+
* `target/segment-publicapi-59.7.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
@@ -7,6 +7,7 @@ All URIs are relative to *https://api.segmentapis.com*
77
| [**addAudienceScheduleToAudience**](AudiencesApi.md#addAudienceScheduleToAudience) | **POST** /spaces/{spaceId}/audiences/{id}/schedules | Add Audience Schedule to Audience |
88
| [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience |
99
| [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview |
10+
| [**forceExecuteAudienceRun**](AudiencesApi.md#forceExecuteAudienceRun) | **POST** /spaces/{spaceId}/audiences/{audienceId}/runs | Force Execute Audience Run |
1011
| [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience |
1112
| [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview |
1213
| [**getAudienceScheduleFromSpaceAndAudience**](AudiencesApi.md#getAudienceScheduleFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules/{scheduleId} | Get Audience Schedule from Space And Audience |
@@ -246,6 +247,81 @@ public class Example {
246247
| **429** | Too many requests | - |
247248

248249

250+
## Operation: forceExecuteAudienceRun
251+
252+
> ForceExecuteAudienceRun200Response forceExecuteAudienceRun(spaceId, audienceId)
253+
254+
Force Execute Audience Run
255+
256+
The ability to force execute a run for an Audience is limited to Linked Audiences (audienceType &#x3D; &#x60;LINKED&#x60;). • 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 Run Forced&#x60; event in the [audit trail](/tag/Audit-Trail).
257+
258+
### Example
259+
260+
```java
261+
// Import classes:
262+
import com.segment.publicapi.ApiClient;
263+
import com.segment.publicapi.ApiException;
264+
import com.segment.publicapi.Configuration;
265+
import com.segment.publicapi.auth.*;
266+
import com.segment.publicapi.models.*;
267+
import com.segment.publicapi.api.AudiencesApi;
268+
269+
public class Example {
270+
public static void main(String[] args) {
271+
ApiClient defaultClient = Configuration.getDefaultApiClient();
272+
273+
// Configure HTTP bearer authorization: token
274+
HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token");
275+
token.setBearerToken("BEARER TOKEN");
276+
277+
AudiencesApi apiInstance = new AudiencesApi(defaultClient);
278+
String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String |
279+
String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String |
280+
try {
281+
ForceExecuteAudienceRun200Response result = apiInstance.forceExecuteAudienceRun(spaceId, audienceId);
282+
System.out.println(result);
283+
} catch (ApiException e) {
284+
System.err.println("Exception when calling AudiencesApi#forceExecuteAudienceRun");
285+
System.err.println("Status code: " + e.getCode());
286+
System.err.println("Reason: " + e.getResponseBody());
287+
System.err.println("Response headers: " + e.getResponseHeaders());
288+
e.printStackTrace();
289+
}
290+
}
291+
}
292+
```
293+
294+
### Parameters
295+
296+
297+
| Name | Type | Description | Notes |
298+
|------------- | ------------- | ------------- | -------------|
299+
| **spaceId** | **String**| | |
300+
| **audienceId** | **String**| | |
301+
302+
### Return type
303+
304+
[**ForceExecuteAudienceRun200Response**](ForceExecuteAudienceRun200Response.md)
305+
306+
### Authorization
307+
308+
[token](../README.md#token)
309+
310+
### HTTP request headers
311+
312+
- **Content-Type**: Not defined
313+
- **Accept**: application/vnd.segment.v1alpha+json, application/json
314+
315+
316+
### HTTP response details
317+
| Status code | Description | Response headers |
318+
|-------------|-------------|------------------|
319+
| **200** | OK | - |
320+
| **404** | Resource not found | - |
321+
| **422** | Validation failure | - |
322+
| **429** | Too many requests | - |
323+
324+
249325
## Operation: getAudience
250326

251327
> GetAudience200Response getAudience(spaceId, id, include)

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

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

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ private static Class getClassByDiscriminator(
220220
.CustomTypeAdapterFactory());
221221
gsonBuilder.registerTypeAdapterFactory(
222222
new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory());
223+
gsonBuilder.registerTypeAdapterFactory(
224+
new com.segment.publicapi.models.AudienceRunInfo.CustomTypeAdapterFactory());
223225
gsonBuilder.registerTypeAdapterFactory(
224226
new com.segment.publicapi.models.AudienceSchedule.CustomTypeAdapterFactory());
225227
gsonBuilder.registerTypeAdapterFactory(
@@ -721,6 +723,12 @@ private static Class getClassByDiscriminator(
721723
new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory());
722724
gsonBuilder.registerTypeAdapterFactory(
723725
new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory());
726+
gsonBuilder.registerTypeAdapterFactory(
727+
new com.segment.publicapi.models.ForceExecuteAudienceRun200Response
728+
.CustomTypeAdapterFactory());
729+
gsonBuilder.registerTypeAdapterFactory(
730+
new com.segment.publicapi.models.ForceExecuteAudienceRunAlphaOutput
731+
.CustomTypeAdapterFactory());
724732
gsonBuilder.registerTypeAdapterFactory(
725733
new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory());
726734
gsonBuilder.registerTypeAdapterFactory(

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

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.segment.publicapi.models.CreateAudienceBetaInput;
2525
import com.segment.publicapi.models.CreateAudiencePreview200Response;
2626
import com.segment.publicapi.models.CreateAudiencePreviewBetaInput;
27+
import com.segment.publicapi.models.ForceExecuteAudienceRun200Response;
2728
import com.segment.publicapi.models.GetAudience200Response;
2829
import com.segment.publicapi.models.GetAudiencePreview200Response;
2930
import com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response;
@@ -740,6 +741,204 @@ public okhttp3.Call createAudiencePreviewAsync(
740741
return localVarCall;
741742
}
742743

744+
/**
745+
* Build call for forceExecuteAudienceRun
746+
*
747+
* @param spaceId (required)
748+
* @param audienceId (required)
749+
* @param _callback Callback for upload/download progress
750+
* @return Call to execute
751+
* @throws ApiException If fail to serialize the request body object
752+
* @http.response.details
753+
* <table summary="Response Details" border="1">
754+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
755+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
756+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
757+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
758+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
759+
* </table>
760+
*/
761+
public okhttp3.Call forceExecuteAudienceRunCall(
762+
String spaceId, String audienceId, final ApiCallback _callback) throws ApiException {
763+
String basePath = null;
764+
// Operation Servers
765+
String[] localBasePaths = new String[] {};
766+
767+
// Determine Base Path to Use
768+
if (localCustomBaseUrl != null) {
769+
basePath = localCustomBaseUrl;
770+
} else if (localBasePaths.length > 0) {
771+
basePath = localBasePaths[localHostIndex];
772+
} else {
773+
basePath = null;
774+
}
775+
776+
Object localVarPostBody = null;
777+
778+
// create path and map variables
779+
String localVarPath =
780+
"/spaces/{spaceId}/audiences/{audienceId}/runs"
781+
.replace(
782+
"{" + "spaceId" + "}",
783+
localVarApiClient.escapeString(spaceId.toString()))
784+
.replace(
785+
"{" + "audienceId" + "}",
786+
localVarApiClient.escapeString(audienceId.toString()));
787+
788+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
789+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
790+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
791+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
792+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
793+
794+
final String[] localVarAccepts = {
795+
"application/vnd.segment.v1alpha+json", "application/json"
796+
};
797+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
798+
if (localVarAccept != null) {
799+
localVarHeaderParams.put("Accept", localVarAccept);
800+
}
801+
802+
final String[] localVarContentTypes = {};
803+
final String localVarContentType =
804+
localVarApiClient.selectHeaderContentType(localVarContentTypes);
805+
if (localVarContentType != null) {
806+
localVarHeaderParams.put("Content-Type", localVarContentType);
807+
}
808+
809+
String[] localVarAuthNames = new String[] {"token"};
810+
return localVarApiClient.buildCall(
811+
basePath,
812+
localVarPath,
813+
"POST",
814+
localVarQueryParams,
815+
localVarCollectionQueryParams,
816+
localVarPostBody,
817+
localVarHeaderParams,
818+
localVarCookieParams,
819+
localVarFormParams,
820+
localVarAuthNames,
821+
_callback);
822+
}
823+
824+
@SuppressWarnings("rawtypes")
825+
private okhttp3.Call forceExecuteAudienceRunValidateBeforeCall(
826+
String spaceId, String audienceId, final ApiCallback _callback) throws ApiException {
827+
// verify the required parameter 'spaceId' is set
828+
if (spaceId == null) {
829+
throw new ApiException(
830+
"Missing the required parameter 'spaceId' when calling"
831+
+ " forceExecuteAudienceRun(Async)");
832+
}
833+
834+
// verify the required parameter 'audienceId' is set
835+
if (audienceId == null) {
836+
throw new ApiException(
837+
"Missing the required parameter 'audienceId' when calling"
838+
+ " forceExecuteAudienceRun(Async)");
839+
}
840+
841+
return forceExecuteAudienceRunCall(spaceId, audienceId, _callback);
842+
}
843+
844+
/**
845+
* Force Execute Audience Run The ability to force execute a run for an Audience is limited to
846+
* Linked Audiences (audienceType &#x3D; &#x60;LINKED&#x60;). • This endpoint is in **Alpha**
847+
* testing. Please submit any feedback by sending an email to [email protected]. • In order to
848+
* successfully call this endpoint, the specified Workspace needs to have the Audience feature
849+
* enabled. Please reach out to your customer success manager for more information. • When
850+
* called, this endpoint may generate the &#x60;Audience Run Forced&#x60; event in the [audit
851+
* trail](/tag/Audit-Trail).
852+
*
853+
* @param spaceId (required)
854+
* @param audienceId (required)
855+
* @return ForceExecuteAudienceRun200Response
856+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
857+
* response body
858+
* @http.response.details
859+
* <table summary="Response Details" border="1">
860+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
861+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
862+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
863+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
864+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
865+
* </table>
866+
*/
867+
public ForceExecuteAudienceRun200Response forceExecuteAudienceRun(
868+
String spaceId, String audienceId) throws ApiException {
869+
ApiResponse<ForceExecuteAudienceRun200Response> localVarResp =
870+
forceExecuteAudienceRunWithHttpInfo(spaceId, audienceId);
871+
return localVarResp.getData();
872+
}
873+
874+
/**
875+
* Force Execute Audience Run The ability to force execute a run for an Audience is limited to
876+
* Linked Audiences (audienceType &#x3D; &#x60;LINKED&#x60;). • This endpoint is in **Alpha**
877+
* testing. Please submit any feedback by sending an email to [email protected]. • In order to
878+
* successfully call this endpoint, the specified Workspace needs to have the Audience feature
879+
* enabled. Please reach out to your customer success manager for more information. • When
880+
* called, this endpoint may generate the &#x60;Audience Run Forced&#x60; event in the [audit
881+
* trail](/tag/Audit-Trail).
882+
*
883+
* @param spaceId (required)
884+
* @param audienceId (required)
885+
* @return ApiResponse&lt;ForceExecuteAudienceRun200Response&gt;
886+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
887+
* response body
888+
* @http.response.details
889+
* <table summary="Response Details" border="1">
890+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
891+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
892+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
893+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
894+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
895+
* </table>
896+
*/
897+
public ApiResponse<ForceExecuteAudienceRun200Response> forceExecuteAudienceRunWithHttpInfo(
898+
String spaceId, String audienceId) throws ApiException {
899+
okhttp3.Call localVarCall =
900+
forceExecuteAudienceRunValidateBeforeCall(spaceId, audienceId, null);
901+
Type localVarReturnType = new TypeToken<ForceExecuteAudienceRun200Response>() {}.getType();
902+
return localVarApiClient.execute(localVarCall, localVarReturnType);
903+
}
904+
905+
/**
906+
* Force Execute Audience Run (asynchronously) The ability to force execute a run for an
907+
* Audience is limited to Linked Audiences (audienceType &#x3D; &#x60;LINKED&#x60;). • This
908+
* endpoint is in **Alpha** testing. Please submit any feedback by sending an email to
909+
* [email protected]. • In order to successfully call this endpoint, the specified Workspace
910+
* needs to have the Audience feature enabled. Please reach out to your customer success manager
911+
* for more information. • When called, this endpoint may generate the &#x60;Audience Run
912+
* Forced&#x60; event in the [audit trail](/tag/Audit-Trail).
913+
*
914+
* @param spaceId (required)
915+
* @param audienceId (required)
916+
* @param _callback The callback to be executed when the API call finishes
917+
* @return The request call
918+
* @throws ApiException If fail to process the API call, e.g. serializing the request body
919+
* object
920+
* @http.response.details
921+
* <table summary="Response Details" border="1">
922+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
923+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
924+
* <tr><td> 404 </td><td> Resource not found </td><td> - </td></tr>
925+
* <tr><td> 422 </td><td> Validation failure </td><td> - </td></tr>
926+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
927+
* </table>
928+
*/
929+
public okhttp3.Call forceExecuteAudienceRunAsync(
930+
String spaceId,
931+
String audienceId,
932+
final ApiCallback<ForceExecuteAudienceRun200Response> _callback)
933+
throws ApiException {
934+
935+
okhttp3.Call localVarCall =
936+
forceExecuteAudienceRunValidateBeforeCall(spaceId, audienceId, _callback);
937+
Type localVarReturnType = new TypeToken<ForceExecuteAudienceRun200Response>() {}.getType();
938+
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
939+
return localVarCall;
940+
}
941+
743942
/**
744943
* Build call for getAudience
745944
*

0 commit comments

Comments
 (0)