|
11 | 11 | import com.datadog.api.client.v2.model.CreateTableRequest; |
12 | 12 | import com.datadog.api.client.v2.model.CreateUploadRequest; |
13 | 13 | import com.datadog.api.client.v2.model.CreateUploadResponse; |
| 14 | +import com.datadog.api.client.v2.model.ListRowsResponse; |
14 | 15 | import com.datadog.api.client.v2.model.PatchTableRequest; |
15 | 16 | import com.datadog.api.client.v2.model.ReferenceTableSortType; |
16 | 17 | import com.datadog.api.client.v2.model.TableResultV2; |
@@ -1031,6 +1032,227 @@ public CompletableFuture<ApiResponse<TableResultV2>> getTableWithHttpInfoAsync(S |
1031 | 1032 | new GenericType<TableResultV2>() {}); |
1032 | 1033 | } |
1033 | 1034 |
|
| 1035 | + /** Manage optional parameters to listReferenceTableRows. */ |
| 1036 | + public static class ListReferenceTableRowsOptionalParameters { |
| 1037 | + private Long pageLimit; |
| 1038 | + private String pageContinuationToken; |
| 1039 | + |
| 1040 | + /** |
| 1041 | + * Set pageLimit. |
| 1042 | + * |
| 1043 | + * @param pageLimit Number of rows to return per page. Defaults to 100, maximum is 1000. |
| 1044 | + * (optional, default to 100) |
| 1045 | + * @return ListReferenceTableRowsOptionalParameters |
| 1046 | + */ |
| 1047 | + public ListReferenceTableRowsOptionalParameters pageLimit(Long pageLimit) { |
| 1048 | + this.pageLimit = pageLimit; |
| 1049 | + return this; |
| 1050 | + } |
| 1051 | + |
| 1052 | + /** |
| 1053 | + * Set pageContinuationToken. |
| 1054 | + * |
| 1055 | + * @param pageContinuationToken Opaque cursor returned in the previous response links.next. Pass |
| 1056 | + * this value to retrieve the next page of results on the same consistent snapshot. |
| 1057 | + * (optional) |
| 1058 | + * @return ListReferenceTableRowsOptionalParameters |
| 1059 | + */ |
| 1060 | + public ListReferenceTableRowsOptionalParameters pageContinuationToken( |
| 1061 | + String pageContinuationToken) { |
| 1062 | + this.pageContinuationToken = pageContinuationToken; |
| 1063 | + return this; |
| 1064 | + } |
| 1065 | + } |
| 1066 | + |
| 1067 | + /** |
| 1068 | + * List reference table rows. |
| 1069 | + * |
| 1070 | + * <p>See {@link #listReferenceTableRowsWithHttpInfo}. |
| 1071 | + * |
| 1072 | + * @param id Unique identifier of the reference table to list rows from. (required) |
| 1073 | + * @return ListRowsResponse |
| 1074 | + * @throws ApiException if fails to make API call |
| 1075 | + */ |
| 1076 | + public ListRowsResponse listReferenceTableRows(String id) throws ApiException { |
| 1077 | + return listReferenceTableRowsWithHttpInfo(id, new ListReferenceTableRowsOptionalParameters()) |
| 1078 | + .getData(); |
| 1079 | + } |
| 1080 | + |
| 1081 | + /** |
| 1082 | + * List reference table rows. |
| 1083 | + * |
| 1084 | + * <p>See {@link #listReferenceTableRowsWithHttpInfoAsync}. |
| 1085 | + * |
| 1086 | + * @param id Unique identifier of the reference table to list rows from. (required) |
| 1087 | + * @return CompletableFuture<ListRowsResponse> |
| 1088 | + */ |
| 1089 | + public CompletableFuture<ListRowsResponse> listReferenceTableRowsAsync(String id) { |
| 1090 | + return listReferenceTableRowsWithHttpInfoAsync( |
| 1091 | + id, new ListReferenceTableRowsOptionalParameters()) |
| 1092 | + .thenApply( |
| 1093 | + response -> { |
| 1094 | + return response.getData(); |
| 1095 | + }); |
| 1096 | + } |
| 1097 | + |
| 1098 | + /** |
| 1099 | + * List reference table rows. |
| 1100 | + * |
| 1101 | + * <p>See {@link #listReferenceTableRowsWithHttpInfo}. |
| 1102 | + * |
| 1103 | + * @param id Unique identifier of the reference table to list rows from. (required) |
| 1104 | + * @param parameters Optional parameters for the request. |
| 1105 | + * @return ListRowsResponse |
| 1106 | + * @throws ApiException if fails to make API call |
| 1107 | + */ |
| 1108 | + public ListRowsResponse listReferenceTableRows( |
| 1109 | + String id, ListReferenceTableRowsOptionalParameters parameters) throws ApiException { |
| 1110 | + return listReferenceTableRowsWithHttpInfo(id, parameters).getData(); |
| 1111 | + } |
| 1112 | + |
| 1113 | + /** |
| 1114 | + * List reference table rows. |
| 1115 | + * |
| 1116 | + * <p>See {@link #listReferenceTableRowsWithHttpInfoAsync}. |
| 1117 | + * |
| 1118 | + * @param id Unique identifier of the reference table to list rows from. (required) |
| 1119 | + * @param parameters Optional parameters for the request. |
| 1120 | + * @return CompletableFuture<ListRowsResponse> |
| 1121 | + */ |
| 1122 | + public CompletableFuture<ListRowsResponse> listReferenceTableRowsAsync( |
| 1123 | + String id, ListReferenceTableRowsOptionalParameters parameters) { |
| 1124 | + return listReferenceTableRowsWithHttpInfoAsync(id, parameters) |
| 1125 | + .thenApply( |
| 1126 | + response -> { |
| 1127 | + return response.getData(); |
| 1128 | + }); |
| 1129 | + } |
| 1130 | + |
| 1131 | + /** |
| 1132 | + * List rows from a reference table using cursor-based pagination. Use the returned |
| 1133 | + * continuation_token in the next request to fetch the following page. Returns a 400 error for |
| 1134 | + * tables with more than 10,000,000 rows. |
| 1135 | + * |
| 1136 | + * @param id Unique identifier of the reference table to list rows from. (required) |
| 1137 | + * @param parameters Optional parameters for the request. |
| 1138 | + * @return ApiResponse<ListRowsResponse> |
| 1139 | + * @throws ApiException if fails to make API call |
| 1140 | + * @http.response.details |
| 1141 | + * <table border="1"> |
| 1142 | + * <caption>Response details</caption> |
| 1143 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 1144 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 1145 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 1146 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 1147 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 1148 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 1149 | + * </table> |
| 1150 | + */ |
| 1151 | + public ApiResponse<ListRowsResponse> listReferenceTableRowsWithHttpInfo( |
| 1152 | + String id, ListReferenceTableRowsOptionalParameters parameters) throws ApiException { |
| 1153 | + Object localVarPostBody = null; |
| 1154 | + |
| 1155 | + // verify the required parameter 'id' is set |
| 1156 | + if (id == null) { |
| 1157 | + throw new ApiException( |
| 1158 | + 400, "Missing the required parameter 'id' when calling listReferenceTableRows"); |
| 1159 | + } |
| 1160 | + Long pageLimit = parameters.pageLimit; |
| 1161 | + String pageContinuationToken = parameters.pageContinuationToken; |
| 1162 | + // create path and map variables |
| 1163 | + String localVarPath = |
| 1164 | + "/api/v2/reference-tables/tables/{id}/rows/list" |
| 1165 | + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); |
| 1166 | + |
| 1167 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1168 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1169 | + |
| 1170 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); |
| 1171 | + localVarQueryParams.addAll( |
| 1172 | + apiClient.parameterToPairs("", "page[continuation_token]", pageContinuationToken)); |
| 1173 | + |
| 1174 | + Invocation.Builder builder = |
| 1175 | + apiClient.createBuilder( |
| 1176 | + "v2.ReferenceTablesApi.listReferenceTableRows", |
| 1177 | + localVarPath, |
| 1178 | + localVarQueryParams, |
| 1179 | + localVarHeaderParams, |
| 1180 | + new HashMap<String, String>(), |
| 1181 | + new String[] {"application/json"}, |
| 1182 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 1183 | + return apiClient.invokeAPI( |
| 1184 | + "GET", |
| 1185 | + builder, |
| 1186 | + localVarHeaderParams, |
| 1187 | + new String[] {}, |
| 1188 | + localVarPostBody, |
| 1189 | + new HashMap<String, Object>(), |
| 1190 | + false, |
| 1191 | + new GenericType<ListRowsResponse>() {}); |
| 1192 | + } |
| 1193 | + |
| 1194 | + /** |
| 1195 | + * List reference table rows. |
| 1196 | + * |
| 1197 | + * <p>See {@link #listReferenceTableRowsWithHttpInfo}. |
| 1198 | + * |
| 1199 | + * @param id Unique identifier of the reference table to list rows from. (required) |
| 1200 | + * @param parameters Optional parameters for the request. |
| 1201 | + * @return CompletableFuture<ApiResponse<ListRowsResponse>> |
| 1202 | + */ |
| 1203 | + public CompletableFuture<ApiResponse<ListRowsResponse>> listReferenceTableRowsWithHttpInfoAsync( |
| 1204 | + String id, ListReferenceTableRowsOptionalParameters parameters) { |
| 1205 | + Object localVarPostBody = null; |
| 1206 | + |
| 1207 | + // verify the required parameter 'id' is set |
| 1208 | + if (id == null) { |
| 1209 | + CompletableFuture<ApiResponse<ListRowsResponse>> result = new CompletableFuture<>(); |
| 1210 | + result.completeExceptionally( |
| 1211 | + new ApiException( |
| 1212 | + 400, "Missing the required parameter 'id' when calling listReferenceTableRows")); |
| 1213 | + return result; |
| 1214 | + } |
| 1215 | + Long pageLimit = parameters.pageLimit; |
| 1216 | + String pageContinuationToken = parameters.pageContinuationToken; |
| 1217 | + // create path and map variables |
| 1218 | + String localVarPath = |
| 1219 | + "/api/v2/reference-tables/tables/{id}/rows/list" |
| 1220 | + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); |
| 1221 | + |
| 1222 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1223 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1224 | + |
| 1225 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); |
| 1226 | + localVarQueryParams.addAll( |
| 1227 | + apiClient.parameterToPairs("", "page[continuation_token]", pageContinuationToken)); |
| 1228 | + |
| 1229 | + Invocation.Builder builder; |
| 1230 | + try { |
| 1231 | + builder = |
| 1232 | + apiClient.createBuilder( |
| 1233 | + "v2.ReferenceTablesApi.listReferenceTableRows", |
| 1234 | + localVarPath, |
| 1235 | + localVarQueryParams, |
| 1236 | + localVarHeaderParams, |
| 1237 | + new HashMap<String, String>(), |
| 1238 | + new String[] {"application/json"}, |
| 1239 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 1240 | + } catch (ApiException ex) { |
| 1241 | + CompletableFuture<ApiResponse<ListRowsResponse>> result = new CompletableFuture<>(); |
| 1242 | + result.completeExceptionally(ex); |
| 1243 | + return result; |
| 1244 | + } |
| 1245 | + return apiClient.invokeAPIAsync( |
| 1246 | + "GET", |
| 1247 | + builder, |
| 1248 | + localVarHeaderParams, |
| 1249 | + new String[] {}, |
| 1250 | + localVarPostBody, |
| 1251 | + new HashMap<String, Object>(), |
| 1252 | + false, |
| 1253 | + new GenericType<ListRowsResponse>() {}); |
| 1254 | + } |
| 1255 | + |
1034 | 1256 | /** Manage optional parameters to listTables. */ |
1035 | 1257 | public static class ListTablesOptionalParameters { |
1036 | 1258 | private Long pageLimit; |
|
0 commit comments