diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fd30acae59..74d20bb658 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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index e56164d879..c4d3a20e7c 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -417,6 +417,13 @@ datadog\_api\_client.v2.api.governance\_insights\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.governance\_settings\_api module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.api.governance_settings_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.high\_availability\_multi\_region\_api module ------------------------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index fb502da668..da86bec8fa 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -8026,6 +8026,76 @@ datadog\_api\_client.v2.model.content\_encoding module :members: :show-inheritance: +datadog\_api\_client.v2.model.control\_notification\_event\_setting module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.control_notification_event_setting + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_resource\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_response module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_update\_attributes module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_update\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_settings\_update\_request module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.control_notification_settings_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_target module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.control_notification_target + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.control\_notification\_target\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.control_notification_target_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.convert\_job\_results\_to\_signals\_attributes module ----------------------------------------------------------------------------------- @@ -17014,6 +17084,34 @@ datadog\_api\_client.v2.model.governance\_best\_practice\_definition module :members: :show-inheritance: +datadog\_api\_client.v2.model.governance\_config\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_config_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_config\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_config_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_config\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_config_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_console\_config\_resource\_type module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_console_config_resource_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.governance\_control\_attributes module -------------------------------------------------------------------- @@ -17028,6 +17126,83 @@ datadog\_api\_client.v2.model.governance\_control\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.governance\_control\_detection\_assignment\_source module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_assignment_source + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_attributes module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_resource\_type module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_response module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_state module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_state + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_update\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_update\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_update\_request module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detection\_update\_state module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_control_detection_update_state + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_control\_detections\_response module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.governance_control_detections_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.governance\_control\_mitigation\_definition module -------------------------------------------------------------------------------- @@ -17182,6 +17357,146 @@ datadog\_api\_client.v2.model.governance\_insights\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.governance\_limit\_attributes module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.governance_limit_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_limit\_data module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.governance_limit_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_limit\_query module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_limit_query + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_limit\_query\_config module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_limit_query_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_limit\_resource\_type module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_limit_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_limits\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_limits_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_mitigation\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_mitigation_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_mitigation\_request\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_mitigation_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_mitigation\_request\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_mitigation_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_data module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_resource\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_response module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_update\_attributes module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_update\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_notification\_settings\_update\_request module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_notification_settings_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_resource\_limit\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_resource_limit_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_resource\_limit\_data module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_resource_limit_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_resource\_limit\_resource\_type module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_resource_limit_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.governance\_resource\_limits\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.governance_resource_limits_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.grey\_noise\_api\_key module ---------------------------------------------------------- diff --git a/examples/v2/governance-controls/CreateGovernanceMitigation.py b/examples/v2/governance-controls/CreateGovernanceMitigation.py new file mode 100644 index 0000000000..1087ba8b76 --- /dev/null +++ b/examples/v2/governance-controls/CreateGovernanceMitigation.py @@ -0,0 +1,31 @@ +""" +Mitigate governance detections returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi +from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, +) +from datadog_api_client.v2.model.governance_mitigation_request import GovernanceMitigationRequest +from datadog_api_client.v2.model.governance_mitigation_request_attributes import GovernanceMitigationRequestAttributes +from datadog_api_client.v2.model.governance_mitigation_request_data import GovernanceMitigationRequestData + +body = GovernanceMitigationRequest( + data=GovernanceMitigationRequestData( + attributes=GovernanceMitigationRequestAttributes( + detection_ids=[ + "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d", + ], + detection_type="unused_api_keys", + mitigation_type="revoke_api_key", + ), + type=GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_governance_mitigation"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceControlsApi(api_client) + api_instance.create_governance_mitigation(body=body) diff --git a/examples/v2/governance-controls/GetGovernanceControlDetection.py b/examples/v2/governance-controls/GetGovernanceControlDetection.py new file mode 100644 index 0000000000..d53076f68a --- /dev/null +++ b/examples/v2/governance-controls/GetGovernanceControlDetection.py @@ -0,0 +1,17 @@ +""" +Get a governance control detection returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi + +configuration = Configuration() +configuration.unstable_operations["get_governance_control_detection"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceControlsApi(api_client) + response = api_instance.get_governance_control_detection( + detection_type="detection_type", + detection_id="detection_id", + ) + + print(response) diff --git a/examples/v2/governance-controls/GetGovernanceControlNotificationSettings.py b/examples/v2/governance-controls/GetGovernanceControlNotificationSettings.py new file mode 100644 index 0000000000..43eeab2f15 --- /dev/null +++ b/examples/v2/governance-controls/GetGovernanceControlNotificationSettings.py @@ -0,0 +1,16 @@ +""" +Get governance control notification settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi + +configuration = Configuration() +configuration.unstable_operations["get_governance_control_notification_settings"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceControlsApi(api_client) + response = api_instance.get_governance_control_notification_settings( + detection_type="detection_type", + ) + + print(response) diff --git a/examples/v2/governance-controls/ListGovernanceControlDetections.py b/examples/v2/governance-controls/ListGovernanceControlDetections.py new file mode 100644 index 0000000000..c33a28d503 --- /dev/null +++ b/examples/v2/governance-controls/ListGovernanceControlDetections.py @@ -0,0 +1,16 @@ +""" +List governance control detections returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi + +configuration = Configuration() +configuration.unstable_operations["list_governance_control_detections"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceControlsApi(api_client) + response = api_instance.list_governance_control_detections( + detection_type="detection_type", + ) + + print(response) diff --git a/examples/v2/governance-controls/UpdateGovernanceControlDetection.py b/examples/v2/governance-controls/UpdateGovernanceControlDetection.py new file mode 100644 index 0000000000..c8afd22217 --- /dev/null +++ b/examples/v2/governance-controls/UpdateGovernanceControlDetection.py @@ -0,0 +1,41 @@ +""" +Update a governance control detection returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi +from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, +) +from datadog_api_client.v2.model.governance_control_detection_update_attributes import ( + GovernanceControlDetectionUpdateAttributes, +) +from datadog_api_client.v2.model.governance_control_detection_update_data import GovernanceControlDetectionUpdateData +from datadog_api_client.v2.model.governance_control_detection_update_request import ( + GovernanceControlDetectionUpdateRequest, +) +from datadog_api_client.v2.model.governance_control_detection_update_state import GovernanceControlDetectionUpdateState +from datetime import datetime +from dateutil.tz import tzutc + +body = GovernanceControlDetectionUpdateRequest( + data=GovernanceControlDetectionUpdateData( + attributes=GovernanceControlDetectionUpdateAttributes( + assigned_team="platform-security", + assigned_to="11111111-2222-3333-4444-555555555555", + mitigate_after=datetime(2024, 3, 15, 0, 0, tzinfo=tzutc()), + state=GovernanceControlDetectionUpdateState.EXCEPTION, + ), + type=GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_governance_control_detection"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceControlsApi(api_client) + response = api_instance.update_governance_control_detection( + detection_type="detection_type", detection_id="detection_id", body=body + ) + + print(response) diff --git a/examples/v2/governance-controls/UpdateGovernanceControlNotificationSettings.py b/examples/v2/governance-controls/UpdateGovernanceControlNotificationSettings.py new file mode 100644 index 0000000000..30a3a3b76c --- /dev/null +++ b/examples/v2/governance-controls/UpdateGovernanceControlNotificationSettings.py @@ -0,0 +1,47 @@ +""" +Update governance control notification settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi +from datadog_api_client.v2.model.control_notification_event_setting import ControlNotificationEventSetting +from datadog_api_client.v2.model.control_notification_settings_resource_type import ( + ControlNotificationSettingsResourceType, +) +from datadog_api_client.v2.model.control_notification_settings_update_attributes import ( + ControlNotificationSettingsUpdateAttributes, +) +from datadog_api_client.v2.model.control_notification_settings_update_data import ControlNotificationSettingsUpdateData +from datadog_api_client.v2.model.control_notification_settings_update_request import ( + ControlNotificationSettingsUpdateRequest, +) +from datadog_api_client.v2.model.control_notification_target import ControlNotificationTarget +from datadog_api_client.v2.model.control_notification_target_type import ControlNotificationTargetType + +body = ControlNotificationSettingsUpdateRequest( + data=ControlNotificationSettingsUpdateData( + attributes=ControlNotificationSettingsUpdateAttributes( + event_settings=[ + ControlNotificationEventSetting( + enabled=True, + event_type="new_detection", + targets=[ + ControlNotificationTarget( + handle="#governance-alerts", + type=ControlNotificationTargetType.SLACK, + ), + ], + ), + ], + ), + type=ControlNotificationSettingsResourceType.CONTROL_NOTIFICATION_SETTINGS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_governance_control_notification_settings"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceControlsApi(api_client) + response = api_instance.update_governance_control_notification_settings(detection_type="detection_type", body=body) + + print(response) diff --git a/examples/v2/governance-settings/GetGovernanceConfig.py b/examples/v2/governance-settings/GetGovernanceConfig.py new file mode 100644 index 0000000000..a4c71c0f29 --- /dev/null +++ b/examples/v2/governance-settings/GetGovernanceConfig.py @@ -0,0 +1,14 @@ +""" +Get the governance console configuration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_settings_api import GovernanceSettingsApi + +configuration = Configuration() +configuration.unstable_operations["get_governance_config"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceSettingsApi(api_client) + response = api_instance.get_governance_config() + + print(response) diff --git a/examples/v2/governance-settings/GetGovernanceNotificationSettings.py b/examples/v2/governance-settings/GetGovernanceNotificationSettings.py new file mode 100644 index 0000000000..94d47f29b1 --- /dev/null +++ b/examples/v2/governance-settings/GetGovernanceNotificationSettings.py @@ -0,0 +1,14 @@ +""" +Get governance notification settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_settings_api import GovernanceSettingsApi + +configuration = Configuration() +configuration.unstable_operations["get_governance_notification_settings"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceSettingsApi(api_client) + response = api_instance.get_governance_notification_settings() + + print(response) diff --git a/examples/v2/governance-settings/ListGovernanceLimits.py b/examples/v2/governance-settings/ListGovernanceLimits.py new file mode 100644 index 0000000000..bc8b1d7fe6 --- /dev/null +++ b/examples/v2/governance-settings/ListGovernanceLimits.py @@ -0,0 +1,14 @@ +""" +List governance limits returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_settings_api import GovernanceSettingsApi + +configuration = Configuration() +configuration.unstable_operations["list_governance_limits"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceSettingsApi(api_client) + response = api_instance.list_governance_limits() + + print(response) diff --git a/examples/v2/governance-settings/ListGovernanceResourceLimits.py b/examples/v2/governance-settings/ListGovernanceResourceLimits.py new file mode 100644 index 0000000000..bf7064d96c --- /dev/null +++ b/examples/v2/governance-settings/ListGovernanceResourceLimits.py @@ -0,0 +1,14 @@ +""" +List governance resource limits returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_settings_api import GovernanceSettingsApi + +configuration = Configuration() +configuration.unstable_operations["list_governance_resource_limits"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceSettingsApi(api_client) + response = api_instance.list_governance_resource_limits() + + print(response) diff --git a/examples/v2/governance-settings/UpdateGovernanceNotificationSettings.py b/examples/v2/governance-settings/UpdateGovernanceNotificationSettings.py new file mode 100644 index 0000000000..f707e69f3d --- /dev/null +++ b/examples/v2/governance-settings/UpdateGovernanceNotificationSettings.py @@ -0,0 +1,35 @@ +""" +Update governance notification settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.governance_settings_api import GovernanceSettingsApi +from datadog_api_client.v2.model.governance_notification_settings_resource_type import ( + GovernanceNotificationSettingsResourceType, +) +from datadog_api_client.v2.model.governance_notification_settings_update_attributes import ( + GovernanceNotificationSettingsUpdateAttributes, +) +from datadog_api_client.v2.model.governance_notification_settings_update_data import ( + GovernanceNotificationSettingsUpdateData, +) +from datadog_api_client.v2.model.governance_notification_settings_update_request import ( + GovernanceNotificationSettingsUpdateRequest, +) + +body = GovernanceNotificationSettingsUpdateRequest( + data=GovernanceNotificationSettingsUpdateData( + attributes=GovernanceNotificationSettingsUpdateAttributes( + assignment_notifications_enabled=True, + ), + type=GovernanceNotificationSettingsResourceType.GOVERNANCE_NOTIFICATION_SETTINGS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_governance_notification_settings"] = True +with ApiClient(configuration) as api_client: + api_instance = GovernanceSettingsApi(api_client) + response = api_instance.update_governance_notification_settings(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index ef1da82442..eba22c3312 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -546,9 +546,20 @@ def __init__( "v2.upsert_and_publish_form_version": False, "v2.upsert_form_version": False, "v2.update_org_saml_configurations": False, + "v2.get_governance_config": False, + "v2.get_governance_notification_settings": False, + "v2.list_governance_limits": False, + "v2.list_governance_resource_limits": False, + "v2.update_governance_notification_settings": False, + "v2.create_governance_mitigation": False, "v2.get_governance_control": False, + "v2.get_governance_control_detection": False, + "v2.get_governance_control_notification_settings": False, + "v2.list_governance_control_detections": False, "v2.list_governance_controls": False, "v2.update_governance_control": False, + "v2.update_governance_control_detection": False, + "v2.update_governance_control_notification_settings": False, "v2.list_governance_insights": False, "v2.create_hamr_org_connection": False, "v2.get_hamr_org_connection": False, diff --git a/src/datadog_api_client/v2/api/governance_controls_api.py b/src/datadog_api_client/v2/api/governance_controls_api.py index 445f511093..2b1b080883 100644 --- a/src/datadog_api_client/v2/api/governance_controls_api.py +++ b/src/datadog_api_client/v2/api/governance_controls_api.py @@ -3,13 +3,27 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +from typing import Any, Dict, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) from datadog_api_client.v2.model.governance_controls_response import GovernanceControlsResponse from datadog_api_client.v2.model.governance_control_response import GovernanceControlResponse from datadog_api_client.v2.model.governance_control_update_request import GovernanceControlUpdateRequest +from datadog_api_client.v2.model.governance_control_detections_response import GovernanceControlDetectionsResponse +from datadog_api_client.v2.model.governance_control_detection_response import GovernanceControlDetectionResponse +from datadog_api_client.v2.model.governance_control_detection_update_request import ( + GovernanceControlDetectionUpdateRequest, +) +from datadog_api_client.v2.model.control_notification_settings_response import ControlNotificationSettingsResponse +from datadog_api_client.v2.model.control_notification_settings_update_request import ( + ControlNotificationSettingsUpdateRequest, +) +from datadog_api_client.v2.model.governance_mitigation_request import GovernanceMitigationRequest class GovernanceControlsApi: @@ -25,10 +39,30 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_governance_mitigation_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/mitigate", + "operation_id": "create_governance_mitigation", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (GovernanceMitigationRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._get_governance_control_endpoint = _Endpoint( settings={ "response_type": (GovernanceControlResponse,), - "auth": ["apiKeyAuth", "appKeyAuth"], + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/governance/control/{detection_type}", "operation_id": "get_governance_control", "http_method": "GET", @@ -48,10 +82,110 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_governance_control_detection_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceControlDetectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/control/{detection_type}/detections/{detection_id}", + "operation_id": "get_governance_control_detection", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "detection_type": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_type", + "location": "path", + }, + "detection_id": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_governance_control_notification_settings_endpoint = _Endpoint( + settings={ + "response_type": (ControlNotificationSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/control/{detection_type}/notification_settings", + "operation_id": "get_governance_control_notification_settings", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "detection_type": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_type", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_governance_control_detections_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceControlDetectionsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/control/{detection_type}/detections", + "operation_id": "list_governance_control_detections", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "detection_type": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_type", + "location": "path", + }, + "filter_state": { + "openapi_types": (str,), + "attribute": "filter[state]", + "location": "query", + }, + "filter_query": { + "openapi_types": (str,), + "attribute": "filter[query]", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_governance_controls_endpoint = _Endpoint( settings={ "response_type": (GovernanceControlsResponse,), - "auth": ["apiKeyAuth", "appKeyAuth"], + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/governance/control", "operation_id": "list_governance_controls", "http_method": "GET", @@ -67,7 +201,7 @@ def __init__(self, api_client=None): self._update_governance_control_endpoint = _Endpoint( settings={ "response_type": (GovernanceControlResponse,), - "auth": ["apiKeyAuth", "appKeyAuth"], + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/governance/control/{detection_type}", "operation_id": "update_governance_control", "http_method": "PATCH", @@ -90,6 +224,82 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_governance_control_detection_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceControlDetectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/control/{detection_type}/detections/{detection_id}", + "operation_id": "update_governance_control_detection", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "detection_type": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_type", + "location": "path", + }, + "detection_id": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (GovernanceControlDetectionUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_governance_control_notification_settings_endpoint = _Endpoint( + settings={ + "response_type": (ControlNotificationSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/control/{detection_type}/notification_settings", + "operation_id": "update_governance_control_notification_settings", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "detection_type": { + "required": True, + "openapi_types": (str,), + "attribute": "detection_type", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ControlNotificationSettingsUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_governance_mitigation( + self, + body: GovernanceMitigationRequest, + ) -> None: + """Mitigate governance detections. + + 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. + + :type body: GovernanceMitigationRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_governance_mitigation_endpoint.call_with_http_info(**kwargs) + def get_governance_control( self, detection_type: str, @@ -108,6 +318,96 @@ def get_governance_control( return self._get_governance_control_endpoint.call_with_http_info(**kwargs) + def get_governance_control_detection( + self, + detection_type: str, + detection_id: str, + ) -> GovernanceControlDetectionResponse: + """Get a governance control detection. + + Retrieve a single detection produced by the governance control with the given detection type. + + :param detection_type: The detection type that identifies the control; for example, ``unused_api_keys``. + :type detection_type: str + :param detection_id: The unique identifier of the detection. + :type detection_id: str + :rtype: GovernanceControlDetectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["detection_type"] = detection_type + + kwargs["detection_id"] = detection_id + + return self._get_governance_control_detection_endpoint.call_with_http_info(**kwargs) + + def get_governance_control_notification_settings( + self, + detection_type: str, + ) -> ControlNotificationSettingsResponse: + """Get governance control notification settings. + + 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 detection_type: The detection type that identifies the control; for example, ``unused_api_keys``. + :type detection_type: str + :rtype: ControlNotificationSettingsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["detection_type"] = detection_type + + return self._get_governance_control_notification_settings_endpoint.call_with_http_info(**kwargs) + + def list_governance_control_detections( + self, + detection_type: str, + *, + filter_state: Union[str, UnsetType] = unset, + filter_query: Union[str, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + ) -> GovernanceControlDetectionsResponse: + """List governance control detections. + + 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 detection_type: The detection type that identifies the control; for example, ``unused_api_keys``. + :type detection_type: str + :param filter_state: Restrict the results to detections in the given state. + :type filter_state: str, optional + :param filter_query: Restrict the results to detections matching the given free-text query. + :type filter_query: str, optional + :param sort: The attribute to sort detections by. Prefix with ``-`` for descending order. + :type sort: str, optional + :param page_number: The zero-based index of the page to return; the first page is 0. + :type page_number: int, optional + :param page_size: The number of detections to return per page. + :type page_size: int, optional + :rtype: GovernanceControlDetectionsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["detection_type"] = detection_type + + if filter_state is not unset: + kwargs["filter_state"] = filter_state + + if filter_query is not unset: + kwargs["filter_query"] = filter_query + + if sort is not unset: + kwargs["sort"] = sort + + if page_number is not unset: + kwargs["page_number"] = page_number + + if page_size is not unset: + kwargs["page_size"] = page_size + + return self._list_governance_control_detections_endpoint.call_with_http_info(**kwargs) + def list_governance_controls( self, ) -> GovernanceControlsResponse: @@ -144,3 +444,54 @@ def update_governance_control( kwargs["body"] = body return self._update_governance_control_endpoint.call_with_http_info(**kwargs) + + def update_governance_control_detection( + self, + detection_type: str, + detection_id: str, + body: GovernanceControlDetectionUpdateRequest, + ) -> GovernanceControlDetectionResponse: + """Update a governance control detection. + + 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 detection_type: The detection type that identifies the control; for example, ``unused_api_keys``. + :type detection_type: str + :param detection_id: The unique identifier of the detection. + :type detection_id: str + :type body: GovernanceControlDetectionUpdateRequest + :rtype: GovernanceControlDetectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["detection_type"] = detection_type + + kwargs["detection_id"] = detection_id + + kwargs["body"] = body + + return self._update_governance_control_detection_endpoint.call_with_http_info(**kwargs) + + def update_governance_control_notification_settings( + self, + detection_type: str, + body: ControlNotificationSettingsUpdateRequest, + ) -> ControlNotificationSettingsResponse: + """Update governance control notification settings. + + 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 detection_type: The detection type that identifies the control; for example, ``unused_api_keys``. + :type detection_type: str + :type body: ControlNotificationSettingsUpdateRequest + :rtype: ControlNotificationSettingsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["detection_type"] = detection_type + + kwargs["body"] = body + + return self._update_governance_control_notification_settings_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/governance_insights_api.py b/src/datadog_api_client/v2/api/governance_insights_api.py index 5b1d2db7ff..dff3a01cd6 100644 --- a/src/datadog_api_client/v2/api/governance_insights_api.py +++ b/src/datadog_api_client/v2/api/governance_insights_api.py @@ -30,7 +30,7 @@ def __init__(self, api_client=None): self._list_governance_insights_endpoint = _Endpoint( settings={ "response_type": (GovernanceInsightsResponse,), - "auth": ["apiKeyAuth", "appKeyAuth"], + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/governance/insights", "operation_id": "list_governance_insights", "http_method": "GET", diff --git a/src/datadog_api_client/v2/api/governance_settings_api.py b/src/datadog_api_client/v2/api/governance_settings_api.py new file mode 100644 index 0000000000..4de706b0c3 --- /dev/null +++ b/src/datadog_api_client/v2/api/governance_settings_api.py @@ -0,0 +1,185 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.governance_config_response import GovernanceConfigResponse +from datadog_api_client.v2.model.governance_limits_response import GovernanceLimitsResponse +from datadog_api_client.v2.model.governance_notification_settings_response import GovernanceNotificationSettingsResponse +from datadog_api_client.v2.model.governance_notification_settings_update_request import ( + GovernanceNotificationSettingsUpdateRequest, +) +from datadog_api_client.v2.model.governance_resource_limits_response import GovernanceResourceLimitsResponse + + +class GovernanceSettingsApi: + """ + 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. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._get_governance_config_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/config", + "operation_id": "get_governance_config", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_governance_notification_settings_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceNotificationSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/notification_settings", + "operation_id": "get_governance_notification_settings", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_governance_limits_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceLimitsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/limits", + "operation_id": "list_governance_limits", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_governance_resource_limits_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceResourceLimitsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/resource-limits", + "operation_id": "list_governance_resource_limits", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_governance_notification_settings_endpoint = _Endpoint( + settings={ + "response_type": (GovernanceNotificationSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/governance/notification_settings", + "operation_id": "update_governance_notification_settings", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (GovernanceNotificationSettingsUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def get_governance_config( + self, + ) -> GovernanceConfigResponse: + """Get the governance console configuration. + + 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. + + :rtype: GovernanceConfigResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_governance_config_endpoint.call_with_http_info(**kwargs) + + def get_governance_notification_settings( + self, + ) -> GovernanceNotificationSettingsResponse: + """Get governance notification settings. + + Retrieve the organization-wide governance notification settings, including whether users are + notified when detections are assigned to them. + + :rtype: GovernanceNotificationSettingsResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_governance_notification_settings_endpoint.call_with_http_info(**kwargs) + + def list_governance_limits( + self, + ) -> GovernanceLimitsResponse: + """List governance limits. + + 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. + + :rtype: GovernanceLimitsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_governance_limits_endpoint.call_with_http_info(**kwargs) + + def list_governance_resource_limits( + self, + ) -> GovernanceResourceLimitsResponse: + """List governance resource limits. + + 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. + + :rtype: GovernanceResourceLimitsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_governance_resource_limits_endpoint.call_with_http_info(**kwargs) + + def update_governance_notification_settings( + self, + body: GovernanceNotificationSettingsUpdateRequest, + ) -> GovernanceNotificationSettingsResponse: + """Update governance notification settings. + + Update the organization-wide governance notification settings. Only the attributes present in + the request are modified. + + :type body: GovernanceNotificationSettingsUpdateRequest + :rtype: GovernanceNotificationSettingsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._update_governance_notification_settings_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 1e147db9bf..baaa8b4cc1 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -57,6 +57,7 @@ from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi from datadog_api_client.v2.api.governance_controls_api import GovernanceControlsApi from datadog_api_client.v2.api.governance_insights_api import GovernanceInsightsApi +from datadog_api_client.v2.api.governance_settings_api import GovernanceSettingsApi from datadog_api_client.v2.api.high_availability_multi_region_api import HighAvailabilityMultiRegionApi from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi from datadog_api_client.v2.api.incidents_api import IncidentsApi @@ -194,6 +195,7 @@ "GoogleChatIntegrationApi", "GovernanceControlsApi", "GovernanceInsightsApi", + "GovernanceSettingsApi", "HighAvailabilityMultiRegionApi", "IPAllowlistApi", "IncidentsApi", diff --git a/src/datadog_api_client/v2/model/control_notification_event_setting.py b/src/datadog_api_client/v2/model/control_notification_event_setting.py new file mode 100644 index 0000000000..caa90637e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_event_setting.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_target import ControlNotificationTarget + + +class ControlNotificationEventSetting(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_target import ControlNotificationTarget + + return { + "enabled": (bool,), + "event_type": (str,), + "targets": ([ControlNotificationTarget],), + } + + attribute_map = { + "enabled": "enabled", + "event_type": "event_type", + "targets": "targets", + } + + def __init__(self_, enabled: bool, event_type: str, targets: List[ControlNotificationTarget], **kwargs): + """ + The notification settings for a single event type on a control. + + :param enabled: Whether notifications are enabled for this event type. + :type enabled: bool + + :param event_type: The event type the notification settings apply to, such as ``new_detection``. + :type event_type: str + + :param targets: The destinations that receive notifications for an event type. + :type targets: [ControlNotificationTarget] + """ + super().__init__(kwargs) + + self_.enabled = enabled + self_.event_type = event_type + self_.targets = targets diff --git a/src/datadog_api_client/v2/model/control_notification_settings_attributes.py b/src/datadog_api_client/v2/model/control_notification_settings_attributes.py new file mode 100644 index 0000000000..62e7ff6443 --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_event_setting import ControlNotificationEventSetting + + +class ControlNotificationSettingsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_event_setting import ControlNotificationEventSetting + + return { + "event_settings": ([ControlNotificationEventSetting],), + } + + attribute_map = { + "event_settings": "event_settings", + } + + def __init__(self_, event_settings: List[ControlNotificationEventSetting], **kwargs): + """ + The attributes of a governance control's notification settings. + + :param event_settings: The notification settings for each supported event type on the control. + :type event_settings: [ControlNotificationEventSetting] + """ + super().__init__(kwargs) + + self_.event_settings = event_settings diff --git a/src/datadog_api_client/v2/model/control_notification_settings_data.py b/src/datadog_api_client/v2/model/control_notification_settings_data.py new file mode 100644 index 0000000000..701a72c253 --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_data.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_settings_attributes import ( + ControlNotificationSettingsAttributes, + ) + from datadog_api_client.v2.model.control_notification_settings_resource_type import ( + ControlNotificationSettingsResourceType, + ) + + +class ControlNotificationSettingsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_settings_attributes import ( + ControlNotificationSettingsAttributes, + ) + from datadog_api_client.v2.model.control_notification_settings_resource_type import ( + ControlNotificationSettingsResourceType, + ) + + return { + "attributes": (ControlNotificationSettingsAttributes,), + "id": (str,), + "type": (ControlNotificationSettingsResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: ControlNotificationSettingsAttributes, + id: str, + type: ControlNotificationSettingsResourceType, + **kwargs, + ): + """ + A control notification settings resource. + + :param attributes: The attributes of a governance control's notification settings. + :type attributes: ControlNotificationSettingsAttributes + + :param id: The detection type the notification settings apply to. + :type id: str + + :param type: Control notification settings resource type. + :type type: ControlNotificationSettingsResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/control_notification_settings_resource_type.py b/src/datadog_api_client/v2/model/control_notification_settings_resource_type.py new file mode 100644 index 0000000000..087a0eba7c --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_resource_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ControlNotificationSettingsResourceType(ModelSimple): + """ + Control notification settings resource type. + + :param value: If omitted defaults to "control_notification_settings". Must be one of ["control_notification_settings"]. + :type value: str + """ + + allowed_values = { + "control_notification_settings", + } + CONTROL_NOTIFICATION_SETTINGS: ClassVar["ControlNotificationSettingsResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ControlNotificationSettingsResourceType.CONTROL_NOTIFICATION_SETTINGS = ControlNotificationSettingsResourceType( + "control_notification_settings" +) diff --git a/src/datadog_api_client/v2/model/control_notification_settings_response.py b/src/datadog_api_client/v2/model/control_notification_settings_response.py new file mode 100644 index 0000000000..5cb621a17d --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_settings_data import ControlNotificationSettingsData + + +class ControlNotificationSettingsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_settings_data import ControlNotificationSettingsData + + return { + "data": (ControlNotificationSettingsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ControlNotificationSettingsData, **kwargs): + """ + The notification settings for a governance control. + + :param data: A control notification settings resource. + :type data: ControlNotificationSettingsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/control_notification_settings_update_attributes.py b/src/datadog_api_client/v2/model/control_notification_settings_update_attributes.py new file mode 100644 index 0000000000..7cd726e168 --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_update_attributes.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_event_setting import ControlNotificationEventSetting + + +class ControlNotificationSettingsUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_event_setting import ControlNotificationEventSetting + + return { + "event_settings": ([ControlNotificationEventSetting],), + } + + attribute_map = { + "event_settings": "event_settings", + } + + def __init__(self_, event_settings: Union[List[ControlNotificationEventSetting], UnsetType] = unset, **kwargs): + """ + The attributes of a governance control's notification settings that can be updated. + + :param event_settings: The notification settings for each supported event type on the control. + :type event_settings: [ControlNotificationEventSetting], optional + """ + if event_settings is not unset: + kwargs["event_settings"] = event_settings + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/control_notification_settings_update_data.py b/src/datadog_api_client/v2/model/control_notification_settings_update_data.py new file mode 100644 index 0000000000..250b90219f --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_update_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_settings_update_attributes import ( + ControlNotificationSettingsUpdateAttributes, + ) + from datadog_api_client.v2.model.control_notification_settings_resource_type import ( + ControlNotificationSettingsResourceType, + ) + + +class ControlNotificationSettingsUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_settings_update_attributes import ( + ControlNotificationSettingsUpdateAttributes, + ) + from datadog_api_client.v2.model.control_notification_settings_resource_type import ( + ControlNotificationSettingsResourceType, + ) + + return { + "attributes": (ControlNotificationSettingsUpdateAttributes,), + "type": (ControlNotificationSettingsResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: ControlNotificationSettingsResourceType, + attributes: Union[ControlNotificationSettingsUpdateAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The data of a control notification settings update request. + + :param attributes: The attributes of a governance control's notification settings that can be updated. + :type attributes: ControlNotificationSettingsUpdateAttributes, optional + + :param type: Control notification settings resource type. + :type type: ControlNotificationSettingsResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/control_notification_settings_update_request.py b/src/datadog_api_client/v2/model/control_notification_settings_update_request.py new file mode 100644 index 0000000000..484413ab5a --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_settings_update_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_settings_update_data import ( + ControlNotificationSettingsUpdateData, + ) + + +class ControlNotificationSettingsUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_settings_update_data import ( + ControlNotificationSettingsUpdateData, + ) + + return { + "data": (ControlNotificationSettingsUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ControlNotificationSettingsUpdateData, **kwargs): + """ + A request to update the notification settings for a governance control. + + :param data: The data of a control notification settings update request. + :type data: ControlNotificationSettingsUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/control_notification_target.py b/src/datadog_api_client/v2/model/control_notification_target.py new file mode 100644 index 0000000000..d1d6011816 --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_target.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.control_notification_target_type import ControlNotificationTargetType + + +class ControlNotificationTarget(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.control_notification_target_type import ControlNotificationTargetType + + return { + "handle": (str,), + "type": (ControlNotificationTargetType,), + } + + attribute_map = { + "handle": "handle", + "type": "type", + } + + def __init__(self_, handle: str, type: ControlNotificationTargetType, **kwargs): + """ + A destination that receives notifications for an event type. + + :param handle: The destination handle, such as an email address, Slack channel, or user handle. + :type handle: str + + :param type: The type of notification destination. + :type type: ControlNotificationTargetType + """ + super().__init__(kwargs) + + self_.handle = handle + self_.type = type diff --git a/src/datadog_api_client/v2/model/control_notification_target_type.py b/src/datadog_api_client/v2/model/control_notification_target_type.py new file mode 100644 index 0000000000..95f7e48486 --- /dev/null +++ b/src/datadog_api_client/v2/model/control_notification_target_type.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ControlNotificationTargetType(ModelSimple): + """ + The type of notification destination. + + :param value: Must be one of ["email", "slack", "at_mention", "case"]. + :type value: str + """ + + allowed_values = { + "email", + "slack", + "at_mention", + "case", + } + EMAIL: ClassVar["ControlNotificationTargetType"] + SLACK: ClassVar["ControlNotificationTargetType"] + AT_MENTION: ClassVar["ControlNotificationTargetType"] + CASE: ClassVar["ControlNotificationTargetType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ControlNotificationTargetType.EMAIL = ControlNotificationTargetType("email") +ControlNotificationTargetType.SLACK = ControlNotificationTargetType("slack") +ControlNotificationTargetType.AT_MENTION = ControlNotificationTargetType("at_mention") +ControlNotificationTargetType.CASE = ControlNotificationTargetType("case") diff --git a/src/datadog_api_client/v2/model/governance_config_attributes.py b/src/datadog_api_client/v2/model/governance_config_attributes.py new file mode 100644 index 0000000000..e568b25ed2 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_config_attributes.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class GovernanceConfigAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_notifications_enabled": (bool,), + "enabled": (bool,), + "usage_attribution_configured": (bool,), + } + + attribute_map = { + "assignment_notifications_enabled": "assignment_notifications_enabled", + "enabled": "enabled", + "usage_attribution_configured": "usage_attribution_configured", + } + + def __init__( + self_, assignment_notifications_enabled: bool, enabled: bool, usage_attribution_configured: bool, **kwargs + ): + """ + The attributes of a Governance Console configuration. + + :param assignment_notifications_enabled: Whether notifications are sent to users when detections are assigned to them. + :type assignment_notifications_enabled: bool + + :param enabled: Whether the Governance Console is enabled for the organization. + :type enabled: bool + + :param usage_attribution_configured: Whether usage attribution is configured for the organization. + :type usage_attribution_configured: bool + """ + super().__init__(kwargs) + + self_.assignment_notifications_enabled = assignment_notifications_enabled + self_.enabled = enabled + self_.usage_attribution_configured = usage_attribution_configured diff --git a/src/datadog_api_client/v2/model/governance_config_data.py b/src/datadog_api_client/v2/model/governance_config_data.py new file mode 100644 index 0000000000..b553b43e26 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_config_data.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_config_attributes import GovernanceConfigAttributes + from datadog_api_client.v2.model.governance_console_config_resource_type import GovernanceConsoleConfigResourceType + + +class GovernanceConfigData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_config_attributes import GovernanceConfigAttributes + from datadog_api_client.v2.model.governance_console_config_resource_type import ( + GovernanceConsoleConfigResourceType, + ) + + return { + "attributes": (GovernanceConfigAttributes,), + "id": (str,), + "type": (GovernanceConsoleConfigResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: GovernanceConfigAttributes, id: str, type: GovernanceConsoleConfigResourceType, **kwargs + ): + """ + A Governance Console configuration resource. + + :param attributes: The attributes of a Governance Console configuration. + :type attributes: GovernanceConfigAttributes + + :param id: The unique identifier of the organization the Governance Console configuration applies to. + :type id: str + + :param type: Governance console config resource type. + :type type: GovernanceConsoleConfigResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_config_response.py b/src/datadog_api_client/v2/model/governance_config_response.py new file mode 100644 index 0000000000..36abb62f93 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_config_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_config_data import GovernanceConfigData + + +class GovernanceConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_config_data import GovernanceConfigData + + return { + "data": (GovernanceConfigData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GovernanceConfigData, **kwargs): + """ + The Governance Console configuration for an organization. + + :param data: A Governance Console configuration resource. + :type data: GovernanceConfigData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_console_config_resource_type.py b/src/datadog_api_client/v2/model/governance_console_config_resource_type.py new file mode 100644 index 0000000000..80180cb5c2 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_console_config_resource_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceConsoleConfigResourceType(ModelSimple): + """ + Governance console config resource type. + + :param value: If omitted defaults to "governance_console_config". Must be one of ["governance_console_config"]. + :type value: str + """ + + allowed_values = { + "governance_console_config", + } + GOVERNANCE_CONSOLE_CONFIG: ClassVar["GovernanceConsoleConfigResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceConsoleConfigResourceType.GOVERNANCE_CONSOLE_CONFIG = GovernanceConsoleConfigResourceType( + "governance_console_config" +) diff --git a/src/datadog_api_client/v2/model/governance_control_detection_assignment_source.py b/src/datadog_api_client/v2/model/governance_control_detection_assignment_source.py new file mode 100644 index 0000000000..e346e378aa --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_assignment_source.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceControlDetectionAssignmentSource(ModelSimple): + """ + How the detection's current assignment was determined. Possible values are `auto_resolved`, `manual`, `reassigned`, and `cleared`. + + :param value: Must be one of ["auto_resolved", "manual", "reassigned", "cleared"]. + :type value: str + """ + + allowed_values = { + "auto_resolved", + "manual", + "reassigned", + "cleared", + } + AUTO_RESOLVED: ClassVar["GovernanceControlDetectionAssignmentSource"] + MANUAL: ClassVar["GovernanceControlDetectionAssignmentSource"] + REASSIGNED: ClassVar["GovernanceControlDetectionAssignmentSource"] + CLEARED: ClassVar["GovernanceControlDetectionAssignmentSource"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceControlDetectionAssignmentSource.AUTO_RESOLVED = GovernanceControlDetectionAssignmentSource("auto_resolved") +GovernanceControlDetectionAssignmentSource.MANUAL = GovernanceControlDetectionAssignmentSource("manual") +GovernanceControlDetectionAssignmentSource.REASSIGNED = GovernanceControlDetectionAssignmentSource("reassigned") +GovernanceControlDetectionAssignmentSource.CLEARED = GovernanceControlDetectionAssignmentSource("cleared") diff --git a/src/datadog_api_client/v2/model/governance_control_detection_attributes.py b/src/datadog_api_client/v2/model/governance_control_detection_attributes.py new file mode 100644 index 0000000000..299bfb6e37 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_attributes.py @@ -0,0 +1,179 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_assignment_source import ( + GovernanceControlDetectionAssignmentSource, + ) + from datadog_api_client.v2.model.governance_control_detection_state import GovernanceControlDetectionState + + +class GovernanceControlDetectionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_assignment_source import ( + GovernanceControlDetectionAssignmentSource, + ) + from datadog_api_client.v2.model.governance_control_detection_state import GovernanceControlDetectionState + + return { + "assigned_team": (str,), + "assigned_to": (str,), + "assignment_source": (GovernanceControlDetectionAssignmentSource,), + "control_id": (str,), + "created_at": (datetime,), + "detection_type": (str,), + "display_name": (str,), + "exception_at": (datetime,), + "exception_by": (str,), + "metadata": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ), + "mitigate_after": (datetime,), + "mitigated_at": (datetime,), + "priority": (int,), + "resource_id": (str,), + "resource_url": (str,), + "state": (GovernanceControlDetectionState,), + } + + attribute_map = { + "assigned_team": "assigned_team", + "assigned_to": "assigned_to", + "assignment_source": "assignment_source", + "control_id": "control_id", + "created_at": "created_at", + "detection_type": "detection_type", + "display_name": "display_name", + "exception_at": "exception_at", + "exception_by": "exception_by", + "metadata": "metadata", + "mitigate_after": "mitigate_after", + "mitigated_at": "mitigated_at", + "priority": "priority", + "resource_id": "resource_id", + "resource_url": "resource_url", + "state": "state", + } + + def __init__( + self_, + assignment_source: GovernanceControlDetectionAssignmentSource, + control_id: str, + created_at: datetime, + detection_type: str, + display_name: str, + priority: int, + resource_id: str, + resource_url: str, + state: GovernanceControlDetectionState, + assigned_team: Union[str, UnsetType] = unset, + assigned_to: Union[str, UnsetType] = unset, + exception_at: Union[datetime, UnsetType] = unset, + exception_by: Union[str, UnsetType] = unset, + metadata: Union[Any, UnsetType] = unset, + mitigate_after: Union[datetime, UnsetType] = unset, + mitigated_at: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of a governance control detection. + + :param assigned_team: The identifier of the team the detection is assigned to, if any. + :type assigned_team: str, optional + + :param assigned_to: The identifier of the user the detection is assigned to, if any. + :type assigned_to: str, optional + + :param assignment_source: How the detection's current assignment was determined. Possible values are ``auto_resolved`` , ``manual`` , ``reassigned`` , and ``cleared``. + :type assignment_source: GovernanceControlDetectionAssignmentSource + + :param control_id: The unique identifier of the control that produced this detection. + :type control_id: str + + :param created_at: The date and time when the detection was created. + :type created_at: datetime + + :param detection_type: The type of detection, which determines what condition was detected. + :type detection_type: str + + :param display_name: The human-readable name of the detected resource. + :type display_name: str + + :param exception_at: The date and time when the detection was marked as an exception, if applicable. + :type exception_at: datetime, optional + + :param exception_by: The identifier of the user who marked the detection as an exception, if applicable. + :type exception_by: str, optional + + :param metadata: Free-form metadata associated with the detection. + :type metadata: bool, date, datetime, dict, float, int, list, str, UUID, none_type, optional + + :param mitigate_after: The date and time after which the detection is scheduled to be mitigated, if applicable. + :type mitigate_after: datetime, optional + + :param mitigated_at: The date and time when the detection was mitigated, if applicable. + :type mitigated_at: datetime, optional + + :param priority: The priority of the detection, if set. + :type priority: int + + :param resource_id: The identifier of the resource the detection applies to. + :type resource_id: str + + :param resource_url: A link to the detected resource in Datadog. + :type resource_url: str + + :param state: The current state of the detection. Possible values are ``active`` , ``exception`` , ``mitigated`` , ``inactive`` , ``obsolete`` , ``resolved_externally`` , and ``mitigation_in_progress``. + :type state: GovernanceControlDetectionState + """ + if assigned_team is not unset: + kwargs["assigned_team"] = assigned_team + if assigned_to is not unset: + kwargs["assigned_to"] = assigned_to + if exception_at is not unset: + kwargs["exception_at"] = exception_at + if exception_by is not unset: + kwargs["exception_by"] = exception_by + if metadata is not unset: + kwargs["metadata"] = metadata + if mitigate_after is not unset: + kwargs["mitigate_after"] = mitigate_after + if mitigated_at is not unset: + kwargs["mitigated_at"] = mitigated_at + super().__init__(kwargs) + + self_.assignment_source = assignment_source + self_.control_id = control_id + self_.created_at = created_at + self_.detection_type = detection_type + self_.display_name = display_name + self_.priority = priority + self_.resource_id = resource_id + self_.resource_url = resource_url + self_.state = state diff --git a/src/datadog_api_client/v2/model/governance_control_detection_data.py b/src/datadog_api_client/v2/model/governance_control_detection_data.py new file mode 100644 index 0000000000..60245182be --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_data.py @@ -0,0 +1,66 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_attributes import GovernanceControlDetectionAttributes + from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, + ) + + +class GovernanceControlDetectionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_attributes import ( + GovernanceControlDetectionAttributes, + ) + from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, + ) + + return { + "attributes": (GovernanceControlDetectionAttributes,), + "id": (str,), + "type": (GovernanceControlDetectionResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: GovernanceControlDetectionAttributes, + id: str, + type: GovernanceControlDetectionResourceType, + **kwargs, + ): + """ + A governance control detection resource. + + :param attributes: The attributes of a governance control detection. + :type attributes: GovernanceControlDetectionAttributes + + :param id: The unique identifier of the detection. + :type id: str + + :param type: Governance control detection resource type. + :type type: GovernanceControlDetectionResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_control_detection_resource_type.py b/src/datadog_api_client/v2/model/governance_control_detection_resource_type.py new file mode 100644 index 0000000000..f462a36683 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_resource_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceControlDetectionResourceType(ModelSimple): + """ + Governance control detection resource type. + + :param value: If omitted defaults to "governance_control_detection". Must be one of ["governance_control_detection"]. + :type value: str + """ + + allowed_values = { + "governance_control_detection", + } + GOVERNANCE_CONTROL_DETECTION: ClassVar["GovernanceControlDetectionResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION = GovernanceControlDetectionResourceType( + "governance_control_detection" +) diff --git a/src/datadog_api_client/v2/model/governance_control_detection_response.py b/src/datadog_api_client/v2/model/governance_control_detection_response.py new file mode 100644 index 0000000000..6f057fc891 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_data import GovernanceControlDetectionData + + +class GovernanceControlDetectionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_data import GovernanceControlDetectionData + + return { + "data": (GovernanceControlDetectionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GovernanceControlDetectionData, **kwargs): + """ + A single governance control detection. + + :param data: A governance control detection resource. + :type data: GovernanceControlDetectionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_control_detection_state.py b/src/datadog_api_client/v2/model/governance_control_detection_state.py new file mode 100644 index 0000000000..2c57e21ebc --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_state.py @@ -0,0 +1,53 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceControlDetectionState(ModelSimple): + """ + The current state of the detection. Possible values are `active`, `exception`, `mitigated`, `inactive`, `obsolete`, `resolved_externally`, and `mitigation_in_progress`. + + :param value: Must be one of ["active", "exception", "mitigated", "inactive", "obsolete", "resolved_externally", "mitigation_in_progress"]. + :type value: str + """ + + allowed_values = { + "active", + "exception", + "mitigated", + "inactive", + "obsolete", + "resolved_externally", + "mitigation_in_progress", + } + ACTIVE: ClassVar["GovernanceControlDetectionState"] + EXCEPTION: ClassVar["GovernanceControlDetectionState"] + MITIGATED: ClassVar["GovernanceControlDetectionState"] + INACTIVE: ClassVar["GovernanceControlDetectionState"] + OBSOLETE: ClassVar["GovernanceControlDetectionState"] + RESOLVED_EXTERNALLY: ClassVar["GovernanceControlDetectionState"] + MITIGATION_IN_PROGRESS: ClassVar["GovernanceControlDetectionState"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceControlDetectionState.ACTIVE = GovernanceControlDetectionState("active") +GovernanceControlDetectionState.EXCEPTION = GovernanceControlDetectionState("exception") +GovernanceControlDetectionState.MITIGATED = GovernanceControlDetectionState("mitigated") +GovernanceControlDetectionState.INACTIVE = GovernanceControlDetectionState("inactive") +GovernanceControlDetectionState.OBSOLETE = GovernanceControlDetectionState("obsolete") +GovernanceControlDetectionState.RESOLVED_EXTERNALLY = GovernanceControlDetectionState("resolved_externally") +GovernanceControlDetectionState.MITIGATION_IN_PROGRESS = GovernanceControlDetectionState("mitigation_in_progress") diff --git a/src/datadog_api_client/v2/model/governance_control_detection_update_attributes.py b/src/datadog_api_client/v2/model/governance_control_detection_update_attributes.py new file mode 100644 index 0000000000..e2a94c0fc7 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_update_attributes.py @@ -0,0 +1,75 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_update_state import ( + GovernanceControlDetectionUpdateState, + ) + + +class GovernanceControlDetectionUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_update_state import ( + GovernanceControlDetectionUpdateState, + ) + + return { + "assigned_team": (str,), + "assigned_to": (str,), + "mitigate_after": (datetime,), + "state": (GovernanceControlDetectionUpdateState,), + } + + attribute_map = { + "assigned_team": "assigned_team", + "assigned_to": "assigned_to", + "mitigate_after": "mitigate_after", + "state": "state", + } + + def __init__( + self_, + assigned_team: Union[str, UnsetType] = unset, + assigned_to: Union[str, UnsetType] = unset, + mitigate_after: Union[datetime, UnsetType] = unset, + state: Union[GovernanceControlDetectionUpdateState, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of a governance control detection that can be updated. Only the attributes present in the request are modified. + + :param assigned_team: The handle of the team the detection is assigned to. Set to an empty string to clear the assignment. + :type assigned_team: str, optional + + :param assigned_to: The UUID of the user the detection is assigned to. Set to an empty string to clear the assignment. + :type assigned_to: str, optional + + :param mitigate_after: The timestamp after which the detection becomes eligible for mitigation. Used to defer mitigation to a later time. + :type mitigate_after: datetime, optional + + :param state: 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. + :type state: GovernanceControlDetectionUpdateState, optional + """ + if assigned_team is not unset: + kwargs["assigned_team"] = assigned_team + if assigned_to is not unset: + kwargs["assigned_to"] = assigned_to + if mitigate_after is not unset: + kwargs["mitigate_after"] = mitigate_after + if state is not unset: + kwargs["state"] = state + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/governance_control_detection_update_data.py b/src/datadog_api_client/v2/model/governance_control_detection_update_data.py new file mode 100644 index 0000000000..1ef61c05fa --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_update_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_update_attributes import ( + GovernanceControlDetectionUpdateAttributes, + ) + from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, + ) + + +class GovernanceControlDetectionUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_update_attributes import ( + GovernanceControlDetectionUpdateAttributes, + ) + from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, + ) + + return { + "attributes": (GovernanceControlDetectionUpdateAttributes,), + "type": (GovernanceControlDetectionResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: GovernanceControlDetectionResourceType, + attributes: Union[GovernanceControlDetectionUpdateAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The data of a governance control detection update request. + + :param attributes: The attributes of a governance control detection that can be updated. Only the attributes present in the request are modified. + :type attributes: GovernanceControlDetectionUpdateAttributes, optional + + :param type: Governance control detection resource type. + :type type: GovernanceControlDetectionResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_control_detection_update_request.py b/src/datadog_api_client/v2/model/governance_control_detection_update_request.py new file mode 100644 index 0000000000..308b726b8b --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_update_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_update_data import ( + GovernanceControlDetectionUpdateData, + ) + + +class GovernanceControlDetectionUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_update_data import ( + GovernanceControlDetectionUpdateData, + ) + + return { + "data": (GovernanceControlDetectionUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GovernanceControlDetectionUpdateData, **kwargs): + """ + A request to update a governance control detection. + + :param data: The data of a governance control detection update request. + :type data: GovernanceControlDetectionUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_control_detection_update_state.py b/src/datadog_api_client/v2/model/governance_control_detection_update_state.py new file mode 100644 index 0000000000..78b04f907e --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detection_update_state.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceControlDetectionUpdateState(ModelSimple): + """ + 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. + + :param value: Must be one of ["exception", "active"]. + :type value: str + """ + + allowed_values = { + "exception", + "active", + } + EXCEPTION: ClassVar["GovernanceControlDetectionUpdateState"] + ACTIVE: ClassVar["GovernanceControlDetectionUpdateState"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceControlDetectionUpdateState.EXCEPTION = GovernanceControlDetectionUpdateState("exception") +GovernanceControlDetectionUpdateState.ACTIVE = GovernanceControlDetectionUpdateState("active") diff --git a/src/datadog_api_client/v2/model/governance_control_detections_response.py b/src/datadog_api_client/v2/model/governance_control_detections_response.py new file mode 100644 index 0000000000..ba2ba9eb32 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_control_detections_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_detection_data import GovernanceControlDetectionData + + +class GovernanceControlDetectionsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_detection_data import GovernanceControlDetectionData + + return { + "data": ([GovernanceControlDetectionData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[GovernanceControlDetectionData], **kwargs): + """ + A list of governance control detections. + + :param data: An array of governance control detection resources. + :type data: [GovernanceControlDetectionData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_insight_query_config.py b/src/datadog_api_client/v2/model/governance_insight_query_config.py index fcb82af379..258b573460 100644 --- a/src/datadog_api_client/v2/model/governance_insight_query_config.py +++ b/src/datadog_api_client/v2/model/governance_insight_query_config.py @@ -47,7 +47,7 @@ def __init__( :param chart_type: The chart type the frontend should use to render the insight. :type chart_type: str, optional - :param comparison_shift: The window used for the previous value comparison, for example ``week`` or ``month``. + :param comparison_shift: The window used for the previous value comparison; for example, ``week`` or ``month``. :type comparison_shift: str :param default_value: The default value to display when no data is available. diff --git a/src/datadog_api_client/v2/model/governance_limit_attributes.py b/src/datadog_api_client/v2/model/governance_limit_attributes.py new file mode 100644 index 0000000000..97bebf0ea5 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_limit_attributes.py @@ -0,0 +1,109 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_limit_query import GovernanceLimitQuery + from datadog_api_client.v2.model.governance_limit_query_config import GovernanceLimitQueryConfig + + +class GovernanceLimitAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_limit_query import GovernanceLimitQuery + from datadog_api_client.v2.model.governance_limit_query_config import GovernanceLimitQueryConfig + + return { + "description": (str,), + "display_name": (str,), + "limit_type": (str,), + "product": (str,), + "query": (GovernanceLimitQuery,), + "query_config": (GovernanceLimitQueryConfig,), + "time_range": (str,), + "times_hit_limit": (float,), + "unit_name": (str,), + "usage_status": (str,), + } + + attribute_map = { + "description": "description", + "display_name": "display_name", + "limit_type": "limit_type", + "product": "product", + "query": "query", + "query_config": "query_config", + "time_range": "time_range", + "times_hit_limit": "times_hit_limit", + "unit_name": "unit_name", + "usage_status": "usage_status", + } + + def __init__( + self_, + description: str, + display_name: str, + limit_type: str, + product: str, + query: GovernanceLimitQuery, + query_config: GovernanceLimitQueryConfig, + time_range: str, + times_hit_limit: float, + unit_name: str, + usage_status: str, + **kwargs, + ): + """ + The attributes of a governance limit. + + :param description: A description of what the limit measures. + :type description: str + + :param display_name: The human-readable name of the limit. + :type display_name: str + + :param limit_type: The type of limit, such as a rate limit or a usage limit. + :type limit_type: str + + :param product: The Datadog product the limit belongs to. + :type product: str + + :param query: A metric query used to compute usage against a limit. + :type query: GovernanceLimitQuery + + :param query_config: The query execution context used to visualize a limit and its usage. + :type query_config: GovernanceLimitQueryConfig + + :param time_range: The time range over which usage against the limit is measured. + :type time_range: str + + :param times_hit_limit: The number of times usage has reached the limit within the measured time range. + :type times_hit_limit: float + + :param unit_name: The unit in which the limit and its usage are measured. + :type unit_name: str + + :param usage_status: The current usage status of the limit relative to its threshold. + :type usage_status: str + """ + super().__init__(kwargs) + + self_.description = description + self_.display_name = display_name + self_.limit_type = limit_type + self_.product = product + self_.query = query + self_.query_config = query_config + self_.time_range = time_range + self_.times_hit_limit = times_hit_limit + self_.unit_name = unit_name + self_.usage_status = usage_status diff --git a/src/datadog_api_client/v2/model/governance_limit_data.py b/src/datadog_api_client/v2/model/governance_limit_data.py new file mode 100644 index 0000000000..bfea450c09 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_limit_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_limit_attributes import GovernanceLimitAttributes + from datadog_api_client.v2.model.governance_limit_resource_type import GovernanceLimitResourceType + + +class GovernanceLimitData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_limit_attributes import GovernanceLimitAttributes + from datadog_api_client.v2.model.governance_limit_resource_type import GovernanceLimitResourceType + + return { + "attributes": (GovernanceLimitAttributes,), + "id": (str,), + "type": (GovernanceLimitResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: GovernanceLimitAttributes, id: str, type: GovernanceLimitResourceType, **kwargs): + """ + A governance limit resource. + + :param attributes: The attributes of a governance limit. + :type attributes: GovernanceLimitAttributes + + :param id: The unique identifier of the limit. + :type id: str + + :param type: Limit resource type. + :type type: GovernanceLimitResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_limit_query.py b/src/datadog_api_client/v2/model/governance_limit_query.py new file mode 100644 index 0000000000..bfcd994467 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_limit_query.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class GovernanceLimitQuery(ModelNormal): + @cached_property + def openapi_types(_): + return { + "query": (str,), + "reducer": (str,), + "source": (str,), + } + + attribute_map = { + "query": "query", + "reducer": "reducer", + "source": "source", + } + + def __init__(self_, query: str, reducer: str, source: str, **kwargs): + """ + A metric query used to compute usage against a limit. + + :param query: The metric query expression used to compute the limit value. + :type query: str + + :param reducer: How the query results are aggregated into a single value (for example, sum, max, or avg). + :type reducer: str + + :param source: The data source used to evaluate the metric query (for example, the metrics or events backend). + :type source: str + """ + super().__init__(kwargs) + + self_.query = query + self_.reducer = reducer + self_.source = source diff --git a/src/datadog_api_client/v2/model/governance_limit_query_config.py b/src/datadog_api_client/v2/model/governance_limit_query_config.py new file mode 100644 index 0000000000..87c860ce1d --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_limit_query_config.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class GovernanceLimitQueryConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "chart_type": (str,), + "comparison_shift": (str,), + "default_value": (int,), + "directionality": (str,), + "effective_time_window_days": (int,), + } + + attribute_map = { + "chart_type": "chart_type", + "comparison_shift": "comparison_shift", + "default_value": "default_value", + "directionality": "directionality", + "effective_time_window_days": "effective_time_window_days", + } + + def __init__( + self_, + chart_type: Union[str, UnsetType] = unset, + comparison_shift: Union[str, UnsetType] = unset, + default_value: Union[int, UnsetType] = unset, + directionality: Union[str, UnsetType] = unset, + effective_time_window_days: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + The query execution context used to visualize a limit and its usage. + + :param chart_type: The chart type used to visualize the limit and its usage. + :type chart_type: str, optional + + :param comparison_shift: The time shift applied to compare current usage against a prior period. + :type comparison_shift: str, optional + + :param default_value: The default value used for the limit when no explicit value is configured. + :type default_value: int, optional + + :param directionality: The direction in which usage approaches the limit, indicating whether higher or lower values are closer to the limit. + :type directionality: str, optional + + :param effective_time_window_days: The number of days of data the limit query evaluates over. + :type effective_time_window_days: int, optional + """ + if chart_type is not unset: + kwargs["chart_type"] = chart_type + if comparison_shift is not unset: + kwargs["comparison_shift"] = comparison_shift + if default_value is not unset: + kwargs["default_value"] = default_value + if directionality is not unset: + kwargs["directionality"] = directionality + if effective_time_window_days is not unset: + kwargs["effective_time_window_days"] = effective_time_window_days + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/governance_limit_resource_type.py b/src/datadog_api_client/v2/model/governance_limit_resource_type.py new file mode 100644 index 0000000000..ed2f4e5617 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_limit_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceLimitResourceType(ModelSimple): + """ + Limit resource type. + + :param value: If omitted defaults to "limit". Must be one of ["limit"]. + :type value: str + """ + + allowed_values = { + "limit", + } + LIMIT: ClassVar["GovernanceLimitResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceLimitResourceType.LIMIT = GovernanceLimitResourceType("limit") diff --git a/src/datadog_api_client/v2/model/governance_limits_response.py b/src/datadog_api_client/v2/model/governance_limits_response.py new file mode 100644 index 0000000000..61f993d9e9 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_limits_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_limit_data import GovernanceLimitData + + +class GovernanceLimitsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_limit_data import GovernanceLimitData + + return { + "data": ([GovernanceLimitData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[GovernanceLimitData], **kwargs): + """ + A list of governance limits. + + :param data: An array of governance limit resources. + :type data: [GovernanceLimitData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_mitigation_request.py b/src/datadog_api_client/v2/model/governance_mitigation_request.py new file mode 100644 index 0000000000..6c66ec5229 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_mitigation_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_mitigation_request_data import GovernanceMitigationRequestData + + +class GovernanceMitigationRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_mitigation_request_data import GovernanceMitigationRequestData + + return { + "data": (GovernanceMitigationRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GovernanceMitigationRequestData, **kwargs): + """ + A request to mitigate a set of governance detections. + + :param data: The data of a governance mitigation request. + :type data: GovernanceMitigationRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_mitigation_request_attributes.py b/src/datadog_api_client/v2/model/governance_mitigation_request_attributes.py new file mode 100644 index 0000000000..7c1a3aec03 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_mitigation_request_attributes.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_control_parameters_map import GovernanceControlParametersMap + + +class GovernanceMitigationRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_control_parameters_map import GovernanceControlParametersMap + + return { + "detection_ids": ([str],), + "detection_type": (str,), + "mitigation_parameters": (GovernanceControlParametersMap,), + "mitigation_type": (str,), + } + + attribute_map = { + "detection_ids": "detection_ids", + "detection_type": "detection_type", + "mitigation_parameters": "mitigation_parameters", + "mitigation_type": "mitigation_type", + } + + def __init__( + self_, + detection_ids: Union[List[str], UnsetType] = unset, + detection_type: Union[str, UnsetType] = unset, + mitigation_parameters: Union[GovernanceControlParametersMap, UnsetType] = unset, + mitigation_type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of a governance mitigation request. + + :param detection_ids: The identifiers of the detections to mitigate in this request. + :type detection_ids: [str], optional + + :param detection_type: The detection type whose detections should be mitigated. + :type detection_type: str, optional + + :param mitigation_parameters: A free-form map of parameter names to their configured values. + :type mitigation_parameters: GovernanceControlParametersMap, optional + + :param mitigation_type: The mitigation to apply to the selected detections. Defaults to the control's configured mitigation when omitted. + :type mitigation_type: str, optional + """ + if detection_ids is not unset: + kwargs["detection_ids"] = detection_ids + if detection_type is not unset: + kwargs["detection_type"] = detection_type + if mitigation_parameters is not unset: + kwargs["mitigation_parameters"] = mitigation_parameters + if mitigation_type is not unset: + kwargs["mitigation_type"] = mitigation_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/governance_mitigation_request_data.py b/src/datadog_api_client/v2/model/governance_mitigation_request_data.py new file mode 100644 index 0000000000..b1e16558af --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_mitigation_request_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_mitigation_request_attributes import ( + GovernanceMitigationRequestAttributes, + ) + from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, + ) + + +class GovernanceMitigationRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_mitigation_request_attributes import ( + GovernanceMitigationRequestAttributes, + ) + from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, + ) + + return { + "attributes": (GovernanceMitigationRequestAttributes,), + "type": (GovernanceControlDetectionResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: GovernanceControlDetectionResourceType, + attributes: Union[GovernanceMitigationRequestAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The data of a governance mitigation request. + + :param attributes: The attributes of a governance mitigation request. + :type attributes: GovernanceMitigationRequestAttributes, optional + + :param type: Governance control detection resource type. + :type type: GovernanceControlDetectionResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_attributes.py b/src/datadog_api_client/v2/model/governance_notification_settings_attributes.py new file mode 100644 index 0000000000..d27eb4952b --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class GovernanceNotificationSettingsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_notifications_enabled": (bool,), + } + + attribute_map = { + "assignment_notifications_enabled": "assignment_notifications_enabled", + } + + def __init__(self_, assignment_notifications_enabled: bool, **kwargs): + """ + The attributes of the organization-wide governance notification settings. + + :param assignment_notifications_enabled: Whether notifications are sent to users when detections are assigned to them. + :type assignment_notifications_enabled: bool + """ + super().__init__(kwargs) + + self_.assignment_notifications_enabled = assignment_notifications_enabled diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_data.py b/src/datadog_api_client/v2/model/governance_notification_settings_data.py new file mode 100644 index 0000000000..8b784e3d04 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_data.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_notification_settings_attributes import ( + GovernanceNotificationSettingsAttributes, + ) + from datadog_api_client.v2.model.governance_notification_settings_resource_type import ( + GovernanceNotificationSettingsResourceType, + ) + + +class GovernanceNotificationSettingsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_notification_settings_attributes import ( + GovernanceNotificationSettingsAttributes, + ) + from datadog_api_client.v2.model.governance_notification_settings_resource_type import ( + GovernanceNotificationSettingsResourceType, + ) + + return { + "attributes": (GovernanceNotificationSettingsAttributes,), + "id": (str,), + "type": (GovernanceNotificationSettingsResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: GovernanceNotificationSettingsAttributes, + id: str, + type: GovernanceNotificationSettingsResourceType, + **kwargs, + ): + """ + A governance notification settings resource. + + :param attributes: The attributes of the organization-wide governance notification settings. + :type attributes: GovernanceNotificationSettingsAttributes + + :param id: The unique identifier of the organization the notification settings apply to. + :type id: str + + :param type: Governance notification settings resource type. + :type type: GovernanceNotificationSettingsResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_resource_type.py b/src/datadog_api_client/v2/model/governance_notification_settings_resource_type.py new file mode 100644 index 0000000000..4d99292b42 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_resource_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceNotificationSettingsResourceType(ModelSimple): + """ + Governance notification settings resource type. + + :param value: If omitted defaults to "governance_notification_settings". Must be one of ["governance_notification_settings"]. + :type value: str + """ + + allowed_values = { + "governance_notification_settings", + } + GOVERNANCE_NOTIFICATION_SETTINGS: ClassVar["GovernanceNotificationSettingsResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceNotificationSettingsResourceType.GOVERNANCE_NOTIFICATION_SETTINGS = ( + GovernanceNotificationSettingsResourceType("governance_notification_settings") +) diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_response.py b/src/datadog_api_client/v2/model/governance_notification_settings_response.py new file mode 100644 index 0000000000..47270f2b87 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_notification_settings_data import GovernanceNotificationSettingsData + + +class GovernanceNotificationSettingsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_notification_settings_data import GovernanceNotificationSettingsData + + return { + "data": (GovernanceNotificationSettingsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GovernanceNotificationSettingsData, **kwargs): + """ + The organization-wide governance notification settings. + + :param data: A governance notification settings resource. + :type data: GovernanceNotificationSettingsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_update_attributes.py b/src/datadog_api_client/v2/model/governance_notification_settings_update_attributes.py new file mode 100644 index 0000000000..ba9d259f36 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_update_attributes.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class GovernanceNotificationSettingsUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_notifications_enabled": (bool,), + } + + attribute_map = { + "assignment_notifications_enabled": "assignment_notifications_enabled", + } + + def __init__(self_, assignment_notifications_enabled: Union[bool, UnsetType] = unset, **kwargs): + """ + The attributes of the governance notification settings that can be updated. Only the attributes present in the request are modified. + + :param assignment_notifications_enabled: Whether notifications are sent to users when detections are assigned to them. + :type assignment_notifications_enabled: bool, optional + """ + if assignment_notifications_enabled is not unset: + kwargs["assignment_notifications_enabled"] = assignment_notifications_enabled + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_update_data.py b/src/datadog_api_client/v2/model/governance_notification_settings_update_data.py new file mode 100644 index 0000000000..bd31931259 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_update_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_notification_settings_update_attributes import ( + GovernanceNotificationSettingsUpdateAttributes, + ) + from datadog_api_client.v2.model.governance_notification_settings_resource_type import ( + GovernanceNotificationSettingsResourceType, + ) + + +class GovernanceNotificationSettingsUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_notification_settings_update_attributes import ( + GovernanceNotificationSettingsUpdateAttributes, + ) + from datadog_api_client.v2.model.governance_notification_settings_resource_type import ( + GovernanceNotificationSettingsResourceType, + ) + + return { + "attributes": (GovernanceNotificationSettingsUpdateAttributes,), + "type": (GovernanceNotificationSettingsResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: GovernanceNotificationSettingsResourceType, + attributes: Union[GovernanceNotificationSettingsUpdateAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The data of a governance notification settings update request. + + :param attributes: The attributes of the governance notification settings that can be updated. Only the attributes present in the request are modified. + :type attributes: GovernanceNotificationSettingsUpdateAttributes, optional + + :param type: Governance notification settings resource type. + :type type: GovernanceNotificationSettingsResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_notification_settings_update_request.py b/src/datadog_api_client/v2/model/governance_notification_settings_update_request.py new file mode 100644 index 0000000000..a1dcc2739c --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_notification_settings_update_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_notification_settings_update_data import ( + GovernanceNotificationSettingsUpdateData, + ) + + +class GovernanceNotificationSettingsUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_notification_settings_update_data import ( + GovernanceNotificationSettingsUpdateData, + ) + + return { + "data": (GovernanceNotificationSettingsUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GovernanceNotificationSettingsUpdateData, **kwargs): + """ + A request to update the organization-wide governance notification settings. + + :param data: The data of a governance notification settings update request. + :type data: GovernanceNotificationSettingsUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/governance_resource_limit_attributes.py b/src/datadog_api_client/v2/model/governance_resource_limit_attributes.py new file mode 100644 index 0000000000..64d9bb1aaa --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_resource_limit_attributes.py @@ -0,0 +1,137 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_limit_query import GovernanceLimitQuery + from datadog_api_client.v2.model.governance_limit_query_config import GovernanceLimitQueryConfig + + +class GovernanceResourceLimitAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_limit_query import GovernanceLimitQuery + from datadog_api_client.v2.model.governance_limit_query_config import GovernanceLimitQueryConfig + + return { + "current_limit": (float,), + "current_value": (float,), + "deep_link": (str,), + "default_current_value": (float,), + "default_limit_value": (float,), + "description": (str,), + "display_name": (str,), + "limit_query": (GovernanceLimitQuery,), + "product": (str,), + "query": (GovernanceLimitQuery,), + "query_config": (GovernanceLimitQueryConfig,), + "time_range": (str,), + "unit_name": (str,), + "usage_status": (str,), + } + + attribute_map = { + "current_limit": "current_limit", + "current_value": "current_value", + "deep_link": "deep_link", + "default_current_value": "default_current_value", + "default_limit_value": "default_limit_value", + "description": "description", + "display_name": "display_name", + "limit_query": "limit_query", + "product": "product", + "query": "query", + "query_config": "query_config", + "time_range": "time_range", + "unit_name": "unit_name", + "usage_status": "usage_status", + } + + def __init__( + self_, + current_limit: float, + current_value: float, + deep_link: str, + default_current_value: float, + default_limit_value: float, + description: str, + display_name: str, + limit_query: GovernanceLimitQuery, + product: str, + query: GovernanceLimitQuery, + query_config: GovernanceLimitQueryConfig, + time_range: str, + unit_name: str, + usage_status: str, + **kwargs, + ): + """ + The attributes of a governance resource limit. + + :param current_limit: The current limit configured for the resource. + :type current_limit: float + + :param current_value: The current value of the resource. + :type current_value: float + + :param deep_link: A link to the Datadog page where the resource and its limit can be managed. + :type deep_link: str + + :param default_current_value: The default current value used when the resource value cannot be computed from the query. + :type default_current_value: float + + :param default_limit_value: The default limit value used when the limit cannot be computed from the query. + :type default_limit_value: float + + :param description: A description of what the resource limit measures. + :type description: str + + :param display_name: The human-readable name of the resource limit. + :type display_name: str + + :param limit_query: A metric query used to compute usage against a limit. + :type limit_query: GovernanceLimitQuery + + :param product: The Datadog product the resource limit belongs to. + :type product: str + + :param query: A metric query used to compute usage against a limit. + :type query: GovernanceLimitQuery + + :param query_config: The query execution context used to visualize a limit and its usage. + :type query_config: GovernanceLimitQueryConfig + + :param time_range: The time range over which the resource value is measured. + :type time_range: str + + :param unit_name: The unit in which the resource value and limit are measured. + :type unit_name: str + + :param usage_status: The current usage status of the resource relative to its limit. + :type usage_status: str + """ + super().__init__(kwargs) + + self_.current_limit = current_limit + self_.current_value = current_value + self_.deep_link = deep_link + self_.default_current_value = default_current_value + self_.default_limit_value = default_limit_value + self_.description = description + self_.display_name = display_name + self_.limit_query = limit_query + self_.product = product + self_.query = query + self_.query_config = query_config + self_.time_range = time_range + self_.unit_name = unit_name + self_.usage_status = usage_status diff --git a/src/datadog_api_client/v2/model/governance_resource_limit_data.py b/src/datadog_api_client/v2/model/governance_resource_limit_data.py new file mode 100644 index 0000000000..9d1f832ccc --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_resource_limit_data.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_resource_limit_attributes import GovernanceResourceLimitAttributes + from datadog_api_client.v2.model.governance_resource_limit_resource_type import GovernanceResourceLimitResourceType + + +class GovernanceResourceLimitData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_resource_limit_attributes import GovernanceResourceLimitAttributes + from datadog_api_client.v2.model.governance_resource_limit_resource_type import ( + GovernanceResourceLimitResourceType, + ) + + return { + "attributes": (GovernanceResourceLimitAttributes,), + "id": (str,), + "type": (GovernanceResourceLimitResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: GovernanceResourceLimitAttributes, + id: str, + type: GovernanceResourceLimitResourceType, + **kwargs, + ): + """ + A governance resource limit resource. + + :param attributes: The attributes of a governance resource limit. + :type attributes: GovernanceResourceLimitAttributes + + :param id: The unique identifier of the resource limit. + :type id: str + + :param type: Resource limit resource type. + :type type: GovernanceResourceLimitResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/governance_resource_limit_resource_type.py b/src/datadog_api_client/v2/model/governance_resource_limit_resource_type.py new file mode 100644 index 0000000000..32baaeeb30 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_resource_limit_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GovernanceResourceLimitResourceType(ModelSimple): + """ + Resource limit resource type. + + :param value: If omitted defaults to "resource-limit". Must be one of ["resource-limit"]. + :type value: str + """ + + allowed_values = { + "resource-limit", + } + RESOURCE_LIMIT: ClassVar["GovernanceResourceLimitResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GovernanceResourceLimitResourceType.RESOURCE_LIMIT = GovernanceResourceLimitResourceType("resource-limit") diff --git a/src/datadog_api_client/v2/model/governance_resource_limits_response.py b/src/datadog_api_client/v2/model/governance_resource_limits_response.py new file mode 100644 index 0000000000..72726d7ef6 --- /dev/null +++ b/src/datadog_api_client/v2/model/governance_resource_limits_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.governance_resource_limit_data import GovernanceResourceLimitData + + +class GovernanceResourceLimitsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.governance_resource_limit_data import GovernanceResourceLimitData + + return { + "data": ([GovernanceResourceLimitData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[GovernanceResourceLimitData], **kwargs): + """ + A list of governance resource limits. + + :param data: An array of governance resource limit resources. + :type data: [GovernanceResourceLimitData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 8877f93e3f..1ac6e22b76 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1468,6 +1468,22 @@ from datadog_api_client.v2.model.containers_response import ContainersResponse from datadog_api_client.v2.model.containers_response_links import ContainersResponseLinks from datadog_api_client.v2.model.content_encoding import ContentEncoding +from datadog_api_client.v2.model.control_notification_event_setting import ControlNotificationEventSetting +from datadog_api_client.v2.model.control_notification_settings_attributes import ControlNotificationSettingsAttributes +from datadog_api_client.v2.model.control_notification_settings_data import ControlNotificationSettingsData +from datadog_api_client.v2.model.control_notification_settings_resource_type import ( + ControlNotificationSettingsResourceType, +) +from datadog_api_client.v2.model.control_notification_settings_response import ControlNotificationSettingsResponse +from datadog_api_client.v2.model.control_notification_settings_update_attributes import ( + ControlNotificationSettingsUpdateAttributes, +) +from datadog_api_client.v2.model.control_notification_settings_update_data import ControlNotificationSettingsUpdateData +from datadog_api_client.v2.model.control_notification_settings_update_request import ( + ControlNotificationSettingsUpdateRequest, +) +from datadog_api_client.v2.model.control_notification_target import ControlNotificationTarget +from datadog_api_client.v2.model.control_notification_target_type import ControlNotificationTargetType from datadog_api_client.v2.model.convert_job_results_to_signals_attributes import ConvertJobResultsToSignalsAttributes from datadog_api_client.v2.model.convert_job_results_to_signals_data import ConvertJobResultsToSignalsData from datadog_api_client.v2.model.convert_job_results_to_signals_data_type import ConvertJobResultsToSignalsDataType @@ -3186,8 +3202,31 @@ from datadog_api_client.v2.model.google_meet_configuration_reference import GoogleMeetConfigurationReference from datadog_api_client.v2.model.google_meet_configuration_reference_data import GoogleMeetConfigurationReferenceData from datadog_api_client.v2.model.governance_best_practice_definition import GovernanceBestPracticeDefinition +from datadog_api_client.v2.model.governance_config_attributes import GovernanceConfigAttributes +from datadog_api_client.v2.model.governance_config_data import GovernanceConfigData +from datadog_api_client.v2.model.governance_config_response import GovernanceConfigResponse +from datadog_api_client.v2.model.governance_console_config_resource_type import GovernanceConsoleConfigResourceType from datadog_api_client.v2.model.governance_control_attributes import GovernanceControlAttributes from datadog_api_client.v2.model.governance_control_data import GovernanceControlData +from datadog_api_client.v2.model.governance_control_detection_assignment_source import ( + GovernanceControlDetectionAssignmentSource, +) +from datadog_api_client.v2.model.governance_control_detection_attributes import GovernanceControlDetectionAttributes +from datadog_api_client.v2.model.governance_control_detection_data import GovernanceControlDetectionData +from datadog_api_client.v2.model.governance_control_detection_resource_type import ( + GovernanceControlDetectionResourceType, +) +from datadog_api_client.v2.model.governance_control_detection_response import GovernanceControlDetectionResponse +from datadog_api_client.v2.model.governance_control_detection_state import GovernanceControlDetectionState +from datadog_api_client.v2.model.governance_control_detection_update_attributes import ( + GovernanceControlDetectionUpdateAttributes, +) +from datadog_api_client.v2.model.governance_control_detection_update_data import GovernanceControlDetectionUpdateData +from datadog_api_client.v2.model.governance_control_detection_update_request import ( + GovernanceControlDetectionUpdateRequest, +) +from datadog_api_client.v2.model.governance_control_detection_update_state import GovernanceControlDetectionUpdateState +from datadog_api_client.v2.model.governance_control_detections_response import GovernanceControlDetectionsResponse from datadog_api_client.v2.model.governance_control_mitigation_definition import GovernanceControlMitigationDefinition from datadog_api_client.v2.model.governance_control_parameter_definition import GovernanceControlParameterDefinition from datadog_api_client.v2.model.governance_control_parameters_map import GovernanceControlParametersMap @@ -3210,6 +3249,36 @@ from datadog_api_client.v2.model.governance_insight_resource_type import GovernanceInsightResourceType from datadog_api_client.v2.model.governance_insight_usage_query import GovernanceInsightUsageQuery from datadog_api_client.v2.model.governance_insights_response import GovernanceInsightsResponse +from datadog_api_client.v2.model.governance_limit_attributes import GovernanceLimitAttributes +from datadog_api_client.v2.model.governance_limit_data import GovernanceLimitData +from datadog_api_client.v2.model.governance_limit_query import GovernanceLimitQuery +from datadog_api_client.v2.model.governance_limit_query_config import GovernanceLimitQueryConfig +from datadog_api_client.v2.model.governance_limit_resource_type import GovernanceLimitResourceType +from datadog_api_client.v2.model.governance_limits_response import GovernanceLimitsResponse +from datadog_api_client.v2.model.governance_mitigation_request import GovernanceMitigationRequest +from datadog_api_client.v2.model.governance_mitigation_request_attributes import GovernanceMitigationRequestAttributes +from datadog_api_client.v2.model.governance_mitigation_request_data import GovernanceMitigationRequestData +from datadog_api_client.v2.model.governance_notification_settings_attributes import ( + GovernanceNotificationSettingsAttributes, +) +from datadog_api_client.v2.model.governance_notification_settings_data import GovernanceNotificationSettingsData +from datadog_api_client.v2.model.governance_notification_settings_resource_type import ( + GovernanceNotificationSettingsResourceType, +) +from datadog_api_client.v2.model.governance_notification_settings_response import GovernanceNotificationSettingsResponse +from datadog_api_client.v2.model.governance_notification_settings_update_attributes import ( + GovernanceNotificationSettingsUpdateAttributes, +) +from datadog_api_client.v2.model.governance_notification_settings_update_data import ( + GovernanceNotificationSettingsUpdateData, +) +from datadog_api_client.v2.model.governance_notification_settings_update_request import ( + GovernanceNotificationSettingsUpdateRequest, +) +from datadog_api_client.v2.model.governance_resource_limit_attributes import GovernanceResourceLimitAttributes +from datadog_api_client.v2.model.governance_resource_limit_data import GovernanceResourceLimitData +from datadog_api_client.v2.model.governance_resource_limit_resource_type import GovernanceResourceLimitResourceType +from datadog_api_client.v2.model.governance_resource_limits_response import GovernanceResourceLimitsResponse from datadog_api_client.v2.model.grey_noise_api_key import GreyNoiseAPIKey from datadog_api_client.v2.model.grey_noise_api_key_type import GreyNoiseAPIKeyType from datadog_api_client.v2.model.grey_noise_api_key_update import GreyNoiseAPIKeyUpdate @@ -10650,6 +10719,16 @@ "ContainersResponse", "ContainersResponseLinks", "ContentEncoding", + "ControlNotificationEventSetting", + "ControlNotificationSettingsAttributes", + "ControlNotificationSettingsData", + "ControlNotificationSettingsResourceType", + "ControlNotificationSettingsResponse", + "ControlNotificationSettingsUpdateAttributes", + "ControlNotificationSettingsUpdateData", + "ControlNotificationSettingsUpdateRequest", + "ControlNotificationTarget", + "ControlNotificationTargetType", "ConvertJobResultsToSignalsAttributes", "ConvertJobResultsToSignalsData", "ConvertJobResultsToSignalsDataType", @@ -11934,8 +12013,23 @@ "GoogleMeetConfigurationReference", "GoogleMeetConfigurationReferenceData", "GovernanceBestPracticeDefinition", + "GovernanceConfigAttributes", + "GovernanceConfigData", + "GovernanceConfigResponse", + "GovernanceConsoleConfigResourceType", "GovernanceControlAttributes", "GovernanceControlData", + "GovernanceControlDetectionAssignmentSource", + "GovernanceControlDetectionAttributes", + "GovernanceControlDetectionData", + "GovernanceControlDetectionResourceType", + "GovernanceControlDetectionResponse", + "GovernanceControlDetectionState", + "GovernanceControlDetectionUpdateAttributes", + "GovernanceControlDetectionUpdateData", + "GovernanceControlDetectionUpdateRequest", + "GovernanceControlDetectionUpdateState", + "GovernanceControlDetectionsResponse", "GovernanceControlMitigationDefinition", "GovernanceControlParameterDefinition", "GovernanceControlParametersMap", @@ -11958,6 +12052,26 @@ "GovernanceInsightResourceType", "GovernanceInsightUsageQuery", "GovernanceInsightsResponse", + "GovernanceLimitAttributes", + "GovernanceLimitData", + "GovernanceLimitQuery", + "GovernanceLimitQueryConfig", + "GovernanceLimitResourceType", + "GovernanceLimitsResponse", + "GovernanceMitigationRequest", + "GovernanceMitigationRequestAttributes", + "GovernanceMitigationRequestData", + "GovernanceNotificationSettingsAttributes", + "GovernanceNotificationSettingsData", + "GovernanceNotificationSettingsResourceType", + "GovernanceNotificationSettingsResponse", + "GovernanceNotificationSettingsUpdateAttributes", + "GovernanceNotificationSettingsUpdateData", + "GovernanceNotificationSettingsUpdateRequest", + "GovernanceResourceLimitAttributes", + "GovernanceResourceLimitData", + "GovernanceResourceLimitResourceType", + "GovernanceResourceLimitsResponse", "GreyNoiseAPIKey", "GreyNoiseAPIKeyType", "GreyNoiseAPIKeyUpdate", diff --git a/tests/v2/features/governance_controls.feature b/tests/v2/features/governance_controls.feature index 1207f5cf50..c16b965088 100644 --- a/tests/v2/features/governance_controls.feature +++ b/tests/v2/features/governance_controls.feature @@ -11,6 +11,33 @@ Feature: Governance Controls And a valid "appKeyAuth" key in the system And an instance of "GovernanceControls" API + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a governance control detection returns "Bad Request" response + Given operation "GetGovernanceControlDetection" enabled + And new "GetGovernanceControlDetection" request + And request contains "detection_type" parameter from "REPLACE.ME" + And request contains "detection_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a governance control detection returns "Not Found" response + Given operation "GetGovernanceControlDetection" enabled + And new "GetGovernanceControlDetection" request + And request contains "detection_type" parameter from "REPLACE.ME" + And request contains "detection_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a governance control detection returns "OK" response + Given operation "GetGovernanceControlDetection" enabled + And new "GetGovernanceControlDetection" request + And request contains "detection_type" parameter from "REPLACE.ME" + And request contains "detection_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-governance-console Scenario: Get a governance control returns "Bad Request" response Given operation "GetGovernanceControl" enabled @@ -35,6 +62,38 @@ Feature: Governance Controls When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get governance control notification settings returns "Bad Request" response + Given operation "GetGovernanceControlNotificationSettings" enabled + And new "GetGovernanceControlNotificationSettings" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get governance control notification settings returns "OK" response + Given operation "GetGovernanceControlNotificationSettings" enabled + And new "GetGovernanceControlNotificationSettings" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance control detections returns "Bad Request" response + Given operation "ListGovernanceControlDetections" enabled + And new "ListGovernanceControlDetections" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance control detections returns "OK" response + Given operation "ListGovernanceControlDetections" enabled + And new "ListGovernanceControlDetections" request + And request contains "detection_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-governance-console Scenario: List governance controls returns "Bad Request" response Given operation "ListGovernanceControls" enabled @@ -49,6 +108,52 @@ Feature: Governance Controls When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Mitigate governance detections returns "Accepted" response + Given operation "CreateGovernanceMitigation" enabled + And new "CreateGovernanceMitigation" request + And body with value {"data": {"attributes": {"detection_ids": ["3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"], "detection_type": "unused_api_keys", "mitigation_type": "revoke_api_key"}, "type": "governance_control_detection"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Mitigate governance detections returns "Bad Request" response + Given operation "CreateGovernanceMitigation" enabled + And new "CreateGovernanceMitigation" request + And body with value {"data": {"attributes": {"detection_ids": ["3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"], "detection_type": "unused_api_keys", "mitigation_type": "revoke_api_key"}, "type": "governance_control_detection"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a governance control detection returns "Bad Request" response + Given operation "UpdateGovernanceControlDetection" enabled + And new "UpdateGovernanceControlDetection" request + And request contains "detection_type" parameter from "REPLACE.ME" + And request contains "detection_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assigned_team": "platform-security", "assigned_to": "11111111-2222-3333-4444-555555555555", "mitigate_after": "2024-03-15T00:00:00Z", "state": "exception"}, "type": "governance_control_detection"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a governance control detection returns "Not Found" response + Given operation "UpdateGovernanceControlDetection" enabled + And new "UpdateGovernanceControlDetection" request + And request contains "detection_type" parameter from "REPLACE.ME" + And request contains "detection_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assigned_team": "platform-security", "assigned_to": "11111111-2222-3333-4444-555555555555", "mitigate_after": "2024-03-15T00:00:00Z", "state": "exception"}, "type": "governance_control_detection"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a governance control detection returns "OK" response + Given operation "UpdateGovernanceControlDetection" enabled + And new "UpdateGovernanceControlDetection" request + And request contains "detection_type" parameter from "REPLACE.ME" + And request contains "detection_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assigned_team": "platform-security", "assigned_to": "11111111-2222-3333-4444-555555555555", "mitigate_after": "2024-03-15T00:00:00Z", "state": "exception"}, "type": "governance_control_detection"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-governance-console Scenario: Update a governance control returns "Bad Request" response Given operation "UpdateGovernanceControl" enabled @@ -75,3 +180,21 @@ Feature: Governance Controls And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key", "name": "Unused API Keys", "notification_frequency": "daily", "notification_type": "slack"}, "id": "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a", "type": "governance_control"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update governance control notification settings returns "Bad Request" response + Given operation "UpdateGovernanceControlNotificationSettings" enabled + And new "UpdateGovernanceControlNotificationSettings" request + And request contains "detection_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"event_settings": [{"enabled": true, "event_type": "new_detection", "targets": [{"handle": "#governance-alerts", "type": "slack"}]}]}, "type": "control_notification_settings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update governance control notification settings returns "OK" response + Given operation "UpdateGovernanceControlNotificationSettings" enabled + And new "UpdateGovernanceControlNotificationSettings" request + And request contains "detection_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"event_settings": [{"enabled": true, "event_type": "new_detection", "targets": [{"handle": "#governance-alerts", "type": "slack"}]}]}, "type": "control_notification_settings"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/governance_settings.feature b/tests/v2/features/governance_settings.feature new file mode 100644 index 0000000000..a448572312 --- /dev/null +++ b/tests/v2/features/governance_settings.feature @@ -0,0 +1,83 @@ +@endpoint(governance-settings) @endpoint(governance-settings-v2) +Feature: Governance Settings + 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. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "GovernanceSettings" API + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get governance notification settings returns "Bad Request" response + Given operation "GetGovernanceNotificationSettings" enabled + And new "GetGovernanceNotificationSettings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get governance notification settings returns "OK" response + Given operation "GetGovernanceNotificationSettings" enabled + And new "GetGovernanceNotificationSettings" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get the governance console configuration returns "Bad Request" response + Given operation "GetGovernanceConfig" enabled + And new "GetGovernanceConfig" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get the governance console configuration returns "OK" response + Given operation "GetGovernanceConfig" enabled + And new "GetGovernanceConfig" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance limits returns "Bad Request" response + Given operation "ListGovernanceLimits" enabled + And new "ListGovernanceLimits" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance limits returns "OK" response + Given operation "ListGovernanceLimits" enabled + And new "ListGovernanceLimits" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance resource limits returns "Bad Request" response + Given operation "ListGovernanceResourceLimits" enabled + And new "ListGovernanceResourceLimits" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance resource limits returns "OK" response + Given operation "ListGovernanceResourceLimits" enabled + And new "ListGovernanceResourceLimits" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update governance notification settings returns "Bad Request" response + Given operation "UpdateGovernanceNotificationSettings" enabled + And new "UpdateGovernanceNotificationSettings" request + And body with value {"data": {"attributes": {"assignment_notifications_enabled": true}, "type": "governance_notification_settings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update governance notification settings returns "OK" response + Given operation "UpdateGovernanceNotificationSettings" enabled + And new "UpdateGovernanceNotificationSettings" request + And body with value {"data": {"attributes": {"assignment_notifications_enabled": true}, "type": "governance_notification_settings"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index c07e3792ac..2f2c9c766b 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2792,6 +2792,12 @@ "type": "safe" } }, + "GetGovernanceConfig": { + "tag": "Governance Settings", + "undo": { + "type": "safe" + } + }, "ListGovernanceControls": { "tag": "Governance Controls", "undo": { @@ -2810,12 +2816,72 @@ "type": "idempotent" } }, + "ListGovernanceControlDetections": { + "tag": "Governance Controls", + "undo": { + "type": "safe" + } + }, + "GetGovernanceControlDetection": { + "tag": "Governance Controls", + "undo": { + "type": "safe" + } + }, + "UpdateGovernanceControlDetection": { + "tag": "Governance Controls", + "undo": { + "type": "idempotent" + } + }, + "GetGovernanceControlNotificationSettings": { + "tag": "Governance Controls", + "undo": { + "type": "safe" + } + }, + "UpdateGovernanceControlNotificationSettings": { + "tag": "Governance Controls", + "undo": { + "type": "idempotent" + } + }, "ListGovernanceInsights": { "tag": "Governance Insights", "undo": { "type": "safe" } }, + "ListGovernanceLimits": { + "tag": "Governance Settings", + "undo": { + "type": "safe" + } + }, + "CreateGovernanceMitigation": { + "tag": "Governance Controls", + "undo": { + "type": "unsafe" + } + }, + "GetGovernanceNotificationSettings": { + "tag": "Governance Settings", + "undo": { + "type": "safe" + } + }, + "UpdateGovernanceNotificationSettings": { + "tag": "Governance Settings", + "undo": { + "type": "idempotent" + } + }, + "ListGovernanceResourceLimits": { + "tag": "Governance Settings", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": {