diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 052ba0331d3..4dd4eb9c314 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41859,6 +41859,404 @@ components: - impact_hint - status type: object + GovernanceControlAttributes: + description: The attributes of a governance control. + properties: + active_detections_count: + description: The number of active detections for the control. + example: 12 + format: int64 + type: integer + category: + description: The value driver the control is grouped under, such as `security` or `cost`. + example: "security" + type: string + created_at: + description: The time the control configuration was created. + example: "2024-01-15T09:30:00Z" + format: date-time + type: string + created_by: + description: The UUID of the user who created the control configuration. + example: "11111111-2222-3333-4444-555555555555" + type: string + description: + description: A human-readable description of what the control detects. + example: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." + type: string + detection_frequency: + description: How often detections are evaluated for the control. + example: "daily" + type: string + detection_parameters: + $ref: "#/components/schemas/GovernanceControlParametersMap" + nullable: true + detection_type: + description: The detection type that uniquely identifies the control. + example: "unused_api_keys" + type: string + feature_flags: + description: The feature flags that gate the control. + example: [] + items: + description: A feature flag that gates the control. + type: string + type: array + insights: + description: The insight slugs associated with the control. + example: [] + items: + description: An insight slug associated with the control. + type: string + type: array + last_detection_at: + description: The time of the most recent detection for the control. `null` when there are no detections. + example: "2024-03-01T12:00:00Z" + format: date-time + nullable: true + type: string + mitigated_detections_count: + description: The number of mitigated detections for the control. + example: 3 + format: int64 + type: integer + mitigation_parameters: + $ref: "#/components/schemas/GovernanceControlParametersMap" + nullable: true + mitigation_type: + description: The configured mitigation type for the control. Empty when not configured. + example: "revoke_api_key" + type: string + mitigations: + $ref: "#/components/schemas/GovernanceControlMitigationDefinitionArray" + name: + description: Human-readable name of the control. + example: "Unused API Keys" + type: string + next_steps: + description: Guidance on the next steps to remediate detections for the control. + example: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture." + type: string + notification_frequency: + description: The configured notification frequency for the control. Empty when not configured. + example: "" + type: string + notification_parameters: + $ref: "#/components/schemas/GovernanceControlParametersMap" + nullable: true + notification_type: + description: The configured notification type for the control. Empty when not configured. + example: "" + type: string + priority: + description: The priority of the control, such as `High`. + example: "High" + type: string + product: + description: The product the control belongs to. + example: "api_keys" + type: string + release_status: + description: The release status of the control, such as `prod` or `beta`. + example: "prod" + type: string + resource_type: + description: The type of resource the control evaluates. + example: "api_key" + type: string + resource_type_display_name: + description: The human-readable name of the resource type. + example: "API Key" + type: string + supported_detection_parameters: + $ref: "#/components/schemas/GovernanceControlParameterDefinitionArray" + supported_notification_parameters: + $ref: "#/components/schemas/GovernanceControlParameterDefinitionArray" + task: + description: A short description of the remediation task for the control. + example: "Review and revoke unused API keys." + type: string + type: + description: The control type, such as `Proactive` or `Detection`. + example: "Proactive" + type: string + usage_concern: + description: The usage concern the control addresses, such as `Security` or `Cost Optimization`. + example: "Security" + type: string + required: + - name + - description + - detection_type + - supported_detection_parameters + - supported_notification_parameters + - resource_type + - resource_type_display_name + - product + - category + - insights + - mitigations + - task + - next_steps + - release_status + - feature_flags + - type + - priority + - usage_concern + - detection_parameters + - detection_frequency + - notification_type + - notification_parameters + - notification_frequency + - mitigation_type + - mitigation_parameters + - created_at + - created_by + - active_detections_count + - mitigated_detections_count + - last_detection_at + type: object + GovernanceControlData: + description: A governance control resource. + properties: + attributes: + $ref: "#/components/schemas/GovernanceControlAttributes" + id: + description: The unique identifier of the control. + example: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a" + type: string + type: + $ref: "#/components/schemas/GovernanceControlResourceType" + required: + - id + - type + - attributes + type: object + GovernanceControlMitigationDefinition: + description: The definition of a mitigation available for a control. + properties: + action_verb: + description: The verb describing the mitigation action, such as `revoke` or `delete`. + example: "revoke" + type: string + description: + description: A human-readable description of the mitigation. + example: "Automatically identifies and revokes inactive API keys to improve security and reduce potential attack surface." + type: string + execution_modes: + description: The execution modes the mitigation supports, such as `manual` or `automatic`. + example: + - "manual" + - "automatic" + items: + description: An execution mode the mitigation supports. + type: string + type: array + feature_flags: + description: The feature flags that gate the mitigation. + example: [] + items: + description: A feature flag that gates the mitigation. + type: string + type: array + id: + description: The unique identifier of the mitigation. + example: "revoke_api_key" + type: string + manual_mitigation_warning: + description: A warning shown to the user before applying the mitigation manually. + example: "These API keys will be revoked immediately upon confirmation. To revoke future API keys, you must go through this flow again." + type: string + permissions: + description: The permissions required to apply the mitigation. + example: + - "api_keys_write" + - "api_keys_delete" + items: + description: A permission required to apply the mitigation. + type: string + type: array + requires_ai: + description: Whether the mitigation requires AI to be enabled. + example: false + type: boolean + supported_parameters: + $ref: "#/components/schemas/GovernanceControlParameterDefinitionArray" + title: + description: A short, human-readable name for the mitigation. + example: "Revoke Unused API Keys" + type: string + required: + - id + - title + - description + - action_verb + - supported_parameters + - permissions + - manual_mitigation_warning + - feature_flags + - requires_ai + type: object + GovernanceControlMitigationDefinitionArray: + description: The mitigations available for a control. + items: + $ref: "#/components/schemas/GovernanceControlMitigationDefinition" + type: array + GovernanceControlParameterDefinition: + description: The definition of a configurable parameter on a control or mitigation. + properties: + default_value: + description: The default value of the parameter. The JSON type depends on the parameter's `type`. + example: 30 + description: + description: A human-readable description of the parameter. + example: "Number of days of inactivity before an API key is considered unused." + type: string + display_name: + description: The human-readable name of the parameter. + example: "Unused API Key Threshold" + type: string + hidden: + description: Whether the parameter is hidden from the UI. + example: false + type: boolean + name: + description: The machine-readable name of the parameter. + example: "api_key_threshold" + type: string + required: + description: Whether the parameter must be provided. + example: false + type: boolean + supported_values: + $ref: "#/components/schemas/GovernanceControlSupportedValueArray" + type: + description: The type of the parameter, such as `integer`, `string`, `boolean`, `enum`, or `pattern_list`. + example: "integer" + type: string + required: + - name + - display_name + - description + - type + - required + - hidden + - supported_values + - default_value + type: object + GovernanceControlParameterDefinitionArray: + description: An array of parameter definitions. + items: + $ref: "#/components/schemas/GovernanceControlParameterDefinition" + type: array + GovernanceControlParametersMap: + additionalProperties: {} + description: A free-form map of parameter names to their configured values. + type: object + GovernanceControlResourceType: + description: JSON:API resource type for a governance control. + enum: + - governance_control + example: "governance_control" + type: string + x-enum-varnames: + - GOVERNANCE_CONTROL + GovernanceControlResponse: + description: A single governance control. + properties: + data: + $ref: "#/components/schemas/GovernanceControlData" + required: + - data + type: object + GovernanceControlSupportedValue: + description: A supported value for an enumerated parameter. + properties: + label: + description: The human-readable label for the value. + example: "30 days" + type: string + value: + description: The machine-readable value. + example: "thirty" + type: string + required: + - value + - label + type: object + GovernanceControlSupportedValueArray: + description: The supported values for an enumerated parameter. + items: + $ref: "#/components/schemas/GovernanceControlSupportedValue" + type: array + GovernanceControlUpdateAttributes: + description: The attributes of a governance control that can be updated. Only the attributes present in the request are modified. + properties: + detection_frequency: + description: How often detections should be evaluated for the control. + example: "daily" + type: string + detection_parameters: + $ref: "#/components/schemas/GovernanceControlParametersMap" + nullable: true + mitigation_parameters: + $ref: "#/components/schemas/GovernanceControlParametersMap" + nullable: true + mitigation_type: + description: The mitigation type to configure for the control. + example: "revoke_api_key" + type: string + name: + description: A new human-readable name for the control. + example: "Unused API Keys" + type: string + notification_frequency: + description: The notification frequency to configure for the control. + example: "daily" + type: string + notification_parameters: + $ref: "#/components/schemas/GovernanceControlParametersMap" + nullable: true + notification_type: + description: The notification type to configure for the control. + example: "slack" + type: string + type: object + GovernanceControlUpdateData: + description: The data of a governance control update request. + properties: + attributes: + $ref: "#/components/schemas/GovernanceControlUpdateAttributes" + id: + description: The unique identifier of the control. + example: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a" + type: string + type: + $ref: "#/components/schemas/GovernanceControlResourceType" + required: + - type + type: object + GovernanceControlUpdateRequest: + description: A request to update a governance control. + properties: + data: + $ref: "#/components/schemas/GovernanceControlUpdateData" + required: + - data + type: object + GovernanceControlsDataArray: + description: An array of governance control resources. + items: + $ref: "#/components/schemas/GovernanceControlData" + type: array + GovernanceControlsResponse: + description: A list of governance controls. + properties: + data: + $ref: "#/components/schemas/GovernanceControlsDataArray" + required: + - data + type: object GovernanceInsightAttributes: description: The attributes of a governance insight. properties: @@ -134693,6 +135091,319 @@ paths: operator: OR permissions: - user_access_read + /api/v2/governance/control: + get: + description: |- + Retrieve the list of governance controls configured for the organization. Each control pairs a + detection definition with the organization's current detection, notification, and mitigation + configuration, along with counts of active and mitigated detections. + operationId: ListGovernanceControls + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + active_detections_count: 12 + category: "security" + created_at: "2024-01-15T09:30:00Z" + created_by: "11111111-2222-3333-4444-555555555555" + description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." + detection_frequency: "daily" + detection_parameters: + api_key_threshold: 30 + detection_type: "unused_api_keys" + feature_flags: [] + insights: [] + last_detection_at: "2024-03-01T12:00:00Z" + mitigated_detections_count: 3 + mitigation_parameters: {} + mitigation_type: "" + mitigations: + - action_verb: "revoke" + description: "Automatically identifies and revokes inactive API keys to improve security and reduce potential attack surface." + execution_modes: + - "manual" + - "automatic" + feature_flags: [] + id: "revoke_api_key" + manual_mitigation_warning: "These API keys will be revoked immediately upon confirmation. To revoke future API keys, you must go through this flow again." + permissions: + - "api_keys_write" + - "api_keys_delete" + requires_ai: false + supported_parameters: [] + title: "Revoke Unused API Keys" + name: "Unused API Keys" + next_steps: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture." + notification_frequency: "" + notification_parameters: {} + notification_type: "" + priority: "High" + product: "api_keys" + release_status: "prod" + resource_type: "api_key" + resource_type_display_name: "API Key" + supported_detection_parameters: + - default_value: 30 + description: "Number of days of inactivity before an API key is considered unused." + display_name: "Unused API Key Threshold" + hidden: false + name: "api_key_threshold" + required: false + supported_values: [] + type: "integer" + supported_notification_parameters: + - default_value: false + description: "Enables the Governance Console to automatically assign ownership of detections based off of tagging and other internal heuristics." + display_name: "Automatic Ownership Assignment" + hidden: false + name: "governance_auto_assignment" + required: false + supported_values: [] + type: "boolean" + task: "Review and revoke unused API keys." + type: "Proactive" + usage_concern: "Security" + id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a" + type: "governance_control" + schema: + $ref: "#/components/schemas/GovernanceControlsResponse" + 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 controls + tags: + - Governance Controls + 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/governance/control/{detection_type}: + get: + description: |- + Retrieve a single governance control by its detection type, including the organization's current + detection, notification, and mitigation configuration and detection counts. + operationId: GetGovernanceControl + parameters: + - description: The detection type that identifies the control, for example `unused_api_keys`. + example: "unused_api_keys" + in: path + name: detection_type + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + active_detections_count: 12 + category: "security" + created_at: "2024-01-15T09:30:00Z" + created_by: "11111111-2222-3333-4444-555555555555" + description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." + detection_frequency: "daily" + detection_parameters: + api_key_threshold: 30 + detection_type: "unused_api_keys" + feature_flags: [] + insights: [] + last_detection_at: "2024-03-01T12:00:00Z" + mitigated_detections_count: 3 + mitigation_parameters: {} + mitigation_type: "revoke_api_key" + mitigations: [] + name: "Unused API Keys" + next_steps: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture." + notification_frequency: "" + notification_parameters: {} + notification_type: "" + priority: "High" + product: "api_keys" + release_status: "prod" + resource_type: "api_key" + resource_type_display_name: "API Key" + supported_detection_parameters: + - default_value: 30 + description: "Number of days of inactivity before an API key is considered unused." + display_name: "Unused API Key Threshold" + hidden: false + name: "api_key_threshold" + required: false + supported_values: [] + type: "integer" + supported_notification_parameters: [] + task: "Review and revoke unused API keys." + type: "Proactive" + usage_concern: "Security" + id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a" + type: "governance_control" + schema: + $ref: "#/components/schemas/GovernanceControlResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a governance control + tags: + - Governance Controls + 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/). + patch: + description: |- + Update the detection, notification, and mitigation configuration of a governance control. Only + the attributes present in the request are modified. Changing the mitigation type or its + parameters may require additional permissions. + operationId: UpdateGovernanceControl + parameters: + - description: The detection type that identifies the control, for example `unused_api_keys`. + example: "unused_api_keys" + in: path + name: detection_type + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + detection_parameters: + api_key_threshold: 60 + mitigation_type: "revoke_api_key" + type: "governance_control" + schema: + $ref: "#/components/schemas/GovernanceControlUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + active_detections_count: 12 + category: "security" + created_at: "2024-01-15T09:30:00Z" + created_by: "11111111-2222-3333-4444-555555555555" + description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." + detection_frequency: "daily" + detection_parameters: + api_key_threshold: 60 + detection_type: "unused_api_keys" + feature_flags: [] + insights: [] + last_detection_at: "2024-03-01T12:00:00Z" + mitigated_detections_count: 3 + mitigation_parameters: {} + mitigation_type: "revoke_api_key" + mitigations: [] + name: "Unused API Keys" + next_steps: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture." + notification_frequency: "" + notification_parameters: {} + notification_type: "" + priority: "High" + product: "api_keys" + release_status: "prod" + resource_type: "api_key" + resource_type_display_name: "API Key" + supported_detection_parameters: [] + supported_notification_parameters: [] + task: "Review and revoke unused API keys." + type: "Proactive" + usage_concern: "Security" + id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a" + type: "governance_control" + schema: + $ref: "#/components/schemas/GovernanceControlResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a governance control + tags: + - Governance Controls + 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/governance/insights: get: description: |- @@ -194579,6 +195290,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 Controls pair a detection definition with an organization's detection, notification, + and mitigation configuration within the Governance Console. Each control reports how a class of + governance issue (such as unused API keys or unqueried metrics) is detected and remediated, along + with counts of active and mitigated detections. + name: Governance Controls - 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, diff --git a/examples/v2/governance-controls/GetGovernanceControl.java b/examples/v2/governance-controls/GetGovernanceControl.java new file mode 100644 index 00000000000..fbed4ad7fe5 --- /dev/null +++ b/examples/v2/governance-controls/GetGovernanceControl.java @@ -0,0 +1,25 @@ +// Get a governance control returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GovernanceControlsApi; +import com.datadog.api.client.v2.model.GovernanceControlResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getGovernanceControl", true); + GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient); + + try { + GovernanceControlResponse result = apiInstance.getGovernanceControl("unused_api_keys"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GovernanceControlsApi#getGovernanceControl"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/governance-controls/ListGovernanceControls.java b/examples/v2/governance-controls/ListGovernanceControls.java new file mode 100644 index 00000000000..e966ca3520f --- /dev/null +++ b/examples/v2/governance-controls/ListGovernanceControls.java @@ -0,0 +1,25 @@ +// List governance controls returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GovernanceControlsApi; +import com.datadog.api.client.v2.model.GovernanceControlsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listGovernanceControls", true); + GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient); + + try { + GovernanceControlsResponse result = apiInstance.listGovernanceControls(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GovernanceControlsApi#listGovernanceControls"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/governance-controls/UpdateGovernanceControl.java b/examples/v2/governance-controls/UpdateGovernanceControl.java new file mode 100644 index 00000000000..42aefaaa80f --- /dev/null +++ b/examples/v2/governance-controls/UpdateGovernanceControl.java @@ -0,0 +1,44 @@ +// Update a governance control returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GovernanceControlsApi; +import com.datadog.api.client.v2.model.GovernanceControlResourceType; +import com.datadog.api.client.v2.model.GovernanceControlResponse; +import com.datadog.api.client.v2.model.GovernanceControlUpdateAttributes; +import com.datadog.api.client.v2.model.GovernanceControlUpdateData; +import com.datadog.api.client.v2.model.GovernanceControlUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateGovernanceControl", true); + GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient); + + GovernanceControlUpdateRequest body = + new GovernanceControlUpdateRequest() + .data( + new GovernanceControlUpdateData() + .attributes( + new GovernanceControlUpdateAttributes() + .detectionFrequency("daily") + .mitigationType("revoke_api_key") + .name("Unused API Keys") + .notificationFrequency("daily") + .notificationType("slack")) + .id("0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a") + .type(GovernanceControlResourceType.GOVERNANCE_CONTROL)); + + try { + GovernanceControlResponse result = + apiInstance.updateGovernanceControl("unused_api_keys", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GovernanceControlsApi#updateGovernanceControl"); + 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 3b9f6b45809..bd9e92793d5 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1054,6 +1054,9 @@ public class ApiClient { put("v2.upsertAndPublishFormVersion", false); put("v2.upsertFormVersion", false); put("v2.updateOrgSamlConfigurations", false); + put("v2.getGovernanceControl", false); + put("v2.listGovernanceControls", false); + put("v2.updateGovernanceControl", false); put("v2.listGovernanceInsights", false); put("v2.createHamrOrgConnection", false); put("v2.getHamrOrgConnection", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/GovernanceControlsApi.java b/src/main/java/com/datadog/api/client/v2/api/GovernanceControlsApi.java new file mode 100644 index 00000000000..57c380e4d3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/GovernanceControlsApi.java @@ -0,0 +1,529 @@ +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.GovernanceControlResponse; +import com.datadog.api.client.v2.model.GovernanceControlUpdateRequest; +import com.datadog.api.client.v2.model.GovernanceControlsResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +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 GovernanceControlsApi { + private ApiClient apiClient; + + public GovernanceControlsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public GovernanceControlsApi(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; + } + + /** + * Get a governance control. + * + *

See {@link #getGovernanceControlWithHttpInfo}. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @return GovernanceControlResponse + * @throws ApiException if fails to make API call + */ + public GovernanceControlResponse getGovernanceControl(String detectionType) throws ApiException { + return getGovernanceControlWithHttpInfo(detectionType).getData(); + } + + /** + * Get a governance control. + * + *

See {@link #getGovernanceControlWithHttpInfoAsync}. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @return CompletableFuture<GovernanceControlResponse> + */ + public CompletableFuture getGovernanceControlAsync( + String detectionType) { + return getGovernanceControlWithHttpInfoAsync(detectionType) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve a single governance control by its detection type, including the organization's + * current detection, notification, and mitigation configuration and detection counts. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @return ApiResponse<GovernanceControlResponse> + * @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 -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getGovernanceControlWithHttpInfo( + String detectionType) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getGovernanceControl"; + 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; + + // verify the required parameter 'detectionType' is set + if (detectionType == null) { + throw new ApiException( + 400, "Missing the required parameter 'detectionType' when calling getGovernanceControl"); + } + // create path and map variables + String localVarPath = + "/api/v2/governance/control/{detection_type}" + .replaceAll( + "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GovernanceControlsApi.getGovernanceControl", + localVarPath, + new ArrayList(), + 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() {}); + } + + /** + * Get a governance control. + * + *

See {@link #getGovernanceControlWithHttpInfo}. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @return CompletableFuture<ApiResponse<GovernanceControlResponse>> + */ + public CompletableFuture> + getGovernanceControlWithHttpInfoAsync(String detectionType) { + // Check if unstable operation is enabled + String operationId = "getGovernanceControl"; + 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; + + // verify the required parameter 'detectionType' is set + if (detectionType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'detectionType' when calling getGovernanceControl")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/governance/control/{detection_type}" + .replaceAll( + "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GovernanceControlsApi.getGovernanceControl", + localVarPath, + new ArrayList(), + 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() {}); + } + + /** + * List governance controls. + * + *

See {@link #listGovernanceControlsWithHttpInfo}. + * + * @return GovernanceControlsResponse + * @throws ApiException if fails to make API call + */ + public GovernanceControlsResponse listGovernanceControls() throws ApiException { + return listGovernanceControlsWithHttpInfo().getData(); + } + + /** + * List governance controls. + * + *

See {@link #listGovernanceControlsWithHttpInfoAsync}. + * + * @return CompletableFuture<GovernanceControlsResponse> + */ + public CompletableFuture listGovernanceControlsAsync() { + return listGovernanceControlsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the list of governance controls configured for the organization. Each control pairs a + * detection definition with the organization's current detection, notification, and mitigation + * configuration, along with counts of active and mitigated detections. + * + * @return ApiResponse<GovernanceControlsResponse> + * @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 listGovernanceControlsWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listGovernanceControls"; + 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; + // create path and map variables + String localVarPath = "/api/v2/governance/control"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GovernanceControlsApi.listGovernanceControls", + localVarPath, + new ArrayList(), + 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 controls. + * + *

See {@link #listGovernanceControlsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<GovernanceControlsResponse>> + */ + public CompletableFuture> + listGovernanceControlsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listGovernanceControls"; + 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; + // create path and map variables + String localVarPath = "/api/v2/governance/control"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GovernanceControlsApi.listGovernanceControls", + localVarPath, + new ArrayList(), + 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() {}); + } + + /** + * Update a governance control. + * + *

See {@link #updateGovernanceControlWithHttpInfo}. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @param body (required) + * @return GovernanceControlResponse + * @throws ApiException if fails to make API call + */ + public GovernanceControlResponse updateGovernanceControl( + String detectionType, GovernanceControlUpdateRequest body) throws ApiException { + return updateGovernanceControlWithHttpInfo(detectionType, body).getData(); + } + + /** + * Update a governance control. + * + *

See {@link #updateGovernanceControlWithHttpInfoAsync}. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @param body (required) + * @return CompletableFuture<GovernanceControlResponse> + */ + public CompletableFuture updateGovernanceControlAsync( + String detectionType, GovernanceControlUpdateRequest body) { + return updateGovernanceControlWithHttpInfoAsync(detectionType, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the detection, notification, and mitigation configuration of a governance control. Only + * the attributes present in the request are modified. Changing the mitigation type or its + * parameters may require additional permissions. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @param body (required) + * @return ApiResponse<GovernanceControlResponse> + * @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 -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateGovernanceControlWithHttpInfo( + String detectionType, GovernanceControlUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateGovernanceControl"; + 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 = body; + + // verify the required parameter 'detectionType' is set + if (detectionType == null) { + throw new ApiException( + 400, + "Missing the required parameter 'detectionType' when calling updateGovernanceControl"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateGovernanceControl"); + } + // create path and map variables + String localVarPath = + "/api/v2/governance/control/{detection_type}" + .replaceAll( + "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GovernanceControlsApi.updateGovernanceControl", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a governance control. + * + *

See {@link #updateGovernanceControlWithHttpInfo}. + * + * @param detectionType The detection type that identifies the control, for example + * unused_api_keys. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<GovernanceControlResponse>> + */ + public CompletableFuture> + updateGovernanceControlWithHttpInfoAsync( + String detectionType, GovernanceControlUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateGovernanceControl"; + 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 = body; + + // verify the required parameter 'detectionType' is set + if (detectionType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'detectionType' when calling" + + " updateGovernanceControl")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateGovernanceControl")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/governance/control/{detection_type}" + .replaceAll( + "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GovernanceControlsApi.updateGovernanceControl", + localVarPath, + new ArrayList(), + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java new file mode 100644 index 00000000000..0db6849045b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java @@ -0,0 +1,1110 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a governance control. */ +@JsonPropertyOrder({ + GovernanceControlAttributes.JSON_PROPERTY_ACTIVE_DETECTIONS_COUNT, + GovernanceControlAttributes.JSON_PROPERTY_CATEGORY, + GovernanceControlAttributes.JSON_PROPERTY_CREATED_AT, + GovernanceControlAttributes.JSON_PROPERTY_CREATED_BY, + GovernanceControlAttributes.JSON_PROPERTY_DESCRIPTION, + GovernanceControlAttributes.JSON_PROPERTY_DETECTION_FREQUENCY, + GovernanceControlAttributes.JSON_PROPERTY_DETECTION_PARAMETERS, + GovernanceControlAttributes.JSON_PROPERTY_DETECTION_TYPE, + GovernanceControlAttributes.JSON_PROPERTY_FEATURE_FLAGS, + GovernanceControlAttributes.JSON_PROPERTY_INSIGHTS, + GovernanceControlAttributes.JSON_PROPERTY_LAST_DETECTION_AT, + GovernanceControlAttributes.JSON_PROPERTY_MITIGATED_DETECTIONS_COUNT, + GovernanceControlAttributes.JSON_PROPERTY_MITIGATION_PARAMETERS, + GovernanceControlAttributes.JSON_PROPERTY_MITIGATION_TYPE, + GovernanceControlAttributes.JSON_PROPERTY_MITIGATIONS, + GovernanceControlAttributes.JSON_PROPERTY_NAME, + GovernanceControlAttributes.JSON_PROPERTY_NEXT_STEPS, + GovernanceControlAttributes.JSON_PROPERTY_NOTIFICATION_FREQUENCY, + GovernanceControlAttributes.JSON_PROPERTY_NOTIFICATION_PARAMETERS, + GovernanceControlAttributes.JSON_PROPERTY_NOTIFICATION_TYPE, + GovernanceControlAttributes.JSON_PROPERTY_PRIORITY, + GovernanceControlAttributes.JSON_PROPERTY_PRODUCT, + GovernanceControlAttributes.JSON_PROPERTY_RELEASE_STATUS, + GovernanceControlAttributes.JSON_PROPERTY_RESOURCE_TYPE, + GovernanceControlAttributes.JSON_PROPERTY_RESOURCE_TYPE_DISPLAY_NAME, + GovernanceControlAttributes.JSON_PROPERTY_SUPPORTED_DETECTION_PARAMETERS, + GovernanceControlAttributes.JSON_PROPERTY_SUPPORTED_NOTIFICATION_PARAMETERS, + GovernanceControlAttributes.JSON_PROPERTY_TASK, + GovernanceControlAttributes.JSON_PROPERTY_TYPE, + GovernanceControlAttributes.JSON_PROPERTY_USAGE_CONCERN +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTIVE_DETECTIONS_COUNT = "active_detections_count"; + private Long activeDetectionsCount; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DETECTION_FREQUENCY = "detection_frequency"; + private String detectionFrequency; + + public static final String JSON_PROPERTY_DETECTION_PARAMETERS = "detection_parameters"; + private Map detectionParameters = new HashMap(); + + public static final String JSON_PROPERTY_DETECTION_TYPE = "detection_type"; + private String detectionType; + + public static final String JSON_PROPERTY_FEATURE_FLAGS = "feature_flags"; + private List featureFlags = new ArrayList<>(); + + public static final String JSON_PROPERTY_INSIGHTS = "insights"; + private List insights = new ArrayList<>(); + + public static final String JSON_PROPERTY_LAST_DETECTION_AT = "last_detection_at"; + private OffsetDateTime lastDetectionAt; + + public static final String JSON_PROPERTY_MITIGATED_DETECTIONS_COUNT = + "mitigated_detections_count"; + private Long mitigatedDetectionsCount; + + public static final String JSON_PROPERTY_MITIGATION_PARAMETERS = "mitigation_parameters"; + private Map mitigationParameters = new HashMap(); + + public static final String JSON_PROPERTY_MITIGATION_TYPE = "mitigation_type"; + private String mitigationType; + + public static final String JSON_PROPERTY_MITIGATIONS = "mitigations"; + private List mitigations = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NEXT_STEPS = "next_steps"; + private String nextSteps; + + public static final String JSON_PROPERTY_NOTIFICATION_FREQUENCY = "notification_frequency"; + private String notificationFrequency; + + public static final String JSON_PROPERTY_NOTIFICATION_PARAMETERS = "notification_parameters"; + private Map notificationParameters = new HashMap(); + + public static final String JSON_PROPERTY_NOTIFICATION_TYPE = "notification_type"; + private String notificationType; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private String priority; + + public static final String JSON_PROPERTY_PRODUCT = "product"; + private String product; + + public static final String JSON_PROPERTY_RELEASE_STATUS = "release_status"; + private String releaseStatus; + + public static final String JSON_PROPERTY_RESOURCE_TYPE = "resource_type"; + private String resourceType; + + public static final String JSON_PROPERTY_RESOURCE_TYPE_DISPLAY_NAME = + "resource_type_display_name"; + private String resourceTypeDisplayName; + + public static final String JSON_PROPERTY_SUPPORTED_DETECTION_PARAMETERS = + "supported_detection_parameters"; + private List supportedDetectionParameters = + new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTED_NOTIFICATION_PARAMETERS = + "supported_notification_parameters"; + private List supportedNotificationParameters = + new ArrayList<>(); + + public static final String JSON_PROPERTY_TASK = "task"; + private String task; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_USAGE_CONCERN = "usage_concern"; + private String usageConcern; + + public GovernanceControlAttributes() {} + + @JsonCreator + public GovernanceControlAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTIVE_DETECTIONS_COUNT) + Long activeDetectionsCount, + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_DETECTION_FREQUENCY) + String detectionFrequency, + @JsonProperty(required = true, value = JSON_PROPERTY_DETECTION_PARAMETERS) + Map detectionParameters, + @JsonProperty(required = true, value = JSON_PROPERTY_DETECTION_TYPE) String detectionType, + @JsonProperty(required = true, value = JSON_PROPERTY_FEATURE_FLAGS) List featureFlags, + @JsonProperty(required = true, value = JSON_PROPERTY_INSIGHTS) List insights, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_DETECTION_AT) + OffsetDateTime lastDetectionAt, + @JsonProperty(required = true, value = JSON_PROPERTY_MITIGATED_DETECTIONS_COUNT) + Long mitigatedDetectionsCount, + @JsonProperty(required = true, value = JSON_PROPERTY_MITIGATION_PARAMETERS) + Map mitigationParameters, + @JsonProperty(required = true, value = JSON_PROPERTY_MITIGATION_TYPE) String mitigationType, + @JsonProperty(required = true, value = JSON_PROPERTY_MITIGATIONS) + List mitigations, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_NEXT_STEPS) String nextSteps, + @JsonProperty(required = true, value = JSON_PROPERTY_NOTIFICATION_FREQUENCY) + String notificationFrequency, + @JsonProperty(required = true, value = JSON_PROPERTY_NOTIFICATION_PARAMETERS) + Map notificationParameters, + @JsonProperty(required = true, value = JSON_PROPERTY_NOTIFICATION_TYPE) + String notificationType, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIORITY) String priority, + @JsonProperty(required = true, value = JSON_PROPERTY_PRODUCT) String product, + @JsonProperty(required = true, value = JSON_PROPERTY_RELEASE_STATUS) String releaseStatus, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_TYPE) String resourceType, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_TYPE_DISPLAY_NAME) + String resourceTypeDisplayName, + @JsonProperty(required = true, value = JSON_PROPERTY_SUPPORTED_DETECTION_PARAMETERS) + List supportedDetectionParameters, + @JsonProperty(required = true, value = JSON_PROPERTY_SUPPORTED_NOTIFICATION_PARAMETERS) + List supportedNotificationParameters, + @JsonProperty(required = true, value = JSON_PROPERTY_TASK) String task, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type, + @JsonProperty(required = true, value = JSON_PROPERTY_USAGE_CONCERN) String usageConcern) { + this.activeDetectionsCount = activeDetectionsCount; + this.category = category; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.description = description; + this.detectionFrequency = detectionFrequency; + this.detectionParameters = detectionParameters; + this.detectionType = detectionType; + this.featureFlags = featureFlags; + this.insights = insights; + this.lastDetectionAt = lastDetectionAt; + if (lastDetectionAt != null) {} + this.mitigatedDetectionsCount = mitigatedDetectionsCount; + this.mitigationParameters = mitigationParameters; + this.mitigationType = mitigationType; + this.mitigations = mitigations; + this.name = name; + this.nextSteps = nextSteps; + this.notificationFrequency = notificationFrequency; + this.notificationParameters = notificationParameters; + this.notificationType = notificationType; + this.priority = priority; + this.product = product; + this.releaseStatus = releaseStatus; + this.resourceType = resourceType; + this.resourceTypeDisplayName = resourceTypeDisplayName; + this.supportedDetectionParameters = supportedDetectionParameters; + this.supportedNotificationParameters = supportedNotificationParameters; + this.task = task; + this.type = type; + this.usageConcern = usageConcern; + } + + public GovernanceControlAttributes activeDetectionsCount(Long activeDetectionsCount) { + this.activeDetectionsCount = activeDetectionsCount; + return this; + } + + /** + * The number of active detections for the control. + * + * @return activeDetectionsCount + */ + @JsonProperty(JSON_PROPERTY_ACTIVE_DETECTIONS_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getActiveDetectionsCount() { + return activeDetectionsCount; + } + + public void setActiveDetectionsCount(Long activeDetectionsCount) { + this.activeDetectionsCount = activeDetectionsCount; + } + + public GovernanceControlAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The value driver the control is grouped under, such as security or cost + * . + * + * @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 GovernanceControlAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The time the control configuration was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public GovernanceControlAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * The UUID of the user who created the control configuration. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public GovernanceControlAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description of what the control detects. + * + * @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 GovernanceControlAttributes detectionFrequency(String detectionFrequency) { + this.detectionFrequency = detectionFrequency; + return this; + } + + /** + * How often detections are evaluated for the control. + * + * @return detectionFrequency + */ + @JsonProperty(JSON_PROPERTY_DETECTION_FREQUENCY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDetectionFrequency() { + return detectionFrequency; + } + + public void setDetectionFrequency(String detectionFrequency) { + this.detectionFrequency = detectionFrequency; + } + + public GovernanceControlAttributes detectionParameters(Map detectionParameters) { + this.detectionParameters = detectionParameters; + return this; + } + + public GovernanceControlAttributes putDetectionParametersItem( + String key, Object detectionParametersItem) { + this.detectionParameters.put(key, detectionParametersItem); + return this; + } + + /** + * A free-form map of parameter names to their configured values. + * + * @return detectionParameters + */ + @JsonProperty(JSON_PROPERTY_DETECTION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getDetectionParameters() { + return detectionParameters; + } + + public void setDetectionParameters(Map detectionParameters) { + this.detectionParameters = detectionParameters; + } + + public GovernanceControlAttributes detectionType(String detectionType) { + this.detectionType = detectionType; + return this; + } + + /** + * The detection type that uniquely identifies the control. + * + * @return detectionType + */ + @JsonProperty(JSON_PROPERTY_DETECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDetectionType() { + return detectionType; + } + + public void setDetectionType(String detectionType) { + this.detectionType = detectionType; + } + + public GovernanceControlAttributes featureFlags(List featureFlags) { + this.featureFlags = featureFlags; + return this; + } + + public GovernanceControlAttributes addFeatureFlagsItem(String featureFlagsItem) { + this.featureFlags.add(featureFlagsItem); + return this; + } + + /** + * The feature flags that gate the control. + * + * @return featureFlags + */ + @JsonProperty(JSON_PROPERTY_FEATURE_FLAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFeatureFlags() { + return featureFlags; + } + + public void setFeatureFlags(List featureFlags) { + this.featureFlags = featureFlags; + } + + public GovernanceControlAttributes insights(List insights) { + this.insights = insights; + return this; + } + + public GovernanceControlAttributes addInsightsItem(String insightsItem) { + this.insights.add(insightsItem); + return this; + } + + /** + * The insight slugs associated with the control. + * + * @return insights + */ + @JsonProperty(JSON_PROPERTY_INSIGHTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getInsights() { + return insights; + } + + public void setInsights(List insights) { + this.insights = insights; + } + + public GovernanceControlAttributes lastDetectionAt(OffsetDateTime lastDetectionAt) { + this.lastDetectionAt = lastDetectionAt; + if (lastDetectionAt != null) {} + return this; + } + + /** + * The time of the most recent detection for the control. null when there are no + * detections. + * + * @return lastDetectionAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_DETECTION_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getLastDetectionAt() { + return lastDetectionAt; + } + + public void setLastDetectionAt(OffsetDateTime lastDetectionAt) { + this.lastDetectionAt = lastDetectionAt; + } + + public GovernanceControlAttributes mitigatedDetectionsCount(Long mitigatedDetectionsCount) { + this.mitigatedDetectionsCount = mitigatedDetectionsCount; + return this; + } + + /** + * The number of mitigated detections for the control. + * + * @return mitigatedDetectionsCount + */ + @JsonProperty(JSON_PROPERTY_MITIGATED_DETECTIONS_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMitigatedDetectionsCount() { + return mitigatedDetectionsCount; + } + + public void setMitigatedDetectionsCount(Long mitigatedDetectionsCount) { + this.mitigatedDetectionsCount = mitigatedDetectionsCount; + } + + public GovernanceControlAttributes mitigationParameters( + Map mitigationParameters) { + this.mitigationParameters = mitigationParameters; + return this; + } + + public GovernanceControlAttributes putMitigationParametersItem( + String key, Object mitigationParametersItem) { + this.mitigationParameters.put(key, mitigationParametersItem); + return this; + } + + /** + * A free-form map of parameter names to their configured values. + * + * @return mitigationParameters + */ + @JsonProperty(JSON_PROPERTY_MITIGATION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getMitigationParameters() { + return mitigationParameters; + } + + public void setMitigationParameters(Map mitigationParameters) { + this.mitigationParameters = mitigationParameters; + } + + public GovernanceControlAttributes mitigationType(String mitigationType) { + this.mitigationType = mitigationType; + return this; + } + + /** + * The configured mitigation type for the control. Empty when not configured. + * + * @return mitigationType + */ + @JsonProperty(JSON_PROPERTY_MITIGATION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMitigationType() { + return mitigationType; + } + + public void setMitigationType(String mitigationType) { + this.mitigationType = mitigationType; + } + + public GovernanceControlAttributes mitigations( + List mitigations) { + this.mitigations = mitigations; + for (GovernanceControlMitigationDefinition item : mitigations) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceControlAttributes addMitigationsItem( + GovernanceControlMitigationDefinition mitigationsItem) { + this.mitigations.add(mitigationsItem); + this.unparsed |= mitigationsItem.unparsed; + return this; + } + + /** + * The mitigations available for a control. + * + * @return mitigations + */ + @JsonProperty(JSON_PROPERTY_MITIGATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMitigations() { + return mitigations; + } + + public void setMitigations(List mitigations) { + this.mitigations = mitigations; + } + + public GovernanceControlAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Human-readable name of the control. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GovernanceControlAttributes nextSteps(String nextSteps) { + this.nextSteps = nextSteps; + return this; + } + + /** + * Guidance on the next steps to remediate detections for the control. + * + * @return nextSteps + */ + @JsonProperty(JSON_PROPERTY_NEXT_STEPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNextSteps() { + return nextSteps; + } + + public void setNextSteps(String nextSteps) { + this.nextSteps = nextSteps; + } + + public GovernanceControlAttributes notificationFrequency(String notificationFrequency) { + this.notificationFrequency = notificationFrequency; + return this; + } + + /** + * The configured notification frequency for the control. Empty when not configured. + * + * @return notificationFrequency + */ + @JsonProperty(JSON_PROPERTY_NOTIFICATION_FREQUENCY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNotificationFrequency() { + return notificationFrequency; + } + + public void setNotificationFrequency(String notificationFrequency) { + this.notificationFrequency = notificationFrequency; + } + + public GovernanceControlAttributes notificationParameters( + Map notificationParameters) { + this.notificationParameters = notificationParameters; + return this; + } + + public GovernanceControlAttributes putNotificationParametersItem( + String key, Object notificationParametersItem) { + this.notificationParameters.put(key, notificationParametersItem); + return this; + } + + /** + * A free-form map of parameter names to their configured values. + * + * @return notificationParameters + */ + @JsonProperty(JSON_PROPERTY_NOTIFICATION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getNotificationParameters() { + return notificationParameters; + } + + public void setNotificationParameters(Map notificationParameters) { + this.notificationParameters = notificationParameters; + } + + public GovernanceControlAttributes notificationType(String notificationType) { + this.notificationType = notificationType; + return this; + } + + /** + * The configured notification type for the control. Empty when not configured. + * + * @return notificationType + */ + @JsonProperty(JSON_PROPERTY_NOTIFICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNotificationType() { + return notificationType; + } + + public void setNotificationType(String notificationType) { + this.notificationType = notificationType; + } + + public GovernanceControlAttributes priority(String priority) { + this.priority = priority; + return this; + } + + /** + * The priority of the control, such as High. + * + * @return priority + */ + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public GovernanceControlAttributes product(String product) { + this.product = product; + return this; + } + + /** + * The product the control 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 GovernanceControlAttributes releaseStatus(String releaseStatus) { + this.releaseStatus = releaseStatus; + return this; + } + + /** + * The release status of the control, such as prod or beta. + * + * @return releaseStatus + */ + @JsonProperty(JSON_PROPERTY_RELEASE_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReleaseStatus() { + return releaseStatus; + } + + public void setReleaseStatus(String releaseStatus) { + this.releaseStatus = releaseStatus; + } + + public GovernanceControlAttributes resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * The type of resource the control evaluates. + * + * @return resourceType + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public GovernanceControlAttributes resourceTypeDisplayName(String resourceTypeDisplayName) { + this.resourceTypeDisplayName = resourceTypeDisplayName; + return this; + } + + /** + * The human-readable name of the resource type. + * + * @return resourceTypeDisplayName + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_TYPE_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceTypeDisplayName() { + return resourceTypeDisplayName; + } + + public void setResourceTypeDisplayName(String resourceTypeDisplayName) { + this.resourceTypeDisplayName = resourceTypeDisplayName; + } + + public GovernanceControlAttributes supportedDetectionParameters( + List supportedDetectionParameters) { + this.supportedDetectionParameters = supportedDetectionParameters; + for (GovernanceControlParameterDefinition item : supportedDetectionParameters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceControlAttributes addSupportedDetectionParametersItem( + GovernanceControlParameterDefinition supportedDetectionParametersItem) { + this.supportedDetectionParameters.add(supportedDetectionParametersItem); + this.unparsed |= supportedDetectionParametersItem.unparsed; + return this; + } + + /** + * An array of parameter definitions. + * + * @return supportedDetectionParameters + */ + @JsonProperty(JSON_PROPERTY_SUPPORTED_DETECTION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSupportedDetectionParameters() { + return supportedDetectionParameters; + } + + public void setSupportedDetectionParameters( + List supportedDetectionParameters) { + this.supportedDetectionParameters = supportedDetectionParameters; + } + + public GovernanceControlAttributes supportedNotificationParameters( + List supportedNotificationParameters) { + this.supportedNotificationParameters = supportedNotificationParameters; + for (GovernanceControlParameterDefinition item : supportedNotificationParameters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceControlAttributes addSupportedNotificationParametersItem( + GovernanceControlParameterDefinition supportedNotificationParametersItem) { + this.supportedNotificationParameters.add(supportedNotificationParametersItem); + this.unparsed |= supportedNotificationParametersItem.unparsed; + return this; + } + + /** + * An array of parameter definitions. + * + * @return supportedNotificationParameters + */ + @JsonProperty(JSON_PROPERTY_SUPPORTED_NOTIFICATION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSupportedNotificationParameters() { + return supportedNotificationParameters; + } + + public void setSupportedNotificationParameters( + List supportedNotificationParameters) { + this.supportedNotificationParameters = supportedNotificationParameters; + } + + public GovernanceControlAttributes task(String task) { + this.task = task; + return this; + } + + /** + * A short description of the remediation task for the control. + * + * @return task + */ + @JsonProperty(JSON_PROPERTY_TASK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTask() { + return task; + } + + public void setTask(String task) { + this.task = task; + } + + public GovernanceControlAttributes type(String type) { + this.type = type; + return this; + } + + /** + * The control type, such as Proactive or Detection. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public GovernanceControlAttributes usageConcern(String usageConcern) { + this.usageConcern = usageConcern; + return this; + } + + /** + * The usage concern the control addresses, such as Security or + * Cost Optimization. + * + * @return usageConcern + */ + @JsonProperty(JSON_PROPERTY_USAGE_CONCERN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUsageConcern() { + return usageConcern; + } + + public void setUsageConcern(String usageConcern) { + this.usageConcern = usageConcern; + } + + /** + * 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 GovernanceControlAttributes + */ + @JsonAnySetter + public GovernanceControlAttributes 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 GovernanceControlAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlAttributes governanceControlAttributes = (GovernanceControlAttributes) o; + return Objects.equals( + this.activeDetectionsCount, governanceControlAttributes.activeDetectionsCount) + && Objects.equals(this.category, governanceControlAttributes.category) + && Objects.equals(this.createdAt, governanceControlAttributes.createdAt) + && Objects.equals(this.createdBy, governanceControlAttributes.createdBy) + && Objects.equals(this.description, governanceControlAttributes.description) + && Objects.equals(this.detectionFrequency, governanceControlAttributes.detectionFrequency) + && Objects.equals(this.detectionParameters, governanceControlAttributes.detectionParameters) + && Objects.equals(this.detectionType, governanceControlAttributes.detectionType) + && Objects.equals(this.featureFlags, governanceControlAttributes.featureFlags) + && Objects.equals(this.insights, governanceControlAttributes.insights) + && Objects.equals(this.lastDetectionAt, governanceControlAttributes.lastDetectionAt) + && Objects.equals( + this.mitigatedDetectionsCount, governanceControlAttributes.mitigatedDetectionsCount) + && Objects.equals( + this.mitigationParameters, governanceControlAttributes.mitigationParameters) + && Objects.equals(this.mitigationType, governanceControlAttributes.mitigationType) + && Objects.equals(this.mitigations, governanceControlAttributes.mitigations) + && Objects.equals(this.name, governanceControlAttributes.name) + && Objects.equals(this.nextSteps, governanceControlAttributes.nextSteps) + && Objects.equals( + this.notificationFrequency, governanceControlAttributes.notificationFrequency) + && Objects.equals( + this.notificationParameters, governanceControlAttributes.notificationParameters) + && Objects.equals(this.notificationType, governanceControlAttributes.notificationType) + && Objects.equals(this.priority, governanceControlAttributes.priority) + && Objects.equals(this.product, governanceControlAttributes.product) + && Objects.equals(this.releaseStatus, governanceControlAttributes.releaseStatus) + && Objects.equals(this.resourceType, governanceControlAttributes.resourceType) + && Objects.equals( + this.resourceTypeDisplayName, governanceControlAttributes.resourceTypeDisplayName) + && Objects.equals( + this.supportedDetectionParameters, + governanceControlAttributes.supportedDetectionParameters) + && Objects.equals( + this.supportedNotificationParameters, + governanceControlAttributes.supportedNotificationParameters) + && Objects.equals(this.task, governanceControlAttributes.task) + && Objects.equals(this.type, governanceControlAttributes.type) + && Objects.equals(this.usageConcern, governanceControlAttributes.usageConcern) + && Objects.equals( + this.additionalProperties, governanceControlAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + activeDetectionsCount, + category, + createdAt, + createdBy, + description, + detectionFrequency, + detectionParameters, + detectionType, + featureFlags, + insights, + lastDetectionAt, + mitigatedDetectionsCount, + mitigationParameters, + mitigationType, + mitigations, + name, + nextSteps, + notificationFrequency, + notificationParameters, + notificationType, + priority, + product, + releaseStatus, + resourceType, + resourceTypeDisplayName, + supportedDetectionParameters, + supportedNotificationParameters, + task, + type, + usageConcern, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlAttributes {\n"); + sb.append(" activeDetectionsCount: ") + .append(toIndentedString(activeDetectionsCount)) + .append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" detectionFrequency: ").append(toIndentedString(detectionFrequency)).append("\n"); + sb.append(" detectionParameters: ") + .append(toIndentedString(detectionParameters)) + .append("\n"); + sb.append(" detectionType: ").append(toIndentedString(detectionType)).append("\n"); + sb.append(" featureFlags: ").append(toIndentedString(featureFlags)).append("\n"); + sb.append(" insights: ").append(toIndentedString(insights)).append("\n"); + sb.append(" lastDetectionAt: ").append(toIndentedString(lastDetectionAt)).append("\n"); + sb.append(" mitigatedDetectionsCount: ") + .append(toIndentedString(mitigatedDetectionsCount)) + .append("\n"); + sb.append(" mitigationParameters: ") + .append(toIndentedString(mitigationParameters)) + .append("\n"); + sb.append(" mitigationType: ").append(toIndentedString(mitigationType)).append("\n"); + sb.append(" mitigations: ").append(toIndentedString(mitigations)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nextSteps: ").append(toIndentedString(nextSteps)).append("\n"); + sb.append(" notificationFrequency: ") + .append(toIndentedString(notificationFrequency)) + .append("\n"); + sb.append(" notificationParameters: ") + .append(toIndentedString(notificationParameters)) + .append("\n"); + sb.append(" notificationType: ").append(toIndentedString(notificationType)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" releaseStatus: ").append(toIndentedString(releaseStatus)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" resourceTypeDisplayName: ") + .append(toIndentedString(resourceTypeDisplayName)) + .append("\n"); + sb.append(" supportedDetectionParameters: ") + .append(toIndentedString(supportedDetectionParameters)) + .append("\n"); + sb.append(" supportedNotificationParameters: ") + .append(toIndentedString(supportedNotificationParameters)) + .append("\n"); + sb.append(" task: ").append(toIndentedString(task)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" usageConcern: ").append(toIndentedString(usageConcern)).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/GovernanceControlData.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlData.java new file mode 100644 index 00000000000..88fb8f77341 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlData.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 control resource. */ +@JsonPropertyOrder({ + GovernanceControlData.JSON_PROPERTY_ATTRIBUTES, + GovernanceControlData.JSON_PROPERTY_ID, + GovernanceControlData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GovernanceControlAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GovernanceControlResourceType type; + + public GovernanceControlData() {} + + @JsonCreator + public GovernanceControlData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GovernanceControlAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GovernanceControlResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GovernanceControlData attributes(GovernanceControlAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a governance control. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceControlAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GovernanceControlAttributes attributes) { + this.attributes = attributes; + } + + public GovernanceControlData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the control. + * + * @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 GovernanceControlData type(GovernanceControlResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for a governance control. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceControlResourceType getType() { + return type; + } + + public void setType(GovernanceControlResourceType 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 GovernanceControlData + */ + @JsonAnySetter + public GovernanceControlData 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 GovernanceControlData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlData governanceControlData = (GovernanceControlData) o; + return Objects.equals(this.attributes, governanceControlData.attributes) + && Objects.equals(this.id, governanceControlData.id) + && Objects.equals(this.type, governanceControlData.type) + && Objects.equals(this.additionalProperties, governanceControlData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlData {\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/GovernanceControlMitigationDefinition.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlMitigationDefinition.java new file mode 100644 index 00000000000..f36bd4f1dac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlMitigationDefinition.java @@ -0,0 +1,452 @@ +/* + * 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; + +/** The definition of a mitigation available for a control. */ +@JsonPropertyOrder({ + GovernanceControlMitigationDefinition.JSON_PROPERTY_ACTION_VERB, + GovernanceControlMitigationDefinition.JSON_PROPERTY_DESCRIPTION, + GovernanceControlMitigationDefinition.JSON_PROPERTY_EXECUTION_MODES, + GovernanceControlMitigationDefinition.JSON_PROPERTY_FEATURE_FLAGS, + GovernanceControlMitigationDefinition.JSON_PROPERTY_ID, + GovernanceControlMitigationDefinition.JSON_PROPERTY_MANUAL_MITIGATION_WARNING, + GovernanceControlMitigationDefinition.JSON_PROPERTY_PERMISSIONS, + GovernanceControlMitigationDefinition.JSON_PROPERTY_REQUIRES_AI, + GovernanceControlMitigationDefinition.JSON_PROPERTY_SUPPORTED_PARAMETERS, + GovernanceControlMitigationDefinition.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlMitigationDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION_VERB = "action_verb"; + private String actionVerb; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_EXECUTION_MODES = "execution_modes"; + private List executionModes = null; + + public static final String JSON_PROPERTY_FEATURE_FLAGS = "feature_flags"; + private List featureFlags = new ArrayList<>(); + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_MANUAL_MITIGATION_WARNING = "manual_mitigation_warning"; + private String manualMitigationWarning; + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private List permissions = new ArrayList<>(); + + public static final String JSON_PROPERTY_REQUIRES_AI = "requires_ai"; + private Boolean requiresAi; + + public static final String JSON_PROPERTY_SUPPORTED_PARAMETERS = "supported_parameters"; + private List supportedParameters = new ArrayList<>(); + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public GovernanceControlMitigationDefinition() {} + + @JsonCreator + public GovernanceControlMitigationDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION_VERB) String actionVerb, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_FEATURE_FLAGS) List featureFlags, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_MANUAL_MITIGATION_WARNING) + String manualMitigationWarning, + @JsonProperty(required = true, value = JSON_PROPERTY_PERMISSIONS) List permissions, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUIRES_AI) Boolean requiresAi, + @JsonProperty(required = true, value = JSON_PROPERTY_SUPPORTED_PARAMETERS) + List supportedParameters, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.actionVerb = actionVerb; + this.description = description; + this.featureFlags = featureFlags; + this.id = id; + this.manualMitigationWarning = manualMitigationWarning; + this.permissions = permissions; + this.requiresAi = requiresAi; + this.supportedParameters = supportedParameters; + this.title = title; + } + + public GovernanceControlMitigationDefinition actionVerb(String actionVerb) { + this.actionVerb = actionVerb; + return this; + } + + /** + * The verb describing the mitigation action, such as revoke or delete. + * + * @return actionVerb + */ + @JsonProperty(JSON_PROPERTY_ACTION_VERB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getActionVerb() { + return actionVerb; + } + + public void setActionVerb(String actionVerb) { + this.actionVerb = actionVerb; + } + + public GovernanceControlMitigationDefinition description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description of the mitigation. + * + * @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 GovernanceControlMitigationDefinition executionModes(List executionModes) { + this.executionModes = executionModes; + return this; + } + + public GovernanceControlMitigationDefinition addExecutionModesItem(String executionModesItem) { + if (this.executionModes == null) { + this.executionModes = new ArrayList<>(); + } + this.executionModes.add(executionModesItem); + return this; + } + + /** + * The execution modes the mitigation supports, such as manual or automatic + * . + * + * @return executionModes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXECUTION_MODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExecutionModes() { + return executionModes; + } + + public void setExecutionModes(List executionModes) { + this.executionModes = executionModes; + } + + public GovernanceControlMitigationDefinition featureFlags(List featureFlags) { + this.featureFlags = featureFlags; + return this; + } + + public GovernanceControlMitigationDefinition addFeatureFlagsItem(String featureFlagsItem) { + this.featureFlags.add(featureFlagsItem); + return this; + } + + /** + * The feature flags that gate the mitigation. + * + * @return featureFlags + */ + @JsonProperty(JSON_PROPERTY_FEATURE_FLAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFeatureFlags() { + return featureFlags; + } + + public void setFeatureFlags(List featureFlags) { + this.featureFlags = featureFlags; + } + + public GovernanceControlMitigationDefinition id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the mitigation. + * + * @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 GovernanceControlMitigationDefinition manualMitigationWarning( + String manualMitigationWarning) { + this.manualMitigationWarning = manualMitigationWarning; + return this; + } + + /** + * A warning shown to the user before applying the mitigation manually. + * + * @return manualMitigationWarning + */ + @JsonProperty(JSON_PROPERTY_MANUAL_MITIGATION_WARNING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getManualMitigationWarning() { + return manualMitigationWarning; + } + + public void setManualMitigationWarning(String manualMitigationWarning) { + this.manualMitigationWarning = manualMitigationWarning; + } + + public GovernanceControlMitigationDefinition permissions(List permissions) { + this.permissions = permissions; + return this; + } + + public GovernanceControlMitigationDefinition addPermissionsItem(String permissionsItem) { + this.permissions.add(permissionsItem); + return this; + } + + /** + * The permissions required to apply the mitigation. + * + * @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 GovernanceControlMitigationDefinition requiresAi(Boolean requiresAi) { + this.requiresAi = requiresAi; + return this; + } + + /** + * Whether the mitigation requires AI to be enabled. + * + * @return requiresAi + */ + @JsonProperty(JSON_PROPERTY_REQUIRES_AI) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getRequiresAi() { + return requiresAi; + } + + public void setRequiresAi(Boolean requiresAi) { + this.requiresAi = requiresAi; + } + + public GovernanceControlMitigationDefinition supportedParameters( + List supportedParameters) { + this.supportedParameters = supportedParameters; + for (GovernanceControlParameterDefinition item : supportedParameters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceControlMitigationDefinition addSupportedParametersItem( + GovernanceControlParameterDefinition supportedParametersItem) { + this.supportedParameters.add(supportedParametersItem); + this.unparsed |= supportedParametersItem.unparsed; + return this; + } + + /** + * An array of parameter definitions. + * + * @return supportedParameters + */ + @JsonProperty(JSON_PROPERTY_SUPPORTED_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSupportedParameters() { + return supportedParameters; + } + + public void setSupportedParameters( + List supportedParameters) { + this.supportedParameters = supportedParameters; + } + + public GovernanceControlMitigationDefinition title(String title) { + this.title = title; + return this; + } + + /** + * A short, human-readable name for the mitigation. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 GovernanceControlMitigationDefinition + */ + @JsonAnySetter + public GovernanceControlMitigationDefinition 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 GovernanceControlMitigationDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlMitigationDefinition governanceControlMitigationDefinition = + (GovernanceControlMitigationDefinition) o; + return Objects.equals(this.actionVerb, governanceControlMitigationDefinition.actionVerb) + && Objects.equals(this.description, governanceControlMitigationDefinition.description) + && Objects.equals(this.executionModes, governanceControlMitigationDefinition.executionModes) + && Objects.equals(this.featureFlags, governanceControlMitigationDefinition.featureFlags) + && Objects.equals(this.id, governanceControlMitigationDefinition.id) + && Objects.equals( + this.manualMitigationWarning, + governanceControlMitigationDefinition.manualMitigationWarning) + && Objects.equals(this.permissions, governanceControlMitigationDefinition.permissions) + && Objects.equals(this.requiresAi, governanceControlMitigationDefinition.requiresAi) + && Objects.equals( + this.supportedParameters, governanceControlMitigationDefinition.supportedParameters) + && Objects.equals(this.title, governanceControlMitigationDefinition.title) + && Objects.equals( + this.additionalProperties, governanceControlMitigationDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + actionVerb, + description, + executionModes, + featureFlags, + id, + manualMitigationWarning, + permissions, + requiresAi, + supportedParameters, + title, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlMitigationDefinition {\n"); + sb.append(" actionVerb: ").append(toIndentedString(actionVerb)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" executionModes: ").append(toIndentedString(executionModes)).append("\n"); + sb.append(" featureFlags: ").append(toIndentedString(featureFlags)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" manualMitigationWarning: ") + .append(toIndentedString(manualMitigationWarning)) + .append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" requiresAi: ").append(toIndentedString(requiresAi)).append("\n"); + sb.append(" supportedParameters: ") + .append(toIndentedString(supportedParameters)) + .append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/GovernanceControlParameterDefinition.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlParameterDefinition.java new file mode 100644 index 00000000000..f634d444fe3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlParameterDefinition.java @@ -0,0 +1,368 @@ +/* + * 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; + +/** The definition of a configurable parameter on a control or mitigation. */ +@JsonPropertyOrder({ + GovernanceControlParameterDefinition.JSON_PROPERTY_DEFAULT_VALUE, + GovernanceControlParameterDefinition.JSON_PROPERTY_DESCRIPTION, + GovernanceControlParameterDefinition.JSON_PROPERTY_DISPLAY_NAME, + GovernanceControlParameterDefinition.JSON_PROPERTY_HIDDEN, + GovernanceControlParameterDefinition.JSON_PROPERTY_NAME, + GovernanceControlParameterDefinition.JSON_PROPERTY_REQUIRED, + GovernanceControlParameterDefinition.JSON_PROPERTY_SUPPORTED_VALUES, + GovernanceControlParameterDefinition.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlParameterDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFAULT_VALUE = "default_value"; + private Object defaultValue = new Object(); + + 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_HIDDEN = "hidden"; + private Boolean hidden; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_SUPPORTED_VALUES = "supported_values"; + private List supportedValues = new ArrayList<>(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public GovernanceControlParameterDefinition() {} + + @JsonCreator + public GovernanceControlParameterDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFAULT_VALUE) Object defaultValue, + @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_HIDDEN) Boolean hidden, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUIRED) Boolean required, + @JsonProperty(required = true, value = JSON_PROPERTY_SUPPORTED_VALUES) + List supportedValues, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.defaultValue = defaultValue; + this.description = description; + this.displayName = displayName; + this.hidden = hidden; + this.name = name; + this.required = required; + this.supportedValues = supportedValues; + this.type = type; + } + + public GovernanceControlParameterDefinition defaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * The default value of the parameter. The JSON type depends on the parameter's type. + * + * @return defaultValue + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + } + + public GovernanceControlParameterDefinition description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description of the parameter. + * + * @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 GovernanceControlParameterDefinition displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The human-readable name of the parameter. + * + * @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 GovernanceControlParameterDefinition hidden(Boolean hidden) { + this.hidden = hidden; + return this; + } + + /** + * Whether the parameter is hidden from the UI. + * + * @return hidden + */ + @JsonProperty(JSON_PROPERTY_HIDDEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHidden() { + return hidden; + } + + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + + public GovernanceControlParameterDefinition name(String name) { + this.name = name; + return this; + } + + /** + * The machine-readable name of the parameter. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GovernanceControlParameterDefinition required(Boolean required) { + this.required = required; + return this; + } + + /** + * Whether the parameter must be provided. + * + * @return required + */ + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public GovernanceControlParameterDefinition supportedValues( + List supportedValues) { + this.supportedValues = supportedValues; + for (GovernanceControlSupportedValue item : supportedValues) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceControlParameterDefinition addSupportedValuesItem( + GovernanceControlSupportedValue supportedValuesItem) { + this.supportedValues.add(supportedValuesItem); + this.unparsed |= supportedValuesItem.unparsed; + return this; + } + + /** + * The supported values for an enumerated parameter. + * + * @return supportedValues + */ + @JsonProperty(JSON_PROPERTY_SUPPORTED_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSupportedValues() { + return supportedValues; + } + + public void setSupportedValues(List supportedValues) { + this.supportedValues = supportedValues; + } + + public GovernanceControlParameterDefinition type(String type) { + this.type = type; + return this; + } + + /** + * The type of the parameter, such as integer, string, boolean + * , enum, or pattern_list. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 GovernanceControlParameterDefinition + */ + @JsonAnySetter + public GovernanceControlParameterDefinition 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 GovernanceControlParameterDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlParameterDefinition governanceControlParameterDefinition = + (GovernanceControlParameterDefinition) o; + return Objects.equals(this.defaultValue, governanceControlParameterDefinition.defaultValue) + && Objects.equals(this.description, governanceControlParameterDefinition.description) + && Objects.equals(this.displayName, governanceControlParameterDefinition.displayName) + && Objects.equals(this.hidden, governanceControlParameterDefinition.hidden) + && Objects.equals(this.name, governanceControlParameterDefinition.name) + && Objects.equals(this.required, governanceControlParameterDefinition.required) + && Objects.equals( + this.supportedValues, governanceControlParameterDefinition.supportedValues) + && Objects.equals(this.type, governanceControlParameterDefinition.type) + && Objects.equals( + this.additionalProperties, governanceControlParameterDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultValue, + description, + displayName, + hidden, + name, + required, + supportedValues, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlParameterDefinition {\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" supportedValues: ").append(toIndentedString(supportedValues)).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/GovernanceControlResourceType.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlResourceType.java new file mode 100644 index 00000000000..c3fd4f7ce58 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlResourceType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.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 control. */ +@JsonSerialize(using = GovernanceControlResourceType.GovernanceControlResourceTypeSerializer.class) +public class GovernanceControlResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("governance_control")); + + public static final GovernanceControlResourceType GOVERNANCE_CONTROL = + new GovernanceControlResourceType("governance_control"); + + GovernanceControlResourceType(String value) { + super(value, allowedValues); + } + + public static class GovernanceControlResourceTypeSerializer + extends StdSerializer { + public GovernanceControlResourceTypeSerializer(Class t) { + super(t); + } + + public GovernanceControlResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GovernanceControlResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GovernanceControlResourceType fromValue(String value) { + return new GovernanceControlResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlResponse.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlResponse.java new file mode 100644 index 00000000000..fd403d81b1e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlResponse.java @@ -0,0 +1,146 @@ +/* + * 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 single governance control. */ +@JsonPropertyOrder({GovernanceControlResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GovernanceControlData data; + + public GovernanceControlResponse() {} + + @JsonCreator + public GovernanceControlResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GovernanceControlData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GovernanceControlResponse data(GovernanceControlData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A governance control resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceControlData getData() { + return data; + } + + public void setData(GovernanceControlData 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 GovernanceControlResponse + */ + @JsonAnySetter + public GovernanceControlResponse 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 GovernanceControlResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlResponse governanceControlResponse = (GovernanceControlResponse) o; + return Objects.equals(this.data, governanceControlResponse.data) + && Objects.equals( + this.additionalProperties, governanceControlResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlResponse {\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/main/java/com/datadog/api/client/v2/model/GovernanceControlSupportedValue.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlSupportedValue.java new file mode 100644 index 00000000000..464ac4531d5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlSupportedValue.java @@ -0,0 +1,175 @@ +/* + * 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 supported value for an enumerated parameter. */ +@JsonPropertyOrder({ + GovernanceControlSupportedValue.JSON_PROPERTY_LABEL, + GovernanceControlSupportedValue.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlSupportedValue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public GovernanceControlSupportedValue() {} + + @JsonCreator + public GovernanceControlSupportedValue( + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.label = label; + this.value = value; + } + + public GovernanceControlSupportedValue label(String label) { + this.label = label; + return this; + } + + /** + * The human-readable label for the value. + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public GovernanceControlSupportedValue value(String value) { + this.value = value; + return this; + } + + /** + * The machine-readable value. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GovernanceControlSupportedValue + */ + @JsonAnySetter + public GovernanceControlSupportedValue 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 GovernanceControlSupportedValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlSupportedValue governanceControlSupportedValue = + (GovernanceControlSupportedValue) o; + return Objects.equals(this.label, governanceControlSupportedValue.label) + && Objects.equals(this.value, governanceControlSupportedValue.value) + && Objects.equals( + this.additionalProperties, governanceControlSupportedValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(label, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlSupportedValue {\n"); + sb.append(" label: ").append(toIndentedString(label)).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/GovernanceControlUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateAttributes.java new file mode 100644 index 00000000000..58ba5375e54 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateAttributes.java @@ -0,0 +1,383 @@ +/* + * 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.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 control that can be updated. Only the attributes present in the + * request are modified. + */ +@JsonPropertyOrder({ + GovernanceControlUpdateAttributes.JSON_PROPERTY_DETECTION_FREQUENCY, + GovernanceControlUpdateAttributes.JSON_PROPERTY_DETECTION_PARAMETERS, + GovernanceControlUpdateAttributes.JSON_PROPERTY_MITIGATION_PARAMETERS, + GovernanceControlUpdateAttributes.JSON_PROPERTY_MITIGATION_TYPE, + GovernanceControlUpdateAttributes.JSON_PROPERTY_NAME, + GovernanceControlUpdateAttributes.JSON_PROPERTY_NOTIFICATION_FREQUENCY, + GovernanceControlUpdateAttributes.JSON_PROPERTY_NOTIFICATION_PARAMETERS, + GovernanceControlUpdateAttributes.JSON_PROPERTY_NOTIFICATION_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DETECTION_FREQUENCY = "detection_frequency"; + private String detectionFrequency; + + public static final String JSON_PROPERTY_DETECTION_PARAMETERS = "detection_parameters"; + private Map detectionParameters = null; + + public static final String JSON_PROPERTY_MITIGATION_PARAMETERS = "mitigation_parameters"; + private Map mitigationParameters = null; + + public static final String JSON_PROPERTY_MITIGATION_TYPE = "mitigation_type"; + private String mitigationType; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NOTIFICATION_FREQUENCY = "notification_frequency"; + private String notificationFrequency; + + public static final String JSON_PROPERTY_NOTIFICATION_PARAMETERS = "notification_parameters"; + private Map notificationParameters = null; + + public static final String JSON_PROPERTY_NOTIFICATION_TYPE = "notification_type"; + private String notificationType; + + public GovernanceControlUpdateAttributes detectionFrequency(String detectionFrequency) { + this.detectionFrequency = detectionFrequency; + return this; + } + + /** + * How often detections should be evaluated for the control. + * + * @return detectionFrequency + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETECTION_FREQUENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetectionFrequency() { + return detectionFrequency; + } + + public void setDetectionFrequency(String detectionFrequency) { + this.detectionFrequency = detectionFrequency; + } + + public GovernanceControlUpdateAttributes detectionParameters( + Map detectionParameters) { + this.detectionParameters = detectionParameters; + return this; + } + + public GovernanceControlUpdateAttributes putDetectionParametersItem( + String key, Object detectionParametersItem) { + if (this.detectionParameters == null) { + this.detectionParameters = new HashMap<>(); + } + this.detectionParameters.put(key, detectionParametersItem); + return this; + } + + /** + * A free-form map of parameter names to their configured values. + * + * @return detectionParameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETECTION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDetectionParameters() { + return detectionParameters; + } + + public void setDetectionParameters(Map detectionParameters) { + this.detectionParameters = detectionParameters; + } + + public GovernanceControlUpdateAttributes mitigationParameters( + Map mitigationParameters) { + this.mitigationParameters = mitigationParameters; + return this; + } + + public GovernanceControlUpdateAttributes putMitigationParametersItem( + String key, Object mitigationParametersItem) { + if (this.mitigationParameters == null) { + this.mitigationParameters = new HashMap<>(); + } + this.mitigationParameters.put(key, mitigationParametersItem); + return this; + } + + /** + * A free-form map of parameter names to their configured values. + * + * @return mitigationParameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MITIGATION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMitigationParameters() { + return mitigationParameters; + } + + public void setMitigationParameters(Map mitigationParameters) { + this.mitigationParameters = mitigationParameters; + } + + public GovernanceControlUpdateAttributes mitigationType(String mitigationType) { + this.mitigationType = mitigationType; + return this; + } + + /** + * The mitigation type to configure for the control. + * + * @return mitigationType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MITIGATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMitigationType() { + return mitigationType; + } + + public void setMitigationType(String mitigationType) { + this.mitigationType = mitigationType; + } + + public GovernanceControlUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * A new human-readable name for the control. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GovernanceControlUpdateAttributes notificationFrequency(String notificationFrequency) { + this.notificationFrequency = notificationFrequency; + return this; + } + + /** + * The notification frequency to configure for the control. + * + * @return notificationFrequency + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATION_FREQUENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNotificationFrequency() { + return notificationFrequency; + } + + public void setNotificationFrequency(String notificationFrequency) { + this.notificationFrequency = notificationFrequency; + } + + public GovernanceControlUpdateAttributes notificationParameters( + Map notificationParameters) { + this.notificationParameters = notificationParameters; + return this; + } + + public GovernanceControlUpdateAttributes putNotificationParametersItem( + String key, Object notificationParametersItem) { + if (this.notificationParameters == null) { + this.notificationParameters = new HashMap<>(); + } + this.notificationParameters.put(key, notificationParametersItem); + return this; + } + + /** + * A free-form map of parameter names to their configured values. + * + * @return notificationParameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATION_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getNotificationParameters() { + return notificationParameters; + } + + public void setNotificationParameters(Map notificationParameters) { + this.notificationParameters = notificationParameters; + } + + public GovernanceControlUpdateAttributes notificationType(String notificationType) { + this.notificationType = notificationType; + return this; + } + + /** + * The notification type to configure for the control. + * + * @return notificationType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNotificationType() { + return notificationType; + } + + public void setNotificationType(String notificationType) { + this.notificationType = notificationType; + } + + /** + * 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 GovernanceControlUpdateAttributes + */ + @JsonAnySetter + public GovernanceControlUpdateAttributes 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 GovernanceControlUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlUpdateAttributes governanceControlUpdateAttributes = + (GovernanceControlUpdateAttributes) o; + return Objects.equals( + this.detectionFrequency, governanceControlUpdateAttributes.detectionFrequency) + && Objects.equals( + this.detectionParameters, governanceControlUpdateAttributes.detectionParameters) + && Objects.equals( + this.mitigationParameters, governanceControlUpdateAttributes.mitigationParameters) + && Objects.equals(this.mitigationType, governanceControlUpdateAttributes.mitigationType) + && Objects.equals(this.name, governanceControlUpdateAttributes.name) + && Objects.equals( + this.notificationFrequency, governanceControlUpdateAttributes.notificationFrequency) + && Objects.equals( + this.notificationParameters, governanceControlUpdateAttributes.notificationParameters) + && Objects.equals(this.notificationType, governanceControlUpdateAttributes.notificationType) + && Objects.equals( + this.additionalProperties, governanceControlUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + detectionFrequency, + detectionParameters, + mitigationParameters, + mitigationType, + name, + notificationFrequency, + notificationParameters, + notificationType, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlUpdateAttributes {\n"); + sb.append(" detectionFrequency: ").append(toIndentedString(detectionFrequency)).append("\n"); + sb.append(" detectionParameters: ") + .append(toIndentedString(detectionParameters)) + .append("\n"); + sb.append(" mitigationParameters: ") + .append(toIndentedString(mitigationParameters)) + .append("\n"); + sb.append(" mitigationType: ").append(toIndentedString(mitigationType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" notificationFrequency: ") + .append(toIndentedString(notificationFrequency)) + .append("\n"); + sb.append(" notificationParameters: ") + .append(toIndentedString(notificationParameters)) + .append("\n"); + sb.append(" notificationType: ").append(toIndentedString(notificationType)).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/GovernanceControlUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateData.java new file mode 100644 index 00000000000..5af3ca8e2f4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateData.java @@ -0,0 +1,208 @@ +/* + * 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 data of a governance control update request. */ +@JsonPropertyOrder({ + GovernanceControlUpdateData.JSON_PROPERTY_ATTRIBUTES, + GovernanceControlUpdateData.JSON_PROPERTY_ID, + GovernanceControlUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GovernanceControlUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GovernanceControlResourceType type; + + public GovernanceControlUpdateData() {} + + @JsonCreator + public GovernanceControlUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GovernanceControlResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GovernanceControlUpdateData attributes(GovernanceControlUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a governance control that can be updated. Only the attributes present in the + * request are modified. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GovernanceControlUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GovernanceControlUpdateAttributes attributes) { + this.attributes = attributes; + } + + public GovernanceControlUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the control. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GovernanceControlUpdateData type(GovernanceControlResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for a governance control. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceControlResourceType getType() { + return type; + } + + public void setType(GovernanceControlResourceType 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 GovernanceControlUpdateData + */ + @JsonAnySetter + public GovernanceControlUpdateData 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 GovernanceControlUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlUpdateData governanceControlUpdateData = (GovernanceControlUpdateData) o; + return Objects.equals(this.attributes, governanceControlUpdateData.attributes) + && Objects.equals(this.id, governanceControlUpdateData.id) + && Objects.equals(this.type, governanceControlUpdateData.type) + && Objects.equals( + this.additionalProperties, governanceControlUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlUpdateData {\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/GovernanceControlUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateRequest.java new file mode 100644 index 00000000000..cc37a8dc6c5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateRequest.java @@ -0,0 +1,147 @@ +/* + * 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 request to update a governance control. */ +@JsonPropertyOrder({GovernanceControlUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GovernanceControlUpdateData data; + + public GovernanceControlUpdateRequest() {} + + @JsonCreator + public GovernanceControlUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GovernanceControlUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GovernanceControlUpdateRequest data(GovernanceControlUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data of a governance control update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GovernanceControlUpdateData getData() { + return data; + } + + public void setData(GovernanceControlUpdateData 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 GovernanceControlUpdateRequest + */ + @JsonAnySetter + public GovernanceControlUpdateRequest 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 GovernanceControlUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlUpdateRequest governanceControlUpdateRequest = + (GovernanceControlUpdateRequest) o; + return Objects.equals(this.data, governanceControlUpdateRequest.data) + && Objects.equals( + this.additionalProperties, governanceControlUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlUpdateRequest {\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/main/java/com/datadog/api/client/v2/model/GovernanceControlsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlsResponse.java new file mode 100644 index 00000000000..cafb1426c31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlsResponse.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 controls. */ +@JsonPropertyOrder({GovernanceControlsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GovernanceControlsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GovernanceControlsResponse() {} + + @JsonCreator + public GovernanceControlsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public GovernanceControlsResponse data(List data) { + this.data = data; + for (GovernanceControlData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GovernanceControlsResponse addDataItem(GovernanceControlData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of governance control 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 GovernanceControlsResponse + */ + @JsonAnySetter + public GovernanceControlsResponse 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 GovernanceControlsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GovernanceControlsResponse governanceControlsResponse = (GovernanceControlsResponse) o; + return Objects.equals(this.data, governanceControlsResponse.data) + && Objects.equals( + this.additionalProperties, governanceControlsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GovernanceControlsResponse {\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_controls.feature b/src/test/resources/com/datadog/api/client/v2/api/governance_controls.feature new file mode 100644 index 00000000000..1207f5cf507 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/governance_controls.feature @@ -0,0 +1,77 @@ +@endpoint(governance-controls) @endpoint(governance-controls-v2) +Feature: Governance Controls + Governance Controls pair a detection definition with an organization's + detection, notification, and mitigation configuration within the + Governance Console. Each control reports how a class of governance issue + (such as unused API keys or unqueried metrics) is detected and remediated, + along with counts of active and mitigated detections. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "GovernanceControls" API + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a governance control returns "Bad Request" response + Given operation "GetGovernanceControl" enabled + And new "GetGovernanceControl" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a governance control returns "Not Found" response + Given operation "GetGovernanceControl" enabled + And new "GetGovernanceControl" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a governance control returns "OK" response + Given operation "GetGovernanceControl" enabled + And new "GetGovernanceControl" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance controls returns "Bad Request" response + Given operation "ListGovernanceControls" enabled + And new "ListGovernanceControls" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance controls returns "OK" response + Given operation "ListGovernanceControls" enabled + And new "ListGovernanceControls" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a governance control returns "Bad Request" response + Given operation "UpdateGovernanceControl" enabled + And new "UpdateGovernanceControl" request + And request contains "detection_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key", "name": "Unused API Keys", "notification_frequency": "daily", "notification_type": "slack"}, "id": "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a", "type": "governance_control"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a governance control returns "Not Found" response + Given operation "UpdateGovernanceControl" enabled + And new "UpdateGovernanceControl" request + And request contains "detection_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key", "name": "Unused API Keys", "notification_frequency": "daily", "notification_type": "slack"}, "id": "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a", "type": "governance_control"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a governance control returns "OK" response + Given operation "UpdateGovernanceControl" enabled + And new "UpdateGovernanceControl" request + And request contains "detection_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key", "name": "Unused API Keys", "notification_frequency": "daily", "notification_type": "slack"}, "id": "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a", "type": "governance_control"}} + 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 ae9e01d109a..22dc7ad77fe 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 @@ -2792,6 +2792,24 @@ "type": "safe" } }, + "ListGovernanceControls": { + "tag": "Governance Controls", + "undo": { + "type": "safe" + } + }, + "GetGovernanceControl": { + "tag": "Governance Controls", + "undo": { + "type": "safe" + } + }, + "UpdateGovernanceControl": { + "tag": "Governance Controls", + "undo": { + "type": "idempotent" + } + }, "ListGovernanceInsights": { "tag": "Governance Insights", "undo": {