diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 2e8cfcd7772..ede89abbaae 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2594,6 +2594,43 @@ components: type: string x-enum-varnames: - EVENT_TIMELINE + EventsAggregation: + description: The type of aggregation that can be performed on events-based queries. + example: avg + oneOf: + - $ref: "#/components/schemas/EventsAggregationValue" + - $ref: "#/components/schemas/EventsAggregationPercentile" + EventsAggregationPercentile: + description: Percentile aggregation. + pattern: '^pc[0-9]+(\.[0-9]+)?$' + type: string + EventsAggregationValue: + description: Standard aggregation types for events-based queries. + enum: + - avg + - cardinality + - count + - delta + - earliest + - latest + - max + - median + - min + - most_frequent + - sum + type: string + x-enum-varnames: + - AVG + - CARDINALITY + - COUNT + - DELTA + - EARLIEST + - LATEST + - MAX + - MEDIAN + - MIN + - MOST_FREQUENT + - SUM FormulaAndFunctionApmDependencyStatName: description: APM statistic. enum: @@ -10981,6 +11018,55 @@ components: required: - metric type: object + ProductAnalyticsAudienceAccountSubquery: + description: Product Analytics audience account subquery. + properties: + name: + type: string + query: + type: string + type: object + ProductAnalyticsAudienceFilters: + description: Product Analytics/RUM audience filters. + properties: + accounts: + items: + $ref: "#/components/schemas/ProductAnalyticsAudienceAccountSubquery" + type: array + filter_condition: + type: string + segments: + items: + $ref: "#/components/schemas/ProductAnalyticsAudienceSegmentSubquery" + type: array + users: + items: + $ref: "#/components/schemas/ProductAnalyticsAudienceUserSubquery" + type: array + type: object + ProductAnalyticsAudienceOccurrenceFilter: + properties: + operator: + type: string + value: + type: string + type: object + ProductAnalyticsAudienceSegmentSubquery: + description: Product Analytics audience segment subquery. + properties: + name: + type: string + segment_id: + type: string + type: object + ProductAnalyticsAudienceUserSubquery: + description: Product Analytics audience user subquery. + properties: + name: + type: string + query: + type: string + type: object QuerySortOrder: default: desc description: Direction of sort. @@ -12739,6 +12825,249 @@ components: type: string x-enum-varnames: - SLO + SankeyJoinKeys: + additionalProperties: false + description: Join keys. + properties: + primary: + description: Primary join key. + example: "session.id" + type: string + secondary: + description: Secondary join keys. + items: + description: Secondary join key. + type: string + type: array + required: + - primary + type: object + SankeyNetworkDataSource: + default: network + description: Network data source type. + enum: + - network_device_flows + - network + example: network + type: string + x-enum-varnames: + - NETWORK_DEVICE_FLOWS + - NETWORK + SankeyNetworkQuery: + additionalProperties: false + description: Query configuration for Sankey network widget. + properties: + compute: + $ref: "#/components/schemas/SankeyNetworkQueryCompute" + data_source: + $ref: "#/components/schemas/SankeyNetworkDataSource" + group_by: + description: Fields to group by. + example: ["source", "destination"] + items: + type: string + type: array + limit: + description: Maximum number of results. + example: 100 + format: int64 + type: integer + mode: + $ref: "#/components/schemas/SankeyNetworkQueryMode" + query_string: + description: Query string for filtering network data. + example: "*" + type: string + should_exclude_missing: + description: Whether to exclude missing values. + type: boolean + sort: + $ref: "#/components/schemas/SankeyNetworkQuerySort" + required: + - data_source + - query_string + - group_by + - limit + type: object + SankeyNetworkQueryCompute: + additionalProperties: false + description: Compute aggregation for network queries. + properties: + aggregation: + $ref: "#/components/schemas/EventsAggregation" + metric: + description: Metric to aggregate. + example: "" + type: string + required: + - aggregation + - metric + type: object + SankeyNetworkQueryMode: + default: target + description: Sankey mode for network queries. + enum: + - target + example: target + type: string + x-enum-varnames: + - TARGET + SankeyNetworkQuerySort: + description: Sort configuration for network queries. + properties: + field: + description: Field to sort by. + type: string + order: + $ref: "#/components/schemas/WidgetSort" + type: object + SankeyNetworkRequest: + additionalProperties: false + description: Sankey widget request for network data source. + properties: + query: + $ref: "#/components/schemas/SankeyNetworkQuery" + request_type: + $ref: "#/components/schemas/SankeyNetworkRequestType" + required: + - query + - request_type + type: object + SankeyNetworkRequestType: + default: netflow_sankey + description: Type of request for network Sankey widget. + enum: + - netflow_sankey + example: netflow_sankey + type: string + x-enum-varnames: + - NETFLOW_SANKEY + SankeyRumDataSource: + default: rum + description: Sankey widget with RUM data source. + enum: + - rum + - product_analytics + example: rum + type: string + x-enum-varnames: + - RUM + - PRODUCT_ANALYTICS + SankeyRumQuery: + additionalProperties: false + description: Sankey widget with RUM data source query. + properties: + audience_filters: + $ref: "#/components/schemas/ProductAnalyticsAudienceFilters" + data_source: + $ref: "#/components/schemas/SankeyRumDataSource" + entries_per_step: + description: Entries per step. + format: int64 + type: integer + join_keys: + $ref: "#/components/schemas/SankeyJoinKeys" + mode: + $ref: "#/components/schemas/SankeyRumQueryMode" + number_of_steps: + description: Number of steps. + format: int64 + type: integer + occurrences: + $ref: "#/components/schemas/ProductAnalyticsAudienceOccurrenceFilter" + query_string: + description: Query string. + example: "@type:view" + type: string + source: + description: Source. + type: string + subquery_id: + description: Subquery ID. + type: string + target: + description: Target. + type: string + required: + - data_source + - query_string + - mode + type: object + SankeyRumQueryMode: + default: source + description: Sankey mode for RUM queries. + enum: + - source + - target + example: source + type: string + x-enum-varnames: + - SOURCE + - TARGET + SankeyRumRequest: + additionalProperties: false + description: Sankey widget with RUM data source. + properties: + query: + $ref: "#/components/schemas/SankeyRumQuery" + request_type: + $ref: "#/components/schemas/SankeyWidgetDefinitionType" + required: + - query + - request_type + type: object + SankeyWidgetDefinition: + additionalProperties: false + description: The Sankey diagram visualizes the flow of data between categories, stages or sets of values. + properties: + requests: + description: List of Sankey widget requests. + example: + - query: + data_source: rum + mode: source + query_string: "@type:view" + request_type: sankey + items: + $ref: "#/components/schemas/SankeyWidgetRequest" + minItems: 1 + type: array + show_other_links: + description: Whether to show links for "other" category. + type: boolean + sort_nodes: + description: Whether to sort nodes in the Sankey diagram. + type: boolean + time: + $ref: "#/components/schemas/WidgetTime" + title: + description: Title of your widget. + type: string + title_align: + $ref: "#/components/schemas/WidgetTextAlign" + title_size: + description: Size of the title. + type: string + type: + $ref: "#/components/schemas/SankeyWidgetDefinitionType" + required: + - type + - requests + type: object + SankeyWidgetDefinitionType: + default: sankey + description: Type of the Sankey widget. + enum: + - sankey + example: sankey + type: string + x-enum-varnames: + - SANKEY + SankeyWidgetRequest: + description: Request definition for Sankey widget. + oneOf: + - $ref: "#/components/schemas/SankeyRumRequest" + - $ref: "#/components/schemas/SankeyNetworkRequest" ScatterPlotRequest: description: Updated scatter plot. properties: @@ -23817,6 +24146,7 @@ components: - $ref: "#/components/schemas/SLOListWidgetDefinition" - $ref: "#/components/schemas/SLOWidgetDefinition" - $ref: "#/components/schemas/ScatterPlotWidgetDefinition" + - $ref: "#/components/schemas/SankeyWidgetDefinition" - $ref: "#/components/schemas/ServiceMapWidgetDefinition" - $ref: "#/components/schemas/ServiceSummaryWidgetDefinition" - $ref: "#/components/schemas/SplitGraphWidgetDefinition" diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 30adedda3d3..4613e953625 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -75976,6 +75976,7 @@ paths: x-pagination: limitParam: page[size] pageParam: page[number] + pageStart: 1 resultsPath: data post: description: Create a Case @@ -91070,7 +91071,7 @@ paths: schema: type: boolean - description: |- - Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with `filter[queried]`. + Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with `filter[queried]`. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second. example: 15552000 in: query name: filter[queried][window][seconds] @@ -91098,7 +91099,7 @@ paths: schema: type: boolean - description: |- - Only return metrics that have been actively reporting in the specified window. + Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second. example: 3600 in: query name: window[seconds] @@ -91109,7 +91110,7 @@ paths: maximum: 2592000 minimum: 1 type: integer - - description: Maximum number of results per page. Use with `page[cursor]` for pagination. + - description: Maximum number of results per page. Use with `page[cursor]` for pagination. The default value is 10000, the maximum value is 10000, and the minimum value is 1. in: query name: page[size] required: false diff --git a/.generator/src/generator/templates/Api.j2 b/.generator/src/generator/templates/Api.j2 index ff84ca2510e..30219fb2a65 100644 --- a/.generator/src/generator/templates/Api.j2 +++ b/.generator/src/generator/templates/Api.j2 @@ -148,7 +148,7 @@ public class {{ name }} { String valueGetterPath = ""; String valueSetterPath = "{%- if getters|length > 1 %}{{ ".".join(getters[:getters|length-1]) }}.{%- endif %}{{ setters[getters|length-1] }}"; Boolean valueSetterParamOptional = {{ optional|lower }}; - parameters.{% if getters|length > 1 %}{{ ".".join(getters[:getters|length-1]) }}.{%- endif %}{{ setters[getters|length-1] }}({{ 0|format_value(schema=paramSchema['schema']) }}); + parameters.{% if getters|length > 1 %}{{ ".".join(getters[:getters|length-1]) }}.{%- endif %}{{ setters[getters|length-1] }}({{ (pagination.pageStart | default(0))|format_value(schema=paramSchema['schema']) }}); {%- endif %} {#- Limit param field #} @@ -205,7 +205,7 @@ public class {{ name }} { args.put("optionalParams", parameters); {%- endif %} - PaginationIterable iterator = new PaginationIterable(this, "{{ operationId }}", resultsPath, valueGetterPath, valueSetterPath, valueSetterParamOptional, {% if pagination.pageParam %}false{% else %}true{% endif %}, limit, args); + PaginationIterable iterator = new PaginationIterable(this, "{{ operationId }}", resultsPath, valueGetterPath, valueSetterPath, valueSetterParamOptional, {% if pagination.pageParam %}false{% else %}true{% endif %}, limit, args, {{ pagination.pageStart | default(0) }}); return iterator; {%- endmacro %} diff --git a/.generator/src/generator/templates/PaginationIterable.j2 b/.generator/src/generator/templates/PaginationIterable.j2 index 5611ae9c40e..462ce917a8f 100644 --- a/.generator/src/generator/templates/PaginationIterable.j2 +++ b/.generator/src/generator/templates/PaginationIterable.j2 @@ -14,6 +14,7 @@ public class PaginationIterable implements Iterable { Boolean offsetPageIncrement; Object limit; LinkedHashMap args; + int pageStart; public PaginationIterable( Object requestClass, @@ -24,7 +25,8 @@ public class PaginationIterable implements Iterable { Boolean valueSetterParamOptional, Boolean offsetPageIncrement, Object limit, - LinkedHashMap args) { + LinkedHashMap args, + int pageStart) { this.requestClass = requestClass; this.requestName = requestName; @@ -41,6 +43,7 @@ public class PaginationIterable implements Iterable { this.offsetPageIncrement = offsetPageIncrement; this.limit = limit; this.args = args; + this.pageStart = pageStart; } @Override diff --git a/.generator/src/generator/templates/PaginationIterator.j2 b/.generator/src/generator/templates/PaginationIterator.j2 index cc1fdf0642f..791c56fda3b 100644 --- a/.generator/src/generator/templates/PaginationIterator.j2 +++ b/.generator/src/generator/templates/PaginationIterator.j2 @@ -80,13 +80,13 @@ public class PaginationIterator implements Iterator { value = value.getClass().getMethod(path).invoke(value); } } else { - // fallback to pageOffset = totalCount; + // fallback to pageOffset = pageStart + totalCount; // We cast the type based on the setterMethod parameter type String pType = setterMethod.getParameterTypes()[0].getSimpleName(); if ("Long".equals(pType)) { - value = (long) this.totalCount; + value = (long) (this.iterable.pageStart + this.totalCount); } else { - value = this.totalCount; + value = this.iterable.pageStart + this.totalCount; } } diff --git a/examples/v1/dashboards/CreateDashboard_258152475.java b/examples/v1/dashboards/CreateDashboard_258152475.java new file mode 100644 index 00000000000..c7623dd800f --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_258152475.java @@ -0,0 +1,71 @@ +// Create a new dashboard with sankey widget and network data source + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.DashboardsApi; +import com.datadog.api.client.v1.model.Dashboard; +import com.datadog.api.client.v1.model.DashboardLayoutType; +import com.datadog.api.client.v1.model.SankeyNetworkDataSource; +import com.datadog.api.client.v1.model.SankeyNetworkQuery; +import com.datadog.api.client.v1.model.SankeyNetworkRequest; +import com.datadog.api.client.v1.model.SankeyNetworkRequestType; +import com.datadog.api.client.v1.model.SankeyWidgetDefinition; +import com.datadog.api.client.v1.model.SankeyWidgetDefinitionType; +import com.datadog.api.client.v1.model.SankeyWidgetRequest; +import com.datadog.api.client.v1.model.Widget; +import com.datadog.api.client.v1.model.WidgetDefinition; +import com.datadog.api.client.v1.model.WidgetLayout; +import com.datadog.api.client.v1.model.WidgetTextAlign; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + Dashboard body = + new Dashboard() + .title("Example-Dashboard") + .description("") + .widgets( + Collections.singletonList( + new Widget() + .layout(new WidgetLayout().x(0L).y(0L).width(47L).height(15L)) + .definition( + new WidgetDefinition( + new SankeyWidgetDefinition() + .title("") + .titleSize("16") + .titleAlign(WidgetTextAlign.LEFT) + .type(SankeyWidgetDefinitionType.SANKEY) + .requests( + Collections.singletonList( + new SankeyWidgetRequest( + new SankeyNetworkRequest() + .query( + new SankeyNetworkQuery() + .dataSource( + SankeyNetworkDataSource.NETWORK) + .queryString("*") + .groupBy( + Arrays.asList( + "source", "destination")) + .limit(100L)) + .requestType( + SankeyNetworkRequestType + .NETFLOW_SANKEY)))))))) + .layoutType(DashboardLayoutType.FREE); + + try { + Dashboard result = apiInstance.createDashboard(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DashboardsApi#createDashboard"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v1/dashboards/CreateDashboard_2932151909.java b/examples/v1/dashboards/CreateDashboard_2932151909.java new file mode 100644 index 00000000000..f427047d394 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2932151909.java @@ -0,0 +1,65 @@ +// Create a new dashboard with sankey widget and rum data source + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.DashboardsApi; +import com.datadog.api.client.v1.model.Dashboard; +import com.datadog.api.client.v1.model.DashboardLayoutType; +import com.datadog.api.client.v1.model.SankeyRumDataSource; +import com.datadog.api.client.v1.model.SankeyRumQuery; +import com.datadog.api.client.v1.model.SankeyRumQueryMode; +import com.datadog.api.client.v1.model.SankeyRumRequest; +import com.datadog.api.client.v1.model.SankeyWidgetDefinition; +import com.datadog.api.client.v1.model.SankeyWidgetDefinitionType; +import com.datadog.api.client.v1.model.SankeyWidgetRequest; +import com.datadog.api.client.v1.model.Widget; +import com.datadog.api.client.v1.model.WidgetDefinition; +import com.datadog.api.client.v1.model.WidgetLayout; +import com.datadog.api.client.v1.model.WidgetTextAlign; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + Dashboard body = + new Dashboard() + .title("Example-Dashboard") + .description("") + .widgets( + Collections.singletonList( + new Widget() + .layout(new WidgetLayout().x(0L).y(0L).width(47L).height(15L)) + .definition( + new WidgetDefinition( + new SankeyWidgetDefinition() + .title("") + .titleSize("16") + .titleAlign(WidgetTextAlign.LEFT) + .type(SankeyWidgetDefinitionType.SANKEY) + .requests( + Collections.singletonList( + new SankeyWidgetRequest( + new SankeyRumRequest() + .query( + new SankeyRumQuery() + .dataSource(SankeyRumDataSource.RUM) + .queryString("@type:view") + .mode(SankeyRumQueryMode.SOURCE)) + .requestType( + SankeyWidgetDefinitionType.SANKEY)))))))) + .layoutType(DashboardLayoutType.FREE); + + try { + Dashboard result = apiInstance.createDashboard(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DashboardsApi#createDashboard"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v1/dashboards/CreateDashboard_373890042.java b/examples/v1/dashboards/CreateDashboard_373890042.java new file mode 100644 index 00000000000..48da8a511eb --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_373890042.java @@ -0,0 +1,67 @@ +// Create a new dashboard with sankey widget and product analytics data source + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.DashboardsApi; +import com.datadog.api.client.v1.model.Dashboard; +import com.datadog.api.client.v1.model.DashboardLayoutType; +import com.datadog.api.client.v1.model.SankeyRumDataSource; +import com.datadog.api.client.v1.model.SankeyRumQuery; +import com.datadog.api.client.v1.model.SankeyRumQueryMode; +import com.datadog.api.client.v1.model.SankeyRumRequest; +import com.datadog.api.client.v1.model.SankeyWidgetDefinition; +import com.datadog.api.client.v1.model.SankeyWidgetDefinitionType; +import com.datadog.api.client.v1.model.SankeyWidgetRequest; +import com.datadog.api.client.v1.model.Widget; +import com.datadog.api.client.v1.model.WidgetDefinition; +import com.datadog.api.client.v1.model.WidgetLayout; +import com.datadog.api.client.v1.model.WidgetTextAlign; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + Dashboard body = + new Dashboard() + .title("Example-Dashboard") + .description("") + .widgets( + Collections.singletonList( + new Widget() + .layout(new WidgetLayout().x(0L).y(0L).width(47L).height(15L)) + .definition( + new WidgetDefinition( + new SankeyWidgetDefinition() + .title("") + .titleSize("16") + .titleAlign(WidgetTextAlign.LEFT) + .type(SankeyWidgetDefinitionType.SANKEY) + .requests( + Collections.singletonList( + new SankeyWidgetRequest( + new SankeyRumRequest() + .query( + new SankeyRumQuery() + .dataSource( + SankeyRumDataSource + .PRODUCT_ANALYTICS) + .queryString("@type:session") + .mode(SankeyRumQueryMode.SOURCE)) + .requestType( + SankeyWidgetDefinitionType.SANKEY)))))))) + .layoutType(DashboardLayoutType.FREE); + + try { + Dashboard result = apiInstance.createDashboard(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DashboardsApi#createDashboard"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/SearchCases_3433960044.java b/examples/v2/case-management/SearchCases_3433960044.java index bb45c9d8a9d..3bdf8b7d6a9 100644 --- a/examples/v2/case-management/SearchCases_3433960044.java +++ b/examples/v2/case-management/SearchCases_3433960044.java @@ -3,6 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.api.CaseManagementApi.SearchCasesOptionalParameters; import com.datadog.api.client.v2.model.Case; public class Example { @@ -11,7 +12,9 @@ public static void main(String[] args) { CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); try { - PaginationIterable iterable = apiInstance.searchCasesWithPagination(); + PaginationIterable iterable = + apiInstance.searchCasesWithPagination( + new SearchCasesOptionalParameters().pageSize(2L).filter("status:closed")); for (Case item : iterable) { System.out.println(item); diff --git a/examples/v2/teams/DeleteTeamMembership.java b/examples/v2/teams/DeleteTeamMembership.java index e93da80a6b2..dc033fe3840 100644 --- a/examples/v2/teams/DeleteTeamMembership.java +++ b/examples/v2/teams/DeleteTeamMembership.java @@ -12,8 +12,11 @@ public static void main(String[] args) { // there is a valid "dd_team" in the system String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + // there is a valid "user" in the system + String USER_DATA_ID = System.getenv("USER_DATA_ID"); + try { - apiInstance.deleteTeamMembership(DD_TEAM_DATA_ID, "user_id"); + apiInstance.deleteTeamMembership(DD_TEAM_DATA_ID, USER_DATA_ID); } catch (ApiException e) { System.err.println("Exception when calling TeamsApi#deleteTeamMembership"); System.err.println("Status code: " + e.getCode()); diff --git a/examples/v2/teams/UpdateTeam_780342264.java b/examples/v2/teams/UpdateTeam_780342264.java new file mode 100644 index 00000000000..4eb88a442e7 --- /dev/null +++ b/examples/v2/teams/UpdateTeam_780342264.java @@ -0,0 +1,43 @@ +// Update a team with partial update returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamResponse; +import com.datadog.api.client.v2.model.TeamType; +import com.datadog.api.client.v2.model.TeamUpdate; +import com.datadog.api.client.v2.model.TeamUpdateAttributes; +import com.datadog.api.client.v2.model.TeamUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ATTRIBUTES_HANDLE = System.getenv("DD_TEAM_DATA_ATTRIBUTES_HANDLE"); + String DD_TEAM_DATA_ATTRIBUTES_NAME = System.getenv("DD_TEAM_DATA_ATTRIBUTES_NAME"); + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + TeamUpdateRequest body = + new TeamUpdateRequest() + .data( + new TeamUpdate() + .attributes( + new TeamUpdateAttributes() + .handle(DD_TEAM_DATA_ATTRIBUTES_HANDLE) + .name("Example Team updated")) + .type(TeamType.TEAM)); + + try { + TeamResponse result = apiInstance.updateTeam(DD_TEAM_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/PaginationIterable.java b/src/main/java/com/datadog/api/client/PaginationIterable.java index b27db643ea6..46e97372660 100644 --- a/src/main/java/com/datadog/api/client/PaginationIterable.java +++ b/src/main/java/com/datadog/api/client/PaginationIterable.java @@ -18,6 +18,7 @@ public class PaginationIterable implements Iterable { Boolean offsetPageIncrement; Object limit; LinkedHashMap args; + int pageStart; public PaginationIterable( Object requestClass, @@ -28,7 +29,8 @@ public PaginationIterable( Boolean valueSetterParamOptional, Boolean offsetPageIncrement, Object limit, - LinkedHashMap args) { + LinkedHashMap args, + int pageStart) { this.requestClass = requestClass; this.requestName = requestName; @@ -45,6 +47,7 @@ public PaginationIterable( this.offsetPageIncrement = offsetPageIncrement; this.limit = limit; this.args = args; + this.pageStart = pageStart; } @Override diff --git a/src/main/java/com/datadog/api/client/PaginationIterator.java b/src/main/java/com/datadog/api/client/PaginationIterator.java index 791700c874d..6aaac0f7c3e 100644 --- a/src/main/java/com/datadog/api/client/PaginationIterator.java +++ b/src/main/java/com/datadog/api/client/PaginationIterator.java @@ -85,13 +85,13 @@ private void setNextPageValue(Object response) value = value.getClass().getMethod(path).invoke(value); } } else { - // fallback to pageOffset = totalCount; + // fallback to pageOffset = pageStart + totalCount; // We cast the type based on the setterMethod parameter type String pType = setterMethod.getParameterTypes()[0].getSimpleName(); if ("Long".equals(pType)) { - value = (long) this.totalCount; + value = (long) (this.iterable.pageStart + this.totalCount); } else { - value = this.totalCount; + value = this.iterable.pageStart + this.totalCount; } } diff --git a/src/main/java/com/datadog/api/client/v1/api/DashboardsApi.java b/src/main/java/com/datadog/api/client/v1/api/DashboardsApi.java index 89a84044c70..c7c0f2d805f 100644 --- a/src/main/java/com/datadog/api/client/v1/api/DashboardsApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/DashboardsApi.java @@ -1544,7 +1544,8 @@ public PaginationIterable listDashboardsWithPaginati valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v1/api/MonitorsApi.java b/src/main/java/com/datadog/api/client/v1/api/MonitorsApi.java index af38a3413e3..aba7ae81cf3 100644 --- a/src/main/java/com/datadog/api/client/v1/api/MonitorsApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/MonitorsApi.java @@ -1330,7 +1330,8 @@ public PaginationIterable listMonitorsWithPagination( valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v1/api/NotebooksApi.java b/src/main/java/com/datadog/api/client/v1/api/NotebooksApi.java index 69f68c40a03..4698f52b9d5 100644 --- a/src/main/java/com/datadog/api/client/v1/api/NotebooksApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/NotebooksApi.java @@ -691,7 +691,8 @@ public PaginationIterable listNotebooksWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectiveCorrectionsApi.java b/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectiveCorrectionsApi.java index 1cdfcc3aa0a..5aed573c0a8 100644 --- a/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectiveCorrectionsApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectiveCorrectionsApi.java @@ -598,7 +598,8 @@ public PaginationIterable listSLOCorrectionWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectivesApi.java b/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectivesApi.java index cb90074ddc3..078b3f88a4d 100644 --- a/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectivesApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/ServiceLevelObjectivesApi.java @@ -1446,7 +1446,8 @@ public PaginationIterable listSLOsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java b/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java index c54d6bf8d57..959610ad72d 100644 --- a/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java @@ -3655,7 +3655,8 @@ public PaginationIterable listTestsWithPagina valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v1/model/EventsAggregation.java b/src/main/java/com/datadog/api/client/v1/model/EventsAggregation.java new file mode 100644 index 00000000000..6badfaab74c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EventsAggregation.java @@ -0,0 +1,270 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = EventsAggregation.EventsAggregationDeserializer.class) +@JsonSerialize(using = EventsAggregation.EventsAggregationSerializer.class) +public class EventsAggregation extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EventsAggregation.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class EventsAggregationSerializer extends StdSerializer { + public EventsAggregationSerializer(Class t) { + super(t); + } + + public EventsAggregationSerializer() { + this(null); + } + + @Override + public void serialize(EventsAggregation value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class EventsAggregationDeserializer extends StdDeserializer { + public EventsAggregationDeserializer() { + this(EventsAggregation.class); + } + + public EventsAggregationDeserializer(Class vc) { + super(vc); + } + + @Override + public EventsAggregation deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize EventsAggregationValue + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EventsAggregationValue.class.equals(Integer.class) + || EventsAggregationValue.class.equals(Long.class) + || EventsAggregationValue.class.equals(Float.class) + || EventsAggregationValue.class.equals(Double.class) + || EventsAggregationValue.class.equals(Boolean.class) + || EventsAggregationValue.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EventsAggregationValue.class.equals(Integer.class) + || EventsAggregationValue.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EventsAggregationValue.class.equals(Float.class) + || EventsAggregationValue.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EventsAggregationValue.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EventsAggregationValue.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(EventsAggregationValue.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'EventsAggregationValue'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'EventsAggregationValue'", e); + } + + // deserialize String + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (String.class.equals(Integer.class) + || String.class.equals(Long.class) + || String.class.equals(Float.class) + || String.class.equals(Double.class) + || String.class.equals(Boolean.class) + || String.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((String.class.equals(Integer.class) || String.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((String.class.equals(Float.class) || String.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (String.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (String.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(String.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'String'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + EventsAggregation ret = new EventsAggregation(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public EventsAggregation getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "EventsAggregation cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public EventsAggregation() { + super("oneOf", Boolean.FALSE); + } + + public EventsAggregation(EventsAggregationValue o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EventsAggregation(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EventsAggregationValue", new GenericType() {}); + schemas.put("String", new GenericType() {}); + JSON.registerDescendants(EventsAggregation.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return EventsAggregation.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: EventsAggregationValue, String + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(EventsAggregationValue.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be EventsAggregationValue, String"); + } + + /** + * Get the actual instance, which can be the following: EventsAggregationValue, String + * + * @return The actual instance (EventsAggregationValue, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EventsAggregationValue`. If the actual instance is not + * `EventsAggregationValue`, the ClassCastException will be thrown. + * + * @return The actual instance of `EventsAggregationValue` + * @throws ClassCastException if the instance is not `EventsAggregationValue` + */ + public EventsAggregationValue getEventsAggregationValue() throws ClassCastException { + return (EventsAggregationValue) super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EventsAggregationValue.java b/src/main/java/com/datadog/api/client/v1/model/EventsAggregationValue.java new file mode 100644 index 00000000000..eb776407af9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EventsAggregationValue.java @@ -0,0 +1,80 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Standard aggregation types for events-based queries. */ +@JsonSerialize(using = EventsAggregationValue.EventsAggregationValueSerializer.class) +public class EventsAggregationValue extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "avg", + "cardinality", + "count", + "delta", + "earliest", + "latest", + "max", + "median", + "min", + "most_frequent", + "sum")); + + public static final EventsAggregationValue AVG = new EventsAggregationValue("avg"); + public static final EventsAggregationValue CARDINALITY = + new EventsAggregationValue("cardinality"); + public static final EventsAggregationValue COUNT = new EventsAggregationValue("count"); + public static final EventsAggregationValue DELTA = new EventsAggregationValue("delta"); + public static final EventsAggregationValue EARLIEST = new EventsAggregationValue("earliest"); + public static final EventsAggregationValue LATEST = new EventsAggregationValue("latest"); + public static final EventsAggregationValue MAX = new EventsAggregationValue("max"); + public static final EventsAggregationValue MEDIAN = new EventsAggregationValue("median"); + public static final EventsAggregationValue MIN = new EventsAggregationValue("min"); + public static final EventsAggregationValue MOST_FREQUENT = + new EventsAggregationValue("most_frequent"); + public static final EventsAggregationValue SUM = new EventsAggregationValue("sum"); + + EventsAggregationValue(String value) { + super(value, allowedValues); + } + + public static class EventsAggregationValueSerializer + extends StdSerializer { + public EventsAggregationValueSerializer(Class t) { + super(t); + } + + public EventsAggregationValueSerializer() { + this(null); + } + + @Override + public void serialize( + EventsAggregationValue value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EventsAggregationValue fromValue(String value) { + return new EventsAggregationValue(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceAccountSubquery.java b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceAccountSubquery.java new file mode 100644 index 00000000000..c517e4af22a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceAccountSubquery.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Product Analytics audience account subquery. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceAccountSubquery.JSON_PROPERTY_NAME, + ProductAnalyticsAudienceAccountSubquery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceAccountSubquery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsAudienceAccountSubquery name(String name) { + this.name = name; + return this; + } + + /** + * Getname + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProductAnalyticsAudienceAccountSubquery query(String query) { + this.query = query; + return this; + } + + /** + * Getquery + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsAudienceAccountSubquery + */ + @JsonAnySetter + public ProductAnalyticsAudienceAccountSubquery putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProductAnalyticsAudienceAccountSubquery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceAccountSubquery productAnalyticsAudienceAccountSubquery = + (ProductAnalyticsAudienceAccountSubquery) o; + return Objects.equals(this.name, productAnalyticsAudienceAccountSubquery.name) + && Objects.equals(this.query, productAnalyticsAudienceAccountSubquery.query) + && Objects.equals( + this.additionalProperties, + productAnalyticsAudienceAccountSubquery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceAccountSubquery {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceFilters.java b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceFilters.java new file mode 100644 index 00000000000..002940bb8ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceFilters.java @@ -0,0 +1,263 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Product Analytics/RUM audience filters. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceFilters.JSON_PROPERTY_ACCOUNTS, + ProductAnalyticsAudienceFilters.JSON_PROPERTY_FILTER_CONDITION, + ProductAnalyticsAudienceFilters.JSON_PROPERTY_SEGMENTS, + ProductAnalyticsAudienceFilters.JSON_PROPERTY_USERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceFilters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; + + public static final String JSON_PROPERTY_FILTER_CONDITION = "filter_condition"; + private String filterCondition; + + public static final String JSON_PROPERTY_SEGMENTS = "segments"; + private List segments = null; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = null; + + public ProductAnalyticsAudienceFilters accounts( + List accounts) { + this.accounts = accounts; + for (ProductAnalyticsAudienceAccountSubquery item : accounts) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAudienceFilters addAccountsItem( + ProductAnalyticsAudienceAccountSubquery accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + this.unparsed |= accountsItem.unparsed; + return this; + } + + /** + * Getaccounts + * + * @return accounts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccounts() { + return accounts; + } + + public void setAccounts(List accounts) { + this.accounts = accounts; + } + + public ProductAnalyticsAudienceFilters filterCondition(String filterCondition) { + this.filterCondition = filterCondition; + return this; + } + + /** + * GetfilterCondition + * + * @return filterCondition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTER_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilterCondition() { + return filterCondition; + } + + public void setFilterCondition(String filterCondition) { + this.filterCondition = filterCondition; + } + + public ProductAnalyticsAudienceFilters segments( + List segments) { + this.segments = segments; + for (ProductAnalyticsAudienceSegmentSubquery item : segments) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAudienceFilters addSegmentsItem( + ProductAnalyticsAudienceSegmentSubquery segmentsItem) { + if (this.segments == null) { + this.segments = new ArrayList<>(); + } + this.segments.add(segmentsItem); + this.unparsed |= segmentsItem.unparsed; + return this; + } + + /** + * Getsegments + * + * @return segments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSegments() { + return segments; + } + + public void setSegments(List segments) { + this.segments = segments; + } + + public ProductAnalyticsAudienceFilters users(List users) { + this.users = users; + for (ProductAnalyticsAudienceUserSubquery item : users) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAudienceFilters addUsersItem( + ProductAnalyticsAudienceUserSubquery usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + this.unparsed |= usersItem.unparsed; + return this; + } + + /** + * Getusers + * + * @return users + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsAudienceFilters + */ + @JsonAnySetter + public ProductAnalyticsAudienceFilters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProductAnalyticsAudienceFilters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceFilters productAnalyticsAudienceFilters = + (ProductAnalyticsAudienceFilters) o; + return Objects.equals(this.accounts, productAnalyticsAudienceFilters.accounts) + && Objects.equals(this.filterCondition, productAnalyticsAudienceFilters.filterCondition) + && Objects.equals(this.segments, productAnalyticsAudienceFilters.segments) + && Objects.equals(this.users, productAnalyticsAudienceFilters.users) + && Objects.equals( + this.additionalProperties, productAnalyticsAudienceFilters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accounts, filterCondition, segments, users, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceFilters {\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append(" filterCondition: ").append(toIndentedString(filterCondition)).append("\n"); + sb.append(" segments: ").append(toIndentedString(segments)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceOccurrenceFilter.java b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceOccurrenceFilter.java new file mode 100644 index 00000000000..22a3771ccb6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceOccurrenceFilter.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceOccurrenceFilter.JSON_PROPERTY_OPERATOR, + ProductAnalyticsAudienceOccurrenceFilter.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceOccurrenceFilter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private String operator; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public ProductAnalyticsAudienceOccurrenceFilter operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Getoperator + * + * @return operator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public ProductAnalyticsAudienceOccurrenceFilter value(String value) { + this.value = value; + return this; + } + + /** + * Getvalue + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsAudienceOccurrenceFilter + */ + @JsonAnySetter + public ProductAnalyticsAudienceOccurrenceFilter putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProductAnalyticsAudienceOccurrenceFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceOccurrenceFilter productAnalyticsAudienceOccurrenceFilter = + (ProductAnalyticsAudienceOccurrenceFilter) o; + return Objects.equals(this.operator, productAnalyticsAudienceOccurrenceFilter.operator) + && Objects.equals(this.value, productAnalyticsAudienceOccurrenceFilter.value) + && Objects.equals( + this.additionalProperties, + productAnalyticsAudienceOccurrenceFilter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operator, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceOccurrenceFilter {\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceSegmentSubquery.java b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceSegmentSubquery.java new file mode 100644 index 00000000000..591f7ba5416 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceSegmentSubquery.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Product Analytics audience segment subquery. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceSegmentSubquery.JSON_PROPERTY_NAME, + ProductAnalyticsAudienceSegmentSubquery.JSON_PROPERTY_SEGMENT_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceSegmentSubquery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SEGMENT_ID = "segment_id"; + private String segmentId; + + public ProductAnalyticsAudienceSegmentSubquery name(String name) { + this.name = name; + return this; + } + + /** + * Getname + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProductAnalyticsAudienceSegmentSubquery segmentId(String segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * GetsegmentId + * + * @return segmentId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSegmentId() { + return segmentId; + } + + public void setSegmentId(String segmentId) { + this.segmentId = segmentId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsAudienceSegmentSubquery + */ + @JsonAnySetter + public ProductAnalyticsAudienceSegmentSubquery putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProductAnalyticsAudienceSegmentSubquery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceSegmentSubquery productAnalyticsAudienceSegmentSubquery = + (ProductAnalyticsAudienceSegmentSubquery) o; + return Objects.equals(this.name, productAnalyticsAudienceSegmentSubquery.name) + && Objects.equals(this.segmentId, productAnalyticsAudienceSegmentSubquery.segmentId) + && Objects.equals( + this.additionalProperties, + productAnalyticsAudienceSegmentSubquery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, segmentId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceSegmentSubquery {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceUserSubquery.java b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceUserSubquery.java new file mode 100644 index 00000000000..cb1fec701fe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/ProductAnalyticsAudienceUserSubquery.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Product Analytics audience user subquery. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceUserSubquery.JSON_PROPERTY_NAME, + ProductAnalyticsAudienceUserSubquery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceUserSubquery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsAudienceUserSubquery name(String name) { + this.name = name; + return this; + } + + /** + * Getname + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProductAnalyticsAudienceUserSubquery query(String query) { + this.query = query; + return this; + } + + /** + * Getquery + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsAudienceUserSubquery + */ + @JsonAnySetter + public ProductAnalyticsAudienceUserSubquery putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProductAnalyticsAudienceUserSubquery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceUserSubquery productAnalyticsAudienceUserSubquery = + (ProductAnalyticsAudienceUserSubquery) o; + return Objects.equals(this.name, productAnalyticsAudienceUserSubquery.name) + && Objects.equals(this.query, productAnalyticsAudienceUserSubquery.query) + && Objects.equals( + this.additionalProperties, productAnalyticsAudienceUserSubquery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceUserSubquery {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyJoinKeys.java b/src/main/java/com/datadog/api/client/v1/model/SankeyJoinKeys.java new file mode 100644 index 00000000000..e7cc3940045 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyJoinKeys.java @@ -0,0 +1,125 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Join keys. */ +@JsonPropertyOrder({SankeyJoinKeys.JSON_PROPERTY_PRIMARY, SankeyJoinKeys.JSON_PROPERTY_SECONDARY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyJoinKeys { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PRIMARY = "primary"; + private String primary; + + public static final String JSON_PROPERTY_SECONDARY = "secondary"; + private List secondary = null; + + public SankeyJoinKeys() {} + + @JsonCreator + public SankeyJoinKeys( + @JsonProperty(required = true, value = JSON_PROPERTY_PRIMARY) String primary) { + this.primary = primary; + } + + public SankeyJoinKeys primary(String primary) { + this.primary = primary; + return this; + } + + /** + * Primary join key. + * + * @return primary + */ + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrimary() { + return primary; + } + + public void setPrimary(String primary) { + this.primary = primary; + } + + public SankeyJoinKeys secondary(List secondary) { + this.secondary = secondary; + return this; + } + + public SankeyJoinKeys addSecondaryItem(String secondaryItem) { + if (this.secondary == null) { + this.secondary = new ArrayList<>(); + } + this.secondary.add(secondaryItem); + return this; + } + + /** + * Secondary join keys. + * + * @return secondary + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSecondary() { + return secondary; + } + + public void setSecondary(List secondary) { + this.secondary = secondary; + } + + /** Return true if this SankeyJoinKeys object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyJoinKeys sankeyJoinKeys = (SankeyJoinKeys) o; + return Objects.equals(this.primary, sankeyJoinKeys.primary) + && Objects.equals(this.secondary, sankeyJoinKeys.secondary); + } + + @Override + public int hashCode() { + return Objects.hash(primary, secondary); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyJoinKeys {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" secondary: ").append(toIndentedString(secondary)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkDataSource.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkDataSource.java new file mode 100644 index 00000000000..d5ab54de05d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkDataSource.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Network data source type. */ +@JsonSerialize(using = SankeyNetworkDataSource.SankeyNetworkDataSourceSerializer.class) +public class SankeyNetworkDataSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("network_device_flows", "network")); + + public static final SankeyNetworkDataSource NETWORK_DEVICE_FLOWS = + new SankeyNetworkDataSource("network_device_flows"); + public static final SankeyNetworkDataSource NETWORK = new SankeyNetworkDataSource("network"); + + SankeyNetworkDataSource(String value) { + super(value, allowedValues); + } + + public static class SankeyNetworkDataSourceSerializer + extends StdSerializer { + public SankeyNetworkDataSourceSerializer(Class t) { + super(t); + } + + public SankeyNetworkDataSourceSerializer() { + this(null); + } + + @Override + public void serialize( + SankeyNetworkDataSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SankeyNetworkDataSource fromValue(String value) { + return new SankeyNetworkDataSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQuery.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQuery.java new file mode 100644 index 00000000000..c8a2e444921 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQuery.java @@ -0,0 +1,305 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Query configuration for Sankey network widget. */ +@JsonPropertyOrder({ + SankeyNetworkQuery.JSON_PROPERTY_COMPUTE, + SankeyNetworkQuery.JSON_PROPERTY_DATA_SOURCE, + SankeyNetworkQuery.JSON_PROPERTY_GROUP_BY, + SankeyNetworkQuery.JSON_PROPERTY_LIMIT, + SankeyNetworkQuery.JSON_PROPERTY_MODE, + SankeyNetworkQuery.JSON_PROPERTY_QUERY_STRING, + SankeyNetworkQuery.JSON_PROPERTY_SHOULD_EXCLUDE_MISSING, + SankeyNetworkQuery.JSON_PROPERTY_SORT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyNetworkQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private SankeyNetworkQueryCompute compute; + + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private SankeyNetworkDataSource dataSource = SankeyNetworkDataSource.NETWORK; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_MODE = "mode"; + private SankeyNetworkQueryMode mode = SankeyNetworkQueryMode.TARGET; + + public static final String JSON_PROPERTY_QUERY_STRING = "query_string"; + private String queryString; + + public static final String JSON_PROPERTY_SHOULD_EXCLUDE_MISSING = "should_exclude_missing"; + private Boolean shouldExcludeMissing; + + public static final String JSON_PROPERTY_SORT = "sort"; + private SankeyNetworkQuerySort sort; + + public SankeyNetworkQuery() {} + + @JsonCreator + public SankeyNetworkQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) + SankeyNetworkDataSource dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_BY) List groupBy, + @JsonProperty(required = true, value = JSON_PROPERTY_LIMIT) Long limit, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY_STRING) String queryString) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + this.groupBy = groupBy; + this.limit = limit; + this.queryString = queryString; + } + + public SankeyNetworkQuery compute(SankeyNetworkQueryCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * Compute aggregation for network queries. + * + * @return compute + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SankeyNetworkQueryCompute getCompute() { + return compute; + } + + public void setCompute(SankeyNetworkQueryCompute compute) { + this.compute = compute; + } + + public SankeyNetworkQuery dataSource(SankeyNetworkDataSource dataSource) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + return this; + } + + /** + * Network data source type. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyNetworkDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(SankeyNetworkDataSource dataSource) { + if (!dataSource.isValid()) { + this.unparsed = true; + } + this.dataSource = dataSource; + } + + public SankeyNetworkQuery groupBy(List groupBy) { + this.groupBy = groupBy; + return this; + } + + public SankeyNetworkQuery addGroupByItem(String groupByItem) { + this.groupBy.add(groupByItem); + return this; + } + + /** + * Fields to group by. + * + * @return groupBy + */ + @JsonProperty(JSON_PROPERTY_GROUP_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public SankeyNetworkQuery limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of results. + * + * @return limit + */ + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public SankeyNetworkQuery mode(SankeyNetworkQueryMode mode) { + this.mode = mode; + this.unparsed |= !mode.isValid(); + return this; + } + + /** + * Sankey mode for network queries. + * + * @return mode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SankeyNetworkQueryMode getMode() { + return mode; + } + + public void setMode(SankeyNetworkQueryMode mode) { + if (!mode.isValid()) { + this.unparsed = true; + } + this.mode = mode; + } + + public SankeyNetworkQuery queryString(String queryString) { + this.queryString = queryString; + return this; + } + + /** + * Query string for filtering network data. + * + * @return queryString + */ + @JsonProperty(JSON_PROPERTY_QUERY_STRING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQueryString() { + return queryString; + } + + public void setQueryString(String queryString) { + this.queryString = queryString; + } + + public SankeyNetworkQuery shouldExcludeMissing(Boolean shouldExcludeMissing) { + this.shouldExcludeMissing = shouldExcludeMissing; + return this; + } + + /** + * Whether to exclude missing values. + * + * @return shouldExcludeMissing + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOULD_EXCLUDE_MISSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShouldExcludeMissing() { + return shouldExcludeMissing; + } + + public void setShouldExcludeMissing(Boolean shouldExcludeMissing) { + this.shouldExcludeMissing = shouldExcludeMissing; + } + + public SankeyNetworkQuery sort(SankeyNetworkQuerySort sort) { + this.sort = sort; + this.unparsed |= sort.unparsed; + return this; + } + + /** + * Sort configuration for network queries. + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SankeyNetworkQuerySort getSort() { + return sort; + } + + public void setSort(SankeyNetworkQuerySort sort) { + this.sort = sort; + } + + /** Return true if this SankeyNetworkQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyNetworkQuery sankeyNetworkQuery = (SankeyNetworkQuery) o; + return Objects.equals(this.compute, sankeyNetworkQuery.compute) + && Objects.equals(this.dataSource, sankeyNetworkQuery.dataSource) + && Objects.equals(this.groupBy, sankeyNetworkQuery.groupBy) + && Objects.equals(this.limit, sankeyNetworkQuery.limit) + && Objects.equals(this.mode, sankeyNetworkQuery.mode) + && Objects.equals(this.queryString, sankeyNetworkQuery.queryString) + && Objects.equals(this.shouldExcludeMissing, sankeyNetworkQuery.shouldExcludeMissing) + && Objects.equals(this.sort, sankeyNetworkQuery.sort); + } + + @Override + public int hashCode() { + return Objects.hash( + compute, dataSource, groupBy, limit, mode, queryString, shouldExcludeMissing, sort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyNetworkQuery {\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" queryString: ").append(toIndentedString(queryString)).append("\n"); + sb.append(" shouldExcludeMissing: ") + .append(toIndentedString(shouldExcludeMissing)) + .append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQueryCompute.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQueryCompute.java new file mode 100644 index 00000000000..95cdfe3083e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQueryCompute.java @@ -0,0 +1,122 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Compute aggregation for network queries. */ +@JsonPropertyOrder({ + SankeyNetworkQueryCompute.JSON_PROPERTY_AGGREGATION, + SankeyNetworkQueryCompute.JSON_PROPERTY_METRIC +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyNetworkQueryCompute { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION = "aggregation"; + private EventsAggregation aggregation; + + public static final String JSON_PROPERTY_METRIC = "metric"; + private String metric; + + public SankeyNetworkQueryCompute() {} + + @JsonCreator + public SankeyNetworkQueryCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) + EventsAggregation aggregation, + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC) String metric) { + this.aggregation = aggregation; + this.unparsed |= aggregation.unparsed; + this.metric = metric; + } + + public SankeyNetworkQueryCompute aggregation(EventsAggregation aggregation) { + this.aggregation = aggregation; + this.unparsed |= aggregation.unparsed; + return this; + } + + /** + * The type of aggregation that can be performed on events-based queries. + * + * @return aggregation + */ + @JsonProperty(JSON_PROPERTY_AGGREGATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventsAggregation getAggregation() { + return aggregation; + } + + public void setAggregation(EventsAggregation aggregation) { + this.aggregation = aggregation; + } + + public SankeyNetworkQueryCompute metric(String metric) { + this.metric = metric; + return this; + } + + /** + * Metric to aggregate. + * + * @return metric + */ + @JsonProperty(JSON_PROPERTY_METRIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + /** Return true if this SankeyNetworkQueryCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyNetworkQueryCompute sankeyNetworkQueryCompute = (SankeyNetworkQueryCompute) o; + return Objects.equals(this.aggregation, sankeyNetworkQueryCompute.aggregation) + && Objects.equals(this.metric, sankeyNetworkQueryCompute.metric); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, metric); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyNetworkQueryCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQueryMode.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQueryMode.java new file mode 100644 index 00000000000..2a39acf234c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQueryMode.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Sankey mode for network queries. */ +@JsonSerialize(using = SankeyNetworkQueryMode.SankeyNetworkQueryModeSerializer.class) +public class SankeyNetworkQueryMode extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("target")); + + public static final SankeyNetworkQueryMode TARGET = new SankeyNetworkQueryMode("target"); + + SankeyNetworkQueryMode(String value) { + super(value, allowedValues); + } + + public static class SankeyNetworkQueryModeSerializer + extends StdSerializer { + public SankeyNetworkQueryModeSerializer(Class t) { + super(t); + } + + public SankeyNetworkQueryModeSerializer() { + this(null); + } + + @Override + public void serialize( + SankeyNetworkQueryMode value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SankeyNetworkQueryMode fromValue(String value) { + return new SankeyNetworkQueryMode(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQuerySort.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQuerySort.java new file mode 100644 index 00000000000..2289c614029 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkQuerySort.java @@ -0,0 +1,168 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Sort configuration for network queries. */ +@JsonPropertyOrder({ + SankeyNetworkQuerySort.JSON_PROPERTY_FIELD, + SankeyNetworkQuerySort.JSON_PROPERTY_ORDER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyNetworkQuerySort { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELD = "field"; + private String field; + + public static final String JSON_PROPERTY_ORDER = "order"; + private WidgetSort order; + + public SankeyNetworkQuerySort field(String field) { + this.field = field; + return this; + } + + /** + * Field to sort by. + * + * @return field + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } + + public SankeyNetworkQuerySort order(WidgetSort order) { + this.order = order; + this.unparsed |= !order.isValid(); + return this; + } + + /** + * Widget sorting methods. + * + * @return order + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetSort getOrder() { + return order; + } + + public void setOrder(WidgetSort order) { + if (!order.isValid()) { + this.unparsed = true; + } + this.order = order; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SankeyNetworkQuerySort + */ + @JsonAnySetter + public SankeyNetworkQuerySort putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SankeyNetworkQuerySort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyNetworkQuerySort sankeyNetworkQuerySort = (SankeyNetworkQuerySort) o; + return Objects.equals(this.field, sankeyNetworkQuerySort.field) + && Objects.equals(this.order, sankeyNetworkQuerySort.order) + && Objects.equals(this.additionalProperties, sankeyNetworkQuerySort.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(field, order, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyNetworkQuerySort {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkRequest.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkRequest.java new file mode 100644 index 00000000000..3621c9d73e1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkRequest.java @@ -0,0 +1,127 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Sankey widget request for network data source. */ +@JsonPropertyOrder({ + SankeyNetworkRequest.JSON_PROPERTY_QUERY, + SankeyNetworkRequest.JSON_PROPERTY_REQUEST_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyNetworkRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_QUERY = "query"; + private SankeyNetworkQuery query; + + public static final String JSON_PROPERTY_REQUEST_TYPE = "request_type"; + private SankeyNetworkRequestType requestType = SankeyNetworkRequestType.NETFLOW_SANKEY; + + public SankeyNetworkRequest() {} + + @JsonCreator + public SankeyNetworkRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) SankeyNetworkQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUEST_TYPE) + SankeyNetworkRequestType requestType) { + this.query = query; + this.unparsed |= query.unparsed; + this.requestType = requestType; + this.unparsed |= !requestType.isValid(); + } + + public SankeyNetworkRequest query(SankeyNetworkQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query configuration for Sankey network widget. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyNetworkQuery getQuery() { + return query; + } + + public void setQuery(SankeyNetworkQuery query) { + this.query = query; + } + + public SankeyNetworkRequest requestType(SankeyNetworkRequestType requestType) { + this.requestType = requestType; + this.unparsed |= !requestType.isValid(); + return this; + } + + /** + * Type of request for network Sankey widget. + * + * @return requestType + */ + @JsonProperty(JSON_PROPERTY_REQUEST_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyNetworkRequestType getRequestType() { + return requestType; + } + + public void setRequestType(SankeyNetworkRequestType requestType) { + if (!requestType.isValid()) { + this.unparsed = true; + } + this.requestType = requestType; + } + + /** Return true if this SankeyNetworkRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyNetworkRequest sankeyNetworkRequest = (SankeyNetworkRequest) o; + return Objects.equals(this.query, sankeyNetworkRequest.query) + && Objects.equals(this.requestType, sankeyNetworkRequest.requestType); + } + + @Override + public int hashCode() { + return Objects.hash(query, requestType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyNetworkRequest {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkRequestType.java b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkRequestType.java new file mode 100644 index 00000000000..0aaa67d47c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyNetworkRequestType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of request for network Sankey widget. */ +@JsonSerialize(using = SankeyNetworkRequestType.SankeyNetworkRequestTypeSerializer.class) +public class SankeyNetworkRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("netflow_sankey")); + + public static final SankeyNetworkRequestType NETFLOW_SANKEY = + new SankeyNetworkRequestType("netflow_sankey"); + + SankeyNetworkRequestType(String value) { + super(value, allowedValues); + } + + public static class SankeyNetworkRequestTypeSerializer + extends StdSerializer { + public SankeyNetworkRequestTypeSerializer(Class t) { + super(t); + } + + public SankeyNetworkRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SankeyNetworkRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SankeyNetworkRequestType fromValue(String value) { + return new SankeyNetworkRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyRumDataSource.java b/src/main/java/com/datadog/api/client/v1/model/SankeyRumDataSource.java new file mode 100644 index 00000000000..33e74df4d8d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyRumDataSource.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Sankey widget with RUM data source. */ +@JsonSerialize(using = SankeyRumDataSource.SankeyRumDataSourceSerializer.class) +public class SankeyRumDataSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("rum", "product_analytics")); + + public static final SankeyRumDataSource RUM = new SankeyRumDataSource("rum"); + public static final SankeyRumDataSource PRODUCT_ANALYTICS = + new SankeyRumDataSource("product_analytics"); + + SankeyRumDataSource(String value) { + super(value, allowedValues); + } + + public static class SankeyRumDataSourceSerializer extends StdSerializer { + public SankeyRumDataSourceSerializer(Class t) { + super(t); + } + + public SankeyRumDataSourceSerializer() { + this(null); + } + + @Override + public void serialize( + SankeyRumDataSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SankeyRumDataSource fromValue(String value) { + return new SankeyRumDataSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyRumQuery.java b/src/main/java/com/datadog/api/client/v1/model/SankeyRumQuery.java new file mode 100644 index 00000000000..1152f17740b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyRumQuery.java @@ -0,0 +1,388 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Sankey widget with RUM data source query. */ +@JsonPropertyOrder({ + SankeyRumQuery.JSON_PROPERTY_AUDIENCE_FILTERS, + SankeyRumQuery.JSON_PROPERTY_DATA_SOURCE, + SankeyRumQuery.JSON_PROPERTY_ENTRIES_PER_STEP, + SankeyRumQuery.JSON_PROPERTY_JOIN_KEYS, + SankeyRumQuery.JSON_PROPERTY_MODE, + SankeyRumQuery.JSON_PROPERTY_NUMBER_OF_STEPS, + SankeyRumQuery.JSON_PROPERTY_OCCURRENCES, + SankeyRumQuery.JSON_PROPERTY_QUERY_STRING, + SankeyRumQuery.JSON_PROPERTY_SOURCE, + SankeyRumQuery.JSON_PROPERTY_SUBQUERY_ID, + SankeyRumQuery.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyRumQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_FILTERS = "audience_filters"; + private ProductAnalyticsAudienceFilters audienceFilters; + + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private SankeyRumDataSource dataSource = SankeyRumDataSource.RUM; + + public static final String JSON_PROPERTY_ENTRIES_PER_STEP = "entries_per_step"; + private Long entriesPerStep; + + public static final String JSON_PROPERTY_JOIN_KEYS = "join_keys"; + private SankeyJoinKeys joinKeys; + + public static final String JSON_PROPERTY_MODE = "mode"; + private SankeyRumQueryMode mode = SankeyRumQueryMode.SOURCE; + + public static final String JSON_PROPERTY_NUMBER_OF_STEPS = "number_of_steps"; + private Long numberOfSteps; + + public static final String JSON_PROPERTY_OCCURRENCES = "occurrences"; + private ProductAnalyticsAudienceOccurrenceFilter occurrences; + + public static final String JSON_PROPERTY_QUERY_STRING = "query_string"; + private String queryString; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public static final String JSON_PROPERTY_SUBQUERY_ID = "subquery_id"; + private String subqueryId; + + public static final String JSON_PROPERTY_TARGET = "target"; + private String target; + + public SankeyRumQuery() {} + + @JsonCreator + public SankeyRumQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) + SankeyRumDataSource dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_MODE) SankeyRumQueryMode mode, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY_STRING) String queryString) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + this.mode = mode; + this.unparsed |= !mode.isValid(); + this.queryString = queryString; + } + + public SankeyRumQuery audienceFilters(ProductAnalyticsAudienceFilters audienceFilters) { + this.audienceFilters = audienceFilters; + this.unparsed |= audienceFilters.unparsed; + return this; + } + + /** + * Product Analytics/RUM audience filters. + * + * @return audienceFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUDIENCE_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsAudienceFilters getAudienceFilters() { + return audienceFilters; + } + + public void setAudienceFilters(ProductAnalyticsAudienceFilters audienceFilters) { + this.audienceFilters = audienceFilters; + } + + public SankeyRumQuery dataSource(SankeyRumDataSource dataSource) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + return this; + } + + /** + * Sankey widget with RUM data source. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyRumDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(SankeyRumDataSource dataSource) { + if (!dataSource.isValid()) { + this.unparsed = true; + } + this.dataSource = dataSource; + } + + public SankeyRumQuery entriesPerStep(Long entriesPerStep) { + this.entriesPerStep = entriesPerStep; + return this; + } + + /** + * Entries per step. + * + * @return entriesPerStep + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTRIES_PER_STEP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEntriesPerStep() { + return entriesPerStep; + } + + public void setEntriesPerStep(Long entriesPerStep) { + this.entriesPerStep = entriesPerStep; + } + + public SankeyRumQuery joinKeys(SankeyJoinKeys joinKeys) { + this.joinKeys = joinKeys; + this.unparsed |= joinKeys.unparsed; + return this; + } + + /** + * Join keys. + * + * @return joinKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JOIN_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SankeyJoinKeys getJoinKeys() { + return joinKeys; + } + + public void setJoinKeys(SankeyJoinKeys joinKeys) { + this.joinKeys = joinKeys; + } + + public SankeyRumQuery mode(SankeyRumQueryMode mode) { + this.mode = mode; + this.unparsed |= !mode.isValid(); + return this; + } + + /** + * Sankey mode for RUM queries. + * + * @return mode + */ + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyRumQueryMode getMode() { + return mode; + } + + public void setMode(SankeyRumQueryMode mode) { + if (!mode.isValid()) { + this.unparsed = true; + } + this.mode = mode; + } + + public SankeyRumQuery numberOfSteps(Long numberOfSteps) { + this.numberOfSteps = numberOfSteps; + return this; + } + + /** + * Number of steps. + * + * @return numberOfSteps + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_STEPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumberOfSteps() { + return numberOfSteps; + } + + public void setNumberOfSteps(Long numberOfSteps) { + this.numberOfSteps = numberOfSteps; + } + + public SankeyRumQuery occurrences(ProductAnalyticsAudienceOccurrenceFilter occurrences) { + this.occurrences = occurrences; + this.unparsed |= occurrences.unparsed; + return this; + } + + /** + * Getoccurrences + * + * @return occurrences + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OCCURRENCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsAudienceOccurrenceFilter getOccurrences() { + return occurrences; + } + + public void setOccurrences(ProductAnalyticsAudienceOccurrenceFilter occurrences) { + this.occurrences = occurrences; + } + + public SankeyRumQuery queryString(String queryString) { + this.queryString = queryString; + return this; + } + + /** + * Query string. + * + * @return queryString + */ + @JsonProperty(JSON_PROPERTY_QUERY_STRING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQueryString() { + return queryString; + } + + public void setQueryString(String queryString) { + this.queryString = queryString; + } + + public SankeyRumQuery source(String source) { + this.source = source; + return this; + } + + /** + * Source. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public SankeyRumQuery subqueryId(String subqueryId) { + this.subqueryId = subqueryId; + return this; + } + + /** + * Subquery ID. + * + * @return subqueryId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBQUERY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubqueryId() { + return subqueryId; + } + + public void setSubqueryId(String subqueryId) { + this.subqueryId = subqueryId; + } + + public SankeyRumQuery target(String target) { + this.target = target; + return this; + } + + /** + * Target. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + /** Return true if this SankeyRumQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyRumQuery sankeyRumQuery = (SankeyRumQuery) o; + return Objects.equals(this.audienceFilters, sankeyRumQuery.audienceFilters) + && Objects.equals(this.dataSource, sankeyRumQuery.dataSource) + && Objects.equals(this.entriesPerStep, sankeyRumQuery.entriesPerStep) + && Objects.equals(this.joinKeys, sankeyRumQuery.joinKeys) + && Objects.equals(this.mode, sankeyRumQuery.mode) + && Objects.equals(this.numberOfSteps, sankeyRumQuery.numberOfSteps) + && Objects.equals(this.occurrences, sankeyRumQuery.occurrences) + && Objects.equals(this.queryString, sankeyRumQuery.queryString) + && Objects.equals(this.source, sankeyRumQuery.source) + && Objects.equals(this.subqueryId, sankeyRumQuery.subqueryId) + && Objects.equals(this.target, sankeyRumQuery.target); + } + + @Override + public int hashCode() { + return Objects.hash( + audienceFilters, + dataSource, + entriesPerStep, + joinKeys, + mode, + numberOfSteps, + occurrences, + queryString, + source, + subqueryId, + target); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyRumQuery {\n"); + sb.append(" audienceFilters: ").append(toIndentedString(audienceFilters)).append("\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" entriesPerStep: ").append(toIndentedString(entriesPerStep)).append("\n"); + sb.append(" joinKeys: ").append(toIndentedString(joinKeys)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" numberOfSteps: ").append(toIndentedString(numberOfSteps)).append("\n"); + sb.append(" occurrences: ").append(toIndentedString(occurrences)).append("\n"); + sb.append(" queryString: ").append(toIndentedString(queryString)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" subqueryId: ").append(toIndentedString(subqueryId)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyRumQueryMode.java b/src/main/java/com/datadog/api/client/v1/model/SankeyRumQueryMode.java new file mode 100644 index 00000000000..00ce6864284 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyRumQueryMode.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Sankey mode for RUM queries. */ +@JsonSerialize(using = SankeyRumQueryMode.SankeyRumQueryModeSerializer.class) +public class SankeyRumQueryMode extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("source", "target")); + + public static final SankeyRumQueryMode SOURCE = new SankeyRumQueryMode("source"); + public static final SankeyRumQueryMode TARGET = new SankeyRumQueryMode("target"); + + SankeyRumQueryMode(String value) { + super(value, allowedValues); + } + + public static class SankeyRumQueryModeSerializer extends StdSerializer { + public SankeyRumQueryModeSerializer(Class t) { + super(t); + } + + public SankeyRumQueryModeSerializer() { + this(null); + } + + @Override + public void serialize(SankeyRumQueryMode value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SankeyRumQueryMode fromValue(String value) { + return new SankeyRumQueryMode(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyRumRequest.java b/src/main/java/com/datadog/api/client/v1/model/SankeyRumRequest.java new file mode 100644 index 00000000000..8be9a9171da --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyRumRequest.java @@ -0,0 +1,127 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Sankey widget with RUM data source. */ +@JsonPropertyOrder({ + SankeyRumRequest.JSON_PROPERTY_QUERY, + SankeyRumRequest.JSON_PROPERTY_REQUEST_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyRumRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_QUERY = "query"; + private SankeyRumQuery query; + + public static final String JSON_PROPERTY_REQUEST_TYPE = "request_type"; + private SankeyWidgetDefinitionType requestType = SankeyWidgetDefinitionType.SANKEY; + + public SankeyRumRequest() {} + + @JsonCreator + public SankeyRumRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) SankeyRumQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUEST_TYPE) + SankeyWidgetDefinitionType requestType) { + this.query = query; + this.unparsed |= query.unparsed; + this.requestType = requestType; + this.unparsed |= !requestType.isValid(); + } + + public SankeyRumRequest query(SankeyRumQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Sankey widget with RUM data source query. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyRumQuery getQuery() { + return query; + } + + public void setQuery(SankeyRumQuery query) { + this.query = query; + } + + public SankeyRumRequest requestType(SankeyWidgetDefinitionType requestType) { + this.requestType = requestType; + this.unparsed |= !requestType.isValid(); + return this; + } + + /** + * Type of the Sankey widget. + * + * @return requestType + */ + @JsonProperty(JSON_PROPERTY_REQUEST_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyWidgetDefinitionType getRequestType() { + return requestType; + } + + public void setRequestType(SankeyWidgetDefinitionType requestType) { + if (!requestType.isValid()) { + this.unparsed = true; + } + this.requestType = requestType; + } + + /** Return true if this SankeyRumRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyRumRequest sankeyRumRequest = (SankeyRumRequest) o; + return Objects.equals(this.query, sankeyRumRequest.query) + && Objects.equals(this.requestType, sankeyRumRequest.requestType); + } + + @Override + public int hashCode() { + return Objects.hash(query, requestType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyRumRequest {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetDefinition.java new file mode 100644 index 00000000000..05e24e7f444 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetDefinition.java @@ -0,0 +1,304 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** The Sankey diagram visualizes the flow of data between categories, stages or sets of values. */ +@JsonPropertyOrder({ + SankeyWidgetDefinition.JSON_PROPERTY_REQUESTS, + SankeyWidgetDefinition.JSON_PROPERTY_SHOW_OTHER_LINKS, + SankeyWidgetDefinition.JSON_PROPERTY_SORT_NODES, + SankeyWidgetDefinition.JSON_PROPERTY_TIME, + SankeyWidgetDefinition.JSON_PROPERTY_TITLE, + SankeyWidgetDefinition.JSON_PROPERTY_TITLE_ALIGN, + SankeyWidgetDefinition.JSON_PROPERTY_TITLE_SIZE, + SankeyWidgetDefinition.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SankeyWidgetDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REQUESTS = "requests"; + private List requests = new ArrayList<>(); + + public static final String JSON_PROPERTY_SHOW_OTHER_LINKS = "show_other_links"; + private Boolean showOtherLinks; + + public static final String JSON_PROPERTY_SORT_NODES = "sort_nodes"; + private Boolean sortNodes; + + public static final String JSON_PROPERTY_TIME = "time"; + private WidgetTime time; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TITLE_ALIGN = "title_align"; + private WidgetTextAlign titleAlign; + + public static final String JSON_PROPERTY_TITLE_SIZE = "title_size"; + private String titleSize; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SankeyWidgetDefinitionType type = SankeyWidgetDefinitionType.SANKEY; + + public SankeyWidgetDefinition() {} + + @JsonCreator + public SankeyWidgetDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_REQUESTS) + List requests, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SankeyWidgetDefinitionType type) { + this.requests = requests; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SankeyWidgetDefinition requests(List requests) { + this.requests = requests; + for (SankeyWidgetRequest item : requests) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SankeyWidgetDefinition addRequestsItem(SankeyWidgetRequest requestsItem) { + this.requests.add(requestsItem); + this.unparsed |= requestsItem.unparsed; + return this; + } + + /** + * List of Sankey widget requests. + * + * @return requests + */ + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequests() { + return requests; + } + + public void setRequests(List requests) { + this.requests = requests; + } + + public SankeyWidgetDefinition showOtherLinks(Boolean showOtherLinks) { + this.showOtherLinks = showOtherLinks; + return this; + } + + /** + * Whether to show links for "other" category. + * + * @return showOtherLinks + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_OTHER_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowOtherLinks() { + return showOtherLinks; + } + + public void setShowOtherLinks(Boolean showOtherLinks) { + this.showOtherLinks = showOtherLinks; + } + + public SankeyWidgetDefinition sortNodes(Boolean sortNodes) { + this.sortNodes = sortNodes; + return this; + } + + /** + * Whether to sort nodes in the Sankey diagram. + * + * @return sortNodes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT_NODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSortNodes() { + return sortNodes; + } + + public void setSortNodes(Boolean sortNodes) { + this.sortNodes = sortNodes; + } + + public SankeyWidgetDefinition time(WidgetTime time) { + this.time = time; + this.unparsed |= time.unparsed; + return this; + } + + /** + * Time setting for the widget. + * + * @return time + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetTime getTime() { + return time; + } + + public void setTime(WidgetTime time) { + this.time = time; + } + + public SankeyWidgetDefinition title(String title) { + this.title = title; + return this; + } + + /** + * Title of your widget. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public SankeyWidgetDefinition titleAlign(WidgetTextAlign titleAlign) { + this.titleAlign = titleAlign; + this.unparsed |= !titleAlign.isValid(); + return this; + } + + /** + * How to align the text on the widget. + * + * @return titleAlign + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE_ALIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetTextAlign getTitleAlign() { + return titleAlign; + } + + public void setTitleAlign(WidgetTextAlign titleAlign) { + if (!titleAlign.isValid()) { + this.unparsed = true; + } + this.titleAlign = titleAlign; + } + + public SankeyWidgetDefinition titleSize(String titleSize) { + this.titleSize = titleSize; + return this; + } + + /** + * Size of the title. + * + * @return titleSize + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitleSize() { + return titleSize; + } + + public void setTitleSize(String titleSize) { + this.titleSize = titleSize; + } + + public SankeyWidgetDefinition type(SankeyWidgetDefinitionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Sankey widget. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SankeyWidgetDefinitionType getType() { + return type; + } + + public void setType(SankeyWidgetDefinitionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this SankeyWidgetDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SankeyWidgetDefinition sankeyWidgetDefinition = (SankeyWidgetDefinition) o; + return Objects.equals(this.requests, sankeyWidgetDefinition.requests) + && Objects.equals(this.showOtherLinks, sankeyWidgetDefinition.showOtherLinks) + && Objects.equals(this.sortNodes, sankeyWidgetDefinition.sortNodes) + && Objects.equals(this.time, sankeyWidgetDefinition.time) + && Objects.equals(this.title, sankeyWidgetDefinition.title) + && Objects.equals(this.titleAlign, sankeyWidgetDefinition.titleAlign) + && Objects.equals(this.titleSize, sankeyWidgetDefinition.titleSize) + && Objects.equals(this.type, sankeyWidgetDefinition.type); + } + + @Override + public int hashCode() { + return Objects.hash( + requests, showOtherLinks, sortNodes, time, title, titleAlign, titleSize, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SankeyWidgetDefinition {\n"); + sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); + sb.append(" showOtherLinks: ").append(toIndentedString(showOtherLinks)).append("\n"); + sb.append(" sortNodes: ").append(toIndentedString(sortNodes)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" titleAlign: ").append(toIndentedString(titleAlign)).append("\n"); + sb.append(" titleSize: ").append(toIndentedString(titleSize)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetDefinitionType.java b/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetDefinitionType.java new file mode 100644 index 00000000000..67222b484f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetDefinitionType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the Sankey widget. */ +@JsonSerialize(using = SankeyWidgetDefinitionType.SankeyWidgetDefinitionTypeSerializer.class) +public class SankeyWidgetDefinitionType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("sankey")); + + public static final SankeyWidgetDefinitionType SANKEY = new SankeyWidgetDefinitionType("sankey"); + + SankeyWidgetDefinitionType(String value) { + super(value, allowedValues); + } + + public static class SankeyWidgetDefinitionTypeSerializer + extends StdSerializer { + public SankeyWidgetDefinitionTypeSerializer(Class t) { + super(t); + } + + public SankeyWidgetDefinitionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SankeyWidgetDefinitionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SankeyWidgetDefinitionType fromValue(String value) { + return new SankeyWidgetDefinitionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetRequest.java b/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetRequest.java new file mode 100644 index 00000000000..e5d8138e358 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SankeyWidgetRequest.java @@ -0,0 +1,277 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = SankeyWidgetRequest.SankeyWidgetRequestDeserializer.class) +@JsonSerialize(using = SankeyWidgetRequest.SankeyWidgetRequestSerializer.class) +public class SankeyWidgetRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SankeyWidgetRequest.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class SankeyWidgetRequestSerializer extends StdSerializer { + public SankeyWidgetRequestSerializer(Class t) { + super(t); + } + + public SankeyWidgetRequestSerializer() { + this(null); + } + + @Override + public void serialize( + SankeyWidgetRequest value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class SankeyWidgetRequestDeserializer extends StdDeserializer { + public SankeyWidgetRequestDeserializer() { + this(SankeyWidgetRequest.class); + } + + public SankeyWidgetRequestDeserializer(Class vc) { + super(vc); + } + + @Override + public SankeyWidgetRequest deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize SankeyRumRequest + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SankeyRumRequest.class.equals(Integer.class) + || SankeyRumRequest.class.equals(Long.class) + || SankeyRumRequest.class.equals(Float.class) + || SankeyRumRequest.class.equals(Double.class) + || SankeyRumRequest.class.equals(Boolean.class) + || SankeyRumRequest.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SankeyRumRequest.class.equals(Integer.class) + || SankeyRumRequest.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SankeyRumRequest.class.equals(Float.class) + || SankeyRumRequest.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SankeyRumRequest.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SankeyRumRequest.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SankeyRumRequest.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SankeyRumRequest) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SankeyRumRequest'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SankeyRumRequest'", e); + } + + // deserialize SankeyNetworkRequest + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SankeyNetworkRequest.class.equals(Integer.class) + || SankeyNetworkRequest.class.equals(Long.class) + || SankeyNetworkRequest.class.equals(Float.class) + || SankeyNetworkRequest.class.equals(Double.class) + || SankeyNetworkRequest.class.equals(Boolean.class) + || SankeyNetworkRequest.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SankeyNetworkRequest.class.equals(Integer.class) + || SankeyNetworkRequest.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SankeyNetworkRequest.class.equals(Float.class) + || SankeyNetworkRequest.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SankeyNetworkRequest.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SankeyNetworkRequest.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SankeyNetworkRequest.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SankeyNetworkRequest) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SankeyNetworkRequest'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SankeyNetworkRequest'", e); + } + + SankeyWidgetRequest ret = new SankeyWidgetRequest(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public SankeyWidgetRequest getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "SankeyWidgetRequest cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public SankeyWidgetRequest() { + super("oneOf", Boolean.FALSE); + } + + public SankeyWidgetRequest(SankeyRumRequest o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SankeyWidgetRequest(SankeyNetworkRequest o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SankeyRumRequest", new GenericType() {}); + schemas.put("SankeyNetworkRequest", new GenericType() {}); + JSON.registerDescendants(SankeyWidgetRequest.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return SankeyWidgetRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: SankeyRumRequest, SankeyNetworkRequest + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(SankeyRumRequest.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(SankeyNetworkRequest.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be SankeyRumRequest, SankeyNetworkRequest"); + } + + /** + * Get the actual instance, which can be the following: SankeyRumRequest, SankeyNetworkRequest + * + * @return The actual instance (SankeyRumRequest, SankeyNetworkRequest) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SankeyRumRequest`. If the actual instance is not + * `SankeyRumRequest`, the ClassCastException will be thrown. + * + * @return The actual instance of `SankeyRumRequest` + * @throws ClassCastException if the instance is not `SankeyRumRequest` + */ + public SankeyRumRequest getSankeyRumRequest() throws ClassCastException { + return (SankeyRumRequest) super.getActualInstance(); + } + + /** + * Get the actual instance of `SankeyNetworkRequest`. If the actual instance is not + * `SankeyNetworkRequest`, the ClassCastException will be thrown. + * + * @return The actual instance of `SankeyNetworkRequest` + * @throws ClassCastException if the instance is not `SankeyNetworkRequest` + */ + public SankeyNetworkRequest getSankeyNetworkRequest() throws ClassCastException { + return (SankeyNetworkRequest) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java index aa6841cb55e..13801cc0a14 100644 --- a/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java +++ b/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java @@ -1247,6 +1247,51 @@ public WidgetDefinition deserialize(JsonParser jp, DeserializationContext ctxt) log.log(Level.FINER, "Input data does not match schema 'ScatterPlotWidgetDefinition'", e); } + // deserialize SankeyWidgetDefinition + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SankeyWidgetDefinition.class.equals(Integer.class) + || SankeyWidgetDefinition.class.equals(Long.class) + || SankeyWidgetDefinition.class.equals(Float.class) + || SankeyWidgetDefinition.class.equals(Double.class) + || SankeyWidgetDefinition.class.equals(Boolean.class) + || SankeyWidgetDefinition.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SankeyWidgetDefinition.class.equals(Integer.class) + || SankeyWidgetDefinition.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SankeyWidgetDefinition.class.equals(Float.class) + || SankeyWidgetDefinition.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SankeyWidgetDefinition.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SankeyWidgetDefinition.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SankeyWidgetDefinition.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SankeyWidgetDefinition) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SankeyWidgetDefinition'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SankeyWidgetDefinition'", e); + } + // deserialize ServiceMapWidgetDefinition try { boolean attemptParsing = true; @@ -1811,6 +1856,11 @@ public WidgetDefinition(ScatterPlotWidgetDefinition o) { setActualInstance(o); } + public WidgetDefinition(SankeyWidgetDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public WidgetDefinition(ServiceMapWidgetDefinition o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -1885,6 +1935,7 @@ public WidgetDefinition(TreeMapWidgetDefinition o) { schemas.put("SLOListWidgetDefinition", new GenericType() {}); schemas.put("SLOWidgetDefinition", new GenericType() {}); schemas.put("ScatterPlotWidgetDefinition", new GenericType() {}); + schemas.put("SankeyWidgetDefinition", new GenericType() {}); schemas.put("ServiceMapWidgetDefinition", new GenericType() {}); schemas.put( "ServiceSummaryWidgetDefinition", new GenericType() {}); @@ -1914,9 +1965,10 @@ public Map getSchemas() { * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, * PowerpackWidgetDefinition, QueryValueWidgetDefinition, RunWorkflowWidgetDefinition, * SLOListWidgetDefinition, SLOWidgetDefinition, ScatterPlotWidgetDefinition, - * ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, - * SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, - * ToplistWidgetDefinition, TopologyMapWidgetDefinition, TreeMapWidgetDefinition + * SankeyWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, + * SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, + * TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition, + * TreeMapWidgetDefinition * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -2028,6 +2080,10 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(SankeyWidgetDefinition.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(ServiceMapWidgetDefinition.class, instance, new HashSet>())) { super.setActualInstance(instance); return; @@ -2080,10 +2136,11 @@ public void setActualInstance(Object instance) { + " ListStreamWidgetDefinition, LogStreamWidgetDefinition," + " MonitorSummaryWidgetDefinition, NoteWidgetDefinition, PowerpackWidgetDefinition," + " QueryValueWidgetDefinition, RunWorkflowWidgetDefinition, SLOListWidgetDefinition," - + " SLOWidgetDefinition, ScatterPlotWidgetDefinition, ServiceMapWidgetDefinition," - + " ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition," - + " SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition," - + " ToplistWidgetDefinition, TopologyMapWidgetDefinition, TreeMapWidgetDefinition"); + + " SLOWidgetDefinition, ScatterPlotWidgetDefinition, SankeyWidgetDefinition," + + " ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition," + + " SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition," + + " TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition," + + " TreeMapWidgetDefinition"); } /** @@ -2096,10 +2153,10 @@ public void setActualInstance(Object instance) { * ListStreamWidgetDefinition, LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, * NoteWidgetDefinition, PowerpackWidgetDefinition, QueryValueWidgetDefinition, * RunWorkflowWidgetDefinition, SLOListWidgetDefinition, SLOWidgetDefinition, - * ScatterPlotWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, - * SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, - * TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition, - * TreeMapWidgetDefinition + * ScatterPlotWidgetDefinition, SankeyWidgetDefinition, ServiceMapWidgetDefinition, + * ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, SunburstWidgetDefinition, + * TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, + * TopologyMapWidgetDefinition, TreeMapWidgetDefinition * * @return The actual instance (AlertGraphWidgetDefinition, AlertValueWidgetDefinition, * BarChartWidgetDefinition, ChangeWidgetDefinition, CheckStatusWidgetDefinition, @@ -2110,9 +2167,10 @@ public void setActualInstance(Object instance) { * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, * PowerpackWidgetDefinition, QueryValueWidgetDefinition, RunWorkflowWidgetDefinition, * SLOListWidgetDefinition, SLOWidgetDefinition, ScatterPlotWidgetDefinition, - * ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, - * SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, - * ToplistWidgetDefinition, TopologyMapWidgetDefinition, TreeMapWidgetDefinition) + * SankeyWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, + * SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, + * TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition, + * TreeMapWidgetDefinition) */ @Override public Object getActualInstance() { @@ -2407,6 +2465,17 @@ public ScatterPlotWidgetDefinition getScatterPlotWidgetDefinition() throws Class return (ScatterPlotWidgetDefinition) super.getActualInstance(); } + /** + * Get the actual instance of `SankeyWidgetDefinition`. If the actual instance is not + * `SankeyWidgetDefinition`, the ClassCastException will be thrown. + * + * @return The actual instance of `SankeyWidgetDefinition` + * @throws ClassCastException if the instance is not `SankeyWidgetDefinition` + */ + public SankeyWidgetDefinition getSankeyWidgetDefinition() throws ClassCastException { + return (SankeyWidgetDefinition) super.getActualInstance(); + } + /** * Get the actual instance of `ServiceMapWidgetDefinition`. If the actual instance is not * `ServiceMapWidgetDefinition`, the ClassCastException will be thrown. diff --git a/src/main/java/com/datadog/api/client/v2/api/AuditApi.java b/src/main/java/com/datadog/api/client/v2/api/AuditApi.java index 02e264b62b1..028bb0fcc11 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AuditApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AuditApi.java @@ -233,7 +233,8 @@ public PaginationIterable listAuditLogsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -486,7 +487,8 @@ public PaginationIterable searchAuditLogsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java index f165fdde4db..0b15564dc6f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java @@ -3308,7 +3308,7 @@ public PaginationIterable searchCasesWithPagination( String valueGetterPath = ""; String valueSetterPath = "pageNumber"; Boolean valueSetterParamOptional = true; - parameters.pageNumber(0l); + parameters.pageNumber(1l); Long limit; if (parameters.pageSize == null) { @@ -3331,7 +3331,8 @@ public PaginationIterable searchCasesWithPagination( valueSetterParamOptional, false, limit, - args); + args, + 1); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/CiVisibilityPipelinesApi.java b/src/main/java/com/datadog/api/client/v2/api/CiVisibilityPipelinesApi.java index 56b11e919a5..6356a85347a 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CiVisibilityPipelinesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CiVisibilityPipelinesApi.java @@ -521,7 +521,8 @@ public PaginationIterable listCIAppPipelineEventsWithPaginat valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -781,7 +782,8 @@ public PaginationIterable searchCIAppPipelineEventsWithPagin valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java b/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java index 97d4d4ccc11..ded0f178a91 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java @@ -371,7 +371,8 @@ public PaginationIterable listCIAppTestEventsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -628,7 +629,8 @@ public PaginationIterable searchCIAppTestEventsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/ContainerImagesApi.java b/src/main/java/com/datadog/api/client/v2/api/ContainerImagesApi.java index 371914deeac..57a74724119 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ContainerImagesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ContainerImagesApi.java @@ -217,7 +217,8 @@ public PaginationIterable listContainerImagesWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/ContainersApi.java b/src/main/java/com/datadog/api/client/v2/api/ContainersApi.java index e9b2f8977b9..0ff066beec9 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ContainersApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ContainersApi.java @@ -217,7 +217,8 @@ public PaginationIterable listContainersWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/DowntimesApi.java b/src/main/java/com/datadog/api/client/v2/api/DowntimesApi.java index f64342cff31..9f736d1df9f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/DowntimesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/DowntimesApi.java @@ -680,7 +680,8 @@ public PaginationIterable listDowntimesWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -936,7 +937,8 @@ public PaginationIterable listMonitorDowntimes valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java index 7a8cfbce750..df4977b4ca2 100644 --- a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java @@ -515,7 +515,8 @@ public PaginationIterable listEventsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -768,7 +769,8 @@ public PaginationIterable searchEventsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java index 1ca7db02399..a1bfe4604ed 100644 --- a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java @@ -7020,7 +7020,8 @@ public PaginationIterable listIncidentsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -7677,7 +7678,8 @@ public PaginationIterable searchIncidentsWi valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/LogsApi.java b/src/main/java/com/datadog/api/client/v2/api/LogsApi.java index da2634ce22c..d23161a544e 100644 --- a/src/main/java/com/datadog/api/client/v2/api/LogsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/LogsApi.java @@ -313,7 +313,8 @@ public PaginationIterable listLogsWithPagination(ListLogsOptionalParameters valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -621,7 +622,8 @@ public PaginationIterable listLogsGetWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java b/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java index 52f6082222b..befb8b2cb33 100644 --- a/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java @@ -1671,8 +1671,9 @@ public ListTagConfigurationsOptionalParameters filterQueried(Boolean filterQueri * Set filterQueriedWindowSeconds. * * @param filterQueriedWindowSeconds Only return metrics that have been queried or not queried - * in the specified window. Dependent on being sent with filter[queried]. - * (optional, default to 2592000) + * in the specified window. Dependent on being sent with filter[queried]. The + * default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds + * (180 days), and the minimum value is 1 second. (optional, default to 2592000) * @return ListTagConfigurationsOptionalParameters */ public ListTagConfigurationsOptionalParameters filterQueriedWindowSeconds( @@ -1710,7 +1711,8 @@ public ListTagConfigurationsOptionalParameters filterRelatedAssets( * Set windowSeconds. * * @param windowSeconds Only return metrics that have been actively reporting in the specified - * window. (optional, default to 3600) + * window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 + * seconds (30 days), and the minimum value is 1 second. (optional, default to 3600) * @return ListTagConfigurationsOptionalParameters */ public ListTagConfigurationsOptionalParameters windowSeconds(Long windowSeconds) { @@ -1722,7 +1724,8 @@ public ListTagConfigurationsOptionalParameters windowSeconds(Long windowSeconds) * Set pageSize. * * @param pageSize Maximum number of results per page. Use with page[cursor] for - * pagination. (optional, default to 10000) + * pagination. The default value is 10000, the maximum value is 10000, and the minimum value + * is 1. (optional, default to 10000) * @return ListTagConfigurationsOptionalParameters */ public ListTagConfigurationsOptionalParameters pageSize(Integer pageSize) { @@ -1853,7 +1856,8 @@ public PaginationIterable listTagConfiguratio valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/NetworkDeviceMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/NetworkDeviceMonitoringApi.java index c97dcaa5368..f9316af252f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/NetworkDeviceMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/NetworkDeviceMonitoringApi.java @@ -536,7 +536,8 @@ public PaginationIterable listDevicesWithPagination( valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java b/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java index 224a07a4deb..c2f8cf50894 100644 --- a/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java @@ -582,7 +582,8 @@ public PaginationIterable listPowerpacksWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/ProcessesApi.java b/src/main/java/com/datadog/api/client/v2/api/ProcessesApi.java index bbeb531b521..29894dbae87 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ProcessesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ProcessesApi.java @@ -235,7 +235,8 @@ public PaginationIterable listProcessesWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/RumApi.java b/src/main/java/com/datadog/api/client/v2/api/RumApi.java index 7dd0209f768..aeb60163a35 100644 --- a/src/main/java/com/datadog/api/client/v2/api/RumApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/RumApi.java @@ -881,7 +881,8 @@ public PaginationIterable listRUMEventsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -1073,7 +1074,8 @@ public PaginationIterable searchRUMEventsWithPagination(RUMSearchEvent valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 6ea7df0811d..9276637f567 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -8955,7 +8955,8 @@ public PaginationIterable listFindingsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -9964,7 +9965,8 @@ public PaginationIterable listSecurityFindingsWithPaginati valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -10897,7 +10899,8 @@ public PaginationIterable listSecurityMonitoringSignal valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -13857,7 +13860,8 @@ public PaginationIterable searchSecurityFindingsWithPagina valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -14304,7 +14308,8 @@ public PaginationIterable searchSecurityMonitoringSign valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/ServiceDefinitionApi.java b/src/main/java/com/datadog/api/client/v2/api/ServiceDefinitionApi.java index 32aef45675c..0c2b9f1ee87 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ServiceDefinitionApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ServiceDefinitionApi.java @@ -685,7 +685,8 @@ public PaginationIterable listServiceDefinitionsWithPagin valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java b/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java index fd74c5fff55..58e809fb751 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java @@ -739,7 +739,8 @@ public PaginationIterable listScorecardOutcomesWithPag valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -1133,7 +1134,8 @@ public PaginationIterable listScorecardRulesWithPagin valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java b/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java index e8595724a63..cac149729d0 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java @@ -569,7 +569,8 @@ public PaginationIterable listCatalogEntityWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -872,7 +873,8 @@ public PaginationIterable listCatalogKindWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -1181,7 +1183,8 @@ public PaginationIterable listCatalogRelationWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/SpansApi.java b/src/main/java/com/datadog/api/client/v2/api/SpansApi.java index 079d45de3a0..46faade2865 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SpansApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SpansApi.java @@ -262,7 +262,8 @@ public PaginationIterable listSpansWithPagination(SpansListRequest body) { valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } @@ -556,7 +557,8 @@ public PaginationIterable listSpansGetWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java b/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java index c39bf1b320f..73c98b942a3 100644 --- a/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java @@ -1744,7 +1744,8 @@ public PaginationIterable listCustomRuleRevisionsWithPaginat valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java index 19ab6c45265..9cd28fa7759 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java @@ -2599,7 +2599,8 @@ public PaginationIterable getTeamMembershipsWithPagination( valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } @@ -3607,7 +3608,8 @@ public PaginationIterable listMemberTeamsWithPagination( valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } @@ -3950,7 +3952,8 @@ public PaginationIterable listTeamConnectionsWithPagination( valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } @@ -4237,7 +4240,8 @@ public PaginationIterable listTeamHierarchyLinksWithPaginatio valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } @@ -4544,7 +4548,8 @@ public PaginationIterable listTeamsWithPagination(ListTeamsOptionalParamet valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java index d45173ef6aa..6a2f070b14f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java @@ -509,7 +509,8 @@ public PaginationIterable searchFlakyTestsWithPagination( valueSetterParamOptional, true, limit, - args); + args, + 0); return iterator; } diff --git a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java index 6a427901f80..f348e82138d 100644 --- a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java @@ -1045,7 +1045,8 @@ public PaginationIterable listUsersWithPagination(ListUsersOptionalParamet valueSetterParamOptional, false, limit, - args); + args, + 0); return iterator; } diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_network_data_source.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_network_data_source.freeze new file mode 100644 index 00000000000..819ff420241 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_network_data_source.freeze @@ -0,0 +1 @@ +2026-01-02T15:26:45.908Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_network_data_source.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_network_data_source.json new file mode 100644 index 00000000000..4e1ec77ce9d --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_network_data_source.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_sankey_widget_and_network_data_source-1767367605\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"network\",\"group_by\":[\"source\",\"destination\"],\"limit\":100,\"query_string\":\"*\"},\"request_type\":\"netflow_sankey\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sankey\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v1/dashboard", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"id\":\"ngh-vn6-nqq\",\"title\":\"Test-Create_a_new_dashboard_with_sankey_widget_and_network_data_source-1767367605\",\"description\":\"\",\"author_handle\":\"sophie.cao@datadoghq.com\",\"author_name\":\"Sophie Cao\",\"layout_type\":\"free\",\"url\":\"/dashboard/ngh-vn6-nqq/test-createanewdashboardwithsankeywidgetandnetworkdatasource-1767367605\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"network\",\"group_by\":[\"source\",\"destination\"],\"limit\":100,\"query_string\":\"*\"},\"request_type\":\"netflow_sankey\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sankey\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":4009219214466684}],\"notify_list\":[],\"created_at\":\"2026-01-02T15:26:46.118136+00:00\",\"modified_at\":\"2026-01-02T15:26:46.118136+00:00\",\"restricted_roles\":[]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "05785a12-bb7d-2936-0e2f-bb3622fc33d9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v1/dashboard/ngh-vn6-nqq", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"deleted_dashboard_id\":\"ngh-vn6-nqq\"}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9c0d340a-b4d7-8451-b849-b8f5cb338e4d" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source.freeze new file mode 100644 index 00000000000..d7f34013375 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source.freeze @@ -0,0 +1 @@ +2026-01-02T15:27:06.013Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source.json new file mode 100644 index 00000000000..c839d9f77a2 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source-1767367626\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"product_analytics\",\"mode\":\"source\",\"query_string\":\"@type:session\"},\"request_type\":\"sankey\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sankey\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v1/dashboard", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"id\":\"y6u-yab-bdi\",\"title\":\"Test-Create_a_new_dashboard_with_sankey_widget_and_product_analytics_data_source-1767367626\",\"description\":\"\",\"author_handle\":\"sophie.cao@datadoghq.com\",\"author_name\":\"Sophie Cao\",\"layout_type\":\"free\",\"url\":\"/dashboard/y6u-yab-bdi/test-createanewdashboardwithsankeywidgetandproductanalyticsdatasource-1767367626\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"product_analytics\",\"mode\":\"source\",\"query_string\":\"@type:session\"},\"request_type\":\"sankey\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sankey\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":7919851856522238}],\"notify_list\":[],\"created_at\":\"2026-01-02T15:27:06.177915+00:00\",\"modified_at\":\"2026-01-02T15:27:06.177915+00:00\",\"restricted_roles\":[]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5d27f2ce-d55c-4ad7-cf36-49de340a533c" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v1/dashboard/y6u-yab-bdi", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"deleted_dashboard_id\":\"y6u-yab-bdi\"}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2b138fda-2740-445d-10a9-6aa55a4283a5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_rum_data_source.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_rum_data_source.freeze new file mode 100644 index 00000000000..6f1ee04a8ff --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_rum_data_source.freeze @@ -0,0 +1 @@ +2026-01-02T15:26:19.626Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_rum_data_source.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_rum_data_source.json new file mode 100644 index 00000000000..6ebe96a5ece --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_sankey_widget_and_rum_data_source.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_sankey_widget_and_rum_data_source-1767367579\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"rum\",\"mode\":\"source\",\"query_string\":\"@type:view\"},\"request_type\":\"sankey\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sankey\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v1/dashboard", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"id\":\"pgj-vt6-zeg\",\"title\":\"Test-Create_a_new_dashboard_with_sankey_widget_and_rum_data_source-1767367579\",\"description\":\"\",\"author_handle\":\"sophie.cao@datadoghq.com\",\"author_name\":\"Sophie Cao\",\"layout_type\":\"free\",\"url\":\"/dashboard/pgj-vt6-zeg/test-createanewdashboardwithsankeywidgetandrumdatasource-1767367579\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"rum\",\"mode\":\"source\",\"query_string\":\"@type:view\"},\"request_type\":\"sankey\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sankey\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":1607494419972582}],\"notify_list\":[],\"created_at\":\"2026-01-02T15:26:19.817734+00:00\",\"modified_at\":\"2026-01-02T15:26:19.817734+00:00\",\"restricted_roles\":[]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e50096f8-701d-2695-ccb5-e4bb8dc80a98" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v1/dashboard/pgj-vt6-zeg", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"deleted_dashboard_id\":\"pgj-vt6-zeg\"}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3597b2c2-f955-8709-af84-283c2af5a46b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.freeze index d30828c2f76..1eb59a7e760 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.freeze @@ -1 +1 @@ -2026-02-02T10:35:23.539Z \ No newline at end of file +2026-02-18T16:57:03.696Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.json index a68ea0a93d0..d0277a25e22 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_Network_Path_test_returns_OK_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"network_test\",\"attributes\":{\"public_id\":\"iab-wcx-mhp\",\"name\":\"Example Network Path test\",\"locations\":[\"aws:us-east-1\",\"agent:my-agent-name\"],\"subtype\":\"tcp\",\"status\":\"live\",\"options\":{\"tick_every\":60},\"config\":{\"assertions\":[{\"operator\":\"lessThan\",\"property\":\"avg\",\"target\":500,\"type\":\"latency\"}],\"request\":{\"max_ttl\":30,\"tcp_method\":\"prefer_sack\",\"host\":\"example.com\",\"traceroute_queries\":3,\"e2e_queries\":50,\"port\":443}},\"type\":\"network\",\"tags\":[\"env:production\"],\"message\":\"Network Path test notification\"},\"id\":\"iab-wcx-mhp\"}}\n", + "body": "{\"data\":{\"type\":\"network_test\",\"attributes\":{\"config\":{\"request\":{\"max_ttl\":30,\"tcp_method\":\"prefer_sack\",\"host\":\"example.com\",\"e2e_queries\":50,\"traceroute_queries\":3,\"port\":443},\"assertions\":[{\"operator\":\"lessThan\",\"property\":\"avg\",\"target\":500,\"type\":\"latency\"}]},\"message\":\"Network Path test notification\",\"name\":\"Example Network Path test\",\"tags\":[\"env:production\"],\"options\":{\"tick_every\":60},\"type\":\"network\",\"public_id\":\"b2j-fw3-qr5\",\"subtype\":\"tcp\",\"locations\":[\"aws:us-east-1\",\"agent:my-agent-name\"],\"status\":\"live\"},\"id\":\"b2j-fw3-qr5\"}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "3e9c7578-282c-3e74-af19-c5c1adf2db21" + "id": "3e9c7578-282c-3e74-af19-c5c1adf2db20" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"public_ids\":[\"iab-wcx-mhp\"]},\"type\":\"delete_tests_request\"}}" + "json": "{\"data\":{\"attributes\":{\"public_ids\":[\"b2j-fw3-qr5\"]},\"type\":\"delete_tests_request\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"type\":\"delete_tests\",\"attributes\":{\"deleted_at\":\"2026-02-02T10:35:25.382918+00:00\",\"public_id\":\"iab-wcx-mhp\"},\"id\":\"iab-wcx-mhp\"}]}\n", + "body": "{\"data\":[{\"type\":\"delete_tests\",\"attributes\":{\"deleted_at\":\"2026-02-18T16:57:04.752457+00:00\",\"public_id\":\"b2j-fw3-qr5\"},\"id\":\"b2j-fw3-qr5\"}]}\n", "headers": { "Content-Type": [ "application/json" @@ -57,6 +57,6 @@ "timeToLive": { "unlimited": true }, - "id": "6fa27e8b-cfa1-19a5-e9b9-633b289465bd" + "id": "55ca62e2-7197-1794-385f-f42131cef2d5" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.freeze index 62723cd8d29..957e037f23c 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-07T12:38:45.716Z \ No newline at end of file +2026-02-18T16:57:05.121Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.json index 170f3322e1a..38094966fa4 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_test_suite_returns_OK_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"suites\",\"id\":\"36n-bb6-njj\",\"attributes\":{\"tags\":[\"env:production\"],\"type\":\"suite\",\"created_by\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"created_at\":\"2026-01-07T12:38:46.109472+00:00\",\"modified_at\":\"2026-01-07T12:38:46.109472+00:00\",\"message\":\"Notification message\",\"public_id\":\"36n-bb6-njj\",\"options\":{},\"modified_by\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"tests\":[],\"name\":\"Example suite name\",\"org_id\":321813,\"monitor_id\":249141773}}}\n", + "body": "{\"data\":{\"type\":\"suites\",\"attributes\":{\"type\":\"suite\",\"monitor_id\":259845717,\"name\":\"Example suite name\",\"options\":{},\"tests\":[],\"tags\":[\"env:production\"],\"public_id\":\"hik-xp5-9q6\",\"created_at\":\"2026-02-18T16:57:05.583051+00:00\",\"modified_at\":\"2026-02-18T16:57:05.583051+00:00\",\"created_by\":{\"name\":\"Corentin Girard\",\"email\":\"corentin.girard@datadoghq.com\",\"handle\":\"corentin.girard@datadoghq.com\"},\"message\":\"Notification message\",\"org_id\":321813,\"modified_by\":{\"name\":\"Corentin Girard\",\"email\":\"corentin.girard@datadoghq.com\",\"handle\":\"corentin.girard@datadoghq.com\"}},\"id\":\"hik-xp5-9q6\"}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "28246ef1-4beb-7593-0aef-1feb4367b253" + "id": "28246ef1-4beb-7593-0aef-1feb4367b252" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"public_ids\":[\"36n-bb6-njj\"]},\"type\":\"delete_suites_request\"}}" + "json": "{\"data\":{\"attributes\":{\"public_ids\":[\"hik-xp5-9q6\"]},\"type\":\"delete_suites_request\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"type\":\"suites\",\"attributes\":{\"public_id\":\"36n-bb6-njj\",\"deleted_at\":\"2026-01-07 12:38:46.679914\"},\"id\":\"36n-bb6-njj\"}]}\n", + "body": "{\"data\":[{\"type\":\"suites\",\"attributes\":{\"deleted_at\":\"2026-02-18 16:57:06.420679\",\"public_id\":\"hik-xp5-9q6\"},\"id\":\"hik-xp5-9q6\"}]}\n", "headers": { "Content-Type": [ "application/json" @@ -57,6 +57,6 @@ "timeToLive": { "unlimited": true }, - "id": "1bd5428b-eb45-1f07-ea8a-b3d0bc71b1e8" + "id": "79a4484e-b99a-993b-e9f8-04bc2937a220" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_No_Content_response.freeze new file mode 100644 index 00000000000..252ef651187 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-03-25T10:51:13.320Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_No_Content_response.json new file mode 100644 index 00000000000..8cba843e67e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_No_Content_response.json @@ -0,0 +1,181 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-789e569afaa52bde\",\"name\":\"test-name-789e569afaa52bde\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1d059472-0eff-4857-a6c8-5e5041448b54\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-03-25T10:51:13.938804+00:00\",\"description\":null,\"handle\":\"test-handle-789e569afaa52bde\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-03-25T10:51:13.938804+00:00\",\"name\":\"test-name-789e569afaa52bde\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "06adab81-5152-105a-98eb-24da866c8255" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Remove_a_user_from_a_team_returns_No_Content_response-1774435873@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\": {\"type\": \"users\", \"id\": \"66e25b0b-3f3b-427e-b162-e779f4535abb\", \"attributes\": {\"name\": null, \"handle\": \"test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com\", \"created_at\": \"2026-03-25T10:51:14.481612+00:00\", \"modified_at\": \"2026-03-25T10:51:14.481612+00:00\", \"email\": \"test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com\", \"icon\": \"https://secure.gravatar.com/avatar/be9f1c5abecde28b4c01cc8aa0680377?s=48&d=retro\", \"title\": \"user title\", \"verified\": false, \"service_account\": false, \"disabled\": false, \"allowed_login_methods\": [], \"status\": \"Pending\", \"last_login_time\": null}, \"relationships\": {\"roles\": {\"data\": []}, \"org\": {\"data\": {\"type\": \"orgs\", \"id\": \"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3dc77df1-1901-1be1-eb29-329a067fc083" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"66e25b0b-3f3b-427e-b162-e779f4535abb\",\"type\":\"users\"}}},\"type\":\"team_memberships\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/memberships", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"TeamMembership-1d059472-0eff-4857-a6c8-5e5041448b54-66092046\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"a1d5ff5a-c6dd-11f0-9cb6-06640ca27ad4\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"66e25b0b-3f3b-427e-b162-e779f4535abb\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"66e25b0b-3f3b-427e-b162-e779f4535abb\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com\",\"handle\":\"test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/be9f1c5abecde28b4c01cc8aa0680377?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ad5388a0-0a48-5363-8709-c59f5cbfee62" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/memberships/66e25b0b-3f3b-427e-b162-e779f4535abb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3aeec0bd-eac4-015d-33e5-3eade6d0f1cf" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/memberships/66e25b0b-3f3b-427e-b162-e779f4535abb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"User 66e25b0b-3f3b-427e-b162-e779f4535abb is not a member of Team 1d059472-0eff-4857-a6c8-5e5041448b54 not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3aeec0bd-eac4-015d-33e5-3eade6d0f1d0" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/users/66e25b0b-3f3b-427e-b162-e779f4535abb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d4b0b03d-2643-9397-d8c0-9dfe0a6b9934" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6dd9b9f9-5091-41eb-1746-8737f2857a45" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_cases_returns_OK_response_with_pagination.freeze b/src/test/resources/cassettes/features/v2/Search_cases_returns_OK_response_with_pagination.freeze new file mode 100644 index 00000000000..35ea4cca541 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Search_cases_returns_OK_response_with_pagination.freeze @@ -0,0 +1 @@ +2026-03-25T10:29:24.893Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_cases_returns_OK_response_with_pagination.json b/src/test/resources/cassettes/features/v2/Search_cases_returns_OK_response_with_pagination.json new file mode 100644 index 00000000000..a2ba64fb3ed --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Search_cases_returns_OK_response_with_pagination.json @@ -0,0 +1,76 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/cases", + "queryStringParameters": { + "page[size]": [ + "2" + ], + "page[number]": [ + "1" + ], + "filter": [ + "status:closed" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"cd4abeaa-0a5b-4b83-b99c-5b6d1f912938\",\"type\":\"case\",\"attributes\":{\"attributes\":{\"service\":[\"synthetics-browser\"]},\"closed_at\":\"2026-01-24T00:47:45.477244496Z\",\"comment_count\":0,\"created_at\":\"2025-11-12T00:42:59.178125Z\",\"created_by_author\":{\"type\":\"USER\",\"content\":{\"ID\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"active\":true}},\"creation_source\":\"ERROR_TRACKING\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[{\"type\":\"ERROR_TRACKING\",\"ref\":\"/error-tracking?issueId=a5bb2896-a4d0-11f0-bd76-da7ad0900002\",\"resource_id\":\"a5bb2896-a4d0-11f0-bd76-da7ad0900002\"}],\"internal_id\":\"cd4abeaa-0a5b-4b83-b99c-5b6d1f912938\",\"key\":\"ET-3\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2026-02-05T03:58:14.876711989Z\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"89979\",\"status\":\"CLOSED\",\"status_group\":\"SG_CLOSED\",\"status_name\":\"Closed\",\"title\":\"require-trusted-types-for: csp_violation: 'trusted-types-sink' blocked by 'require-trusted-types-for' directive\",\"type\":\"ERROR_TRACKING_ISSUE\",\"type_id\":\"00000000-0000-0000-0000-000000000005\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"384521ba-dc5f-481f-942d-15bd48428029\",\"type\":\"project\"}}}},{\"id\":\"7afc10c8-4096-4af1-9ccf-ec0df3a2f63b\",\"type\":\"case\",\"attributes\":{\"attributes\":{\"service\":[\"synthetics-browser\"]},\"comment_count\":0,\"created_at\":\"2025-09-02T13:56:48.031226Z\",\"created_by_author\":{\"type\":\"USER\",\"content\":{\"ID\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"frog\",\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"active\":true}},\"creation_source\":\"ERROR_TRACKING\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[{\"type\":\"ERROR_TRACKING\",\"ref\":\"/error-tracking?issueId=d3ab59c6-84ee-11f0-87bb-da7ad0900002\",\"resource_id\":\"d3ab59c6-84ee-11f0-87bb-da7ad0900002\"}],\"internal_id\":\"7afc10c8-4096-4af1-9ccf-ec0df3a2f63b\",\"key\":\"ET-2\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2026-03-25T09:56:47.052997427Z\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"79361\",\"status\":\"CLOSED\",\"status_group\":\"SG_CLOSED\",\"status_name\":\"Closed\",\"title\":\"Error: Expected unhandled error\",\"type\":\"ERROR_TRACKING_ISSUE\",\"type_id\":\"00000000-0000-0000-0000-000000000005\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"384521ba-dc5f-481f-942d-15bd48428029\",\"type\":\"project\"}}}}],\"meta\":{\"total_cases\":3,\"page\":{\"current\":1,\"size\":2,\"total\":2}},\"included\":[{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\",\"attributes\":{\"active\":false,\"email\":\"\",\"handle\":\"\",\"name\":\"\"}},{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}},{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a97b8b37-8352-cdc6-fbd4-99ef00afc3f6" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/cases", + "queryStringParameters": { + "page[size]": [ + "2" + ], + "page[number]": [ + "2" + ], + "filter": [ + "status:closed" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"f1b32a47-621d-4c57-9642-045aeb83891e\",\"type\":\"case\",\"attributes\":{\"attributes\":{\"service\":[\"synthetics-browser\"]},\"closed_at\":\"2025-08-21T17:21:13.882830862Z\",\"comment_count\":0,\"created_at\":\"2025-08-21T17:20:22.807979Z\",\"created_by_author\":{\"type\":\"USER\",\"content\":{\"ID\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"frog\",\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"active\":true}},\"creation_source\":\"ERROR_TRACKING\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[{\"type\":\"ERROR_TRACKING\",\"ref\":\"/error-tracking?issueId=5f8ebd5c-6dd9-11f0-8a28-da7ad0900002\",\"resource_id\":\"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002\"}],\"internal_id\":\"f1b32a47-621d-4c57-9642-045aeb83891e\",\"key\":\"ET-1\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2025-08-21T17:21:13.882830862Z\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"77795\",\"status\":\"CLOSED\",\"status_group\":\"SG_CLOSED\",\"status_name\":\"Closed\",\"title\":\"Error: HTTP error\",\"type\":\"ERROR_TRACKING_ISSUE\",\"type_id\":\"00000000-0000-0000-0000-000000000005\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"384521ba-dc5f-481f-942d-15bd48428029\",\"type\":\"project\"}}}}],\"meta\":{\"total_cases\":3,\"page\":{\"current\":2,\"size\":1,\"total\":2}},\"included\":[{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"}},{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\",\"attributes\":{\"active\":false,\"email\":\"\",\"handle\":\"\",\"name\":\"\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e440eea8-a785-21a7-1674-3ebcab9e6db0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_with_partial_update_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_team_with_partial_update_returns_OK_response.freeze new file mode 100644 index 00000000000..e997c2a92ba --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_with_partial_update_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-03-25T11:58:33.497Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_with_partial_update_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_team_with_partial_update_returns_OK_response.json new file mode 100644 index 00000000000..c8e7b2760a6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_with_partial_update_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-1aa8ea88c040ca48\",\"name\":\"test-name-1aa8ea88c040ca48\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5f6e649c-340c-46e7-96bc-bc5ececc7839\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":15,\"created_at\":\"2026-03-25T11:58:34.181069+00:00\",\"description\":null,\"handle\":\"test-handle-1aa8ea88c040ca48\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-03-25T11:58:34.181069+00:00\",\"name\":\"test-name-1aa8ea88c040ca48\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ccd9e7c9-39b8-d4e0-131c-9326f37c9d97" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-1aa8ea88c040ca48\",\"name\":\"test-name-1aa8ea88c040ca48 updated\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"5f6e649c-340c-46e7-96bc-bc5ececc7839\",\"attributes\":{\"name\":\"test-name-1aa8ea88c040ca48 updated\",\"handle\":\"test-handle-1aa8ea88c040ca48\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":15,\"visible_modules\":null,\"hidden_modules\":null,\"created_at\":\"2026-03-25T11:58:34.181069+00:00\",\"modified_at\":\"2026-03-25T11:58:34.727617+00:00\",\"user_count\":0,\"link_count\":0,\"is_managed\":false},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e090e31a-f93e-3c02-5f5d-cf1169aa5d80" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "20ab5a15-8050-32eb-841b-b60db95008d0" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature b/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature index 1d88b5bbc9d..bf8e47ce3b6 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature @@ -801,6 +801,43 @@ Feature: Dashboards And the response "widgets[0].definition.workflow_id" is equal to "2e055f16-8b6a-4cdd-b452-17a34c44b160" And the response "widgets[0].definition.inputs[0]" is equal to {"name": "environment", "value": "$env.value"} + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with sankey widget and network data source + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/sankey_network_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "sankey" + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "network" + And the response "widgets[0].definition.requests[0].query.query_string" is equal to "*" + And the response "widgets[0].definition.requests[0].query.group_by" is equal to ["source", "destination"] + And the response "widgets[0].definition.requests[0].query.limit" is equal to 100 + And the response "widgets[0].definition.requests[0].request_type" is equal to "netflow_sankey" + + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with sankey widget and product analytics data source + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/sankey_product_analytics_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "sankey" + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "product_analytics" + And the response "widgets[0].definition.requests[0].query.query_string" is equal to "@type:session" + And the response "widgets[0].definition.requests[0].query.mode" is equal to "source" + And the response "widgets[0].definition.requests[0].request_type" is equal to "sankey" + + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with sankey widget and rum data source + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/sankey_rum_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "sankey" + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "rum" + And the response "widgets[0].definition.requests[0].query.query_string" is equal to "@type:view" + And the response "widgets[0].definition.requests[0].query.mode" is equal to "source" + And the response "widgets[0].definition.requests[0].request_type" is equal to "sankey" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with scatterplot widget Given new "CreateDashboard" request diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_network_widget.json b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_network_widget.json new file mode 100644 index 00000000000..1f237af8f2f --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_network_widget.json @@ -0,0 +1,41 @@ +{ + "title":"{{ unique }}", + "description":"", + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":15 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "type":"sankey", + "requests":[ + { + "query":{ + "data_source":"network", + "query_string":"*", + "group_by":[ + "source", + "destination" + ], + "limit":100 + }, + "request_type":"netflow_sankey" + } + ] + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_product_analytics_widget.json b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_product_analytics_widget.json new file mode 100644 index 00000000000..c81edb69c6d --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_product_analytics_widget.json @@ -0,0 +1,37 @@ +{ + "title":"{{ unique }}", + "description":"", + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":15 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "type":"sankey", + "requests":[ + { + "query":{ + "data_source":"product_analytics", + "query_string":"@type:session", + "mode":"source" + }, + "request_type":"sankey" + } + ] + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_rum_widget.json b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_rum_widget.json new file mode 100644 index 00000000000..b8a833ee375 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/sankey_rum_widget.json @@ -0,0 +1,37 @@ +{ + "title":"{{ unique }}", + "description":"", + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":15 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "type":"sankey", + "requests":[ + { + "query":{ + "data_source":"rum", + "query_string":"@type:view", + "mode":"source" + }, + "request_type":"sankey" + } + ] + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature index 56d8f9ed68e..bd67a8ddf2c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature @@ -508,11 +508,14 @@ Feature: Case Management When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/case-management @with-pagination + @replay-only @skip-validation @team:DataDog/case-management @with-pagination Scenario: Search cases returns "OK" response with pagination Given new "SearchCases" request + And request contains "page[size]" parameter with value 2 + And request contains "filter" parameter with value "status:closed" When the request with pagination is sent Then the response status is 200 OK + And the response has 3 items @team:DataDog/case-management Scenario: Unarchive case returns "Bad Request" response diff --git a/src/test/resources/com/datadog/api/client/v2/api/teams.feature b/src/test/resources/com/datadog/api/client/v2/api/teams.feature index 480e3215e99..50f7f314684 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/teams.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/teams.feature @@ -573,12 +573,14 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Remove a user from a team returns "No Content" response Given new "DeleteTeamMembership" request And there is a valid "dd_team" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system And request contains "team_id" parameter from "dd_team.data.id" - And request contains "user_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "user.data.id" When the request is sent Then the response status is 204 No Content @@ -607,11 +609,13 @@ Feature: Teams And the response "data.attributes.label" is equal to "New Label" And the response "data.attributes.url" is equal to "https://example.com" - @generated @skip @team:DataDog/aaa-omg + @skip @team:DataDog/aaa-omg Scenario: Update a team returns "API error response." response Given new "UpdateTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"avatar": "\ud83e\udd51", "banner": null, "handle": "example-team", "hidden_modules": [], "name": "Example Team", "visible_modules": []}, "relationships": {"team_links": {"data": [{"id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001", "type": "team_links"}], "links": {"related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"}}}, "type": "team"}} + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And body with value {"data": {"attributes": {"handle": "{{dd_team_2.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}}"}, "type": "team"}} When the request is sent Then the response status is 409 API error response. @@ -631,6 +635,17 @@ Feature: Teams And the response "data.attributes.hidden_modules" is equal to ["m3"] And the response "data.attributes.visible_modules" is equal to ["m1", "m2"] + @team:DataDog/aaa-omg + Scenario: Update a team with partial update returns "OK" response + Given new "UpdateTeam" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And body with value {"data": {"attributes": {"handle": "{{dd_team.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}} updated"}, "type": "team"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "{{dd_team.data.attributes.name}} updated" + And the response "data.attributes.handle" is equal to "{{dd_team.data.attributes.handle}}" + @team:DataDog/aaa-omg Scenario: Update a user's membership attributes on a team returns "API error response." response Given new "UpdateTeamMembership" request