33import com .datadog .api .client .ApiClient ;
44import com .datadog .api .client .ApiException ;
55import com .datadog .api .client .ApiResponse ;
6+ import com .datadog .api .client .PaginationIterable ;
67import com .datadog .api .client .Pair ;
78import com .datadog .api .client .v2 .model .IntakePayloadAccepted ;
89import com .datadog .api .client .v2 .model .MetricAllTagsResponse ;
1920import com .datadog .api .client .v2 .model .MetricTagConfigurationResponse ;
2021import com .datadog .api .client .v2 .model .MetricTagConfigurationUpdateRequest ;
2122import com .datadog .api .client .v2 .model .MetricVolumesResponse ;
23+ import com .datadog .api .client .v2 .model .MetricsAndMetricTagConfigurations ;
2224import com .datadog .api .client .v2 .model .MetricsAndMetricTagConfigurationsResponse ;
2325import com .datadog .api .client .v2 .model .ScalarFormulaQueryRequest ;
2426import com .datadog .api .client .v2 .model .ScalarFormulaQueryResponse ;
2830import jakarta .ws .rs .core .GenericType ;
2931import java .util .ArrayList ;
3032import java .util .HashMap ;
33+ import java .util .LinkedHashMap ;
3134import java .util .List ;
3235import java .util .Map ;
3336import java .util .concurrent .CompletableFuture ;
@@ -1450,6 +1453,8 @@ public static class ListTagConfigurationsOptionalParameters {
14501453 private Boolean filterQueried ;
14511454 private String filterTags ;
14521455 private Long windowSeconds ;
1456+ private Integer pageSize ;
1457+ private String pageCursor ;
14531458
14541459 /**
14551460 * Set filterConfigured.
@@ -1537,6 +1542,30 @@ public ListTagConfigurationsOptionalParameters windowSeconds(Long windowSeconds)
15371542 this .windowSeconds = windowSeconds ;
15381543 return this ;
15391544 }
1545+
1546+ /**
1547+ * Set pageSize.
1548+ *
1549+ * @param pageSize Maximum number of results returned. (optional, default to 10000)
1550+ * @return ListTagConfigurationsOptionalParameters
1551+ */
1552+ public ListTagConfigurationsOptionalParameters pageSize (Integer pageSize ) {
1553+ this .pageSize = pageSize ;
1554+ return this ;
1555+ }
1556+
1557+ /**
1558+ * Set pageCursor.
1559+ *
1560+ * @param pageCursor String to query the next page of results. This key is provided with each
1561+ * valid response from the API in <code>meta.pagination.next_cursor</code>. Once the <code>
1562+ * meta.pagination.next_cursor</code> key is null, all pages have been retrieved. (optional)
1563+ * @return ListTagConfigurationsOptionalParameters
1564+ */
1565+ public ListTagConfigurationsOptionalParameters pageCursor (String pageCursor ) {
1566+ this .pageCursor = pageCursor ;
1567+ return this ;
1568+ }
15401569 }
15411570
15421571 /**
@@ -1598,9 +1627,68 @@ public CompletableFuture<MetricsAndMetricTagConfigurationsResponse> listTagConfi
15981627 });
15991628 }
16001629
1630+ /**
1631+ * Get a list of metrics.
1632+ *
1633+ * <p>See {@link #listTagConfigurationsWithHttpInfo}.
1634+ *
1635+ * @return PaginationIterable<MetricsAndMetricTagConfigurations>
1636+ */
1637+ public PaginationIterable <MetricsAndMetricTagConfigurations >
1638+ listTagConfigurationsWithPagination () {
1639+ ListTagConfigurationsOptionalParameters parameters =
1640+ new ListTagConfigurationsOptionalParameters ();
1641+ return listTagConfigurationsWithPagination (parameters );
1642+ }
1643+
1644+ /**
1645+ * Get a list of metrics.
1646+ *
1647+ * <p>See {@link #listTagConfigurationsWithHttpInfo}.
1648+ *
1649+ * @return MetricsAndMetricTagConfigurationsResponse
1650+ */
1651+ public PaginationIterable <MetricsAndMetricTagConfigurations > listTagConfigurationsWithPagination (
1652+ ListTagConfigurationsOptionalParameters parameters ) {
1653+ String resultsPath = "getData" ;
1654+ String valueGetterPath = "getMeta.getPagination.getNextCursor" ;
1655+ String valueSetterPath = "pageCursor" ;
1656+ Boolean valueSetterParamOptional = true ;
1657+ Integer limit ;
1658+
1659+ if (parameters .pageSize == null ) {
1660+ limit = 10000 ;
1661+ parameters .pageSize (limit );
1662+ } else {
1663+ limit = parameters .pageSize ;
1664+ }
1665+
1666+ LinkedHashMap <String , Object > args = new LinkedHashMap <String , Object >();
1667+ args .put ("optionalParams" , parameters );
1668+
1669+ PaginationIterable iterator =
1670+ new PaginationIterable (
1671+ this ,
1672+ "listTagConfigurations" ,
1673+ resultsPath ,
1674+ valueGetterPath ,
1675+ valueSetterPath ,
1676+ valueSetterParamOptional ,
1677+ true ,
1678+ limit ,
1679+ args );
1680+
1681+ return iterator ;
1682+ }
1683+
16011684 /**
16021685 * Returns all metrics that can be configured in the Metrics Summary page or with Metrics without
1603- * Limits™ (matching additional filters if specified).
1686+ * Limits™ (matching additional filters if specified). Optionally, paginate by using the <code>
1687+ * page[cursor]</code> and/or <code>page[size]</code> query parameters. To fetch the first page,
1688+ * pass in a query parameter with either a valid <code>page[size]</code> or an empty cursor like
1689+ * <code>page[cursor]=</code>. To fetch the next page, pass in the <code>next_cursor</code> value
1690+ * from the response as the new <code>page[cursor]</code> value. Once the <code>
1691+ * meta.pagination.next_cursor</code> value is null, all pages have been retrieved.
16041692 *
16051693 * @param parameters Optional parameters for the request.
16061694 * @return ApiResponse<MetricsAndMetricTagConfigurationsResponse>
@@ -1625,6 +1713,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
16251713 Boolean filterQueried = parameters .filterQueried ;
16261714 String filterTags = parameters .filterTags ;
16271715 Long windowSeconds = parameters .windowSeconds ;
1716+ Integer pageSize = parameters .pageSize ;
1717+ String pageCursor = parameters .pageCursor ;
16281718 // create path and map variables
16291719 String localVarPath = "/api/v2/metrics" ;
16301720
@@ -1642,6 +1732,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
16421732 localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "filter[queried]" , filterQueried ));
16431733 localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "filter[tags]" , filterTags ));
16441734 localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "window[seconds]" , windowSeconds ));
1735+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "page[size]" , pageSize ));
1736+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "page[cursor]" , pageCursor ));
16451737
16461738 Invocation .Builder builder =
16471739 apiClient .createBuilder (
@@ -1681,6 +1773,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
16811773 Boolean filterQueried = parameters .filterQueried ;
16821774 String filterTags = parameters .filterTags ;
16831775 Long windowSeconds = parameters .windowSeconds ;
1776+ Integer pageSize = parameters .pageSize ;
1777+ String pageCursor = parameters .pageCursor ;
16841778 // create path and map variables
16851779 String localVarPath = "/api/v2/metrics" ;
16861780
@@ -1698,6 +1792,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
16981792 localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "filter[queried]" , filterQueried ));
16991793 localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "filter[tags]" , filterTags ));
17001794 localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "window[seconds]" , windowSeconds ));
1795+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "page[size]" , pageSize ));
1796+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "page[cursor]" , pageCursor ));
17011797
17021798 Invocation .Builder builder ;
17031799 try {
0 commit comments