|
42 | 42 | import com.datadog.api.client.v2.model.CostTagKeySourcesResponse; |
43 | 43 | import com.datadog.api.client.v2.model.CostTagKeysResponse; |
44 | 44 | import com.datadog.api.client.v2.model.CostTagMetadataDailyFilter; |
| 45 | +import com.datadog.api.client.v2.model.CostTagMetadataMonthsResponse; |
45 | 46 | import com.datadog.api.client.v2.model.CostTagsResponse; |
46 | 47 | import com.datadog.api.client.v2.model.CreateRulesetRequest; |
47 | 48 | import com.datadog.api.client.v2.model.CustomCostsFileGetResponse; |
@@ -7919,6 +7920,185 @@ public ApiResponse<CostMetricsResponse> listCostTagMetadataMetricsWithHttpInfo( |
7919 | 7920 | new GenericType<CostMetricsResponse>() {}); |
7920 | 7921 | } |
7921 | 7922 |
|
| 7923 | + /** |
| 7924 | + * List Cloud Cost Management tag metadata months. |
| 7925 | + * |
| 7926 | + * <p>See {@link #listCostTagMetadataMonthsWithHttpInfo}. |
| 7927 | + * |
| 7928 | + * @param filterProvider Provider to scope the query to. Use the value of the <code>providername |
| 7929 | + * </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>, |
| 7930 | + * <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs |
| 7931 | + * uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive. |
| 7932 | + * (required) |
| 7933 | + * @return CostTagMetadataMonthsResponse |
| 7934 | + * @throws ApiException if fails to make API call |
| 7935 | + */ |
| 7936 | + public CostTagMetadataMonthsResponse listCostTagMetadataMonths(String filterProvider) |
| 7937 | + throws ApiException { |
| 7938 | + return listCostTagMetadataMonthsWithHttpInfo(filterProvider).getData(); |
| 7939 | + } |
| 7940 | + |
| 7941 | + /** |
| 7942 | + * List Cloud Cost Management tag metadata months. |
| 7943 | + * |
| 7944 | + * <p>See {@link #listCostTagMetadataMonthsWithHttpInfoAsync}. |
| 7945 | + * |
| 7946 | + * @param filterProvider Provider to scope the query to. Use the value of the <code>providername |
| 7947 | + * </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>, |
| 7948 | + * <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs |
| 7949 | + * uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive. |
| 7950 | + * (required) |
| 7951 | + * @return CompletableFuture<CostTagMetadataMonthsResponse> |
| 7952 | + */ |
| 7953 | + public CompletableFuture<CostTagMetadataMonthsResponse> listCostTagMetadataMonthsAsync( |
| 7954 | + String filterProvider) { |
| 7955 | + return listCostTagMetadataMonthsWithHttpInfoAsync(filterProvider) |
| 7956 | + .thenApply( |
| 7957 | + response -> { |
| 7958 | + return response.getData(); |
| 7959 | + }); |
| 7960 | + } |
| 7961 | + |
| 7962 | + /** |
| 7963 | + * List months that have Cloud Cost Management tag metadata for a given provider, ordered |
| 7964 | + * most-recent first. The response is capped at 36 months. |
| 7965 | + * |
| 7966 | + * @param filterProvider Provider to scope the query to. Use the value of the <code>providername |
| 7967 | + * </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>, |
| 7968 | + * <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs |
| 7969 | + * uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive. |
| 7970 | + * (required) |
| 7971 | + * @return ApiResponse<CostTagMetadataMonthsResponse> |
| 7972 | + * @throws ApiException if fails to make API call |
| 7973 | + * @http.response.details |
| 7974 | + * <table border="1"> |
| 7975 | + * <caption>Response details</caption> |
| 7976 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 7977 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 7978 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 7979 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 7980 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 7981 | + * </table> |
| 7982 | + */ |
| 7983 | + public ApiResponse<CostTagMetadataMonthsResponse> listCostTagMetadataMonthsWithHttpInfo( |
| 7984 | + String filterProvider) throws ApiException { |
| 7985 | + // Check if unstable operation is enabled |
| 7986 | + String operationId = "listCostTagMetadataMonths"; |
| 7987 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 7988 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 7989 | + } else { |
| 7990 | + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); |
| 7991 | + } |
| 7992 | + Object localVarPostBody = null; |
| 7993 | + |
| 7994 | + // verify the required parameter 'filterProvider' is set |
| 7995 | + if (filterProvider == null) { |
| 7996 | + throw new ApiException( |
| 7997 | + 400, |
| 7998 | + "Missing the required parameter 'filterProvider' when calling listCostTagMetadataMonths"); |
| 7999 | + } |
| 8000 | + // create path and map variables |
| 8001 | + String localVarPath = "/api/v2/cost/tag_metadata/months"; |
| 8002 | + |
| 8003 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 8004 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 8005 | + |
| 8006 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); |
| 8007 | + |
| 8008 | + Invocation.Builder builder = |
| 8009 | + apiClient.createBuilder( |
| 8010 | + "v2.CloudCostManagementApi.listCostTagMetadataMonths", |
| 8011 | + localVarPath, |
| 8012 | + localVarQueryParams, |
| 8013 | + localVarHeaderParams, |
| 8014 | + new HashMap<String, String>(), |
| 8015 | + new String[] {"application/json"}, |
| 8016 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 8017 | + return apiClient.invokeAPI( |
| 8018 | + "GET", |
| 8019 | + builder, |
| 8020 | + localVarHeaderParams, |
| 8021 | + new String[] {}, |
| 8022 | + localVarPostBody, |
| 8023 | + new HashMap<String, Object>(), |
| 8024 | + false, |
| 8025 | + new GenericType<CostTagMetadataMonthsResponse>() {}); |
| 8026 | + } |
| 8027 | + |
| 8028 | + /** |
| 8029 | + * List Cloud Cost Management tag metadata months. |
| 8030 | + * |
| 8031 | + * <p>See {@link #listCostTagMetadataMonthsWithHttpInfo}. |
| 8032 | + * |
| 8033 | + * @param filterProvider Provider to scope the query to. Use the value of the <code>providername |
| 8034 | + * </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>, |
| 8035 | + * <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs |
| 8036 | + * uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive. |
| 8037 | + * (required) |
| 8038 | + * @return CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> |
| 8039 | + */ |
| 8040 | + public CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> |
| 8041 | + listCostTagMetadataMonthsWithHttpInfoAsync(String filterProvider) { |
| 8042 | + // Check if unstable operation is enabled |
| 8043 | + String operationId = "listCostTagMetadataMonths"; |
| 8044 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 8045 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 8046 | + } else { |
| 8047 | + CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result = |
| 8048 | + new CompletableFuture<>(); |
| 8049 | + result.completeExceptionally( |
| 8050 | + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); |
| 8051 | + return result; |
| 8052 | + } |
| 8053 | + Object localVarPostBody = null; |
| 8054 | + |
| 8055 | + // verify the required parameter 'filterProvider' is set |
| 8056 | + if (filterProvider == null) { |
| 8057 | + CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result = |
| 8058 | + new CompletableFuture<>(); |
| 8059 | + result.completeExceptionally( |
| 8060 | + new ApiException( |
| 8061 | + 400, |
| 8062 | + "Missing the required parameter 'filterProvider' when calling" |
| 8063 | + + " listCostTagMetadataMonths")); |
| 8064 | + return result; |
| 8065 | + } |
| 8066 | + // create path and map variables |
| 8067 | + String localVarPath = "/api/v2/cost/tag_metadata/months"; |
| 8068 | + |
| 8069 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 8070 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 8071 | + |
| 8072 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); |
| 8073 | + |
| 8074 | + Invocation.Builder builder; |
| 8075 | + try { |
| 8076 | + builder = |
| 8077 | + apiClient.createBuilder( |
| 8078 | + "v2.CloudCostManagementApi.listCostTagMetadataMonths", |
| 8079 | + localVarPath, |
| 8080 | + localVarQueryParams, |
| 8081 | + localVarHeaderParams, |
| 8082 | + new HashMap<String, String>(), |
| 8083 | + new String[] {"application/json"}, |
| 8084 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 8085 | + } catch (ApiException ex) { |
| 8086 | + CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result = |
| 8087 | + new CompletableFuture<>(); |
| 8088 | + result.completeExceptionally(ex); |
| 8089 | + return result; |
| 8090 | + } |
| 8091 | + return apiClient.invokeAPIAsync( |
| 8092 | + "GET", |
| 8093 | + builder, |
| 8094 | + localVarHeaderParams, |
| 8095 | + new String[] {}, |
| 8096 | + localVarPostBody, |
| 8097 | + new HashMap<String, Object>(), |
| 8098 | + false, |
| 8099 | + new GenericType<CostTagMetadataMonthsResponse>() {}); |
| 8100 | + } |
| 8101 | + |
7922 | 8102 | /** Manage optional parameters to listCostTagMetadataOrchestrators. */ |
7923 | 8103 | public static class ListCostTagMetadataOrchestratorsOptionalParameters { |
7924 | 8104 | private String filterProvider; |
|
0 commit comments