diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f11972d91d0..128bce58baa 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41880,6 +41880,83 @@ components: type: string x-enum-varnames: - PERMISSIONS + PostmortemAttachmentRequest: + properties: + data: + $ref: '#/components/schemas/PostmortemAttachmentRequestData' + required: + - data + type: object + PostmortemAttachmentRequestAttributes: + description: Postmortem attachment attributes + properties: + cells: + description: The cells of the postmortem + items: + $ref: '#/components/schemas/PostmortemCell' + type: array + content: + description: The content of the postmortem + example: '# Incident Report - IR-123 + + [...]' + type: string + postmortem_template_id: + description: The ID of the postmortem template + example: 93645509-874e-45c4-adfa-623bfeaead89-123 + type: string + title: + description: The title of the postmortem + example: Postmortem-IR-123 + type: string + type: object + PostmortemAttachmentRequestData: + description: Postmortem attachment data + properties: + attributes: + $ref: '#/components/schemas/PostmortemAttachmentRequestAttributes' + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + - attributes + type: object + PostmortemCell: + description: A cell in the postmortem + properties: + attributes: + $ref: '#/components/schemas/PostmortemCellAttributes' + id: + description: The unique identifier of the cell + example: cell-1 + type: string + type: + $ref: '#/components/schemas/PostmortemCellType' + type: object + PostmortemCellAttributes: + description: Attributes of a postmortem cell + properties: + definition: + $ref: '#/components/schemas/PostmortemCellDefinition' + type: object + PostmortemCellDefinition: + description: Definition of a postmortem cell + properties: + content: + description: The content of the cell in markdown format + example: '## Incident Summary + + This incident was caused by...' + type: string + type: object + PostmortemCellType: + description: The postmortem cell resource type. + enum: + - markdown + example: markdown + type: string + x-enum-varnames: + - MARKDOWN Powerpack: description: Powerpacks are templated groups of dashboard widgets you can save from an existing dashboard and turn into reusable packs in the widget tray. @@ -49179,6 +49256,18 @@ components: meta: $ref: '#/components/schemas/ResponseMetaAttributes' type: object + SecurityMonitoringPaginatedSuppressionsResponse: + description: Response object containing the available suppression rules with + pagination metadata. + properties: + data: + description: A list of suppressions objects. + items: + $ref: '#/components/schemas/SecurityMonitoringSuppression' + type: array + meta: + $ref: '#/components/schemas/SecurityMonitoringSuppressionsMeta' + type: object SecurityMonitoringReferenceTable: description: Reference tables used in the queries. properties: @@ -51328,6 +51417,31 @@ components: data: $ref: '#/components/schemas/SecurityMonitoringSuppression' type: object + SecurityMonitoringSuppressionSort: + description: The sort parameters used for querying suppression rules. + enum: + - name + - start_date + - expiration_date + - update_date + - enabled + - -name + - -start_date + - -expiration_date + - -update_date + - -enabled + type: string + x-enum-varnames: + - NAME + - START_DATE + - EXPIRATION_DATE + - UPDATE_DATE + - ENABLED + - NAME_DESCENDING + - START_DATE_DESCENDING + - EXPIRATION_DATE_DESCENDING + - UPDATE_DATE_DESCENDING + - ENABLED_DESCENDING SecurityMonitoringSuppressionType: default: suppressions description: The type of the resource. The value should always be `suppressions`. @@ -51423,6 +51537,31 @@ components: required: - data type: object + SecurityMonitoringSuppressionsMeta: + description: Metadata for the suppression list response. + properties: + page: + $ref: '#/components/schemas/SecurityMonitoringSuppressionsPageMeta' + type: object + SecurityMonitoringSuppressionsPageMeta: + description: Pagination metadata. + properties: + pageNumber: + description: Current page number. + example: 0 + format: int64 + type: integer + pageSize: + description: Current page size. + example: 2 + format: int64 + type: integer + totalCount: + description: Total count of suppressions. + example: 2 + format: int64 + type: integer + type: object SecurityMonitoringSuppressionsResponse: description: Response object containing the available suppression rules. properties: @@ -71685,6 +71824,46 @@ paths: - incident_write x-unstable: '**Note**: This endpoint is in Preview. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/attachments/postmortems: + post: + description: Create a postmortem attachment for an incident. + operationId: CreateIncidentPostmortemAttachment + parameters: + - description: The ID of the incident + in: path + name: incident_id + required: true + schema: + example: 00000000-0000-0000-0000-000000000000 + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemAttachmentRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create postmortem attachment + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/attachments/{attachment_id}: delete: @@ -85553,12 +85732,29 @@ paths: required: false schema: type: string + - description: Attribute used to sort the list of suppression rules. Prefix + with `-` to sort in descending order. + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/SecurityMonitoringSuppressionSort' + - description: Size for a given page. Use `-1` to return all items. + in: query + name: page[size] + required: false + schema: + default: -1 + example: 10 + format: int64 + type: integer + - $ref: '#/components/parameters/PageNumber' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSuppressionsResponse' + $ref: '#/components/schemas/SecurityMonitoringPaginatedSuppressionsResponse' description: OK '403': $ref: '#/components/responses/NotAuthorizedResponse' diff --git a/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen index 3f3e3c99f21..ec35b858851 100644 --- a/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-11-07T12:27:26.759Z \ No newline at end of file +2026-01-14T17:29:03.168Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.yml index e3828707dc7..37f25710f24 100644 --- a/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.yml +++ b/cassettes/features/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.yml @@ -1,9 +1,10 @@ http_interactions: -- recorded_at: Fri, 07 Nov 2025 12:27:26 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:03 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","enabled":true,"name":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + string: '{"data":{"attributes":{"description":"Test-Delete_a_suppression_rule_returns_OK_response-1768411743","enabled":true,"name":"suppression + Test-Delete_a_suppression_rule_returns_OK_response-1768411743","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' headers: Accept: - application/json @@ -14,8 +15,9 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"uea-lab-big","type":"suppressions","attributes":{"creation_date":1762518447002,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","editable":true,"enabled":true,"name":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518447002,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"itm-ljs-0qw","type":"suppressions","attributes":{"creation_date":1768411744411,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Delete_a_suppression_rule_returns_OK_response-1768411743","editable":true,"enabled":true,"name":"suppression + Test-Delete_a_suppression_rule_returns_OK_response-1768411743","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411744411,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' headers: Content-Type: @@ -23,14 +25,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 07 Nov 2025 12:27:26 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:03 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uea-lab-big + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/itm-ljs-0qw response: body: encoding: UTF-8 @@ -39,18 +41,18 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 07 Nov 2025 12:27:26 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:03 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uea-lab-big + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/itm-ljs-0qw response: body: encoding: UTF-8 - string: '{"errors":["not_found(Suppression with ID uea-lab-big not found)"]}' + string: '{"errors":["not_found(Suppression with ID itm-ljs-0qw not found)"]}' headers: Content-Type: - application/json diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen index a93a4d20e75..16f1a15eddc 100644 --- a/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-11-07T12:27:27.654Z \ No newline at end of file +2026-01-14T17:29:04.856Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.yml index 21d50015e7c..6021eaad967 100644 --- a/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.yml +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.yml @@ -1,9 +1,10 @@ http_interactions: -- recorded_at: Fri, 07 Nov 2025 12:27:27 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:04 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Get_a_suppression_rule_returns_OK_response-1762518447","enabled":true,"name":"Test-Get_a_suppression_rule_returns_OK_response-1762518447","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + string: '{"data":{"attributes":{"description":"Test-Get_a_suppression_rule_returns_OK_response-1768411744","enabled":true,"name":"suppression + Test-Get_a_suppression_rule_returns_OK_response-1768411744","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' headers: Accept: - application/json @@ -14,8 +15,9 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"ylq-igi-icg","type":"suppressions","attributes":{"creation_date":1762518447901,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1762518447","editable":true,"enabled":true,"name":"Test-Get_a_suppression_rule_returns_OK_response-1762518447","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518447901,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"xno-kwg-8df","type":"suppressions","attributes":{"creation_date":1768411744987,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1768411744","editable":true,"enabled":true,"name":"suppression + Test-Get_a_suppression_rule_returns_OK_response-1768411744","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411744987,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' headers: Content-Type: @@ -23,19 +25,20 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 07 Nov 2025 12:27:27 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:04 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ylq-igi-icg + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/xno-kwg-8df response: body: encoding: UTF-8 - string: '{"data":{"id":"ylq-igi-icg","type":"suppressions","attributes":{"creation_date":1762518447901,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1762518447","editable":true,"enabled":true,"name":"Test-Get_a_suppression_rule_returns_OK_response-1762518447","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518447901,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"xno-kwg-8df","type":"suppressions","attributes":{"creation_date":1768411744987,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1768411744","editable":true,"enabled":true,"name":"suppression + Test-Get_a_suppression_rule_returns_OK_response-1768411744","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411744987,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' headers: Content-Type: @@ -43,14 +46,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 07 Nov 2025 12:27:27 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:04 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ylq-igi-icg + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/xno-kwg-8df response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen index d0d5ccec313..66913264132 100644 --- a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen @@ -1 +1 @@ -2025-11-26T13:33:06.482Z \ No newline at end of file +2026-01-14T17:29:05.317Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml index 84c317daea0..26e1a51de10 100644 --- a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml @@ -1,9 +1,10 @@ http_interactions: -- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","enabled":true,"name":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + string: '{"data":{"attributes":{"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","enabled":true,"name":"suppression + Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' headers: Accept: - application/json @@ -14,39 +15,45 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"456-piv-74h","type":"suppressions","attributes":{"creation_date":1764163986851,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","editable":true,"enabled":true,"name":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1764163986851,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + string: '{"data":{"id":"sro-unv-k08","type":"suppressions","attributes":{"creation_date":1768411745430,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","editable":true,"enabled":true,"name":"suppression + Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411745430,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:05 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/456-piv-74h/version_history + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/sro-unv-k08/version_history response: body: encoding: UTF-8 - string: '{"data":{"id":"456-piv-74h","type":"suppression_version_history","attributes":{"count":1,"data":{"1":{"suppression":{"id":"456-piv-74h","name":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","enabled":true,"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","rule_query":"source:cloudtrail","suppression_query":"env:test","data_exclusion_query":"","version":1,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"updater":{"handle":"frog@datadoghq.com","name":"frog"},"creation_date":1764163986851,"update_date":1764163986851,"editable":true,"tags":["source:cloudtrail","technique:T1110-brute-force"]},"changes":[]}}}}}' + string: '{"data":{"id":"sro-unv-k08","type":"suppression_version_history","attributes":{"count":1,"data":{"1":{"suppression":{"id":"sro-unv-k08","name":"suppression + Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","enabled":true,"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","data_exclusion_query":"","version":1,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"creation_date":1768411745430,"update_date":1768411745430,"editable":true,"tags":["source:cloudtrail","technique:T1110-brute-force"]},"changes":[]}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/456-piv-74h + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/sro-unv-k08 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-pagination.frozen b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-pagination.frozen new file mode 100644 index 00000000000..23cdf460db7 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-pagination.frozen @@ -0,0 +1 @@ +2026-01-14T17:12:28.523Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-pagination.yml b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-pagination.yml new file mode 100644 index 00000000000..5d0f6038306 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-pagination.yml @@ -0,0 +1,101 @@ +http_interactions: +- recorded_at: Wed, 14 Jan 2026 17:12:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fgz-hyr-ibu","type":"suppressions","attributes":{"creation_date":1768410748883,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","editable":true,"enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410748883,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"lgh-7no-380","type":"suppressions","attributes":{"creation_date":1768410749324,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","editable":true,"enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410749324,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:28 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?page%5Bsize%5D=1&page%5Bnumber%5D=0&query=id%3Afgz-hyr-ibu%20OR%20id%3Algh-7no-380 + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"fgz-hyr-ibu","type":"suppressions","attributes":{"creation_date":1768410748883,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","editable":true,"enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410748883,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":1,"pageNumber":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:28 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/lgh-7no-380 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Wed, 14 Jan 2026 17:12:28 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/fgz-hyr-ibu + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-ascending.frozen b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-ascending.frozen new file mode 100644 index 00000000000..89bfc8cd8ef --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-ascending.frozen @@ -0,0 +1 @@ +2026-01-14T17:12:30.925Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-ascending.yml b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-ascending.yml new file mode 100644 index 00000000000..0e765861acf --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-ascending.yml @@ -0,0 +1,102 @@ +http_interactions: +- recorded_at: Wed, 14 Jan 2026 17:12:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5cq-vnw-eza","type":"suppressions","attributes":{"creation_date":1768410751276,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751276,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fuu-xxd-kjd","type":"suppressions","attributes":{"creation_date":1768410751710,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751710,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:30 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?sort=name&query=id%3A5cq-vnw-eza%20OR%20id%3Afuu-xxd-kjd + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5cq-vnw-eza","type":"suppressions","attributes":{"creation_date":1768410751276,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751276,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}},{"id":"fuu-xxd-kjd","type":"suppressions","attributes":{"creation_date":1768410751710,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751710,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":2,"pageNumber":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:30 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/fuu-xxd-kjd + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Wed, 14 Jan 2026 17:12:30 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/5cq-vnw-eza + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-descending.frozen b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-descending.frozen new file mode 100644 index 00000000000..d184a46ea08 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-descending.frozen @@ -0,0 +1 @@ +2026-01-14T17:12:33.088Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-descending.yml b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-descending.yml new file mode 100644 index 00000000000..8b1f589c467 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-suppression-rules-returns-OK-response-with-sort-descending.yml @@ -0,0 +1,102 @@ +http_interactions: +- recorded_at: Wed, 14 Jan 2026 17:12:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"osw-qyf-tqn","type":"suppressions","attributes":{"creation_date":1768410753455,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753455,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"pe9-gdi-ee2","type":"suppressions","attributes":{"creation_date":1768410753872,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753872,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:33 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?sort=-name&query=id%3Aosw-qyf-tqn%20OR%20id%3Ape9-gdi-ee2 + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"pe9-gdi-ee2","type":"suppressions","attributes":{"creation_date":1768410753872,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression2 + Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753872,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}},{"id":"osw-qyf-tqn","type":"suppressions","attributes":{"creation_date":1768410753455,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression + Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753455,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":2,"pageNumber":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 14 Jan 2026 17:12:33 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/pe9-gdi-ee2 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Wed, 14 Jan 2026 17:12:33 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/osw-qyf-tqn + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen index 8839a50677d..e05f55dd710 100644 --- a/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-11-07T12:27:28.613Z \ No newline at end of file +2026-01-14T17:29:05.825Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.yml index 4fb6f154ade..55f2cb1ff7b 100644 --- a/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.yml +++ b/cassettes/features/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.yml @@ -1,9 +1,10 @@ http_interactions: -- recorded_at: Fri, 07 Nov 2025 12:27:28 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Update_a_suppression_rule_returns_OK_response-1762518448","enabled":true,"name":"Test-Update_a_suppression_rule_returns_OK_response-1762518448","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + string: '{"data":{"attributes":{"description":"Test-Update_a_suppression_rule_returns_OK_response-1768411745","enabled":true,"name":"suppression + Test-Update_a_suppression_rule_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' headers: Accept: - application/json @@ -14,8 +15,9 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"uqt-hh6-qbq","type":"suppressions","attributes":{"creation_date":1762518448839,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1762518448","editable":true,"enabled":true,"name":"Test-Update_a_suppression_rule_returns_OK_response-1762518448","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518448839,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"ucv-bpf-4bc","type":"suppressions","attributes":{"creation_date":1768411745950,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1768411745","editable":true,"enabled":true,"name":"suppression + Test-Update_a_suppression_rule_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411745950,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' headers: Content-Type: @@ -23,7 +25,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 07 Nov 2025 12:27:28 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:05 GMT request: body: encoding: UTF-8 @@ -34,13 +36,14 @@ http_interactions: Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uqt-hh6-qbq + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ucv-bpf-4bc response: body: encoding: UTF-8 - string: '{"data":{"id":"uqt-hh6-qbq","type":"suppressions","attributes":{"creation_date":1762518448839,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1762518448","editable":true,"enabled":true,"name":"Test-Update_a_suppression_rule_returns_OK_response-1762518448","rule_query":"source:cloudtrail","suppression_query":"env:staging - status:low","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518449150,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"ucv-bpf-4bc","type":"suppressions","attributes":{"creation_date":1768411745950,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1768411745","editable":true,"enabled":true,"name":"suppression + Test-Update_a_suppression_rule_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:staging + status:low","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411746111,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":2}}}' headers: Content-Type: @@ -48,14 +51,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 07 Nov 2025 12:27:28 GMT +- recorded_at: Wed, 14 Jan 2026 17:29:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uqt-hh6-qbq + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ucv-bpf-4bc response: body: encoding: UTF-8 diff --git a/examples/v2/incidents/CreateIncidentPostmortemAttachment.rb b/examples/v2/incidents/CreateIncidentPostmortemAttachment.rb new file mode 100644 index 00000000000..00a7b70a65e --- /dev/null +++ b/examples/v2/incidents/CreateIncidentPostmortemAttachment.rb @@ -0,0 +1,30 @@ +# Create postmortem attachment returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_incident_postmortem_attachment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::PostmortemAttachmentRequest.new({ + data: DatadogAPIClient::V2::PostmortemAttachmentRequestData.new({ + attributes: DatadogAPIClient::V2::PostmortemAttachmentRequestAttributes.new({ + cells: [ + DatadogAPIClient::V2::PostmortemCell.new({ + attributes: DatadogAPIClient::V2::PostmortemCellAttributes.new({ + definition: DatadogAPIClient::V2::PostmortemCellDefinition.new({ + content: '## Incident Summary\nThis incident was caused by...', + }), + }), + id: "cell-1", + type: DatadogAPIClient::V2::PostmortemCellType::MARKDOWN, + }), + ], + content: '# Incident Report - IR-123\n[...]', + postmortem_template_id: "93645509-874e-45c4-adfa-623bfeaead89-123", + title: "Postmortem-IR-123", + }), + type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS, + }), +}) +p api_instance.create_incident_postmortem_attachment("00000000-0000-0000-0000-000000000000", body) diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_1315707136.rb b/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_1315707136.rb new file mode 100644 index 00000000000..e4d8b50b439 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_1315707136.rb @@ -0,0 +1,15 @@ +# Get all suppression rules returns "OK" response with sort ascending + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "suppression" in the system +SUPPRESSION_DATA_ID = ENV["SUPPRESSION_DATA_ID"] + +# there is a valid "suppression2" in the system +SUPPRESSION2_DATA_ID = ENV["SUPPRESSION2_DATA_ID"] +opts = { + sort: SecurityMonitoringSuppressionSort::NAME, + query: "id:3dd-0uc-h1s OR id:886e6c3e-e543-049c-ee1b-56a1110295c0", +} +p api_instance.list_security_monitoring_suppressions(opts) diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_1741429096.rb b/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_1741429096.rb new file mode 100644 index 00000000000..ea5cdb65b90 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_1741429096.rb @@ -0,0 +1,15 @@ +# Get all suppression rules returns "OK" response with sort descending + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "suppression" in the system +SUPPRESSION_DATA_ID = ENV["SUPPRESSION_DATA_ID"] + +# there is a valid "suppression2" in the system +SUPPRESSION2_DATA_ID = ENV["SUPPRESSION2_DATA_ID"] +opts = { + sort: SecurityMonitoringSuppressionSort::NAME_DESCENDING, + query: "id:3dd-0uc-h1s OR id:886e6c3e-e543-049c-ee1b-56a1110295c0", +} +p api_instance.list_security_monitoring_suppressions(opts) diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_3985905558.rb b/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_3985905558.rb new file mode 100644 index 00000000000..5e38d9bb571 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions_3985905558.rb @@ -0,0 +1,16 @@ +# Get all suppression rules returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "suppression" in the system +SUPPRESSION_DATA_ID = ENV["SUPPRESSION_DATA_ID"] + +# there is a valid "suppression2" in the system +SUPPRESSION2_DATA_ID = ENV["SUPPRESSION2_DATA_ID"] +opts = { + page_size: 1, + page_number: 0, + query: "id:3dd-0uc-h1s OR id:886e6c3e-e543-049c-ee1b-56a1110295c0", +} +p api_instance.list_security_monitoring_suppressions(opts) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 909e6202543..bb421b0260f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1559,6 +1559,9 @@ }, "v2.ListSecurityMonitoringSuppressions" => { "query" => "String", + "sort" => "SecurityMonitoringSuppressionSort", + "page_size" => "Integer", + "page_number" => "Integer", }, "v2.CreateSecurityMonitoringSuppression" => { "body" => "SecurityMonitoringSuppressionCreateRequest", @@ -2140,6 +2143,10 @@ "include" => "String", "body" => "CreateAttachmentRequest", }, + "v2.CreateIncidentPostmortemAttachment" => { + "incident_id" => "String", + "body" => "PostmortemAttachmentRequest", + }, "v2.DeleteIncidentAttachment" => { "incident_id" => "String", "attachment_id" => "Object", diff --git a/features/v2/given.json b/features/v2/given.json index c717223ca71..9d69fd33f22 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1035,7 +1035,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"{{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" + "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"suppression {{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" } ], "step": "there is a valid \"suppression\" in the system", @@ -1043,6 +1043,18 @@ "tag": "Security Monitoring", "operationId": "CreateSecurityMonitoringSuppression" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"suppression2 {{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" + } + ], + "step": "there is a valid \"suppression2\" in the system", + "key": "suppression2", + "tag": "Security Monitoring", + "operationId": "CreateSecurityMonitoringSuppression" + }, { "parameters": [ { diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index a101f5f4af4..23e5882fa75 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -253,6 +253,24 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem attachment returns "Bad Request" response + Given operation "CreateIncidentPostmortemAttachment" enabled + And new "CreateIncidentPostmortemAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"content": "## Incident Summary\nThis incident was caused by..."}}, "id": "cell-1", "type": "markdown"}], "content": "# Incident Report - IR-123\n[...]", "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123", "title": "Postmortem-IR-123"}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem attachment returns "Created" response + Given operation "CreateIncidentPostmortemAttachment" enabled + And new "CreateIncidentPostmortemAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"content": "## Incident Summary\nThis incident was caused by..."}}, "id": "cell-1", "type": "markdown"}], "content": "# Incident Report - IR-123\n[...]", "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123", "title": "Postmortem-IR-123"}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:Datadog/incident-app Scenario: Delete a notification template returns "Bad Request" response Given operation "DeleteIncidentNotificationTemplate" enabled diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 2a6c599c306..60e9df68bb9 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -1124,6 +1124,40 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform + Scenario: Get all suppression rules returns "OK" response with pagination + Given new "ListSecurityMonitoringSuppressions" request + And there is a valid "suppression" in the system + And there is a valid "suppression2" in the system + And request contains "page[size]" parameter with value 1 + And request contains "page[number]" parameter with value 0 + And request contains "query" parameter with value "id:{{ suppression.data.id }} OR id:{{ suppression2.data.id }}" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + + @team:DataDog/k9-cloud-security-platform + Scenario: Get all suppression rules returns "OK" response with sort ascending + Given new "ListSecurityMonitoringSuppressions" request + And there is a valid "suppression" in the system + And there is a valid "suppression2" in the system + And request contains "sort" parameter with value "name" + And request contains "query" parameter with value "id:{{ suppression.data.id }} OR id:{{ suppression2.data.id }}" + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes.name" is equal to "suppression {{ unique }}" + + @team:DataDog/k9-cloud-security-platform + Scenario: Get all suppression rules returns "OK" response with sort descending + Given new "ListSecurityMonitoringSuppressions" request + And there is a valid "suppression" in the system + And there is a valid "suppression2" in the system + And request contains "sort" parameter with value "-name" + And request contains "query" parameter with value "id:{{ suppression.data.id }} OR id:{{ suppression2.data.id }}" + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes.name" is equal to "suppression2 {{ unique }}" + @skip @team:DataDog/k9-cloud-security-platform Scenario: Get critical assets affecting a specific rule returns "Not Found" response Given new "GetCriticalAssetsAffectingRule" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 421fd893373..59046d30f0b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1734,6 +1734,14 @@ "type": "unsafe" } }, + "CreateIncidentPostmortemAttachment": { + "tag": "Incidents", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "DeleteIncidentAttachment": { "tag": "Incidents", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index cdd2bdf2c01..a050d85bf5a 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -253,6 +253,7 @@ def initialize "v2.create_incident_integration": false, "v2.create_incident_notification_rule": false, "v2.create_incident_notification_template": false, + "v2.create_incident_postmortem_attachment": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, "v2.delete_incident": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5cfdf83ee17..eab18ec23f5 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3561,6 +3561,13 @@ def overrides "v2.permission_attributes" => "PermissionAttributes", "v2.permissions_response" => "PermissionsResponse", "v2.permissions_type" => "PermissionsType", + "v2.postmortem_attachment_request" => "PostmortemAttachmentRequest", + "v2.postmortem_attachment_request_attributes" => "PostmortemAttachmentRequestAttributes", + "v2.postmortem_attachment_request_data" => "PostmortemAttachmentRequestData", + "v2.postmortem_cell" => "PostmortemCell", + "v2.postmortem_cell_attributes" => "PostmortemCellAttributes", + "v2.postmortem_cell_definition" => "PostmortemCellDefinition", + "v2.postmortem_cell_type" => "PostmortemCellType", "v2.powerpack" => "Powerpack", "v2.powerpack_attributes" => "PowerpackAttributes", "v2.powerpack_data" => "PowerpackData", @@ -4059,6 +4066,7 @@ def overrides "v2.security_monitoring_filter" => "SecurityMonitoringFilter", "v2.security_monitoring_filter_action" => "SecurityMonitoringFilterAction", "v2.security_monitoring_list_rules_response" => "SecurityMonitoringListRulesResponse", + "v2.security_monitoring_paginated_suppressions_response" => "SecurityMonitoringPaginatedSuppressionsResponse", "v2.security_monitoring_reference_table" => "SecurityMonitoringReferenceTable", "v2.security_monitoring_rule_anomaly_detection_options" => "SecurityMonitoringRuleAnomalyDetectionOptions", "v2.security_monitoring_rule_anomaly_detection_options_bucket_duration" => "SecurityMonitoringRuleAnomalyDetectionOptionsBucketDuration", @@ -4149,6 +4157,9 @@ def overrides "v2.security_monitoring_suppression_create_data" => "SecurityMonitoringSuppressionCreateData", "v2.security_monitoring_suppression_create_request" => "SecurityMonitoringSuppressionCreateRequest", "v2.security_monitoring_suppression_response" => "SecurityMonitoringSuppressionResponse", + "v2.security_monitoring_suppressions_meta" => "SecurityMonitoringSuppressionsMeta", + "v2.security_monitoring_suppression_sort" => "SecurityMonitoringSuppressionSort", + "v2.security_monitoring_suppressions_page_meta" => "SecurityMonitoringSuppressionsPageMeta", "v2.security_monitoring_suppressions_response" => "SecurityMonitoringSuppressionsResponse", "v2.security_monitoring_suppression_type" => "SecurityMonitoringSuppressionType", "v2.security_monitoring_suppression_update_attributes" => "SecurityMonitoringSuppressionUpdateAttributes", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index ca8a628c1db..9f76aa5e4ea 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -474,6 +474,84 @@ def create_incident_notification_template_with_http_info(body, opts = {}) return data, status_code, headers end + # Create postmortem attachment. + # + # @see #create_incident_postmortem_attachment_with_http_info + def create_incident_postmortem_attachment(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_postmortem_attachment_with_http_info(incident_id, body, opts) + data + end + + # Create postmortem attachment. + # + # Create a postmortem attachment for an incident. + # + # @param incident_id [String] The ID of the incident + # @param body [PostmortemAttachmentRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers + def create_incident_postmortem_attachment_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_postmortem_attachment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_postmortem_attachment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_postmortem_attachment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_postmortem_attachment ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_postmortem_attachment" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_postmortem_attachment" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/attachments/postmortems'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'Attachment' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_incident_postmortem_attachment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_postmortem_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an incident todo. # # @see #create_incident_todo_with_http_info diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index f8bc15c5bcc..a62476064c5 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -4384,18 +4384,28 @@ def list_security_monitoring_suppressions(opts = {}) # # @param opts [Hash] the optional parameters # @option opts [String] :query Query string. - # @return [Array<(SecurityMonitoringSuppressionsResponse, Integer, Hash)>] SecurityMonitoringSuppressionsResponse data, response status code and response headers + # @option opts [SecurityMonitoringSuppressionSort] :sort Attribute used to sort the list of suppression rules. Prefix with `-` to sort in descending order. + # @option opts [Integer] :page_size Size for a given page. Use `-1` to return all items. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(SecurityMonitoringPaginatedSuppressionsResponse, Integer, Hash)>] SecurityMonitoringPaginatedSuppressionsResponse data, response status code and response headers def list_security_monitoring_suppressions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_suppressions ...' end + allowable_values = ['name', 'start_date', 'expiration_date', 'update_date', 'enabled', '-name', '-start_date', '-expiration_date', '-update_date', '-enabled'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end # resource path local_var_path = '/api/v2/security_monitoring/configuration/suppressions' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? # header parameters header_params = opts[:header_params] || {} @@ -4409,7 +4419,7 @@ def list_security_monitoring_suppressions_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'SecurityMonitoringSuppressionsResponse' + return_type = opts[:debug_return_type] || 'SecurityMonitoringPaginatedSuppressionsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] diff --git a/lib/datadog_api_client/v2/models/postmortem_attachment_request.rb b/lib/datadog_api_client/v2/models/postmortem_attachment_request.rb new file mode 100644 index 00000000000..47280012f20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_attachment_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class PostmortemAttachmentRequest + include BaseGenericModel + + # Postmortem attachment data + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PostmortemAttachmentRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PostmortemAttachmentRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_attachment_request_attributes.rb b/lib/datadog_api_client/v2/models/postmortem_attachment_request_attributes.rb new file mode 100644 index 00000000000..5fb6b224ddd --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_attachment_request_attributes.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Postmortem attachment attributes + class PostmortemAttachmentRequestAttributes + include BaseGenericModel + + # The cells of the postmortem + attr_accessor :cells + + # The content of the postmortem + attr_accessor :content + + # The ID of the postmortem template + attr_accessor :postmortem_template_id + + # The title of the postmortem + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cells' => :'cells', + :'content' => :'content', + :'postmortem_template_id' => :'postmortem_template_id', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cells' => :'Array', + :'content' => :'String', + :'postmortem_template_id' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PostmortemAttachmentRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cells') + if (value = attributes[:'cells']).is_a?(Array) + self.cells = value + end + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'postmortem_template_id') + self.postmortem_template_id = attributes[:'postmortem_template_id'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cells == o.cells && + content == o.content && + postmortem_template_id == o.postmortem_template_id && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cells, content, postmortem_template_id, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_attachment_request_data.rb b/lib/datadog_api_client/v2/models/postmortem_attachment_request_data.rb new file mode 100644 index 00000000000..227f3b3ae76 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_attachment_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Postmortem attachment data + class PostmortemAttachmentRequestData + include BaseGenericModel + + # Postmortem attachment attributes + attr_reader :attributes + + # The incident attachment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PostmortemAttachmentRequestAttributes', + :'type' => :'IncidentAttachmentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PostmortemAttachmentRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_cell.rb b/lib/datadog_api_client/v2/models/postmortem_cell.rb new file mode 100644 index 00000000000..3c42d770d37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_cell.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A cell in the postmortem + class PostmortemCell + include BaseGenericModel + + # Attributes of a postmortem cell + attr_accessor :attributes + + # The unique identifier of the cell + attr_accessor :id + + # The postmortem cell resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PostmortemCellAttributes', + :'id' => :'String', + :'type' => :'PostmortemCellType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PostmortemCell` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_cell_attributes.rb b/lib/datadog_api_client/v2/models/postmortem_cell_attributes.rb new file mode 100644 index 00000000000..1d296c6ed91 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_cell_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a postmortem cell + class PostmortemCellAttributes + include BaseGenericModel + + # Definition of a postmortem cell + attr_accessor :definition + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'definition' => :'definition' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'definition' => :'PostmortemCellDefinition' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PostmortemCellAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + definition == o.definition && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [definition, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_cell_definition.rb b/lib/datadog_api_client/v2/models/postmortem_cell_definition.rb new file mode 100644 index 00000000000..79d791c5614 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_cell_definition.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Definition of a postmortem cell + class PostmortemCellDefinition + include BaseGenericModel + + # The content of the cell in markdown format + attr_accessor :content + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content' => :'content' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PostmortemCellDefinition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_cell_type.rb b/lib/datadog_api_client/v2/models/postmortem_cell_type.rb new file mode 100644 index 00000000000..f8c9fea32a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_cell_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem cell resource type. + class PostmortemCellType + include BaseEnumModel + + MARKDOWN = "markdown".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_paginated_suppressions_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_paginated_suppressions_response.rb new file mode 100644 index 00000000000..15545aed3c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_paginated_suppressions_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response object containing the available suppression rules with pagination metadata. + class SecurityMonitoringPaginatedSuppressionsResponse + include BaseGenericModel + + # A list of suppressions objects. + attr_accessor :data + + # Metadata for the suppression list response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SecurityMonitoringSuppressionsMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringPaginatedSuppressionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_suppression_sort.rb b/lib/datadog_api_client/v2/models/security_monitoring_suppression_sort.rb new file mode 100644 index 00000000000..ebcf5ce84f5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_suppression_sort.rb @@ -0,0 +1,35 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The sort parameters used for querying suppression rules. + class SecurityMonitoringSuppressionSort + include BaseEnumModel + + NAME = "name".freeze + START_DATE = "start_date".freeze + EXPIRATION_DATE = "expiration_date".freeze + UPDATE_DATE = "update_date".freeze + ENABLED = "enabled".freeze + NAME_DESCENDING = "-name".freeze + START_DATE_DESCENDING = "-start_date".freeze + EXPIRATION_DATE_DESCENDING = "-expiration_date".freeze + UPDATE_DATE_DESCENDING = "-update_date".freeze + ENABLED_DESCENDING = "-enabled".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_suppressions_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_suppressions_meta.rb new file mode 100644 index 00000000000..170b6a914c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_suppressions_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for the suppression list response. + class SecurityMonitoringSuppressionsMeta + include BaseGenericModel + + # Pagination metadata. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'SecurityMonitoringSuppressionsPageMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringSuppressionsMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_suppressions_page_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_suppressions_page_meta.rb new file mode 100644 index 00000000000..35152ade3c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_suppressions_page_meta.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata. + class SecurityMonitoringSuppressionsPageMeta + include BaseGenericModel + + # Current page number. + attr_accessor :page_number + + # Current page size. + attr_accessor :page_size + + # Total count of suppressions. + attr_accessor :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page_number' => :'pageNumber', + :'page_size' => :'pageSize', + :'total_count' => :'totalCount' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page_number' => :'Integer', + :'page_size' => :'Integer', + :'total_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringSuppressionsPageMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page_number') + self.page_number = attributes[:'page_number'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page_number == o.page_number && + page_size == o.page_size && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page_number, page_size, total_count, additional_properties].hash + end + end +end