diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 607e2e287b5..db5c4be7dde 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41047,6 +41047,390 @@ components: - id - type type: object + GovernanceBestPracticeDefinition: + description: |- + The best practice associated with an insight. Populated with the first active best practice + matched to the insight; `null` when no best practice is attached. + properties: + category: + description: |- + The value driver the best practice is grouped under, such as `access_governance`, + `security`, `compliance`, or `operational_hygiene`. + example: "access_governance" + type: string + deep_link: + description: A relative link to the configuration page where the best practice can be acted upon. + example: "/organization-settings/users?status=inactive" + type: string + description: + description: The full rationale and guidance for the best practice. + example: "Review and deactivate users who have not logged in within the last 90 days." + type: string + detection_type: + description: An optional association to a control's detection type. `null` when not associated with a control. + example: + nullable: true + type: string + id: + description: The unique identifier of the best practice. + example: "bp_monitor_inactive_users" + type: string + impact: + description: The expected impact of following the best practice. + example: "Reduces unauthorized access risk." + type: string + impact_hint: + description: |- + A priority hint for ordering best practices by expected impact. Lower values indicate + higher priority. + example: 1 + format: int64 + type: integer + permissions: + description: The permissions required for the user to act on the best practice. + example: + - "user_access_manage" + items: + description: A permission required to act on the best practice. + type: string + type: array + status: + description: Whether the best practice is currently `active` or `deprecated`. + example: "active" + type: string + summary: + description: A one-line explanation of why this best practice matters. + example: "Inactive users with access increase your security surface area." + type: string + title: + description: A short, human-readable name for the best practice. + example: "Monitor inactive users" + type: string + trigger_condition: + description: |- + The condition that surfaces the best practice. For an `insight` trigger, the insight + slug; for a `static` trigger, a descriptive condition key. + example: "active_users" + type: string + trigger_type: + description: |- + How the best practice is surfaced. `insight` ties it to an insight; `static` surfaces it + unless its condition is met. + example: "insight" + type: string + required: + - id + - title + - summary + - description + - category + - impact + - trigger_type + - trigger_condition + - deep_link + - permissions + - impact_hint + - status + type: object + GovernanceInsightAttributes: + description: The attributes of a governance insight. + properties: + audit_query: + $ref: "#/components/schemas/GovernanceInsightAuditQuery" + nullable: true + best_practice: + $ref: "#/components/schemas/GovernanceBestPracticeDefinition" + nullable: true + deep_link: + description: A relative link to the product surface where the insight can be acted upon. + example: "" + type: string + description: + description: A human-readable description of what the insight measures. + example: "Number of users who have used the Dashboard in the last 30 days" + type: string + display_name: + description: Human-readable name of the insight. + example: "Active Dashboards" + type: string + event_query: + $ref: "#/components/schemas/GovernanceInsightEventQuery" + nullable: true + metric_query: + $ref: "#/components/schemas/GovernanceInsightMetricQuery" + nullable: true + old_value: + description: |- + The value of the insight over the previous comparison window. `null` when values were + not requested or could not be computed. + example: 3274 + format: double + nullable: true + type: number + percentage_query: + $ref: "#/components/schemas/GovernanceInsightPercentageQuery" + nullable: true + product: + description: The product the insight belongs to. + example: "Usage" + type: string + query_config: + $ref: "#/components/schemas/GovernanceInsightQueryConfig" + nullable: true + sort_order: + description: The relative order in which the insight should be displayed. + example: 1 + format: int64 + type: integer + state: + description: |- + The state of the insight. A `critical` insight receives extra UI treatment to draw + attention to it. + example: "critical" + type: string + sub_product: + description: The sub-product the insight belongs to, if any. + example: "Indexes" + type: string + time_range: + description: The time range the insight value is computed over, if applicable. + example: "month" + type: string + unit_name: + description: The unit that the insight's value is measured in. + example: "active dashboards" + type: string + usage_query: + $ref: "#/components/schemas/GovernanceInsightUsageQuery" + nullable: true + value: + description: The current value of the insight. `null` when values were not requested or could not be computed. + example: 3601 + format: double + nullable: true + type: number + required: + - display_name + - product + - best_practice + - sub_product + - unit_name + - description + - time_range + - state + - deep_link + - value + - old_value + - metric_query + - event_query + - usage_query + - audit_query + - percentage_query + type: object + GovernanceInsightAuditCompute: + description: The aggregation applied to an audit log query. + properties: + aggregation: + description: The aggregation function to apply. + example: "cardinality" + type: string + interval: + description: The aggregation time window, in milliseconds. + example: 86400000 + format: int64 + type: integer + metric: + description: The metric or attribute to aggregate. + example: "@usr.id" + type: string + rollup: + description: An optional secondary aggregation applied to the audit query result. + example: "" + type: string + required: + - aggregation + - metric + - interval + type: object + GovernanceInsightAuditQuery: + description: An audit log query used to compute an insight value. + properties: + compute: + $ref: "#/components/schemas/GovernanceInsightAuditCompute" + indexes: + description: The audit log indexes the query runs against. + example: + - "main" + items: + description: An audit log index name. + type: string + type: array + query: + description: The audit log search query string. + example: "@evt.name:Dashboard" + type: string + source: + description: The data source the query runs against. + example: "audit" + type: string + required: + - source + - query + - indexes + - compute + type: object + GovernanceInsightData: + description: A governance insight resource. + properties: + attributes: + $ref: "#/components/schemas/GovernanceInsightAttributes" + id: + description: The unique identifier of the insight. + example: "498ee21f-8037-48b8-a961-a488692902f4" + type: string + type: + $ref: "#/components/schemas/GovernanceInsightResourceType" + required: + - id + - type + - attributes + type: object + GovernanceInsightEventCompute: + description: The aggregation applied to an event query. + properties: + aggregation: + description: The aggregation function to apply. + example: "count" + type: string + interval: + description: The aggregation time window, in milliseconds. + example: 86400000 + format: int64 + type: integer + required: + - aggregation + - interval + type: object + GovernanceInsightEventQuery: + description: An event query used to compute an insight value. + properties: + compute: + $ref: "#/components/schemas/GovernanceInsightEventCompute" + nullable: true + indexes: + description: The event indexes the query runs against. + example: + - "main" + items: + description: An event index name. + type: string + type: array + query: + description: The event search query string. + example: "source:cloudtrail" + type: string + required: + - query + - indexes + type: object + GovernanceInsightMetricQuery: + description: A metric query used to compute an insight value. + properties: + query: + description: The query string. + example: "avg:system.cpu.user{*}" + type: string + reducer: + description: How the query result series is reduced to a single value. + example: "avg" + type: string + source: + description: The data source the query runs against. + example: "metrics" + type: string + required: + - source + - query + - reducer + type: object + GovernanceInsightPercentageQuery: + description: A percentage query that computes an insight value as a ratio of two metric queries. + properties: + denominator_query: + $ref: "#/components/schemas/GovernanceInsightMetricQuery" + numerator_query: + $ref: "#/components/schemas/GovernanceInsightMetricQuery" + required: + - numerator_query + - denominator_query + type: object + GovernanceInsightQueryConfig: + description: Query execution context that allows the frontend to execute insight queries directly. + properties: + chart_type: + description: The chart type the frontend should use to render the insight. + example: "line" + type: string + comparison_shift: + description: The window used for the previous value comparison, for example `week` or `month`. + example: "month" + type: string + default_value: + description: The default value to display when no data is available. + example: 0 + format: int64 + type: integer + directionality: + description: |- + Whether an increase in the value is good, bad, or neutral. One of `neutral`, + `increase_better`, or `decrease_better`. + example: "neutral" + type: string + effective_time_window_days: + description: The number of days the insight value is computed over. + example: 30 + format: int64 + type: integer + required: + - effective_time_window_days + - comparison_shift + type: object + GovernanceInsightResourceType: + description: JSON:API resource type for a governance insight. + enum: + - insight + example: "insight" + type: string + x-enum-varnames: + - INSIGHT + GovernanceInsightUsageQuery: + description: A usage query used to compute an insight value. + properties: + query: + description: The usage query string. + example: "logs_indexed_events" + type: string + reducer: + description: How the query result series is reduced to a single value. + example: "sum" + type: string + required: + - query + - reducer + type: object + GovernanceInsightsDataArray: + description: An array of governance insight resources. + items: + $ref: "#/components/schemas/GovernanceInsightData" + type: array + GovernanceInsightsResponse: + description: A list of governance insights. + properties: + data: + $ref: "#/components/schemas/GovernanceInsightsDataArray" + required: + - data + type: object GreyNoiseAPIKey: description: The definition of the `GreyNoiseAPIKey` object. properties: @@ -131737,6 +132121,135 @@ paths: operator: OR permissions: - user_access_read + /api/v2/governance/insights: + get: + description: |- + Retrieve the list of governance insights available to the organization. By default, only + insight metadata is returned; pass `withValues=true` to also compute and include each + insight's current and previous values. Insights can be filtered by product. + operationId: ListGovernanceInsights + parameters: + - description: |- + Whether to compute and include the current and previous value of each insight. + Defaults to `false`, in which case only insight metadata is returned. + example: true + in: query + name: withValues + required: false + schema: + type: boolean + - description: |- + The UUID of the organization to compute insights for. Defaults to the organization of + the authenticated user. Used to retrieve insights for a child organization from a + parent organization. + example: "11111111-2222-3333-4444-555555555555" + in: query + name: orgUuid + required: false + schema: + type: string + - description: |- + Restrict the results to insights belonging to the given products. May be repeated to + filter by multiple products. Matching is case-insensitive. + example: + - "Usage" + - "Logs Settings" + in: query + name: filter[product] + required: false + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + audit_query: + best_practice: + deep_link: "" + description: "" + display_name: "Active Dashboards" + event_query: + metric_query: + old_value: 3274 + percentage_query: + product: "Usage" + state: "" + sub_product: "" + time_range: "" + unit_name: "active dashboards" + usage_query: + value: 3601 + id: "498ee21f-8037-48b8-a961-a488692902f4" + type: "insight" + - attributes: + audit_query: + best_practice: + category: "access_governance" + deep_link: "/organization-settings/users?status=inactive" + description: "Review and deactivate users who have not logged in within the last 90 days." + detection_type: + id: "bp_monitor_inactive_users" + impact: "Reduces unauthorized access risk." + impact_hint: 1 + permissions: + - "user_access_manage" + status: "active" + summary: "Inactive users with access increase your security surface area." + title: "Monitor inactive users" + trigger_condition: "active_users" + trigger_type: "insight" + deep_link: "" + description: "Number of users who have used the Dashboard in the last 30 days" + display_name: "Active Users" + event_query: + metric_query: + old_value: 1173 + percentage_query: + product: "Usage" + state: "" + sub_product: "" + time_range: "month" + unit_name: "active users" + usage_query: + value: 1291 + id: "a3248d1b-5578-4345-a34e-fe9657300f22" + type: "insight" + schema: + $ref: "#/components/schemas/GovernanceInsightsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List governance insights + tags: + - Governance Insights + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/hamr: get: description: |- @@ -189748,6 +190261,12 @@ tags: description: For more information about the Datadog Google Chat integration, see the integration page. url: https://docs.datadoghq.com/integrations/google-hangouts-chat/ name: Google Chat Integration + - description: |- + Governance Insights surface key usage, configuration, and best-practice signals for an + organization within the Governance Console. Each insight reports a current value (and, + optionally, a previous value for comparison) along with the query used to compute it, so + that the Console can render trends and highlight areas that need attention. + name: Governance Insights - description: |- Configure High Availability Multi-Region (HAMR) connections between Datadog organizations. HAMR provides disaster recovery capabilities by maintaining synchronized data between primary diff --git a/examples/v2/governance-insights/ListGovernanceInsights.java b/examples/v2/governance-insights/ListGovernanceInsights.java new file mode 100644 index 00000000000..3ec8610de6a --- /dev/null +++ b/examples/v2/governance-insights/ListGovernanceInsights.java @@ -0,0 +1,25 @@ +// List governance insights returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GovernanceInsightsApi; +import com.datadog.api.client.v2.model.GovernanceInsightsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listGovernanceInsights", true); + GovernanceInsightsApi apiInstance = new GovernanceInsightsApi(defaultClient); + + try { + GovernanceInsightsResponse result = apiInstance.listGovernanceInsights(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GovernanceInsightsApi#listGovernanceInsights"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 2f1b54ed2b3..806c106619d 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1031,6 +1031,7 @@ public class ApiClient { put("v2.upsertAndPublishFormVersion", false); put("v2.upsertFormVersion", false); put("v2.updateOrgSamlConfigurations", false); + put("v2.listGovernanceInsights", false); put("v2.createHamrOrgConnection", false); put("v2.getHamrOrgConnection", false); put("v2.deleteEntityIntegrationConfig", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java b/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java new file mode 100644 index 00000000000..cfc8d9c0898 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java @@ -0,0 +1,275 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GovernanceInsightsResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightsApi { + private ApiClient apiClient; + + public GovernanceInsightsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public GovernanceInsightsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** Manage optional parameters to listGovernanceInsights. */ + public static class ListGovernanceInsightsOptionalParameters { + private Boolean withValues; + private String orgUuid; + private List filterProduct; + + /** + * Set withValues. + * + * @param withValues Whether to compute and include the current and previous value of each + * insight. Defaults to false, in which case only insight metadata is returned. + * (optional) + * @return ListGovernanceInsightsOptionalParameters + */ + public ListGovernanceInsightsOptionalParameters withValues(Boolean withValues) { + this.withValues = withValues; + return this; + } + + /** + * Set orgUuid. + * + * @param orgUuid The UUID of the organization to compute insights for. Defaults to the + * organization of the authenticated user. Used to retrieve insights for a child + * organization from a parent organization. (optional) + * @return ListGovernanceInsightsOptionalParameters + */ + public ListGovernanceInsightsOptionalParameters orgUuid(String orgUuid) { + this.orgUuid = orgUuid; + return this; + } + + /** + * Set filterProduct. + * + * @param filterProduct Restrict the results to insights belonging to the given products. May be + * repeated to filter by multiple products. Matching is case-insensitive. (optional) + * @return ListGovernanceInsightsOptionalParameters + */ + public ListGovernanceInsightsOptionalParameters filterProduct(List filterProduct) { + this.filterProduct = filterProduct; + return this; + } + } + + /** + * List governance insights. + * + *

See {@link #listGovernanceInsightsWithHttpInfo}. + * + * @return GovernanceInsightsResponse + * @throws ApiException if fails to make API call + */ + public GovernanceInsightsResponse listGovernanceInsights() throws ApiException { + return listGovernanceInsightsWithHttpInfo(new ListGovernanceInsightsOptionalParameters()) + .getData(); + } + + /** + * List governance insights. + * + *

See {@link #listGovernanceInsightsWithHttpInfoAsync}. + * + * @return CompletableFuture<GovernanceInsightsResponse> + */ + public CompletableFuture listGovernanceInsightsAsync() { + return listGovernanceInsightsWithHttpInfoAsync(new ListGovernanceInsightsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List governance insights. + * + *

See {@link #listGovernanceInsightsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return GovernanceInsightsResponse + * @throws ApiException if fails to make API call + */ + public GovernanceInsightsResponse listGovernanceInsights( + ListGovernanceInsightsOptionalParameters parameters) throws ApiException { + return listGovernanceInsightsWithHttpInfo(parameters).getData(); + } + + /** + * List governance insights. + * + *

See {@link #listGovernanceInsightsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GovernanceInsightsResponse> + */ + public CompletableFuture listGovernanceInsightsAsync( + ListGovernanceInsightsOptionalParameters parameters) { + return listGovernanceInsightsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the list of governance insights available to the organization. By default, only + * insight metadata is returned; pass withValues=true to also compute and include + * each insight's current and previous values. Insights can be filtered by product. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<GovernanceInsightsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listGovernanceInsightsWithHttpInfo( + ListGovernanceInsightsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listGovernanceInsights"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Boolean withValues = parameters.withValues; + String orgUuid = parameters.orgUuid; + List filterProduct = parameters.filterProduct; + // create path and map variables + String localVarPath = "/api/v2/governance/insights"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "withValues", withValues)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "orgUuid", orgUuid)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[product]", filterProduct)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GovernanceInsightsApi.listGovernanceInsights", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List governance insights. + * + *

See {@link #listGovernanceInsightsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GovernanceInsightsResponse>> + */ + public CompletableFuture> + listGovernanceInsightsWithHttpInfoAsync(ListGovernanceInsightsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listGovernanceInsights"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Boolean withValues = parameters.withValues; + String orgUuid = parameters.orgUuid; + List filterProduct = parameters.filterProduct; + // create path and map variables + String localVarPath = "/api/v2/governance/insights"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "withValues", withValues)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "orgUuid", orgUuid)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[product]", filterProduct)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GovernanceInsightsApi.listGovernanceInsights", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceBestPracticeDefinition.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceBestPracticeDefinition.java new file mode 100644 index 00000000000..be44c65d496 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceBestPracticeDefinition.java @@ -0,0 +1,523 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * The best practice associated with an insight. Populated with the first active best practice + * matched to the insight; null when no best practice is attached. + */ +@JsonPropertyOrder({ + GovernanceBestPracticeDefinition.JSON_PROPERTY_CATEGORY, + GovernanceBestPracticeDefinition.JSON_PROPERTY_DEEP_LINK, + GovernanceBestPracticeDefinition.JSON_PROPERTY_DESCRIPTION, + GovernanceBestPracticeDefinition.JSON_PROPERTY_DETECTION_TYPE, + GovernanceBestPracticeDefinition.JSON_PROPERTY_ID, + GovernanceBestPracticeDefinition.JSON_PROPERTY_IMPACT, + GovernanceBestPracticeDefinition.JSON_PROPERTY_IMPACT_HINT, + GovernanceBestPracticeDefinition.JSON_PROPERTY_PERMISSIONS, + GovernanceBestPracticeDefinition.JSON_PROPERTY_STATUS, + GovernanceBestPracticeDefinition.JSON_PROPERTY_SUMMARY, + GovernanceBestPracticeDefinition.JSON_PROPERTY_TITLE, + GovernanceBestPracticeDefinition.JSON_PROPERTY_TRIGGER_CONDITION, + GovernanceBestPracticeDefinition.JSON_PROPERTY_TRIGGER_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceBestPracticeDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_DEEP_LINK = "deep_link"; + private String deepLink; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DETECTION_TYPE = "detection_type"; + private JsonNullable detectionType = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_IMPACT = "impact"; + private String impact; + + public static final String JSON_PROPERTY_IMPACT_HINT = "impact_hint"; + private Long impactHint; + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private List permissions = new ArrayList<>(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private String summary; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TRIGGER_CONDITION = "trigger_condition"; + private String triggerCondition; + + public static final String JSON_PROPERTY_TRIGGER_TYPE = "trigger_type"; + private String triggerType; + + public GovernanceBestPracticeDefinition() {} + + @JsonCreator + public GovernanceBestPracticeDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_DEEP_LINK) String deepLink, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_IMPACT) String impact, + @JsonProperty(required = true, value = JSON_PROPERTY_IMPACT_HINT) Long impactHint, + @JsonProperty(required = true, value = JSON_PROPERTY_PERMISSIONS) List permissions, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_SUMMARY) String summary, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGER_CONDITION) + String triggerCondition, + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGER_TYPE) String triggerType) { + this.category = category; + this.deepLink = deepLink; + this.description = description; + this.id = id; + this.impact = impact; + this.impactHint = impactHint; + this.permissions = permissions; + this.status = status; + this.summary = summary; + this.title = title; + this.triggerCondition = triggerCondition; + this.triggerType = triggerType; + } + + public GovernanceBestPracticeDefinition category(String category) { + this.category = category; + return this; + } + + /** + * The value driver the best practice is grouped under, such as access_governance, + * security, compliance, or operational_hygiene. + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public GovernanceBestPracticeDefinition deepLink(String deepLink) { + this.deepLink = deepLink; + return this; + } + + /** + * A relative link to the configuration page where the best practice can be acted upon. + * + * @return deepLink + */ + @JsonProperty(JSON_PROPERTY_DEEP_LINK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDeepLink() { + return deepLink; + } + + public void setDeepLink(String deepLink) { + this.deepLink = deepLink; + } + + public GovernanceBestPracticeDefinition description(String description) { + this.description = description; + return this; + } + + /** + * The full rationale and guidance for the best practice. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GovernanceBestPracticeDefinition detectionType(String detectionType) { + this.detectionType = JsonNullable.of(detectionType); + return this; + } + + /** + * An optional association to a control's detection type. null when not associated + * with a control. + * + * @return detectionType + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDetectionType() { + return detectionType.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DETECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDetectionType_JsonNullable() { + return detectionType; + } + + @JsonProperty(JSON_PROPERTY_DETECTION_TYPE) + public void setDetectionType_JsonNullable(JsonNullable detectionType) { + this.detectionType = detectionType; + } + + public void setDetectionType(String detectionType) { + this.detectionType = JsonNullable.of(detectionType); + } + + public GovernanceBestPracticeDefinition id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the best practice. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GovernanceBestPracticeDefinition impact(String impact) { + this.impact = impact; + return this; + } + + /** + * The expected impact of following the best practice. + * + * @return impact + */ + @JsonProperty(JSON_PROPERTY_IMPACT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getImpact() { + return impact; + } + + public void setImpact(String impact) { + this.impact = impact; + } + + public GovernanceBestPracticeDefinition impactHint(Long impactHint) { + this.impactHint = impactHint; + return this; + } + + /** + * A priority hint for ordering best practices by expected impact. Lower values indicate higher + * priority. + * + * @return impactHint + */ + @JsonProperty(JSON_PROPERTY_IMPACT_HINT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getImpactHint() { + return impactHint; + } + + public void setImpactHint(Long impactHint) { + this.impactHint = impactHint; + } + + public GovernanceBestPracticeDefinition permissions(List permissions) { + this.permissions = permissions; + return this; + } + + public GovernanceBestPracticeDefinition addPermissionsItem(String permissionsItem) { + this.permissions.add(permissionsItem); + return this; + } + + /** + * The permissions required for the user to act on the best practice. + * + * @return permissions + */ + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPermissions() { + return permissions; + } + + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + public GovernanceBestPracticeDefinition status(String status) { + this.status = status; + return this; + } + + /** + * Whether the best practice is currently active or deprecated. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public GovernanceBestPracticeDefinition summary(String summary) { + this.summary = summary; + return this; + } + + /** + * A one-line explanation of why this best practice matters. + * + * @return summary + */ + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public GovernanceBestPracticeDefinition title(String title) { + this.title = title; + return this; + } + + /** + * A short, human-readable name for the best practice. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public GovernanceBestPracticeDefinition triggerCondition(String triggerCondition) { + this.triggerCondition = triggerCondition; + return this; + } + + /** + * The condition that surfaces the best practice. For an insight trigger, the insight + * slug; for a static trigger, a descriptive condition key. + * + * @return triggerCondition + */ + @JsonProperty(JSON_PROPERTY_TRIGGER_CONDITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriggerCondition() { + return triggerCondition; + } + + public void setTriggerCondition(String triggerCondition) { + this.triggerCondition = triggerCondition; + } + + public GovernanceBestPracticeDefinition triggerType(String triggerType) { + this.triggerType = triggerType; + return this; + } + + /** + * How the best practice is surfaced. insight ties it to an insight; static + * surfaces it unless its condition is met. + * + * @return triggerType + */ + @JsonProperty(JSON_PROPERTY_TRIGGER_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriggerType() { + return triggerType; + } + + public void setTriggerType(String triggerType) { + this.triggerType = triggerType; + } + + /** + * 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 GovernanceBestPracticeDefinition + */ + @JsonAnySetter + public GovernanceBestPracticeDefinition 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 GovernanceBestPracticeDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceBestPracticeDefinition governanceBestPracticeDefinition = + (GovernanceBestPracticeDefinition) o; + return Objects.equals(this.category, governanceBestPracticeDefinition.category) + && Objects.equals(this.deepLink, governanceBestPracticeDefinition.deepLink) + && Objects.equals(this.description, governanceBestPracticeDefinition.description) + && Objects.equals(this.detectionType, governanceBestPracticeDefinition.detectionType) + && Objects.equals(this.id, governanceBestPracticeDefinition.id) + && Objects.equals(this.impact, governanceBestPracticeDefinition.impact) + && Objects.equals(this.impactHint, governanceBestPracticeDefinition.impactHint) + && Objects.equals(this.permissions, governanceBestPracticeDefinition.permissions) + && Objects.equals(this.status, governanceBestPracticeDefinition.status) + && Objects.equals(this.summary, governanceBestPracticeDefinition.summary) + && Objects.equals(this.title, governanceBestPracticeDefinition.title) + && Objects.equals(this.triggerCondition, governanceBestPracticeDefinition.triggerCondition) + && Objects.equals(this.triggerType, governanceBestPracticeDefinition.triggerType) + && Objects.equals( + this.additionalProperties, governanceBestPracticeDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + deepLink, + description, + detectionType, + id, + impact, + impactHint, + permissions, + status, + summary, + title, + triggerCondition, + triggerType, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceBestPracticeDefinition {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" deepLink: ").append(toIndentedString(deepLink)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" detectionType: ").append(toIndentedString(detectionType)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" impact: ").append(toIndentedString(impact)).append("\n"); + sb.append(" impactHint: ").append(toIndentedString(impactHint)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" triggerCondition: ").append(toIndentedString(triggerCondition)).append("\n"); + sb.append(" triggerType: ").append(toIndentedString(triggerType)).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/v2/model/GovernanceInsightAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightAttributes.java new file mode 100644 index 00000000000..0a2a62cefe4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightAttributes.java @@ -0,0 +1,669 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a governance insight. */ +@JsonPropertyOrder({ + GovernanceInsightAttributes.JSON_PROPERTY_AUDIT_QUERY, + GovernanceInsightAttributes.JSON_PROPERTY_BEST_PRACTICE, + GovernanceInsightAttributes.JSON_PROPERTY_DEEP_LINK, + GovernanceInsightAttributes.JSON_PROPERTY_DESCRIPTION, + GovernanceInsightAttributes.JSON_PROPERTY_DISPLAY_NAME, + GovernanceInsightAttributes.JSON_PROPERTY_EVENT_QUERY, + GovernanceInsightAttributes.JSON_PROPERTY_METRIC_QUERY, + GovernanceInsightAttributes.JSON_PROPERTY_OLD_VALUE, + GovernanceInsightAttributes.JSON_PROPERTY_PERCENTAGE_QUERY, + GovernanceInsightAttributes.JSON_PROPERTY_PRODUCT, + GovernanceInsightAttributes.JSON_PROPERTY_QUERY_CONFIG, + GovernanceInsightAttributes.JSON_PROPERTY_SORT_ORDER, + GovernanceInsightAttributes.JSON_PROPERTY_STATE, + GovernanceInsightAttributes.JSON_PROPERTY_SUB_PRODUCT, + GovernanceInsightAttributes.JSON_PROPERTY_TIME_RANGE, + GovernanceInsightAttributes.JSON_PROPERTY_UNIT_NAME, + GovernanceInsightAttributes.JSON_PROPERTY_USAGE_QUERY, + GovernanceInsightAttributes.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIT_QUERY = "audit_query"; + private GovernanceInsightAuditQuery auditQuery; + + public static final String JSON_PROPERTY_BEST_PRACTICE = "best_practice"; + private GovernanceBestPracticeDefinition bestPractice; + + public static final String JSON_PROPERTY_DEEP_LINK = "deep_link"; + private String deepLink; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_EVENT_QUERY = "event_query"; + private GovernanceInsightEventQuery eventQuery; + + public static final String JSON_PROPERTY_METRIC_QUERY = "metric_query"; + private GovernanceInsightMetricQuery metricQuery; + + public static final String JSON_PROPERTY_OLD_VALUE = "old_value"; + private Double oldValue; + + public static final String JSON_PROPERTY_PERCENTAGE_QUERY = "percentage_query"; + private GovernanceInsightPercentageQuery percentageQuery; + + public static final String JSON_PROPERTY_PRODUCT = "product"; + private String product; + + public static final String JSON_PROPERTY_QUERY_CONFIG = "query_config"; + private GovernanceInsightQueryConfig queryConfig; + + public static final String JSON_PROPERTY_SORT_ORDER = "sort_order"; + private Long sortOrder; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + public static final String JSON_PROPERTY_SUB_PRODUCT = "sub_product"; + private String subProduct; + + public static final String JSON_PROPERTY_TIME_RANGE = "time_range"; + private String timeRange; + + public static final String JSON_PROPERTY_UNIT_NAME = "unit_name"; + private String unitName; + + public static final String JSON_PROPERTY_USAGE_QUERY = "usage_query"; + private GovernanceInsightUsageQuery usageQuery; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Double value; + + public GovernanceInsightAttributes() {} + + @JsonCreator + public GovernanceInsightAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AUDIT_QUERY) + GovernanceInsightAuditQuery auditQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_BEST_PRACTICE) + GovernanceBestPracticeDefinition bestPractice, + @JsonProperty(required = true, value = JSON_PROPERTY_DEEP_LINK) String deepLink, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_DISPLAY_NAME) String displayName, + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_QUERY) + GovernanceInsightEventQuery eventQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC_QUERY) + GovernanceInsightMetricQuery metricQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_OLD_VALUE) Double oldValue, + @JsonProperty(required = true, value = JSON_PROPERTY_PERCENTAGE_QUERY) + GovernanceInsightPercentageQuery percentageQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_PRODUCT) String product, + @JsonProperty(required = true, value = JSON_PROPERTY_STATE) String state, + @JsonProperty(required = true, value = JSON_PROPERTY_SUB_PRODUCT) String subProduct, + @JsonProperty(required = true, value = JSON_PROPERTY_TIME_RANGE) String timeRange, + @JsonProperty(required = true, value = JSON_PROPERTY_UNIT_NAME) String unitName, + @JsonProperty(required = true, value = JSON_PROPERTY_USAGE_QUERY) + GovernanceInsightUsageQuery usageQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Double value) { + this.auditQuery = auditQuery; + this.unparsed |= auditQuery.unparsed; + this.bestPractice = bestPractice; + this.unparsed |= bestPractice.unparsed; + this.deepLink = deepLink; + this.description = description; + this.displayName = displayName; + this.eventQuery = eventQuery; + this.unparsed |= eventQuery.unparsed; + this.metricQuery = metricQuery; + this.unparsed |= metricQuery.unparsed; + this.oldValue = oldValue; + if (oldValue != null) {} + this.percentageQuery = percentageQuery; + this.unparsed |= percentageQuery.unparsed; + this.product = product; + this.state = state; + this.subProduct = subProduct; + this.timeRange = timeRange; + this.unitName = unitName; + this.usageQuery = usageQuery; + this.unparsed |= usageQuery.unparsed; + this.value = value; + if (value != null) {} + } + + public GovernanceInsightAttributes auditQuery(GovernanceInsightAuditQuery auditQuery) { + this.auditQuery = auditQuery; + this.unparsed |= auditQuery.unparsed; + return this; + } + + /** + * An audit log query used to compute an insight value. + * + * @return auditQuery + */ + @JsonProperty(JSON_PROPERTY_AUDIT_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightAuditQuery getAuditQuery() { + return auditQuery; + } + + public void setAuditQuery(GovernanceInsightAuditQuery auditQuery) { + this.auditQuery = auditQuery; + } + + public GovernanceInsightAttributes bestPractice(GovernanceBestPracticeDefinition bestPractice) { + this.bestPractice = bestPractice; + this.unparsed |= bestPractice.unparsed; + return this; + } + + /** + * The best practice associated with an insight. Populated with the first active best practice + * matched to the insight; null when no best practice is attached. + * + * @return bestPractice + */ + @JsonProperty(JSON_PROPERTY_BEST_PRACTICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceBestPracticeDefinition getBestPractice() { + return bestPractice; + } + + public void setBestPractice(GovernanceBestPracticeDefinition bestPractice) { + this.bestPractice = bestPractice; + } + + public GovernanceInsightAttributes deepLink(String deepLink) { + this.deepLink = deepLink; + return this; + } + + /** + * A relative link to the product surface where the insight can be acted upon. + * + * @return deepLink + */ + @JsonProperty(JSON_PROPERTY_DEEP_LINK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDeepLink() { + return deepLink; + } + + public void setDeepLink(String deepLink) { + this.deepLink = deepLink; + } + + public GovernanceInsightAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description of what the insight measures. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GovernanceInsightAttributes displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Human-readable name of the insight. + * + * @return displayName + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public GovernanceInsightAttributes eventQuery(GovernanceInsightEventQuery eventQuery) { + this.eventQuery = eventQuery; + this.unparsed |= eventQuery.unparsed; + return this; + } + + /** + * An event query used to compute an insight value. + * + * @return eventQuery + */ + @JsonProperty(JSON_PROPERTY_EVENT_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightEventQuery getEventQuery() { + return eventQuery; + } + + public void setEventQuery(GovernanceInsightEventQuery eventQuery) { + this.eventQuery = eventQuery; + } + + public GovernanceInsightAttributes metricQuery(GovernanceInsightMetricQuery metricQuery) { + this.metricQuery = metricQuery; + this.unparsed |= metricQuery.unparsed; + return this; + } + + /** + * A metric query used to compute an insight value. + * + * @return metricQuery + */ + @JsonProperty(JSON_PROPERTY_METRIC_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightMetricQuery getMetricQuery() { + return metricQuery; + } + + public void setMetricQuery(GovernanceInsightMetricQuery metricQuery) { + this.metricQuery = metricQuery; + } + + public GovernanceInsightAttributes oldValue(Double oldValue) { + this.oldValue = oldValue; + if (oldValue != null) {} + return this; + } + + /** + * The value of the insight over the previous comparison window. null when values + * were not requested or could not be computed. + * + * @return oldValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OLD_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getOldValue() { + return oldValue; + } + + public void setOldValue(Double oldValue) { + this.oldValue = oldValue; + } + + public GovernanceInsightAttributes percentageQuery( + GovernanceInsightPercentageQuery percentageQuery) { + this.percentageQuery = percentageQuery; + this.unparsed |= percentageQuery.unparsed; + return this; + } + + /** + * A percentage query that computes an insight value as a ratio of two metric queries. + * + * @return percentageQuery + */ + @JsonProperty(JSON_PROPERTY_PERCENTAGE_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightPercentageQuery getPercentageQuery() { + return percentageQuery; + } + + public void setPercentageQuery(GovernanceInsightPercentageQuery percentageQuery) { + this.percentageQuery = percentageQuery; + } + + public GovernanceInsightAttributes product(String product) { + this.product = product; + return this; + } + + /** + * The product the insight belongs to. + * + * @return product + */ + @JsonProperty(JSON_PROPERTY_PRODUCT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProduct() { + return product; + } + + public void setProduct(String product) { + this.product = product; + } + + public GovernanceInsightAttributes queryConfig(GovernanceInsightQueryConfig queryConfig) { + this.queryConfig = queryConfig; + this.unparsed |= queryConfig.unparsed; + return this; + } + + /** + * Query execution context that allows the frontend to execute insight queries directly. + * + * @return queryConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GovernanceInsightQueryConfig getQueryConfig() { + return queryConfig; + } + + public void setQueryConfig(GovernanceInsightQueryConfig queryConfig) { + this.queryConfig = queryConfig; + } + + public GovernanceInsightAttributes sortOrder(Long sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * The relative order in which the insight should be displayed. + * + * @return sortOrder + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSortOrder() { + return sortOrder; + } + + public void setSortOrder(Long sortOrder) { + this.sortOrder = sortOrder; + } + + public GovernanceInsightAttributes state(String state) { + this.state = state; + return this; + } + + /** + * The state of the insight. A critical insight receives extra UI treatment to draw + * attention to it. + * + * @return state + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public GovernanceInsightAttributes subProduct(String subProduct) { + this.subProduct = subProduct; + return this; + } + + /** + * The sub-product the insight belongs to, if any. + * + * @return subProduct + */ + @JsonProperty(JSON_PROPERTY_SUB_PRODUCT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSubProduct() { + return subProduct; + } + + public void setSubProduct(String subProduct) { + this.subProduct = subProduct; + } + + public GovernanceInsightAttributes timeRange(String timeRange) { + this.timeRange = timeRange; + return this; + } + + /** + * The time range the insight value is computed over, if applicable. + * + * @return timeRange + */ + @JsonProperty(JSON_PROPERTY_TIME_RANGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTimeRange() { + return timeRange; + } + + public void setTimeRange(String timeRange) { + this.timeRange = timeRange; + } + + public GovernanceInsightAttributes unitName(String unitName) { + this.unitName = unitName; + return this; + } + + /** + * The unit that the insight's value is measured in. + * + * @return unitName + */ + @JsonProperty(JSON_PROPERTY_UNIT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public GovernanceInsightAttributes usageQuery(GovernanceInsightUsageQuery usageQuery) { + this.usageQuery = usageQuery; + this.unparsed |= usageQuery.unparsed; + return this; + } + + /** + * A usage query used to compute an insight value. + * + * @return usageQuery + */ + @JsonProperty(JSON_PROPERTY_USAGE_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightUsageQuery getUsageQuery() { + return usageQuery; + } + + public void setUsageQuery(GovernanceInsightUsageQuery usageQuery) { + this.usageQuery = usageQuery; + } + + public GovernanceInsightAttributes value(Double value) { + this.value = value; + if (value != null) {} + return this; + } + + /** + * The current value of the insight. null when values were not requested or could not + * be computed. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getValue() { + return value; + } + + public void setValue(Double 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 GovernanceInsightAttributes + */ + @JsonAnySetter + public GovernanceInsightAttributes 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 GovernanceInsightAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightAttributes governanceInsightAttributes = (GovernanceInsightAttributes) o; + return Objects.equals(this.auditQuery, governanceInsightAttributes.auditQuery) + && Objects.equals(this.bestPractice, governanceInsightAttributes.bestPractice) + && Objects.equals(this.deepLink, governanceInsightAttributes.deepLink) + && Objects.equals(this.description, governanceInsightAttributes.description) + && Objects.equals(this.displayName, governanceInsightAttributes.displayName) + && Objects.equals(this.eventQuery, governanceInsightAttributes.eventQuery) + && Objects.equals(this.metricQuery, governanceInsightAttributes.metricQuery) + && Objects.equals(this.oldValue, governanceInsightAttributes.oldValue) + && Objects.equals(this.percentageQuery, governanceInsightAttributes.percentageQuery) + && Objects.equals(this.product, governanceInsightAttributes.product) + && Objects.equals(this.queryConfig, governanceInsightAttributes.queryConfig) + && Objects.equals(this.sortOrder, governanceInsightAttributes.sortOrder) + && Objects.equals(this.state, governanceInsightAttributes.state) + && Objects.equals(this.subProduct, governanceInsightAttributes.subProduct) + && Objects.equals(this.timeRange, governanceInsightAttributes.timeRange) + && Objects.equals(this.unitName, governanceInsightAttributes.unitName) + && Objects.equals(this.usageQuery, governanceInsightAttributes.usageQuery) + && Objects.equals(this.value, governanceInsightAttributes.value) + && Objects.equals( + this.additionalProperties, governanceInsightAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + auditQuery, + bestPractice, + deepLink, + description, + displayName, + eventQuery, + metricQuery, + oldValue, + percentageQuery, + product, + queryConfig, + sortOrder, + state, + subProduct, + timeRange, + unitName, + usageQuery, + value, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightAttributes {\n"); + sb.append(" auditQuery: ").append(toIndentedString(auditQuery)).append("\n"); + sb.append(" bestPractice: ").append(toIndentedString(bestPractice)).append("\n"); + sb.append(" deepLink: ").append(toIndentedString(deepLink)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" eventQuery: ").append(toIndentedString(eventQuery)).append("\n"); + sb.append(" metricQuery: ").append(toIndentedString(metricQuery)).append("\n"); + sb.append(" oldValue: ").append(toIndentedString(oldValue)).append("\n"); + sb.append(" percentageQuery: ").append(toIndentedString(percentageQuery)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" queryConfig: ").append(toIndentedString(queryConfig)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" subProduct: ").append(toIndentedString(subProduct)).append("\n"); + sb.append(" timeRange: ").append(toIndentedString(timeRange)).append("\n"); + sb.append(" unitName: ").append(toIndentedString(unitName)).append("\n"); + sb.append(" usageQuery: ").append(toIndentedString(usageQuery)).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/v2/model/GovernanceInsightAuditCompute.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightAuditCompute.java new file mode 100644 index 00000000000..33c33d045b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightAuditCompute.java @@ -0,0 +1,229 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The aggregation applied to an audit log query. */ +@JsonPropertyOrder({ + GovernanceInsightAuditCompute.JSON_PROPERTY_AGGREGATION, + GovernanceInsightAuditCompute.JSON_PROPERTY_INTERVAL, + GovernanceInsightAuditCompute.JSON_PROPERTY_METRIC, + GovernanceInsightAuditCompute.JSON_PROPERTY_ROLLUP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightAuditCompute { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION = "aggregation"; + private String aggregation; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Long interval; + + public static final String JSON_PROPERTY_METRIC = "metric"; + private String metric; + + public static final String JSON_PROPERTY_ROLLUP = "rollup"; + private String rollup; + + public GovernanceInsightAuditCompute() {} + + @JsonCreator + public GovernanceInsightAuditCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation, + @JsonProperty(required = true, value = JSON_PROPERTY_INTERVAL) Long interval, + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC) String metric) { + this.aggregation = aggregation; + this.interval = interval; + this.metric = metric; + } + + public GovernanceInsightAuditCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * The aggregation function to apply. + * + * @return aggregation + */ + @JsonProperty(JSON_PROPERTY_AGGREGATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAggregation() { + return aggregation; + } + + public void setAggregation(String aggregation) { + this.aggregation = aggregation; + } + + public GovernanceInsightAuditCompute interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * The aggregation time window, in milliseconds. + * + * @return interval + */ + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getInterval() { + return interval; + } + + public void setInterval(Long interval) { + this.interval = interval; + } + + public GovernanceInsightAuditCompute metric(String metric) { + this.metric = metric; + return this; + } + + /** + * The metric or attribute 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; + } + + public GovernanceInsightAuditCompute rollup(String rollup) { + this.rollup = rollup; + return this; + } + + /** + * An optional secondary aggregation applied to the audit query result. + * + * @return rollup + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLLUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRollup() { + return rollup; + } + + public void setRollup(String rollup) { + this.rollup = rollup; + } + + /** + * 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 GovernanceInsightAuditCompute + */ + @JsonAnySetter + public GovernanceInsightAuditCompute 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 GovernanceInsightAuditCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightAuditCompute governanceInsightAuditCompute = (GovernanceInsightAuditCompute) o; + return Objects.equals(this.aggregation, governanceInsightAuditCompute.aggregation) + && Objects.equals(this.interval, governanceInsightAuditCompute.interval) + && Objects.equals(this.metric, governanceInsightAuditCompute.metric) + && Objects.equals(this.rollup, governanceInsightAuditCompute.rollup) + && Objects.equals( + this.additionalProperties, governanceInsightAuditCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, interval, metric, rollup, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightAuditCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append(" rollup: ").append(toIndentedString(rollup)).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/v2/model/GovernanceInsightAuditQuery.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightAuditQuery.java new file mode 100644 index 00000000000..90cc280f421 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightAuditQuery.java @@ -0,0 +1,240 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** An audit log query used to compute an insight value. */ +@JsonPropertyOrder({ + GovernanceInsightAuditQuery.JSON_PROPERTY_COMPUTE, + GovernanceInsightAuditQuery.JSON_PROPERTY_INDEXES, + GovernanceInsightAuditQuery.JSON_PROPERTY_QUERY, + GovernanceInsightAuditQuery.JSON_PROPERTY_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightAuditQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private GovernanceInsightAuditCompute compute; + + public static final String JSON_PROPERTY_INDEXES = "indexes"; + private List indexes = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public GovernanceInsightAuditQuery() {} + + @JsonCreator + public GovernanceInsightAuditQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTE) + GovernanceInsightAuditCompute compute, + @JsonProperty(required = true, value = JSON_PROPERTY_INDEXES) List indexes, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) String source) { + this.compute = compute; + this.unparsed |= compute.unparsed; + this.indexes = indexes; + this.query = query; + this.source = source; + } + + public GovernanceInsightAuditQuery compute(GovernanceInsightAuditCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * The aggregation applied to an audit log query. + * + * @return compute + */ + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightAuditCompute getCompute() { + return compute; + } + + public void setCompute(GovernanceInsightAuditCompute compute) { + this.compute = compute; + } + + public GovernanceInsightAuditQuery indexes(List indexes) { + this.indexes = indexes; + return this; + } + + public GovernanceInsightAuditQuery addIndexesItem(String indexesItem) { + this.indexes.add(indexesItem); + return this; + } + + /** + * The audit log indexes the query runs against. + * + * @return indexes + */ + @JsonProperty(JSON_PROPERTY_INDEXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIndexes() { + return indexes; + } + + public void setIndexes(List indexes) { + this.indexes = indexes; + } + + public GovernanceInsightAuditQuery query(String query) { + this.query = query; + return this; + } + + /** + * The audit log search query string. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public GovernanceInsightAuditQuery source(String source) { + this.source = source; + return this; + } + + /** + * The data source the query runs against. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + /** + * 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 GovernanceInsightAuditQuery + */ + @JsonAnySetter + public GovernanceInsightAuditQuery 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 GovernanceInsightAuditQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightAuditQuery governanceInsightAuditQuery = (GovernanceInsightAuditQuery) o; + return Objects.equals(this.compute, governanceInsightAuditQuery.compute) + && Objects.equals(this.indexes, governanceInsightAuditQuery.indexes) + && Objects.equals(this.query, governanceInsightAuditQuery.query) + && Objects.equals(this.source, governanceInsightAuditQuery.source) + && Objects.equals( + this.additionalProperties, governanceInsightAuditQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(compute, indexes, query, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightAuditQuery {\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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/v2/model/GovernanceInsightData.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightData.java new file mode 100644 index 00000000000..793d212b5c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightData.java @@ -0,0 +1,210 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A governance insight resource. */ +@JsonPropertyOrder({ + GovernanceInsightData.JSON_PROPERTY_ATTRIBUTES, + GovernanceInsightData.JSON_PROPERTY_ID, + GovernanceInsightData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GovernanceInsightAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GovernanceInsightResourceType type; + + public GovernanceInsightData() {} + + @JsonCreator + public GovernanceInsightData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GovernanceInsightAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GovernanceInsightResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GovernanceInsightData attributes(GovernanceInsightAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a governance insight. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GovernanceInsightAttributes attributes) { + this.attributes = attributes; + } + + public GovernanceInsightData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the insight. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GovernanceInsightData type(GovernanceInsightResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for a governance insight. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightResourceType getType() { + return type; + } + + public void setType(GovernanceInsightResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 GovernanceInsightData + */ + @JsonAnySetter + public GovernanceInsightData 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 GovernanceInsightData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightData governanceInsightData = (GovernanceInsightData) o; + return Objects.equals(this.attributes, governanceInsightData.attributes) + && Objects.equals(this.id, governanceInsightData.id) + && Objects.equals(this.type, governanceInsightData.type) + && Objects.equals(this.additionalProperties, governanceInsightData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/v2/model/GovernanceInsightEventCompute.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightEventCompute.java new file mode 100644 index 00000000000..937e9a38521 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightEventCompute.java @@ -0,0 +1,174 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The aggregation applied to an event query. */ +@JsonPropertyOrder({ + GovernanceInsightEventCompute.JSON_PROPERTY_AGGREGATION, + GovernanceInsightEventCompute.JSON_PROPERTY_INTERVAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightEventCompute { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION = "aggregation"; + private String aggregation; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Long interval; + + public GovernanceInsightEventCompute() {} + + @JsonCreator + public GovernanceInsightEventCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation, + @JsonProperty(required = true, value = JSON_PROPERTY_INTERVAL) Long interval) { + this.aggregation = aggregation; + this.interval = interval; + } + + public GovernanceInsightEventCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * The aggregation function to apply. + * + * @return aggregation + */ + @JsonProperty(JSON_PROPERTY_AGGREGATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAggregation() { + return aggregation; + } + + public void setAggregation(String aggregation) { + this.aggregation = aggregation; + } + + public GovernanceInsightEventCompute interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * The aggregation time window, in milliseconds. + * + * @return interval + */ + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getInterval() { + return interval; + } + + public void setInterval(Long interval) { + this.interval = interval; + } + + /** + * 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 GovernanceInsightEventCompute + */ + @JsonAnySetter + public GovernanceInsightEventCompute 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 GovernanceInsightEventCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightEventCompute governanceInsightEventCompute = (GovernanceInsightEventCompute) o; + return Objects.equals(this.aggregation, governanceInsightEventCompute.aggregation) + && Objects.equals(this.interval, governanceInsightEventCompute.interval) + && Objects.equals( + this.additionalProperties, governanceInsightEventCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, interval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightEventCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).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/v2/model/GovernanceInsightEventQuery.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightEventQuery.java new file mode 100644 index 00000000000..1e3b2e8e73a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightEventQuery.java @@ -0,0 +1,209 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** An event query used to compute an insight value. */ +@JsonPropertyOrder({ + GovernanceInsightEventQuery.JSON_PROPERTY_COMPUTE, + GovernanceInsightEventQuery.JSON_PROPERTY_INDEXES, + GovernanceInsightEventQuery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightEventQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private GovernanceInsightEventCompute compute; + + public static final String JSON_PROPERTY_INDEXES = "indexes"; + private List indexes = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public GovernanceInsightEventQuery() {} + + @JsonCreator + public GovernanceInsightEventQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_INDEXES) List indexes, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.indexes = indexes; + this.query = query; + } + + public GovernanceInsightEventQuery compute(GovernanceInsightEventCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * The aggregation applied to an event query. + * + * @return compute + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GovernanceInsightEventCompute getCompute() { + return compute; + } + + public void setCompute(GovernanceInsightEventCompute compute) { + this.compute = compute; + } + + public GovernanceInsightEventQuery indexes(List indexes) { + this.indexes = indexes; + return this; + } + + public GovernanceInsightEventQuery addIndexesItem(String indexesItem) { + this.indexes.add(indexesItem); + return this; + } + + /** + * The event indexes the query runs against. + * + * @return indexes + */ + @JsonProperty(JSON_PROPERTY_INDEXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIndexes() { + return indexes; + } + + public void setIndexes(List indexes) { + this.indexes = indexes; + } + + public GovernanceInsightEventQuery query(String query) { + this.query = query; + return this; + } + + /** + * The event search query string. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 GovernanceInsightEventQuery + */ + @JsonAnySetter + public GovernanceInsightEventQuery 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 GovernanceInsightEventQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightEventQuery governanceInsightEventQuery = (GovernanceInsightEventQuery) o; + return Objects.equals(this.compute, governanceInsightEventQuery.compute) + && Objects.equals(this.indexes, governanceInsightEventQuery.indexes) + && Objects.equals(this.query, governanceInsightEventQuery.query) + && Objects.equals( + this.additionalProperties, governanceInsightEventQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(compute, indexes, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightEventQuery {\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" indexes: ").append(toIndentedString(indexes)).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/v2/model/GovernanceInsightMetricQuery.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightMetricQuery.java new file mode 100644 index 00000000000..afca04d7cd3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightMetricQuery.java @@ -0,0 +1,202 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A metric query used to compute an insight value. */ +@JsonPropertyOrder({ + GovernanceInsightMetricQuery.JSON_PROPERTY_QUERY, + GovernanceInsightMetricQuery.JSON_PROPERTY_REDUCER, + GovernanceInsightMetricQuery.JSON_PROPERTY_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightMetricQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_REDUCER = "reducer"; + private String reducer; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public GovernanceInsightMetricQuery() {} + + @JsonCreator + public GovernanceInsightMetricQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_REDUCER) String reducer, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) String source) { + this.query = query; + this.reducer = reducer; + this.source = source; + } + + public GovernanceInsightMetricQuery query(String query) { + this.query = query; + return this; + } + + /** + * The query string. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public GovernanceInsightMetricQuery reducer(String reducer) { + this.reducer = reducer; + return this; + } + + /** + * How the query result series is reduced to a single value. + * + * @return reducer + */ + @JsonProperty(JSON_PROPERTY_REDUCER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReducer() { + return reducer; + } + + public void setReducer(String reducer) { + this.reducer = reducer; + } + + public GovernanceInsightMetricQuery source(String source) { + this.source = source; + return this; + } + + /** + * The data source the query runs against. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + /** + * 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 GovernanceInsightMetricQuery + */ + @JsonAnySetter + public GovernanceInsightMetricQuery 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 GovernanceInsightMetricQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightMetricQuery governanceInsightMetricQuery = (GovernanceInsightMetricQuery) o; + return Objects.equals(this.query, governanceInsightMetricQuery.query) + && Objects.equals(this.reducer, governanceInsightMetricQuery.reducer) + && Objects.equals(this.source, governanceInsightMetricQuery.source) + && Objects.equals( + this.additionalProperties, governanceInsightMetricQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(query, reducer, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightMetricQuery {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" reducer: ").append(toIndentedString(reducer)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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/v2/model/GovernanceInsightPercentageQuery.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightPercentageQuery.java new file mode 100644 index 00000000000..59b69117acc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightPercentageQuery.java @@ -0,0 +1,183 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A percentage query that computes an insight value as a ratio of two metric queries. */ +@JsonPropertyOrder({ + GovernanceInsightPercentageQuery.JSON_PROPERTY_DENOMINATOR_QUERY, + GovernanceInsightPercentageQuery.JSON_PROPERTY_NUMERATOR_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightPercentageQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DENOMINATOR_QUERY = "denominator_query"; + private GovernanceInsightMetricQuery denominatorQuery; + + public static final String JSON_PROPERTY_NUMERATOR_QUERY = "numerator_query"; + private GovernanceInsightMetricQuery numeratorQuery; + + public GovernanceInsightPercentageQuery() {} + + @JsonCreator + public GovernanceInsightPercentageQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_DENOMINATOR_QUERY) + GovernanceInsightMetricQuery denominatorQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_NUMERATOR_QUERY) + GovernanceInsightMetricQuery numeratorQuery) { + this.denominatorQuery = denominatorQuery; + this.unparsed |= denominatorQuery.unparsed; + this.numeratorQuery = numeratorQuery; + this.unparsed |= numeratorQuery.unparsed; + } + + public GovernanceInsightPercentageQuery denominatorQuery( + GovernanceInsightMetricQuery denominatorQuery) { + this.denominatorQuery = denominatorQuery; + this.unparsed |= denominatorQuery.unparsed; + return this; + } + + /** + * A metric query used to compute an insight value. + * + * @return denominatorQuery + */ + @JsonProperty(JSON_PROPERTY_DENOMINATOR_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightMetricQuery getDenominatorQuery() { + return denominatorQuery; + } + + public void setDenominatorQuery(GovernanceInsightMetricQuery denominatorQuery) { + this.denominatorQuery = denominatorQuery; + } + + public GovernanceInsightPercentageQuery numeratorQuery( + GovernanceInsightMetricQuery numeratorQuery) { + this.numeratorQuery = numeratorQuery; + this.unparsed |= numeratorQuery.unparsed; + return this; + } + + /** + * A metric query used to compute an insight value. + * + * @return numeratorQuery + */ + @JsonProperty(JSON_PROPERTY_NUMERATOR_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceInsightMetricQuery getNumeratorQuery() { + return numeratorQuery; + } + + public void setNumeratorQuery(GovernanceInsightMetricQuery numeratorQuery) { + this.numeratorQuery = numeratorQuery; + } + + /** + * 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 GovernanceInsightPercentageQuery + */ + @JsonAnySetter + public GovernanceInsightPercentageQuery 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 GovernanceInsightPercentageQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightPercentageQuery governanceInsightPercentageQuery = + (GovernanceInsightPercentageQuery) o; + return Objects.equals(this.denominatorQuery, governanceInsightPercentageQuery.denominatorQuery) + && Objects.equals(this.numeratorQuery, governanceInsightPercentageQuery.numeratorQuery) + && Objects.equals( + this.additionalProperties, governanceInsightPercentageQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(denominatorQuery, numeratorQuery, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightPercentageQuery {\n"); + sb.append(" denominatorQuery: ").append(toIndentedString(denominatorQuery)).append("\n"); + sb.append(" numeratorQuery: ").append(toIndentedString(numeratorQuery)).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/v2/model/GovernanceInsightQueryConfig.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightQueryConfig.java new file mode 100644 index 00000000000..dae8784a5cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightQueryConfig.java @@ -0,0 +1,268 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Query execution context that allows the frontend to execute insight queries directly. */ +@JsonPropertyOrder({ + GovernanceInsightQueryConfig.JSON_PROPERTY_CHART_TYPE, + GovernanceInsightQueryConfig.JSON_PROPERTY_COMPARISON_SHIFT, + GovernanceInsightQueryConfig.JSON_PROPERTY_DEFAULT_VALUE, + GovernanceInsightQueryConfig.JSON_PROPERTY_DIRECTIONALITY, + GovernanceInsightQueryConfig.JSON_PROPERTY_EFFECTIVE_TIME_WINDOW_DAYS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightQueryConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHART_TYPE = "chart_type"; + private String chartType; + + public static final String JSON_PROPERTY_COMPARISON_SHIFT = "comparison_shift"; + private String comparisonShift; + + public static final String JSON_PROPERTY_DEFAULT_VALUE = "default_value"; + private Long defaultValue; + + public static final String JSON_PROPERTY_DIRECTIONALITY = "directionality"; + private String directionality; + + public static final String JSON_PROPERTY_EFFECTIVE_TIME_WINDOW_DAYS = + "effective_time_window_days"; + private Long effectiveTimeWindowDays; + + public GovernanceInsightQueryConfig() {} + + @JsonCreator + public GovernanceInsightQueryConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPARISON_SHIFT) String comparisonShift, + @JsonProperty(required = true, value = JSON_PROPERTY_EFFECTIVE_TIME_WINDOW_DAYS) + Long effectiveTimeWindowDays) { + this.comparisonShift = comparisonShift; + this.effectiveTimeWindowDays = effectiveTimeWindowDays; + } + + public GovernanceInsightQueryConfig chartType(String chartType) { + this.chartType = chartType; + return this; + } + + /** + * The chart type the frontend should use to render the insight. + * + * @return chartType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHART_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChartType() { + return chartType; + } + + public void setChartType(String chartType) { + this.chartType = chartType; + } + + public GovernanceInsightQueryConfig comparisonShift(String comparisonShift) { + this.comparisonShift = comparisonShift; + return this; + } + + /** + * The window used for the previous value comparison, for example week or month + * . + * + * @return comparisonShift + */ + @JsonProperty(JSON_PROPERTY_COMPARISON_SHIFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getComparisonShift() { + return comparisonShift; + } + + public void setComparisonShift(String comparisonShift) { + this.comparisonShift = comparisonShift; + } + + public GovernanceInsightQueryConfig defaultValue(Long defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * The default value to display when no data is available. + * + * @return defaultValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(Long defaultValue) { + this.defaultValue = defaultValue; + } + + public GovernanceInsightQueryConfig directionality(String directionality) { + this.directionality = directionality; + return this; + } + + /** + * Whether an increase in the value is good, bad, or neutral. One of neutral, + * increase_better, or decrease_better. + * + * @return directionality + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIRECTIONALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDirectionality() { + return directionality; + } + + public void setDirectionality(String directionality) { + this.directionality = directionality; + } + + public GovernanceInsightQueryConfig effectiveTimeWindowDays(Long effectiveTimeWindowDays) { + this.effectiveTimeWindowDays = effectiveTimeWindowDays; + return this; + } + + /** + * The number of days the insight value is computed over. + * + * @return effectiveTimeWindowDays + */ + @JsonProperty(JSON_PROPERTY_EFFECTIVE_TIME_WINDOW_DAYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEffectiveTimeWindowDays() { + return effectiveTimeWindowDays; + } + + public void setEffectiveTimeWindowDays(Long effectiveTimeWindowDays) { + this.effectiveTimeWindowDays = effectiveTimeWindowDays; + } + + /** + * 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 GovernanceInsightQueryConfig + */ + @JsonAnySetter + public GovernanceInsightQueryConfig 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 GovernanceInsightQueryConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightQueryConfig governanceInsightQueryConfig = (GovernanceInsightQueryConfig) o; + return Objects.equals(this.chartType, governanceInsightQueryConfig.chartType) + && Objects.equals(this.comparisonShift, governanceInsightQueryConfig.comparisonShift) + && Objects.equals(this.defaultValue, governanceInsightQueryConfig.defaultValue) + && Objects.equals(this.directionality, governanceInsightQueryConfig.directionality) + && Objects.equals( + this.effectiveTimeWindowDays, governanceInsightQueryConfig.effectiveTimeWindowDays) + && Objects.equals( + this.additionalProperties, governanceInsightQueryConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + chartType, + comparisonShift, + defaultValue, + directionality, + effectiveTimeWindowDays, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightQueryConfig {\n"); + sb.append(" chartType: ").append(toIndentedString(chartType)).append("\n"); + sb.append(" comparisonShift: ").append(toIndentedString(comparisonShift)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" directionality: ").append(toIndentedString(directionality)).append("\n"); + sb.append(" effectiveTimeWindowDays: ") + .append(toIndentedString(effectiveTimeWindowDays)) + .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/v2/model/GovernanceInsightResourceType.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightResourceType.java new file mode 100644 index 00000000000..0e23ab545ce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightResourceType.java @@ -0,0 +1,56 @@ +/* + * 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.v2.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; + +/** JSON:API resource type for a governance insight. */ +@JsonSerialize(using = GovernanceInsightResourceType.GovernanceInsightResourceTypeSerializer.class) +public class GovernanceInsightResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("insight")); + + public static final GovernanceInsightResourceType INSIGHT = + new GovernanceInsightResourceType("insight"); + + GovernanceInsightResourceType(String value) { + super(value, allowedValues); + } + + public static class GovernanceInsightResourceTypeSerializer + extends StdSerializer { + public GovernanceInsightResourceTypeSerializer(Class t) { + super(t); + } + + public GovernanceInsightResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GovernanceInsightResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GovernanceInsightResourceType fromValue(String value) { + return new GovernanceInsightResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightUsageQuery.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightUsageQuery.java new file mode 100644 index 00000000000..67febc53ac1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightUsageQuery.java @@ -0,0 +1,174 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A usage query used to compute an insight value. */ +@JsonPropertyOrder({ + GovernanceInsightUsageQuery.JSON_PROPERTY_QUERY, + GovernanceInsightUsageQuery.JSON_PROPERTY_REDUCER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightUsageQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_REDUCER = "reducer"; + private String reducer; + + public GovernanceInsightUsageQuery() {} + + @JsonCreator + public GovernanceInsightUsageQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_REDUCER) String reducer) { + this.query = query; + this.reducer = reducer; + } + + public GovernanceInsightUsageQuery query(String query) { + this.query = query; + return this; + } + + /** + * The usage query string. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public GovernanceInsightUsageQuery reducer(String reducer) { + this.reducer = reducer; + return this; + } + + /** + * How the query result series is reduced to a single value. + * + * @return reducer + */ + @JsonProperty(JSON_PROPERTY_REDUCER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReducer() { + return reducer; + } + + public void setReducer(String reducer) { + this.reducer = reducer; + } + + /** + * 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 GovernanceInsightUsageQuery + */ + @JsonAnySetter + public GovernanceInsightUsageQuery 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 GovernanceInsightUsageQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightUsageQuery governanceInsightUsageQuery = (GovernanceInsightUsageQuery) o; + return Objects.equals(this.query, governanceInsightUsageQuery.query) + && Objects.equals(this.reducer, governanceInsightUsageQuery.reducer) + && Objects.equals( + this.additionalProperties, governanceInsightUsageQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(query, reducer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightUsageQuery {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" reducer: ").append(toIndentedString(reducer)).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/v2/model/GovernanceInsightsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightsResponse.java new file mode 100644 index 00000000000..184bfe4a5e2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceInsightsResponse.java @@ -0,0 +1,155 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A list of governance insights. */ +@JsonPropertyOrder({GovernanceInsightsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceInsightsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GovernanceInsightsResponse() {} + + @JsonCreator + public GovernanceInsightsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public GovernanceInsightsResponse data(List data) { + this.data = data; + for (GovernanceInsightData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceInsightsResponse addDataItem(GovernanceInsightData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of governance insight resources. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * 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 GovernanceInsightsResponse + */ + @JsonAnySetter + public GovernanceInsightsResponse 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 GovernanceInsightsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceInsightsResponse governanceInsightsResponse = (GovernanceInsightsResponse) o; + return Objects.equals(this.data, governanceInsightsResponse.data) + && Objects.equals( + this.additionalProperties, governanceInsightsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceInsightsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/test/resources/com/datadog/api/client/v2/api/governance_insights.feature b/src/test/resources/com/datadog/api/client/v2/api/governance_insights.feature new file mode 100644 index 00000000000..0327e119c54 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/governance_insights.feature @@ -0,0 +1,24 @@ +@endpoint(governance-insights) @endpoint(governance-insights-v2) +Feature: Governance Insights + Governance Insights surface key usage, configuration, and best-practice + signals for an organization within the Governance Console. Each insight + reports a current value (and, optionally, a previous value for comparison) + along with the query used to compute it, so that the Console can render + trends and highlight areas that need attention. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "GovernanceInsights" API + And operation "ListGovernanceInsights" enabled + And new "ListGovernanceInsights" request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance insights returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance insights returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 32eeb14e332..c0998d1fa4e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2762,6 +2762,12 @@ "type": "safe" } }, + "ListGovernanceInsights": { + "tag": "Governance Insights", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": {