diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index fd30acae59e..74d20bb6580 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -21314,6 +21314,125 @@ components:
- IDENTITY
- GZIP
- DEFLATE
+ ControlNotificationEventSetting:
+ description: The notification settings for a single event type on a control.
+ properties:
+ enabled:
+ description: Whether notifications are enabled for this event type.
+ example: true
+ type: boolean
+ event_type:
+ description: The event type the notification settings apply to, such as `new_detection`.
+ example: "new_detection"
+ type: string
+ targets:
+ $ref: "#/components/schemas/ControlNotificationTargetArray"
+ required:
+ - event_type
+ - enabled
+ - targets
+ type: object
+ ControlNotificationEventSettingsArray:
+ description: The notification settings for each supported event type on the control.
+ items:
+ $ref: "#/components/schemas/ControlNotificationEventSetting"
+ type: array
+ ControlNotificationSettingsAttributes:
+ description: The attributes of a governance control's notification settings.
+ properties:
+ event_settings:
+ $ref: "#/components/schemas/ControlNotificationEventSettingsArray"
+ required:
+ - event_settings
+ type: object
+ ControlNotificationSettingsData:
+ description: A control notification settings resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ControlNotificationSettingsAttributes"
+ id:
+ description: The detection type the notification settings apply to.
+ example: "unused_api_keys"
+ type: string
+ type:
+ $ref: "#/components/schemas/ControlNotificationSettingsResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ ControlNotificationSettingsResourceType:
+ description: Control notification settings resource type.
+ enum:
+ - control_notification_settings
+ example: "control_notification_settings"
+ type: string
+ x-enum-varnames:
+ - CONTROL_NOTIFICATION_SETTINGS
+ ControlNotificationSettingsResponse:
+ description: The notification settings for a governance control.
+ properties:
+ data:
+ $ref: "#/components/schemas/ControlNotificationSettingsData"
+ required:
+ - data
+ type: object
+ ControlNotificationSettingsUpdateAttributes:
+ description: The attributes of a governance control's notification settings that can be updated.
+ properties:
+ event_settings:
+ $ref: "#/components/schemas/ControlNotificationEventSettingsArray"
+ type: object
+ ControlNotificationSettingsUpdateData:
+ description: The data of a control notification settings update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ControlNotificationSettingsUpdateAttributes"
+ type:
+ $ref: "#/components/schemas/ControlNotificationSettingsResourceType"
+ required:
+ - type
+ type: object
+ ControlNotificationSettingsUpdateRequest:
+ description: A request to update the notification settings for a governance control.
+ properties:
+ data:
+ $ref: "#/components/schemas/ControlNotificationSettingsUpdateData"
+ required:
+ - data
+ type: object
+ ControlNotificationTarget:
+ description: A destination that receives notifications for an event type.
+ properties:
+ handle:
+ description: The destination handle, such as an email address, Slack channel, or user handle.
+ example: "#governance-alerts"
+ type: string
+ type:
+ $ref: "#/components/schemas/ControlNotificationTargetType"
+ required:
+ - type
+ - handle
+ type: object
+ ControlNotificationTargetArray:
+ description: The destinations that receive notifications for an event type.
+ items:
+ $ref: "#/components/schemas/ControlNotificationTarget"
+ type: array
+ ControlNotificationTargetType:
+ description: The type of notification destination.
+ enum:
+ - email
+ - slack
+ - at_mention
+ - case
+ example: "slack"
+ type: string
+ x-enum-varnames:
+ - EMAIL
+ - SLACK
+ - AT_MENTION
+ - CASE
ConvertJobResultsToSignalsAttributes:
description: Attributes for converting historical job results to signals.
properties:
@@ -41859,6 +41978,58 @@ components:
- impact_hint
- status
type: object
+ GovernanceConfigAttributes:
+ description: The attributes of a Governance Console configuration.
+ properties:
+ assignment_notifications_enabled:
+ description: Whether notifications are sent to users when detections are assigned to them.
+ example: true
+ type: boolean
+ enabled:
+ description: Whether the Governance Console is enabled for the organization.
+ example: true
+ type: boolean
+ usage_attribution_configured:
+ description: Whether usage attribution is configured for the organization.
+ example: true
+ type: boolean
+ required:
+ - enabled
+ - assignment_notifications_enabled
+ - usage_attribution_configured
+ type: object
+ GovernanceConfigData:
+ description: A Governance Console configuration resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceConfigAttributes"
+ id:
+ description: The unique identifier of the organization the Governance Console configuration applies to.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceConsoleConfigResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceConfigResponse:
+ description: The Governance Console configuration for an organization.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceConfigData"
+ required:
+ - data
+ type: object
+ GovernanceConsoleConfigResourceType:
+ description: Governance console config resource type.
+ enum:
+ - governance_console_config
+ example: "governance_console_config"
+ type: string
+ x-enum-varnames:
+ - GOVERNANCE_CONSOLE_CONFIG
GovernanceControlAttributes:
description: The attributes of a governance control.
properties:
@@ -42032,6 +42203,211 @@ components:
- type
- attributes
type: object
+ GovernanceControlDetectionAssignmentSource:
+ description: How the detection's current assignment was determined. Possible values are `auto_resolved`, `manual`, `reassigned`, and `cleared`.
+ enum:
+ - auto_resolved
+ - manual
+ - reassigned
+ - cleared
+ example: "manual"
+ type: string
+ x-enum-varnames:
+ - AUTO_RESOLVED
+ - MANUAL
+ - REASSIGNED
+ - CLEARED
+ GovernanceControlDetectionAttributes:
+ description: The attributes of a governance control detection.
+ properties:
+ assigned_team:
+ description: The identifier of the team the detection is assigned to, if any.
+ example: "platform-security"
+ type: string
+ assigned_to:
+ description: The identifier of the user the detection is assigned to, if any.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ assignment_source:
+ $ref: "#/components/schemas/GovernanceControlDetectionAssignmentSource"
+ control_id:
+ description: The unique identifier of the control that produced this detection.
+ example: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
+ type: string
+ created_at:
+ description: The date and time when the detection was created.
+ example: "2024-03-01T12:00:00Z"
+ format: date-time
+ type: string
+ detection_type:
+ description: The type of detection, which determines what condition was detected.
+ example: "unused_api_keys"
+ type: string
+ display_name:
+ description: The human-readable name of the detected resource.
+ example: "CI Deploy Key"
+ type: string
+ exception_at:
+ description: The date and time when the detection was marked as an exception, if applicable.
+ example: "2024-03-05T09:00:00Z"
+ format: date-time
+ type: string
+ exception_by:
+ description: The identifier of the user who marked the detection as an exception, if applicable.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ metadata:
+ description: Free-form metadata associated with the detection.
+ example:
+ region: "us-east-1"
+ mitigate_after:
+ description: The date and time after which the detection is scheduled to be mitigated, if applicable.
+ example: "2024-03-15T00:00:00Z"
+ format: date-time
+ type: string
+ mitigated_at:
+ description: The date and time when the detection was mitigated, if applicable.
+ example: "2024-03-10T15:30:00Z"
+ format: date-time
+ type: string
+ priority:
+ description: The priority of the detection, if set.
+ example: 1
+ format: int64
+ type: integer
+ resource_id:
+ description: The identifier of the resource the detection applies to.
+ example: "api-key-12345"
+ type: string
+ resource_url:
+ description: A link to the detected resource in Datadog.
+ example: "/organization-settings/api-keys/api-key-12345"
+ type: string
+ state:
+ $ref: "#/components/schemas/GovernanceControlDetectionState"
+ required:
+ - state
+ - control_id
+ - resource_id
+ - resource_url
+ - detection_type
+ - display_name
+ - created_at
+ - assignment_source
+ - priority
+ type: object
+ GovernanceControlDetectionData:
+ description: A governance control detection resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceControlDetectionAttributes"
+ id:
+ description: The unique identifier of the detection.
+ example: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceControlDetectionResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceControlDetectionResourceType:
+ description: Governance control detection resource type.
+ enum:
+ - governance_control_detection
+ example: "governance_control_detection"
+ type: string
+ x-enum-varnames:
+ - GOVERNANCE_CONTROL_DETECTION
+ GovernanceControlDetectionResponse:
+ description: A single governance control detection.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceControlDetectionData"
+ required:
+ - data
+ type: object
+ GovernanceControlDetectionState:
+ description: The current state of the detection. Possible values are `active`, `exception`, `mitigated`, `inactive`, `obsolete`, `resolved_externally`, and `mitigation_in_progress`.
+ enum:
+ - active
+ - exception
+ - mitigated
+ - inactive
+ - obsolete
+ - resolved_externally
+ - mitigation_in_progress
+ example: "active"
+ type: string
+ x-enum-varnames:
+ - ACTIVE
+ - EXCEPTION
+ - MITIGATED
+ - INACTIVE
+ - OBSOLETE
+ - RESOLVED_EXTERNALLY
+ - MITIGATION_IN_PROGRESS
+ GovernanceControlDetectionUpdateAttributes:
+ description: The attributes of a governance control detection that can be updated. Only the attributes present in the request are modified.
+ properties:
+ assigned_team:
+ description: The handle of the team the detection is assigned to. Set to an empty string to clear the assignment.
+ example: "platform-security"
+ type: string
+ assigned_to:
+ description: The UUID of the user the detection is assigned to. Set to an empty string to clear the assignment.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ mitigate_after:
+ description: The timestamp after which the detection becomes eligible for mitigation. Used to defer mitigation to a later time.
+ example: "2024-03-15T00:00:00Z"
+ format: date-time
+ type: string
+ state:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateState"
+ type: object
+ GovernanceControlDetectionUpdateData:
+ description: The data of a governance control detection update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateAttributes"
+ type:
+ $ref: "#/components/schemas/GovernanceControlDetectionResourceType"
+ required:
+ - type
+ type: object
+ GovernanceControlDetectionUpdateRequest:
+ description: A request to update a governance control detection.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateData"
+ required:
+ - data
+ type: object
+ GovernanceControlDetectionUpdateState:
+ description: The new state to set for the detection. Set to `exception` to acknowledge the detection and exclude it from active counts, or `active` to reopen it.
+ enum:
+ - exception
+ - active
+ example: "exception"
+ type: string
+ x-enum-varnames:
+ - EXCEPTION
+ - ACTIVE
+ GovernanceControlDetectionsDataArray:
+ description: An array of governance control detection resources.
+ items:
+ $ref: "#/components/schemas/GovernanceControlDetectionData"
+ type: array
+ GovernanceControlDetectionsResponse:
+ description: A list of governance control detections.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceControlDetectionsDataArray"
+ required:
+ - data
+ type: object
GovernanceControlMitigationDefinition:
description: The definition of a mitigation available for a control.
properties:
@@ -42497,7 +42873,7 @@ components:
example: "line"
type: string
comparison_shift:
- description: The window used for the previous value comparison, for example `week` or `month`.
+ description: The window used for the previous value comparison; for example, `week` or `month`.
example: "month"
type: string
default_value:
@@ -42556,6 +42932,360 @@ components:
required:
- data
type: object
+ GovernanceLimitAttributes:
+ description: The attributes of a governance limit.
+ properties:
+ description:
+ description: A description of what the limit measures.
+ example: "The number of log events indexed in the last 30 days."
+ type: string
+ display_name:
+ description: The human-readable name of the limit.
+ example: "Indexed Logs"
+ type: string
+ limit_type:
+ description: The type of limit, such as a rate limit or a usage limit.
+ example: "usage"
+ type: string
+ product:
+ description: The Datadog product the limit belongs to.
+ example: "logs"
+ type: string
+ query:
+ $ref: "#/components/schemas/GovernanceLimitQuery"
+ query_config:
+ $ref: "#/components/schemas/GovernanceLimitQueryConfig"
+ time_range:
+ description: The time range over which usage against the limit is measured.
+ example: "month"
+ type: string
+ times_hit_limit:
+ description: The number of times usage has reached the limit within the measured time range.
+ example: 2
+ format: double
+ type: number
+ unit_name:
+ description: The unit in which the limit and its usage are measured.
+ example: "events"
+ type: string
+ usage_status:
+ description: The current usage status of the limit relative to its threshold.
+ example: "approaching"
+ type: string
+ required:
+ - display_name
+ - description
+ - product
+ - limit_type
+ - unit_name
+ - time_range
+ - query
+ - times_hit_limit
+ - usage_status
+ - query_config
+ type: object
+ GovernanceLimitData:
+ description: A governance limit resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceLimitAttributes"
+ id:
+ description: The unique identifier of the limit.
+ example: "logs_indexed_events"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceLimitResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceLimitQuery:
+ description: A metric query used to compute usage against a limit.
+ properties:
+ query:
+ description: The metric query expression used to compute the limit value.
+ example: "sum:datadog.estimated_usage.logs.ingested_events{*}"
+ type: string
+ reducer:
+ description: How the query results are aggregated into a single value (for example, sum, max, or avg).
+ example: "sum"
+ type: string
+ source:
+ description: The data source used to evaluate the metric query (for example, the metrics or events backend).
+ example: "metrics"
+ type: string
+ required:
+ - source
+ - query
+ - reducer
+ type: object
+ GovernanceLimitQueryConfig:
+ description: The query execution context used to visualize a limit and its usage.
+ properties:
+ chart_type:
+ description: The chart type used to visualize the limit and its usage.
+ example: "line"
+ type: string
+ comparison_shift:
+ description: The time shift applied to compare current usage against a prior period.
+ example: "month"
+ type: string
+ default_value:
+ description: The default value used for the limit when no explicit value is configured.
+ example: 0
+ format: int64
+ type: integer
+ directionality:
+ description: The direction in which usage approaches the limit, indicating whether higher or lower values are closer to the limit.
+ example: "increase_better"
+ type: string
+ effective_time_window_days:
+ description: The number of days of data the limit query evaluates over.
+ example: 30
+ format: int64
+ type: integer
+ type: object
+ GovernanceLimitResourceType:
+ description: Limit resource type.
+ enum:
+ - limit
+ example: "limit"
+ type: string
+ x-enum-varnames:
+ - LIMIT
+ GovernanceLimitsDataArray:
+ description: An array of governance limit resources.
+ items:
+ $ref: "#/components/schemas/GovernanceLimitData"
+ type: array
+ GovernanceLimitsResponse:
+ description: A list of governance limits.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceLimitsDataArray"
+ required:
+ - data
+ type: object
+ GovernanceMitigationRequest:
+ description: A request to mitigate a set of governance detections.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceMitigationRequestData"
+ required:
+ - data
+ type: object
+ GovernanceMitigationRequestAttributes:
+ description: The attributes of a governance mitigation request.
+ properties:
+ detection_ids:
+ description: The identifiers of the detections to mitigate in this request.
+ example:
+ - "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ items:
+ description: The identifier of a detection to mitigate in this request.
+ type: string
+ type: array
+ detection_type:
+ description: The detection type whose detections should be mitigated.
+ example: "unused_api_keys"
+ type: string
+ mitigation_parameters:
+ $ref: "#/components/schemas/GovernanceControlParametersMap"
+ nullable: true
+ mitigation_type:
+ description: The mitigation to apply to the selected detections. Defaults to the control's configured mitigation when omitted.
+ example: "revoke_api_key"
+ type: string
+ type: object
+ GovernanceMitigationRequestData:
+ description: The data of a governance mitigation request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceMitigationRequestAttributes"
+ type:
+ $ref: "#/components/schemas/GovernanceControlDetectionResourceType"
+ required:
+ - type
+ type: object
+ GovernanceNotificationSettingsAttributes:
+ description: The attributes of the organization-wide governance notification settings.
+ properties:
+ assignment_notifications_enabled:
+ description: Whether notifications are sent to users when detections are assigned to them.
+ example: true
+ type: boolean
+ required:
+ - assignment_notifications_enabled
+ type: object
+ GovernanceNotificationSettingsData:
+ description: A governance notification settings resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsAttributes"
+ id:
+ description: The unique identifier of the organization the notification settings apply to.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceNotificationSettingsResourceType:
+ description: Governance notification settings resource type.
+ enum:
+ - governance_notification_settings
+ example: "governance_notification_settings"
+ type: string
+ x-enum-varnames:
+ - GOVERNANCE_NOTIFICATION_SETTINGS
+ GovernanceNotificationSettingsResponse:
+ description: The organization-wide governance notification settings.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsData"
+ required:
+ - data
+ type: object
+ GovernanceNotificationSettingsUpdateAttributes:
+ description: The attributes of the governance notification settings that can be updated. Only the attributes present in the request are modified.
+ properties:
+ assignment_notifications_enabled:
+ description: Whether notifications are sent to users when detections are assigned to them.
+ example: true
+ type: boolean
+ type: object
+ GovernanceNotificationSettingsUpdateData:
+ description: The data of a governance notification settings update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsUpdateAttributes"
+ type:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResourceType"
+ required:
+ - type
+ type: object
+ GovernanceNotificationSettingsUpdateRequest:
+ description: A request to update the organization-wide governance notification settings.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsUpdateData"
+ required:
+ - data
+ type: object
+ GovernanceResourceLimitAttributes:
+ description: The attributes of a governance resource limit.
+ properties:
+ current_limit:
+ description: The current limit configured for the resource.
+ example: 10000
+ format: double
+ type: number
+ current_value:
+ description: The current value of the resource.
+ example: 8200
+ format: double
+ type: number
+ deep_link:
+ description: A link to the Datadog page where the resource and its limit can be managed.
+ example: "/metric/summary"
+ type: string
+ default_current_value:
+ description: The default current value used when the resource value cannot be computed from the query.
+ example: 0
+ format: double
+ type: number
+ default_limit_value:
+ description: The default limit value used when the limit cannot be computed from the query.
+ example: 0
+ format: double
+ type: number
+ description:
+ description: A description of what the resource limit measures.
+ example: "The number of custom metrics in use against your contracted limit."
+ type: string
+ display_name:
+ description: The human-readable name of the resource limit.
+ example: "Custom Metrics"
+ type: string
+ limit_query:
+ $ref: "#/components/schemas/GovernanceLimitQuery"
+ product:
+ description: The Datadog product the resource limit belongs to.
+ example: "metrics"
+ type: string
+ query:
+ $ref: "#/components/schemas/GovernanceLimitQuery"
+ query_config:
+ $ref: "#/components/schemas/GovernanceLimitQueryConfig"
+ time_range:
+ description: The time range over which the resource value is measured.
+ example: "month"
+ type: string
+ unit_name:
+ description: The unit in which the resource value and limit are measured.
+ example: "metrics"
+ type: string
+ usage_status:
+ description: The current usage status of the resource relative to its limit.
+ example: "approaching"
+ type: string
+ required:
+ - display_name
+ - description
+ - product
+ - unit_name
+ - time_range
+ - current_value
+ - current_limit
+ - default_current_value
+ - default_limit_value
+ - deep_link
+ - query
+ - limit_query
+ - query_config
+ - usage_status
+ type: object
+ GovernanceResourceLimitData:
+ description: A governance resource limit resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceResourceLimitAttributes"
+ id:
+ description: The unique identifier of the resource limit.
+ example: "custom_metrics"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceResourceLimitResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceResourceLimitResourceType:
+ description: Resource limit resource type.
+ enum:
+ - resource-limit
+ example: "resource-limit"
+ type: string
+ x-enum-varnames:
+ - RESOURCE_LIMIT
+ GovernanceResourceLimitsDataArray:
+ description: An array of governance resource limit resources.
+ items:
+ $ref: "#/components/schemas/GovernanceResourceLimitData"
+ type: array
+ GovernanceResourceLimitsResponse:
+ description: A list of governance resource limits.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceResourceLimitsDataArray"
+ required:
+ - data
+ type: object
GreyNoiseAPIKey:
description: The definition of the `GreyNoiseAPIKey` object.
properties:
@@ -135447,6 +136177,60 @@ paths:
operator: OR
permissions:
- user_access_read
+ /api/v2/governance/config:
+ get:
+ description: |-
+ Retrieve the Governance Console configuration for the organization, including whether the
+ Console is enabled, whether assignment notifications are enabled, and whether usage
+ attribution is configured.
+ operationId: GetGovernanceConfig
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assignment_notifications_enabled: true
+ enabled: true
+ usage_attribution_configured: true
+ id: "11111111-2222-3333-4444-555555555555"
+ type: "governance_console_config"
+ schema:
+ $ref: "#/components/schemas/GovernanceConfigResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get the governance console configuration
+ tags:
+ - Governance Settings
+ 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:
get:
description: |-
@@ -135549,9 +136333,17 @@ paths:
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
summary: List governance controls
tags:
- Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
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/).
@@ -135648,9 +136440,17 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
summary: Get a governance control
tags:
- Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
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/).
@@ -135754,9 +136554,481 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
summary: Update a governance control
tags:
- Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ - governance_console_write
+ 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}/detections:
+ get:
+ description: |-
+ Retrieve the detections produced by the governance control with the given detection type.
+ Results can be filtered by state and free-text query, sorted, and paginated.
+ operationId: ListGovernanceControlDetections
+ 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
+ - description: Restrict the results to detections in the given state.
+ example: "active"
+ in: query
+ name: filter[state]
+ required: false
+ schema:
+ type: string
+ - description: Restrict the results to detections matching the given free-text query.
+ example: "production"
+ in: query
+ name: filter[query]
+ required: false
+ schema:
+ type: string
+ - description: The attribute to sort detections by. Prefix with `-` for descending order.
+ example: "-created_at"
+ in: query
+ name: sort
+ required: false
+ schema:
+ type: string
+ - description: "The zero-based index of the page to return; the first page is 0."
+ example: 0
+ in: query
+ name: page[number]
+ required: false
+ schema:
+ default: 0
+ format: int64
+ type: integer
+ - description: The number of detections to return per page.
+ example: 50
+ in: query
+ name: page[size]
+ required: false
+ schema:
+ format: int64
+ type: integer
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ assigned_team: "platform-security"
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ assignment_source: "manual"
+ control_id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
+ created_at: "2024-03-01T12:00:00Z"
+ detection_type: "unused_api_keys"
+ display_name: "CI Deploy Key"
+ metadata:
+ region: "us-east-1"
+ priority: 1
+ resource_id: "api-key-12345"
+ resource_url: "/organization-settings/api-keys/api-key-12345"
+ state: "active"
+ id: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: List governance control detections
+ tags:
+ - Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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}/detections/{detection_id}:
+ get:
+ description: Retrieve a single detection produced by the governance control with the given detection type.
+ operationId: GetGovernanceControlDetection
+ 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
+ - description: The unique identifier of the detection.
+ example: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ in: path
+ name: detection_id
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assigned_team: "platform-security"
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ assignment_source: "manual"
+ control_id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
+ created_at: "2024-03-01T12:00:00Z"
+ detection_type: "unused_api_keys"
+ display_name: "CI Deploy Key"
+ metadata:
+ region: "us-east-1"
+ priority: 1
+ resource_id: "api-key-12345"
+ resource_url: "/organization-settings/api-keys/api-key-12345"
+ state: "active"
+ id: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: Get a governance control detection
+ tags:
+ - Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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 a detection produced by the governance control with the given detection type. Only the
+ attributes present in the request are modified, allowing a detection to be acknowledged as an
+ exception, reopened, reassigned, or deferred for mitigation.
+ operationId: UpdateGovernanceControlDetection
+ 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
+ - description: The unique identifier of the detection.
+ example: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ in: path
+ name: detection_id
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ state: "exception"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assigned_team: "platform-security"
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ assignment_source: "manual"
+ control_id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
+ created_at: "2024-03-01T12:00:00Z"
+ detection_type: "unused_api_keys"
+ display_name: "CI Deploy Key"
+ metadata:
+ region: "us-east-1"
+ priority: 1
+ resource_id: "api-key-12345"
+ resource_url: "/organization-settings/api-keys/api-key-12345"
+ state: "active"
+ id: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: Update a governance control detection
+ tags:
+ - Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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}/notification_settings:
+ get:
+ description: |-
+ Retrieve the notification settings for the governance control with the given detection type,
+ including, for each supported event type, whether notifications are enabled and which
+ destinations receive them.
+ operationId: GetGovernanceControlNotificationSettings
+ 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:
+ event_settings:
+ - enabled: true
+ event_type: "new_detection"
+ targets:
+ - handle: "#governance-alerts"
+ type: "slack"
+ id: "unused_api_keys"
+ type: "control_notification_settings"
+ schema:
+ $ref: "#/components/schemas/ControlNotificationSettingsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: Get governance control notification settings
+ tags:
+ - Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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/).
+ put:
+ description: |-
+ Replace the notification settings for the governance control with the given detection type,
+ setting, for each supported event type, whether notifications are enabled and which
+ destinations receive them.
+ operationId: UpdateGovernanceControlNotificationSettings
+ 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:
+ event_settings:
+ - enabled: true
+ event_type: "new_detection"
+ targets:
+ - handle: "#governance-alerts"
+ type: "slack"
+ type: "control_notification_settings"
+ schema:
+ $ref: "#/components/schemas/ControlNotificationSettingsUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ event_settings:
+ - enabled: true
+ event_type: "new_detection"
+ targets:
+ - handle: "#governance-alerts"
+ type: "slack"
+ id: "unused_api_keys"
+ type: "control_notification_settings"
+ schema:
+ $ref: "#/components/schemas/ControlNotificationSettingsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ - governance_console_write
+ summary: Update governance control notification settings
+ tags:
+ - Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ - governance_console_write
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/).
@@ -135883,9 +137155,365 @@ paths:
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - audit_logs_read
+ - events_read
+ - metrics_read
summary: List governance insights
tags:
- Governance Insights
+ "x-permission":
+ operator: OR
+ permissions:
+ - metrics_read
+ - events_read
+ - audit_logs_read
+ 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/limits:
+ get:
+ description: |-
+ Retrieve the list of usage limits tracked for the organization in the Governance Console.
+ Each limit reports the query used to compute current usage, the unit and time range it is
+ measured over, and its current usage status.
+ operationId: ListGovernanceLimits
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ description: "The number of log events indexed in the last 30 days."
+ display_name: "Indexed Logs"
+ limit_type: "usage"
+ product: "logs"
+ query:
+ query: "sum:datadog.estimated_usage.logs.ingested_events{*}"
+ reducer: "sum"
+ source: "metrics"
+ query_config:
+ chart_type: "line"
+ comparison_shift: "month"
+ default_value: 0
+ directionality: "increase_better"
+ effective_time_window_days: 30
+ time_range: "month"
+ times_hit_limit: 2
+ unit_name: "events"
+ usage_status: "approaching"
+ id: "logs_indexed_events"
+ type: "limit"
+ schema:
+ $ref: "#/components/schemas/GovernanceLimitsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: List governance limits
+ tags:
+ - Governance Settings
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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/mitigate:
+ post:
+ description: |-
+ Apply a mitigation to a set of governance detections of a given detection type. When the
+ mitigation type is omitted, the control's configured mitigation is used. The request is
+ accepted for asynchronous processing.
+ operationId: CreateGovernanceMitigation
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ detection_ids:
+ - "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ detection_type: "unused_api_keys"
+ mitigation_parameters: {}
+ mitigation_type: "revoke_api_key"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceMitigationRequest"
+ required: true
+ responses:
+ "202":
+ description: Accepted
+ "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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: Mitigate governance detections
+ tags:
+ - Governance Controls
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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/notification_settings:
+ get:
+ description: |-
+ Retrieve the organization-wide governance notification settings, including whether users are
+ notified when detections are assigned to them.
+ operationId: GetGovernanceNotificationSettings
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assignment_notifications_enabled: true
+ id: "11111111-2222-3333-4444-555555555555"
+ type: "governance_notification_settings"
+ schema:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: Get governance notification settings
+ tags:
+ - Governance Settings
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ 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 organization-wide governance notification settings. Only the attributes present in
+ the request are modified.
+ operationId: UpdateGovernanceNotificationSettings
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assignment_notifications_enabled: true
+ type: "governance_notification_settings"
+ schema:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assignment_notifications_enabled: true
+ id: "11111111-2222-3333-4444-555555555555"
+ type: "governance_notification_settings"
+ schema:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ - governance_console_write
+ summary: Update governance notification settings
+ tags:
+ - Governance Settings
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ - governance_console_write
+ 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/resource-limits:
+ get:
+ description: |-
+ Retrieve the list of resource limits tracked for the organization in the Governance Console.
+ Each resource limit reports its current value and configured limit, the queries used to
+ compute them, and its current usage status.
+ operationId: ListGovernanceResourceLimits
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ current_limit: 10000
+ current_value: 8200
+ deep_link: "/metric/summary"
+ default_current_value: 0
+ default_limit_value: 0
+ description: "The number of custom metrics in use against your contracted limit."
+ display_name: "Custom Metrics"
+ limit_query:
+ query: "sum:datadog.contract.metrics.custom{*}"
+ reducer: "max"
+ source: "metrics"
+ product: "metrics"
+ query:
+ query: "sum:datadog.estimated_usage.metrics.custom{*}"
+ reducer: "sum"
+ source: "metrics"
+ query_config:
+ chart_type: "line"
+ comparison_shift: "month"
+ default_value: 0
+ directionality: "decrease_better"
+ effective_time_window_days: 30
+ time_range: "month"
+ unit_name: "metrics"
+ usage_status: "approaching"
+ id: "custom_metrics"
+ type: "resource-limit"
+ schema:
+ $ref: "#/components/schemas/GovernanceResourceLimitsResponse"
+ 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"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - governance_console_read
+ summary: List governance resource limits
+ tags:
+ - Governance Settings
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
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/).
@@ -189943,9 +191571,17 @@ paths:
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: List tag policies
tags:
- Tag Policies
+ "x-permission":
+ operator: OR
+ permissions:
+ - telemetry_rules_read
+ - metrics_read
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/).
@@ -190034,9 +191670,16 @@ paths:
description: Conflict
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Create a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: AND
+ permissions:
+ - telemetry_rules_create
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/).
@@ -190091,9 +191734,16 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Delete a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: AND
+ permissions:
+ - telemetry_rules_create
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/).
@@ -190203,9 +191853,17 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Get a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: OR
+ permissions:
+ - telemetry_rules_read
+ - metrics_read
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/).
@@ -190294,9 +191952,16 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Update a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: AND
+ permissions:
+ - telemetry_rules_create
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/).
@@ -190376,9 +192041,17 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Get a tag policy compliance score
tags:
- Tag Policies
+ "x-permission":
+ operator: OR
+ permissions:
+ - telemetry_rules_read
+ - metrics_read
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/).
@@ -196173,6 +197846,11 @@ tags:
optionally, a previous value for comparison) along with the query used to compute it, so
that the Console can render trends and highlight areas that need attention.
name: Governance Insights
+ - description: |-
+ Governance Settings cover organization-wide Governance Console configuration, usage limits and
+ resource limits, and notification preferences that determine when and how the Console alerts
+ users about governance activity.
+ name: Governance Settings
- description: |-
Configure High Availability Multi-Region (HAMR) connections between Datadog organizations.
HAMR provides disaster recovery capabilities by maintaining synchronized data between primary
diff --git a/examples/v2/governance-controls/CreateGovernanceMitigation.java b/examples/v2/governance-controls/CreateGovernanceMitigation.java
new file mode 100644
index 00000000000..593dd14556d
--- /dev/null
+++ b/examples/v2/governance-controls/CreateGovernanceMitigation.java
@@ -0,0 +1,40 @@
+// Mitigate governance detections returns "Accepted" 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.GovernanceControlDetectionResourceType;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequest;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequestAttributes;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequestData;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.createGovernanceMitigation", true);
+ GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+
+ GovernanceMitigationRequest body =
+ new GovernanceMitigationRequest()
+ .data(
+ new GovernanceMitigationRequestData()
+ .attributes(
+ new GovernanceMitigationRequestAttributes()
+ .detectionIds(
+ Collections.singletonList("3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"))
+ .detectionType("unused_api_keys")
+ .mitigationType("revoke_api_key"))
+ .type(GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION));
+
+ try {
+ apiInstance.createGovernanceMitigation(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceControlsApi#createGovernanceMitigation");
+ 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/GetGovernanceControlDetection.java b/examples/v2/governance-controls/GetGovernanceControlDetection.java
new file mode 100644
index 00000000000..7b57bb16efb
--- /dev/null
+++ b/examples/v2/governance-controls/GetGovernanceControlDetection.java
@@ -0,0 +1,28 @@
+// Get a governance control detection 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.GovernanceControlDetectionResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceControlDetection", true);
+ GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+
+ try {
+ GovernanceControlDetectionResponse result =
+ apiInstance.getGovernanceControlDetection(
+ "unused_api_keys", "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceControlsApi#getGovernanceControlDetection");
+ 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/GetGovernanceControlNotificationSettings.java b/examples/v2/governance-controls/GetGovernanceControlNotificationSettings.java
new file mode 100644
index 00000000000..bdd56eafa11
--- /dev/null
+++ b/examples/v2/governance-controls/GetGovernanceControlNotificationSettings.java
@@ -0,0 +1,27 @@
+// Get governance control notification settings 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.ControlNotificationSettingsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceControlNotificationSettings", true);
+ GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+
+ try {
+ ControlNotificationSettingsResponse result =
+ apiInstance.getGovernanceControlNotificationSettings("unused_api_keys");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceControlsApi#getGovernanceControlNotificationSettings");
+ 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/ListGovernanceControlDetections.java b/examples/v2/governance-controls/ListGovernanceControlDetections.java
new file mode 100644
index 00000000000..22b2a21c0e5
--- /dev/null
+++ b/examples/v2/governance-controls/ListGovernanceControlDetections.java
@@ -0,0 +1,27 @@
+// List governance control detections 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.GovernanceControlDetectionsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listGovernanceControlDetections", true);
+ GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+
+ try {
+ GovernanceControlDetectionsResponse result =
+ apiInstance.listGovernanceControlDetections("unused_api_keys");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceControlsApi#listGovernanceControlDetections");
+ 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/UpdateGovernanceControlDetection.java b/examples/v2/governance-controls/UpdateGovernanceControlDetection.java
new file mode 100644
index 00000000000..16dc18f7cc9
--- /dev/null
+++ b/examples/v2/governance-controls/UpdateGovernanceControlDetection.java
@@ -0,0 +1,46 @@
+// Update a governance control detection 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.GovernanceControlDetectionResourceType;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateAttributes;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateData;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateState;
+import java.time.OffsetDateTime;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateGovernanceControlDetection", true);
+ GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+
+ GovernanceControlDetectionUpdateRequest body =
+ new GovernanceControlDetectionUpdateRequest()
+ .data(
+ new GovernanceControlDetectionUpdateData()
+ .attributes(
+ new GovernanceControlDetectionUpdateAttributes()
+ .assignedTeam("platform-security")
+ .assignedTo("11111111-2222-3333-4444-555555555555")
+ .mitigateAfter(OffsetDateTime.parse("2024-03-15T00:00:00Z"))
+ .state(GovernanceControlDetectionUpdateState.EXCEPTION))
+ .type(GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION));
+
+ try {
+ GovernanceControlDetectionResponse result =
+ apiInstance.updateGovernanceControlDetection(
+ "unused_api_keys", "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceControlsApi#updateGovernanceControlDetection");
+ 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/UpdateGovernanceControlNotificationSettings.java b/examples/v2/governance-controls/UpdateGovernanceControlNotificationSettings.java
new file mode 100644
index 00000000000..38ebf2c1ae7
--- /dev/null
+++ b/examples/v2/governance-controls/UpdateGovernanceControlNotificationSettings.java
@@ -0,0 +1,55 @@
+// Update governance control notification settings 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.ControlNotificationEventSetting;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsResourceType;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateAttributes;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateData;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateRequest;
+import com.datadog.api.client.v2.model.ControlNotificationTarget;
+import com.datadog.api.client.v2.model.ControlNotificationTargetType;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled(
+ "v2.updateGovernanceControlNotificationSettings", true);
+ GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+
+ ControlNotificationSettingsUpdateRequest body =
+ new ControlNotificationSettingsUpdateRequest()
+ .data(
+ new ControlNotificationSettingsUpdateData()
+ .attributes(
+ new ControlNotificationSettingsUpdateAttributes()
+ .eventSettings(
+ Collections.singletonList(
+ new ControlNotificationEventSetting()
+ .enabled(true)
+ .eventType("new_detection")
+ .targets(
+ Collections.singletonList(
+ new ControlNotificationTarget()
+ .handle("#governance-alerts")
+ .type(ControlNotificationTargetType.SLACK))))))
+ .type(ControlNotificationSettingsResourceType.CONTROL_NOTIFICATION_SETTINGS));
+
+ try {
+ ControlNotificationSettingsResponse result =
+ apiInstance.updateGovernanceControlNotificationSettings("unused_api_keys", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " GovernanceControlsApi#updateGovernanceControlNotificationSettings");
+ 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-settings/GetGovernanceConfig.java b/examples/v2/governance-settings/GetGovernanceConfig.java
new file mode 100644
index 00000000000..c41c0ce346e
--- /dev/null
+++ b/examples/v2/governance-settings/GetGovernanceConfig.java
@@ -0,0 +1,25 @@
+// Get the governance console configuration returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceSettingsApi;
+import com.datadog.api.client.v2.model.GovernanceConfigResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceConfig", true);
+ GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);
+
+ try {
+ GovernanceConfigResponse result = apiInstance.getGovernanceConfig();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceSettingsApi#getGovernanceConfig");
+ 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-settings/GetGovernanceNotificationSettings.java b/examples/v2/governance-settings/GetGovernanceNotificationSettings.java
new file mode 100644
index 00000000000..c79dde82dc1
--- /dev/null
+++ b/examples/v2/governance-settings/GetGovernanceNotificationSettings.java
@@ -0,0 +1,27 @@
+// Get governance notification settings returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceSettingsApi;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceNotificationSettings", true);
+ GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);
+
+ try {
+ GovernanceNotificationSettingsResponse result =
+ apiInstance.getGovernanceNotificationSettings();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceSettingsApi#getGovernanceNotificationSettings");
+ 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-settings/ListGovernanceLimits.java b/examples/v2/governance-settings/ListGovernanceLimits.java
new file mode 100644
index 00000000000..f814a6873b2
--- /dev/null
+++ b/examples/v2/governance-settings/ListGovernanceLimits.java
@@ -0,0 +1,25 @@
+// List governance limits returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceSettingsApi;
+import com.datadog.api.client.v2.model.GovernanceLimitsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listGovernanceLimits", true);
+ GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);
+
+ try {
+ GovernanceLimitsResponse result = apiInstance.listGovernanceLimits();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceSettingsApi#listGovernanceLimits");
+ 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-settings/ListGovernanceResourceLimits.java b/examples/v2/governance-settings/ListGovernanceResourceLimits.java
new file mode 100644
index 00000000000..98f74e352ba
--- /dev/null
+++ b/examples/v2/governance-settings/ListGovernanceResourceLimits.java
@@ -0,0 +1,26 @@
+// List governance resource limits returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceSettingsApi;
+import com.datadog.api.client.v2.model.GovernanceResourceLimitsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listGovernanceResourceLimits", true);
+ GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);
+
+ try {
+ GovernanceResourceLimitsResponse result = apiInstance.listGovernanceResourceLimits();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceSettingsApi#listGovernanceResourceLimits");
+ 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-settings/UpdateGovernanceNotificationSettings.java b/examples/v2/governance-settings/UpdateGovernanceNotificationSettings.java
new file mode 100644
index 00000000000..0f7d237149f
--- /dev/null
+++ b/examples/v2/governance-settings/UpdateGovernanceNotificationSettings.java
@@ -0,0 +1,42 @@
+// Update governance notification settings returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceSettingsApi;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResourceType;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateAttributes;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateData;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateRequest;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateGovernanceNotificationSettings", true);
+ GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);
+
+ GovernanceNotificationSettingsUpdateRequest body =
+ new GovernanceNotificationSettingsUpdateRequest()
+ .data(
+ new GovernanceNotificationSettingsUpdateData()
+ .attributes(
+ new GovernanceNotificationSettingsUpdateAttributes()
+ .assignmentNotificationsEnabled(true))
+ .type(
+ GovernanceNotificationSettingsResourceType
+ .GOVERNANCE_NOTIFICATION_SETTINGS));
+
+ try {
+ GovernanceNotificationSettingsResponse result =
+ apiInstance.updateGovernanceNotificationSettings(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceSettingsApi#updateGovernanceNotificationSettings");
+ 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 bd9e92793d5..51c747934c6 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -1054,9 +1054,20 @@ public class ApiClient {
put("v2.upsertAndPublishFormVersion", false);
put("v2.upsertFormVersion", false);
put("v2.updateOrgSamlConfigurations", false);
+ put("v2.getGovernanceConfig", false);
+ put("v2.getGovernanceNotificationSettings", false);
+ put("v2.listGovernanceLimits", false);
+ put("v2.listGovernanceResourceLimits", false);
+ put("v2.updateGovernanceNotificationSettings", false);
+ put("v2.createGovernanceMitigation", false);
put("v2.getGovernanceControl", false);
+ put("v2.getGovernanceControlDetection", false);
+ put("v2.getGovernanceControlNotificationSettings", false);
+ put("v2.listGovernanceControlDetections", false);
put("v2.listGovernanceControls", false);
put("v2.updateGovernanceControl", false);
+ put("v2.updateGovernanceControlDetection", false);
+ put("v2.updateGovernanceControlNotificationSettings", 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
index 57c380e4d3b..e86f03041f4 100644
--- a/src/main/java/com/datadog/api/client/v2/api/GovernanceControlsApi.java
+++ b/src/main/java/com/datadog/api/client/v2/api/GovernanceControlsApi.java
@@ -4,13 +4,20 @@
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.ControlNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionsResponse;
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 com.datadog.api.client.v2.model.GovernanceMitigationRequest;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@@ -45,6 +52,157 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /**
+ * Mitigate governance detections.
+ *
+ *
See {@link #createGovernanceMitigationWithHttpInfo}.
+ *
+ * @param body (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void createGovernanceMitigation(GovernanceMitigationRequest body) throws ApiException {
+ createGovernanceMitigationWithHttpInfo(body);
+ }
+
+ /**
+ * Mitigate governance detections.
+ *
+ *
See {@link #createGovernanceMitigationWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture createGovernanceMitigationAsync(GovernanceMitigationRequest body) {
+ return createGovernanceMitigationWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Apply a mitigation to a set of governance detections of a given detection type. When the
+ * mitigation type is omitted, the control's configured mitigation is used. The request is
+ * accepted for asynchronous processing.
+ *
+ * @param body (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 202 | Accepted | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createGovernanceMitigationWithHttpInfo(GovernanceMitigationRequest body)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "createGovernanceMitigation";
+ 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 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createGovernanceMitigation");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/mitigate";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.createGovernanceMitigation",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Mitigate governance detections.
+ *
+ * See {@link #createGovernanceMitigationWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> createGovernanceMitigationWithHttpInfoAsync(
+ GovernanceMitigationRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "createGovernanceMitigation";
+ 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 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling createGovernanceMitigation"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/mitigate";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.createGovernanceMitigation",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
/**
* Get a governance control.
*
@@ -129,7 +287,7 @@ public ApiResponse getGovernanceControlWithHttpInfo(
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"GET",
builder,
@@ -191,7 +349,7 @@ public ApiResponse getGovernanceControlWithHttpInfo(
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture> result = new CompletableFuture<>();
result.completeExceptionally(ex);
@@ -209,26 +367,34 @@ public ApiResponse getGovernanceControlWithHttpInfo(
}
/**
- * List governance controls.
+ * Get a governance control detection.
*
- * See {@link #listGovernanceControlsWithHttpInfo}.
+ *
See {@link #getGovernanceControlDetectionWithHttpInfo}.
*
- * @return GovernanceControlsResponse
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return GovernanceControlDetectionResponse
* @throws ApiException if fails to make API call
*/
- public GovernanceControlsResponse listGovernanceControls() throws ApiException {
- return listGovernanceControlsWithHttpInfo().getData();
+ public GovernanceControlDetectionResponse getGovernanceControlDetection(
+ String detectionType, String detectionId) throws ApiException {
+ return getGovernanceControlDetectionWithHttpInfo(detectionType, detectionId).getData();
}
/**
- * List governance controls.
+ * Get a governance control detection.
*
- *
See {@link #listGovernanceControlsWithHttpInfoAsync}.
+ *
See {@link #getGovernanceControlDetectionWithHttpInfoAsync}.
*
- * @return CompletableFuture<GovernanceControlsResponse>
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return CompletableFuture<GovernanceControlDetectionResponse>
*/
- public CompletableFuture listGovernanceControlsAsync() {
- return listGovernanceControlsWithHttpInfoAsync()
+ public CompletableFuture getGovernanceControlDetectionAsync(
+ String detectionType, String detectionId) {
+ return getGovernanceControlDetectionWithHttpInfoAsync(detectionType, detectionId)
.thenApply(
response -> {
return response.getData();
@@ -236,11 +402,12 @@ public CompletableFuture listGovernanceControlsAsync
}
/**
- * 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.
+ * Retrieve a single detection produced by the governance control with the given detection type.
*
- * @return ApiResponse<GovernanceControlsResponse>
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return ApiResponse<GovernanceControlDetectionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*
@@ -250,33 +417,55 @@ public CompletableFuture listGovernanceControlsAsync
* | 400 | Bad Request | - |
* | 401 | Unauthorized | - |
* | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
* | 429 | Too many requests | - |
*
*/
- public ApiResponse listGovernanceControlsWithHttpInfo()
- throws ApiException {
+ public ApiResponse getGovernanceControlDetectionWithHttpInfo(
+ String detectionType, String detectionId) throws ApiException {
// Check if unstable operation is enabled
- String operationId = "listGovernanceControls";
+ String operationId = "getGovernanceControlDetection";
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"
+ + " getGovernanceControlDetection");
+ }
+
+ // verify the required parameter 'detectionId' is set
+ if (detectionId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'detectionId' when calling"
+ + " getGovernanceControlDetection");
+ }
// create path and map variables
- String localVarPath = "/api/v2/governance/control";
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections/{detection_id}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()))
+ .replaceAll(
+ "\\{" + "detection_id" + "\\}", apiClient.escapeString(detectionId.toString()));
Map localVarHeaderParams = new HashMap();
Invocation.Builder builder =
apiClient.createBuilder(
- "v2.GovernanceControlsApi.listGovernanceControls",
+ "v2.GovernanceControlsApi.getGovernanceControlDetection",
localVarPath,
new ArrayList(),
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"GET",
builder,
@@ -285,31 +474,64 @@ public ApiResponse listGovernanceControlsWithHttpInf
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
}
/**
- * List governance controls.
+ * Get a governance control detection.
*
- * See {@link #listGovernanceControlsWithHttpInfo}.
+ *
See {@link #getGovernanceControlDetectionWithHttpInfo}.
*
- * @return CompletableFuture<ApiResponse<GovernanceControlsResponse>>
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return CompletableFuture<ApiResponse<GovernanceControlDetectionResponse>>
*/
- public CompletableFuture>
- listGovernanceControlsWithHttpInfoAsync() {
+ public CompletableFuture>
+ getGovernanceControlDetectionWithHttpInfoAsync(String detectionType, String detectionId) {
// Check if unstable operation is enabled
- String operationId = "listGovernanceControls";
+ String operationId = "getGovernanceControlDetection";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
- CompletableFuture> result = new CompletableFuture<>();
+ 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"
+ + " getGovernanceControlDetection"));
+ return result;
+ }
+
+ // verify the required parameter 'detectionId' is set
+ if (detectionId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionId' when calling"
+ + " getGovernanceControlDetection"));
+ return result;
+ }
// create path and map variables
- String localVarPath = "/api/v2/governance/control";
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections/{detection_id}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()))
+ .replaceAll(
+ "\\{" + "detection_id" + "\\}", apiClient.escapeString(detectionId.toString()));
Map localVarHeaderParams = new HashMap();
@@ -317,15 +539,16 @@ public ApiResponse listGovernanceControlsWithHttpInf
try {
builder =
apiClient.createBuilder(
- "v2.GovernanceControlsApi.listGovernanceControls",
+ "v2.GovernanceControlsApi.getGovernanceControlDetection",
localVarPath,
new ArrayList(),
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
- CompletableFuture> result = new CompletableFuture<>();
+ CompletableFuture> result =
+ new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
@@ -337,38 +560,36 @@ public ApiResponse listGovernanceControlsWithHttpInf
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
}
/**
- * Update a governance control.
+ * Get governance control notification settings.
*
- * See {@link #updateGovernanceControlWithHttpInfo}.
+ *
See {@link #getGovernanceControlNotificationSettingsWithHttpInfo}.
*
- * @param detectionType The detection type that identifies the control, for example
+ * @param detectionType The detection type that identifies the control; for example,
* unused_api_keys. (required)
- * @param body (required)
- * @return GovernanceControlResponse
+ * @return ControlNotificationSettingsResponse
* @throws ApiException if fails to make API call
*/
- public GovernanceControlResponse updateGovernanceControl(
- String detectionType, GovernanceControlUpdateRequest body) throws ApiException {
- return updateGovernanceControlWithHttpInfo(detectionType, body).getData();
+ public ControlNotificationSettingsResponse getGovernanceControlNotificationSettings(
+ String detectionType) throws ApiException {
+ return getGovernanceControlNotificationSettingsWithHttpInfo(detectionType).getData();
}
/**
- * Update a governance control.
+ * Get governance control notification settings.
*
- * See {@link #updateGovernanceControlWithHttpInfoAsync}.
+ *
See {@link #getGovernanceControlNotificationSettingsWithHttpInfoAsync}.
*
- * @param detectionType The detection type that identifies the control, for example
+ * @param detectionType The detection type that identifies the control; for example,
* unused_api_keys. (required)
- * @param body (required)
- * @return CompletableFuture<GovernanceControlResponse>
+ * @return CompletableFuture<ControlNotificationSettingsResponse>
*/
- public CompletableFuture updateGovernanceControlAsync(
- String detectionType, GovernanceControlUpdateRequest body) {
- return updateGovernanceControlWithHttpInfoAsync(detectionType, body)
+ public CompletableFuture
+ getGovernanceControlNotificationSettingsAsync(String detectionType) {
+ return getGovernanceControlNotificationSettingsWithHttpInfoAsync(detectionType)
.thenApply(
response -> {
return response.getData();
@@ -376,14 +597,13 @@ public CompletableFuture updateGovernanceControlAsync
}
/**
- * 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.
+ * Retrieve the notification settings for the governance control with the given detection type,
+ * including, for each supported event type, whether notifications are enabled and which
+ * destinations receive them.
*
- * @param detectionType The detection type that identifies the control, for example
+ * @param detectionType The detection type that identifies the control; for example,
* unused_api_keys. (required)
- * @param body (required)
- * @return ApiResponse<GovernanceControlResponse>
+ * @return ApiResponse<ControlNotificationSettingsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*
@@ -393,36 +613,31 @@ public CompletableFuture updateGovernanceControlAsync
* | 400 | Bad Request | - |
* | 401 | Unauthorized | - |
* | 403 | Forbidden | - |
- * | 404 | Not Found | - |
* | 429 | Too many requests | - |
*
*/
- public ApiResponse updateGovernanceControlWithHttpInfo(
- String detectionType, GovernanceControlUpdateRequest body) throws ApiException {
+ public ApiResponse
+ getGovernanceControlNotificationSettingsWithHttpInfo(String detectionType)
+ throws ApiException {
// Check if unstable operation is enabled
- String operationId = "updateGovernanceControl";
+ String operationId = "getGovernanceControlNotificationSettings";
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;
+ Object localVarPostBody = null;
// 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");
+ "Missing the required parameter 'detectionType' when calling"
+ + " getGovernanceControlNotificationSettings");
}
// create path and map variables
String localVarPath =
- "/api/v2/governance/control/{detection_type}"
+ "/api/v2/governance/control/{detection_type}/notification_settings"
.replaceAll(
"\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
@@ -430,71 +645,62 @@ public ApiResponse updateGovernanceControlWithHttpInf
Invocation.Builder builder =
apiClient.createBuilder(
- "v2.GovernanceControlsApi.updateGovernanceControl",
+ "v2.GovernanceControlsApi.getGovernanceControlNotificationSettings",
localVarPath,
new ArrayList(),
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
- "PATCH",
+ "GET",
builder,
localVarHeaderParams,
- new String[] {"application/json"},
+ new String[] {},
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
}
/**
- * Update a governance control.
+ * Get governance control notification settings.
*
- * See {@link #updateGovernanceControlWithHttpInfo}.
+ *
See {@link #getGovernanceControlNotificationSettingsWithHttpInfo}.
*
- * @param detectionType The detection type that identifies the control, for example
+ * @param detectionType The detection type that identifies the control; for example,
* unused_api_keys. (required)
- * @param body (required)
- * @return CompletableFuture<ApiResponse<GovernanceControlResponse>>
+ * @return CompletableFuture<ApiResponse<ControlNotificationSettingsResponse>>
*/
- public CompletableFuture>
- updateGovernanceControlWithHttpInfoAsync(
- String detectionType, GovernanceControlUpdateRequest body) {
+ public CompletableFuture>
+ getGovernanceControlNotificationSettingsWithHttpInfoAsync(String detectionType) {
// Check if unstable operation is enabled
- String operationId = "updateGovernanceControl";
+ String operationId = "getGovernanceControlNotificationSettings";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
- CompletableFuture> result = new CompletableFuture<>();
+ CompletableFuture> result =
+ new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
- Object localVarPostBody = body;
+ Object localVarPostBody = null;
// verify the required parameter 'detectionType' is set
if (detectionType == null) {
- CompletableFuture> result = new CompletableFuture<>();
+ 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"));
+ + " getGovernanceControlNotificationSettings"));
return result;
}
// create path and map variables
String localVarPath =
- "/api/v2/governance/control/{detection_type}"
+ "/api/v2/governance/control/{detection_type}/notification_settings"
.replaceAll(
"\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
@@ -504,26 +710,1075 @@ public ApiResponse updateGovernanceControlWithHttpInf
try {
builder =
apiClient.createBuilder(
- "v2.GovernanceControlsApi.updateGovernanceControl",
+ "v2.GovernanceControlsApi.getGovernanceControlNotificationSettings",
localVarPath,
new ArrayList(),
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
- CompletableFuture> result = new CompletableFuture<>();
+ CompletableFuture> result =
+ new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
- "PATCH",
+ "GET",
builder,
localVarHeaderParams,
- new String[] {"application/json"},
+ new String[] {},
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listGovernanceControlDetections. */
+ public static class ListGovernanceControlDetectionsOptionalParameters {
+ private String filterState;
+ private String filterQuery;
+ private String sort;
+ private Long pageNumber;
+ private Long pageSize;
+
+ /**
+ * Set filterState.
+ *
+ * @param filterState Restrict the results to detections in the given state. (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters filterState(String filterState) {
+ this.filterState = filterState;
+ return this;
+ }
+
+ /**
+ * Set filterQuery.
+ *
+ * @param filterQuery Restrict the results to detections matching the given free-text query.
+ * (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters filterQuery(String filterQuery) {
+ this.filterQuery = filterQuery;
+ return this;
+ }
+
+ /**
+ * Set sort.
+ *
+ * @param sort The attribute to sort detections by. Prefix with - for descending
+ * order. (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters sort(String sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ /**
+ * Set pageNumber.
+ *
+ * @param pageNumber The zero-based index of the page to return; the first page is 0. (optional,
+ * default to 0)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters pageNumber(Long pageNumber) {
+ this.pageNumber = pageNumber;
+ return this;
+ }
+
+ /**
+ * Set pageSize.
+ *
+ * @param pageSize The number of detections to return per page. (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters pageSize(Long pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+ }
+
+ /**
+ * List governance control detections.
+ *
+ * See {@link #listGovernanceControlDetectionsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return GovernanceControlDetectionsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlDetectionsResponse listGovernanceControlDetections(String detectionType)
+ throws ApiException {
+ return listGovernanceControlDetectionsWithHttpInfo(
+ detectionType, new ListGovernanceControlDetectionsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * List governance control detections.
+ *
+ *
See {@link #listGovernanceControlDetectionsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return CompletableFuture<GovernanceControlDetectionsResponse>
+ */
+ public CompletableFuture
+ listGovernanceControlDetectionsAsync(String detectionType) {
+ return listGovernanceControlDetectionsWithHttpInfoAsync(
+ detectionType, new ListGovernanceControlDetectionsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List governance control detections.
+ *
+ * See {@link #listGovernanceControlDetectionsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return GovernanceControlDetectionsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlDetectionsResponse listGovernanceControlDetections(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters)
+ throws ApiException {
+ return listGovernanceControlDetectionsWithHttpInfo(detectionType, parameters).getData();
+ }
+
+ /**
+ * List governance control detections.
+ *
+ *
See {@link #listGovernanceControlDetectionsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<GovernanceControlDetectionsResponse>
+ */
+ public CompletableFuture
+ listGovernanceControlDetectionsAsync(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters) {
+ return listGovernanceControlDetectionsWithHttpInfoAsync(detectionType, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the detections produced by the governance control with the given detection type.
+ * Results can be filtered by state and free-text query, sorted, and paginated.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<GovernanceControlDetectionsResponse>
+ * @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
+ listGovernanceControlDetectionsWithHttpInfo(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceControlDetections";
+ 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"
+ + " listGovernanceControlDetections");
+ }
+ String filterState = parameters.filterState;
+ String filterQuery = parameters.filterQuery;
+ String sort = parameters.sort;
+ Long pageNumber = parameters.pageNumber;
+ Long pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[state]", filterState));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.listGovernanceControlDetections",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List governance control detections.
+ *
+ * See {@link #listGovernanceControlDetectionsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<GovernanceControlDetectionsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceControlDetectionsWithHttpInfoAsync(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceControlDetections";
+ 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"
+ + " listGovernanceControlDetections"));
+ return result;
+ }
+ String filterState = parameters.filterState;
+ String filterQuery = parameters.filterQuery;
+ String sort = parameters.sort;
+ Long pageNumber = parameters.pageNumber;
+ Long pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[state]", filterState));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.listGovernanceControlDetections",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } 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", "AuthZ"});
+ 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", "AuthZ"});
+ } 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", "AuthZ"});
+ 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", "AuthZ"});
+ } 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() {});
+ }
+
+ /**
+ * Update a governance control detection.
+ *
+ * See {@link #updateGovernanceControlDetectionWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @param body (required)
+ * @return GovernanceControlDetectionResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlDetectionResponse updateGovernanceControlDetection(
+ String detectionType, String detectionId, GovernanceControlDetectionUpdateRequest body)
+ throws ApiException {
+ return updateGovernanceControlDetectionWithHttpInfo(detectionType, detectionId, body).getData();
+ }
+
+ /**
+ * Update a governance control detection.
+ *
+ *
See {@link #updateGovernanceControlDetectionWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @param body (required)
+ * @return CompletableFuture<GovernanceControlDetectionResponse>
+ */
+ public CompletableFuture
+ updateGovernanceControlDetectionAsync(
+ String detectionType, String detectionId, GovernanceControlDetectionUpdateRequest body) {
+ return updateGovernanceControlDetectionWithHttpInfoAsync(detectionType, detectionId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update a detection produced by the governance control with the given detection type. Only the
+ * attributes present in the request are modified, allowing a detection to be acknowledged as an
+ * exception, reopened, reassigned, or deferred for mitigation.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @param body (required)
+ * @return ApiResponse<GovernanceControlDetectionResponse>
+ * @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
+ updateGovernanceControlDetectionWithHttpInfo(
+ String detectionType, String detectionId, GovernanceControlDetectionUpdateRequest body)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControlDetection";
+ 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"
+ + " updateGovernanceControlDetection");
+ }
+
+ // verify the required parameter 'detectionId' is set
+ if (detectionId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'detectionId' when calling"
+ + " updateGovernanceControlDetection");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling updateGovernanceControlDetection");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections/{detection_id}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()))
+ .replaceAll(
+ "\\{" + "detection_id" + "\\}", apiClient.escapeString(detectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.updateGovernanceControlDetection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update a governance control detection.
+ *
+ * See {@link #updateGovernanceControlDetectionWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param detectionId The unique identifier of the detection. (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<GovernanceControlDetectionResponse>>
+ */
+ public CompletableFuture>
+ updateGovernanceControlDetectionWithHttpInfoAsync(
+ String detectionType, String detectionId, GovernanceControlDetectionUpdateRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControlDetection";
+ 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"
+ + " updateGovernanceControlDetection"));
+ return result;
+ }
+
+ // verify the required parameter 'detectionId' is set
+ if (detectionId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionId' when calling"
+ + " updateGovernanceControlDetection"));
+ 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"
+ + " updateGovernanceControlDetection"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections/{detection_id}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()))
+ .replaceAll(
+ "\\{" + "detection_id" + "\\}", apiClient.escapeString(detectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.updateGovernanceControlDetection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } 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() {});
+ }
+
+ /**
+ * Update governance control notification settings.
+ *
+ * See {@link #updateGovernanceControlNotificationSettingsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return ControlNotificationSettingsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ControlNotificationSettingsResponse updateGovernanceControlNotificationSettings(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) throws ApiException {
+ return updateGovernanceControlNotificationSettingsWithHttpInfo(detectionType, body).getData();
+ }
+
+ /**
+ * Update governance control notification settings.
+ *
+ *
See {@link #updateGovernanceControlNotificationSettingsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return CompletableFuture<ControlNotificationSettingsResponse>
+ */
+ public CompletableFuture
+ updateGovernanceControlNotificationSettingsAsync(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) {
+ return updateGovernanceControlNotificationSettingsWithHttpInfoAsync(detectionType, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Replace the notification settings for the governance control with the given detection type,
+ * setting, for each supported event type, whether notifications are enabled and which
+ * destinations receive them.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return ApiResponse<ControlNotificationSettingsResponse>
+ * @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
+ updateGovernanceControlNotificationSettingsWithHttpInfo(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControlNotificationSettings";
+ 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"
+ + " updateGovernanceControlNotificationSettings");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " updateGovernanceControlNotificationSettings");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/notification_settings"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.updateGovernanceControlNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update governance control notification settings.
+ *
+ * See {@link #updateGovernanceControlNotificationSettingsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<ControlNotificationSettingsResponse>>
+ */
+ public CompletableFuture>
+ updateGovernanceControlNotificationSettingsWithHttpInfoAsync(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControlNotificationSettings";
+ 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"
+ + " updateGovernanceControlNotificationSettings"));
+ 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"
+ + " updateGovernanceControlNotificationSettings"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/notification_settings"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceControlsApi.updateGovernanceControlNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
}
}
diff --git a/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java b/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java
index cfc8d9c0898..bdf55724510 100644
--- a/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java
+++ b/src/main/java/com/datadog/api/client/v2/api/GovernanceInsightsApi.java
@@ -199,7 +199,7 @@ public ApiResponse listGovernanceInsightsWithHttpInf
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"GET",
builder,
@@ -256,7 +256,7 @@ public ApiResponse listGovernanceInsightsWithHttpInf
localVarHeaderParams,
new HashMap(),
new String[] {"application/json"},
- new String[] {"apiKeyAuth", "appKeyAuth"});
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture> result = new CompletableFuture<>();
result.completeExceptionally(ex);
diff --git a/src/main/java/com/datadog/api/client/v2/api/GovernanceSettingsApi.java b/src/main/java/com/datadog/api/client/v2/api/GovernanceSettingsApi.java
new file mode 100644
index 00000000000..c0164c7a713
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/GovernanceSettingsApi.java
@@ -0,0 +1,743 @@
+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.GovernanceConfigResponse;
+import com.datadog.api.client.v2.model.GovernanceLimitsResponse;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceResourceLimitsResponse;
+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 GovernanceSettingsApi {
+ private ApiClient apiClient;
+
+ public GovernanceSettingsApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public GovernanceSettingsApi(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 the governance console configuration.
+ *
+ * See {@link #getGovernanceConfigWithHttpInfo}.
+ *
+ * @return GovernanceConfigResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceConfigResponse getGovernanceConfig() throws ApiException {
+ return getGovernanceConfigWithHttpInfo().getData();
+ }
+
+ /**
+ * Get the governance console configuration.
+ *
+ *
See {@link #getGovernanceConfigWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceConfigResponse>
+ */
+ public CompletableFuture getGovernanceConfigAsync() {
+ return getGovernanceConfigWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the Governance Console configuration for the organization, including whether the
+ * Console is enabled, whether assignment notifications are enabled, and whether usage attribution
+ * is configured.
+ *
+ * @return ApiResponse<GovernanceConfigResponse>
+ * @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 getGovernanceConfigWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceConfig";
+ 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/config";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceSettingsApi.getGovernanceConfig",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get the governance console configuration.
+ *
+ * See {@link #getGovernanceConfigWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceConfigResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceConfigWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceConfig";
+ 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/config";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceSettingsApi.getGovernanceConfig",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } 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() {});
+ }
+
+ /**
+ * Get governance notification settings.
+ *
+ * See {@link #getGovernanceNotificationSettingsWithHttpInfo}.
+ *
+ * @return GovernanceNotificationSettingsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceNotificationSettingsResponse getGovernanceNotificationSettings()
+ throws ApiException {
+ return getGovernanceNotificationSettingsWithHttpInfo().getData();
+ }
+
+ /**
+ * Get governance notification settings.
+ *
+ *
See {@link #getGovernanceNotificationSettingsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceNotificationSettingsResponse>
+ */
+ public CompletableFuture
+ getGovernanceNotificationSettingsAsync() {
+ return getGovernanceNotificationSettingsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the organization-wide governance notification settings, including whether users are
+ * notified when detections are assigned to them.
+ *
+ * @return ApiResponse<GovernanceNotificationSettingsResponse>
+ * @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
+ getGovernanceNotificationSettingsWithHttpInfo() throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceNotificationSettings";
+ 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/notification_settings";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceSettingsApi.getGovernanceNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get governance notification settings.
+ *
+ * See {@link #getGovernanceNotificationSettingsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceNotificationSettingsResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceNotificationSettingsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceNotificationSettings";
+ 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/notification_settings";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceSettingsApi.getGovernanceNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } 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 limits.
+ *
+ * See {@link #listGovernanceLimitsWithHttpInfo}.
+ *
+ * @return GovernanceLimitsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceLimitsResponse listGovernanceLimits() throws ApiException {
+ return listGovernanceLimitsWithHttpInfo().getData();
+ }
+
+ /**
+ * List governance limits.
+ *
+ *
See {@link #listGovernanceLimitsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceLimitsResponse>
+ */
+ public CompletableFuture listGovernanceLimitsAsync() {
+ return listGovernanceLimitsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the list of usage limits tracked for the organization in the Governance Console. Each
+ * limit reports the query used to compute current usage, the unit and time range it is measured
+ * over, and its current usage status.
+ *
+ * @return ApiResponse<GovernanceLimitsResponse>
+ * @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 listGovernanceLimitsWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceLimits";
+ 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/limits";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceSettingsApi.listGovernanceLimits",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List governance limits.
+ *
+ * See {@link #listGovernanceLimitsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceLimitsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceLimitsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceLimits";
+ 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/limits";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceSettingsApi.listGovernanceLimits",
+ localVarPath,
+ new ArrayList