|
27 | 27 | import com.segment.publicapi.models.ListAudiences200Response;
|
28 | 28 | import com.segment.publicapi.models.ListAudiencesPaginationInput;
|
29 | 29 | import com.segment.publicapi.models.PaginationInput;
|
| 30 | +import com.segment.publicapi.models.PreviewAudience200Response; |
| 31 | +import com.segment.publicapi.models.PreviewAudienceInput; |
30 | 32 | import com.segment.publicapi.models.RemoveAudienceFromSpace200Response;
|
31 | 33 | import com.segment.publicapi.models.UpdateAudienceForSpace200Response;
|
32 | 34 | import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput;
|
@@ -944,6 +946,199 @@ public okhttp3.Call listAudiencesAsync(
|
944 | 946 | return localVarCall;
|
945 | 947 | }
|
946 | 948 |
|
| 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 `Audience Preview Created` 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 `Audience Preview Created` event in the [audit |
| 1082 | + * trail](/tag/Audit-Trail). |
| 1083 | + * |
| 1084 | + * @param spaceId (required) |
| 1085 | + * @param previewAudienceInput (required) |
| 1086 | + * @return ApiResponse<PreviewAudience200Response> |
| 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 `Audience Preview Created` 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 | + |
947 | 1142 | /**
|
948 | 1143 | * Build call for removeAudienceFromSpace
|
949 | 1144 | *
|
|
0 commit comments