|
5 | 5 | import com.datadog.api.client.ApiResponse; |
6 | 6 | import com.datadog.api.client.Pair; |
7 | 7 | import com.datadog.api.client.v2.model.BatchDeleteRowsRequestArray; |
| 8 | +import com.datadog.api.client.v2.model.BatchRowsQueryRequest; |
| 9 | +import com.datadog.api.client.v2.model.BatchRowsQueryResponse; |
8 | 10 | import com.datadog.api.client.v2.model.BatchUpsertRowsRequestArray; |
9 | 11 | import com.datadog.api.client.v2.model.CreateTableRequest; |
10 | 12 | import com.datadog.api.client.v2.model.CreateUploadRequest; |
@@ -53,6 +55,140 @@ public void setApiClient(ApiClient apiClient) { |
53 | 55 | this.apiClient = apiClient; |
54 | 56 | } |
55 | 57 |
|
| 58 | + /** |
| 59 | + * Batch rows query. |
| 60 | + * |
| 61 | + * <p>See {@link #batchRowsQueryWithHttpInfo}. |
| 62 | + * |
| 63 | + * @param body (required) |
| 64 | + * @return BatchRowsQueryResponse |
| 65 | + * @throws ApiException if fails to make API call |
| 66 | + */ |
| 67 | + public BatchRowsQueryResponse batchRowsQuery(BatchRowsQueryRequest body) throws ApiException { |
| 68 | + return batchRowsQueryWithHttpInfo(body).getData(); |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * Batch rows query. |
| 73 | + * |
| 74 | + * <p>See {@link #batchRowsQueryWithHttpInfoAsync}. |
| 75 | + * |
| 76 | + * @param body (required) |
| 77 | + * @return CompletableFuture<BatchRowsQueryResponse> |
| 78 | + */ |
| 79 | + public CompletableFuture<BatchRowsQueryResponse> batchRowsQueryAsync(BatchRowsQueryRequest body) { |
| 80 | + return batchRowsQueryWithHttpInfoAsync(body) |
| 81 | + .thenApply( |
| 82 | + response -> { |
| 83 | + return response.getData(); |
| 84 | + }); |
| 85 | + } |
| 86 | + |
| 87 | + /** |
| 88 | + * Batch query reference table rows by their primary key values. Returns only found rows in the |
| 89 | + * included array. |
| 90 | + * |
| 91 | + * @param body (required) |
| 92 | + * @return ApiResponse<BatchRowsQueryResponse> |
| 93 | + * @throws ApiException if fails to make API call |
| 94 | + * @http.response.details |
| 95 | + * <table border="1"> |
| 96 | + * <caption>Response details</caption> |
| 97 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 98 | + * <tr><td> 200 </td><td> Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section. </td><td> - </td></tr> |
| 99 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 100 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 101 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 102 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 103 | + * <tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr> |
| 104 | + * </table> |
| 105 | + */ |
| 106 | + public ApiResponse<BatchRowsQueryResponse> batchRowsQueryWithHttpInfo(BatchRowsQueryRequest body) |
| 107 | + throws ApiException { |
| 108 | + Object localVarPostBody = body; |
| 109 | + |
| 110 | + // verify the required parameter 'body' is set |
| 111 | + if (body == null) { |
| 112 | + throw new ApiException( |
| 113 | + 400, "Missing the required parameter 'body' when calling batchRowsQuery"); |
| 114 | + } |
| 115 | + // create path and map variables |
| 116 | + String localVarPath = "/api/v2/reference-tables/queries/batch-rows"; |
| 117 | + |
| 118 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 119 | + |
| 120 | + Invocation.Builder builder = |
| 121 | + apiClient.createBuilder( |
| 122 | + "v2.ReferenceTablesApi.batchRowsQuery", |
| 123 | + localVarPath, |
| 124 | + new ArrayList<Pair>(), |
| 125 | + localVarHeaderParams, |
| 126 | + new HashMap<String, String>(), |
| 127 | + new String[] {"application/json"}, |
| 128 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 129 | + return apiClient.invokeAPI( |
| 130 | + "POST", |
| 131 | + builder, |
| 132 | + localVarHeaderParams, |
| 133 | + new String[] {"application/json"}, |
| 134 | + localVarPostBody, |
| 135 | + new HashMap<String, Object>(), |
| 136 | + false, |
| 137 | + new GenericType<BatchRowsQueryResponse>() {}); |
| 138 | + } |
| 139 | + |
| 140 | + /** |
| 141 | + * Batch rows query. |
| 142 | + * |
| 143 | + * <p>See {@link #batchRowsQueryWithHttpInfo}. |
| 144 | + * |
| 145 | + * @param body (required) |
| 146 | + * @return CompletableFuture<ApiResponse<BatchRowsQueryResponse>> |
| 147 | + */ |
| 148 | + public CompletableFuture<ApiResponse<BatchRowsQueryResponse>> batchRowsQueryWithHttpInfoAsync( |
| 149 | + BatchRowsQueryRequest body) { |
| 150 | + Object localVarPostBody = body; |
| 151 | + |
| 152 | + // verify the required parameter 'body' is set |
| 153 | + if (body == null) { |
| 154 | + CompletableFuture<ApiResponse<BatchRowsQueryResponse>> result = new CompletableFuture<>(); |
| 155 | + result.completeExceptionally( |
| 156 | + new ApiException( |
| 157 | + 400, "Missing the required parameter 'body' when calling batchRowsQuery")); |
| 158 | + return result; |
| 159 | + } |
| 160 | + // create path and map variables |
| 161 | + String localVarPath = "/api/v2/reference-tables/queries/batch-rows"; |
| 162 | + |
| 163 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 164 | + |
| 165 | + Invocation.Builder builder; |
| 166 | + try { |
| 167 | + builder = |
| 168 | + apiClient.createBuilder( |
| 169 | + "v2.ReferenceTablesApi.batchRowsQuery", |
| 170 | + localVarPath, |
| 171 | + new ArrayList<Pair>(), |
| 172 | + localVarHeaderParams, |
| 173 | + new HashMap<String, String>(), |
| 174 | + new String[] {"application/json"}, |
| 175 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 176 | + } catch (ApiException ex) { |
| 177 | + CompletableFuture<ApiResponse<BatchRowsQueryResponse>> result = new CompletableFuture<>(); |
| 178 | + result.completeExceptionally(ex); |
| 179 | + return result; |
| 180 | + } |
| 181 | + return apiClient.invokeAPIAsync( |
| 182 | + "POST", |
| 183 | + builder, |
| 184 | + localVarHeaderParams, |
| 185 | + new String[] {"application/json"}, |
| 186 | + localVarPostBody, |
| 187 | + new HashMap<String, Object>(), |
| 188 | + false, |
| 189 | + new GenericType<BatchRowsQueryResponse>() {}); |
| 190 | + } |
| 191 | + |
56 | 192 | /** |
57 | 193 | * Create reference table. |
58 | 194 | * |
|
0 commit comments