From 24f3e0cd9328d13a5ba0bf44ffdc7c2320c65745 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 31 Mar 2026 07:47:33 +0000 Subject: [PATCH] Regenerate client from commit a31b8f6 of spec repo --- .generator/schemas/v2/openapi.yaml | 231 ++++++++++++++++ ...lkEditSecurityMonitoringSignalsAssignee.rb | 17 ++ .../BulkEditSecurityMonitoringSignalsState.rb | 18 ++ features/scenarios_model_mapping.rb | 6 + features/v2/security_monitoring.feature | 30 +++ features/v2/undo.json | 12 + lib/datadog_api_client/inflector.rb | 9 + .../v2/api/security_monitoring_api.rb | 136 ++++++++++ ...signals_bulk_assignee_update_attributes.rb | 133 ++++++++++ ...oring_signals_bulk_assignee_update_data.rb | 154 +++++++++++ ...ng_signals_bulk_assignee_update_request.rb | 129 +++++++++ ...nitoring_signals_bulk_state_update_data.rb | 154 +++++++++++ ...oring_signals_bulk_state_update_request.rb | 129 +++++++++ ...ty_monitoring_signals_bulk_triage_event.rb | 144 ++++++++++ ...ng_signals_bulk_triage_event_attributes.rb | 248 ++++++++++++++++++ ...ing_signals_bulk_triage_update_response.rb | 165 ++++++++++++ ...oring_signals_bulk_triage_update_result.rb | 146 +++++++++++ 17 files changed, 1861 insertions(+) create mode 100644 examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsAssignee.rb create mode 100644 examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsState.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_state_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_state_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_result.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2c27fbce2be8..94bfc15b9986 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -58505,6 +58505,155 @@ components: description: Version of the updated signal. If server side version is higher, update will be rejected. format: int64 type: integer + SecurityMonitoringSignalsBulkAssigneeUpdateAttributes: + description: Attributes describing the new assignees for a bulk signal update. + properties: + assignee: + description: UUID of the user to assign to the signal. Use an empty string to unassign. + example: 773b045d-ccf8-4808-bd3b-955ef6a8c940 + type: string + version: + $ref: "#/components/schemas/SecurityMonitoringSignalVersion" + required: + - assignee + type: object + SecurityMonitoringSignalsBulkAssigneeUpdateData: + description: Data for updating the assignees for multiple security signals. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkAssigneeUpdateAttributes" + id: + description: The unique ID of the security signal. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringSignalType" + required: + - id + - attributes + type: object + SecurityMonitoringSignalsBulkAssigneeUpdateRequest: + description: Request body for updating the assignee of multiple security signals. + properties: + data: + description: An array of signal assignee updates. + items: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkAssigneeUpdateData" + maxItems: 199 + type: array + required: + - data + type: object + SecurityMonitoringSignalsBulkStateUpdateData: + description: Data for updating the state for multiple security signals. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringSignalStateUpdateAttributes" + id: + description: The unique ID of the security signal. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringSignalType" + required: + - id + - attributes + type: object + SecurityMonitoringSignalsBulkStateUpdateRequest: + description: Request body for updating the triage states of multiple security signals. + properties: + data: + description: An array of signal state updates. + items: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkStateUpdateData" + maxItems: 199 + type: array + required: + - data + type: object + SecurityMonitoringSignalsBulkTriageEvent: + description: A single signal event entry in a bulk triage update response. + properties: + event: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkTriageEventAttributes" + id: + description: The unique ID of the security signal. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string + required: + - id + - event + type: object + SecurityMonitoringSignalsBulkTriageEventAttributes: + description: Triage attributes of a security signal returned in a bulk update response. + properties: + archive_comment: + $ref: "#/components/schemas/SecurityMonitoringSignalArchiveComment" + archive_comment_timestamp: + description: Timestamp of the last edit to the archive comment. + format: int64 + type: integer + archive_comment_user: + $ref: "#/components/schemas/SecurityMonitoringTriageUser" + archive_reason: + $ref: "#/components/schemas/SecurityMonitoringSignalArchiveReason" + assignee: + $ref: "#/components/schemas/SecurityMonitoringTriageUser" + id: + description: The unique ID of the security signal. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string + incident_ids: + $ref: "#/components/schemas/SecurityMonitoringSignalIncidentIds" + state: + $ref: "#/components/schemas/SecurityMonitoringSignalState" + state_update_timestamp: + description: Timestamp of the last state update. + format: int64 + type: integer + state_update_user: + $ref: "#/components/schemas/SecurityMonitoringTriageUser" + required: + - id + - state + - assignee + - incident_ids + type: object + SecurityMonitoringSignalsBulkTriageUpdateResponse: + description: Response for a bulk triage update of security signals. + properties: + result: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkTriageUpdateResult" + status: + description: The status of the bulk operation. + example: done + type: string + type: + description: The type of the response. + example: status + type: string + required: + - type + - status + - result + type: object + SecurityMonitoringSignalsBulkTriageUpdateResult: + description: The result payload of a bulk signal triage update. + properties: + count: + description: The number of signals updated. + example: 2 + format: int64 + type: integer + events: + description: The list of updated signals. + items: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkTriageEvent" + type: array + required: + - count + - events + type: object SecurityMonitoringSignalsListResponse: description: "The response object with all security signals matching the request\nand pagination information." properties: @@ -103394,6 +103543,88 @@ paths: operator: OR permissions: - security_monitoring_signals_read + /api/v2/security_monitoring/signals/bulk/assignee: + patch: + description: |- + Change the triage assignees of multiple security signals at once. + The maximum number of signals that can be updated in a single request is 199. + operationId: BulkEditSecurityMonitoringSignalsAssignee + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkAssigneeUpdateRequest" + description: Attributes describing the signal assignee updates. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkTriageUpdateResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Bulk update triage assignee of security signals + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_signals_write + /api/v2/security_monitoring/signals/bulk/state: + patch: + description: |- + Change the triage states of multiple security signals at once. + The maximum number of signals that can be updated in a single request is 199. + operationId: BulkEditSecurityMonitoringSignalsState + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkStateUpdateRequest" + description: Attributes describing the signal state updates. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SecurityMonitoringSignalsBulkTriageUpdateResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Bulk update triage state of security signals + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_signals_write /api/v2/security_monitoring/signals/search: post: description: |- diff --git a/examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsAssignee.rb b/examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsAssignee.rb new file mode 100644 index 000000000000..268776e1839a --- /dev/null +++ b/examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsAssignee.rb @@ -0,0 +1,17 @@ +# Bulk update triage assignee of security signals returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringSignalsBulkAssigneeUpdateRequest.new({ + data: [ + DatadogAPIClient::V2::SecurityMonitoringSignalsBulkAssigneeUpdateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringSignalsBulkAssigneeUpdateAttributes.new({ + assignee: "773b045d-ccf8-4808-bd3b-955ef6a8c940", + }), + id: "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", + type: DatadogAPIClient::V2::SecurityMonitoringSignalType::SIGNAL, + }), + ], +}) +p api_instance.bulk_edit_security_monitoring_signals_assignee(body) diff --git a/examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsState.rb b/examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsState.rb new file mode 100644 index 000000000000..1160d05fb41b --- /dev/null +++ b/examples/v2/security-monitoring/BulkEditSecurityMonitoringSignalsState.rb @@ -0,0 +1,18 @@ +# Bulk update triage state of security signals returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringSignalsBulkStateUpdateRequest.new({ + data: [ + DatadogAPIClient::V2::SecurityMonitoringSignalsBulkStateUpdateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringSignalStateUpdateAttributes.new({ + archive_reason: DatadogAPIClient::V2::SecurityMonitoringSignalArchiveReason::NONE, + state: DatadogAPIClient::V2::SecurityMonitoringSignalState::OPEN, + }), + id: "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", + type: DatadogAPIClient::V2::SecurityMonitoringSignalType::SIGNAL, + }), + ], +}) +p api_instance.bulk_edit_security_monitoring_signals_state(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index df090cea2c0a..7926477503d8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1741,6 +1741,12 @@ "page_cursor" => "String", "page_limit" => "Integer", }, + "v2.BulkEditSecurityMonitoringSignalsAssignee" => { + "body" => "SecurityMonitoringSignalsBulkAssigneeUpdateRequest", + }, + "v2.BulkEditSecurityMonitoringSignalsState" => { + "body" => "SecurityMonitoringSignalsBulkStateUpdateRequest", + }, "v2.SearchSecurityMonitoringSignals" => { "body" => "SecurityMonitoringSignalListRequest", }, diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 5695a7ea4a50..791d52de6467 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -121,6 +121,36 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/k9-cloud-security-platform + Scenario: Bulk update triage assignee of security signals returns "Bad Request" response + Given operation "BulkEditSecurityMonitoringSignalsAssignee" enabled + And new "BulkEditSecurityMonitoringSignalsAssignee" request + And body with value {"data": [{"attributes": {}, "id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", "type": "signal"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Bulk update triage assignee of security signals returns "OK" response + Given new "BulkEditSecurityMonitoringSignalsAssignee" request + And body with value {"data": [{"attributes": {"assignee": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}, "id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", "type": "signal"}]} + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/k9-cloud-security-platform + Scenario: Bulk update triage state of security signals returns "Bad Request" response + Given operation "BulkEditSecurityMonitoringSignalsState" enabled + And new "BulkEditSecurityMonitoringSignalsState" request + And body with value {"data": [{"attributes": {}, "id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", "type": "signal"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Bulk update triage state of security signals returns "OK" response + Given new "BulkEditSecurityMonitoringSignalsState" request + And body with value {"data": [{"attributes": {"archive_reason": "none", "state": "open"}, "id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", "type": "signal"}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Bad Request" response Given operation "CancelThreatHuntingJob" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 29b9dc1ab270..f18461244ec3 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5229,6 +5229,18 @@ "type": "safe" } }, + "BulkEditSecurityMonitoringSignalsAssignee": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "BulkEditSecurityMonitoringSignalsState": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "SearchSecurityMonitoringSignals": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1ad2605d59ac..46c7e31d80bf 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4794,6 +4794,15 @@ def overrides "v2.security_monitoring_signal_rule_response" => "SecurityMonitoringSignalRuleResponse", "v2.security_monitoring_signal_rule_response_query" => "SecurityMonitoringSignalRuleResponseQuery", "v2.security_monitoring_signal_rule_type" => "SecurityMonitoringSignalRuleType", + "v2.security_monitoring_signals_bulk_assignee_update_attributes" => "SecurityMonitoringSignalsBulkAssigneeUpdateAttributes", + "v2.security_monitoring_signals_bulk_assignee_update_data" => "SecurityMonitoringSignalsBulkAssigneeUpdateData", + "v2.security_monitoring_signals_bulk_assignee_update_request" => "SecurityMonitoringSignalsBulkAssigneeUpdateRequest", + "v2.security_monitoring_signals_bulk_state_update_data" => "SecurityMonitoringSignalsBulkStateUpdateData", + "v2.security_monitoring_signals_bulk_state_update_request" => "SecurityMonitoringSignalsBulkStateUpdateRequest", + "v2.security_monitoring_signals_bulk_triage_event" => "SecurityMonitoringSignalsBulkTriageEvent", + "v2.security_monitoring_signals_bulk_triage_event_attributes" => "SecurityMonitoringSignalsBulkTriageEventAttributes", + "v2.security_monitoring_signals_bulk_triage_update_response" => "SecurityMonitoringSignalsBulkTriageUpdateResponse", + "v2.security_monitoring_signals_bulk_triage_update_result" => "SecurityMonitoringSignalsBulkTriageUpdateResult", "v2.security_monitoring_signals_list_response" => "SecurityMonitoringSignalsListResponse", "v2.security_monitoring_signals_list_response_links" => "SecurityMonitoringSignalsListResponseLinks", "v2.security_monitoring_signals_list_response_meta" => "SecurityMonitoringSignalsListResponseMeta", 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 546aee0e48d5..eeb9f038aaf7 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -237,6 +237,142 @@ def attach_jira_issue_with_http_info(body, opts = {}) return data, status_code, headers end + # Bulk update triage assignee of security signals. + # + # @see #bulk_edit_security_monitoring_signals_assignee_with_http_info + def bulk_edit_security_monitoring_signals_assignee(body, opts = {}) + data, _status_code, _headers = bulk_edit_security_monitoring_signals_assignee_with_http_info(body, opts) + data + end + + # Bulk update triage assignee of security signals. + # + # Change the triage assignees of multiple security signals at once. + # The maximum number of signals that can be updated in a single request is 199. + # + # @param body [SecurityMonitoringSignalsBulkAssigneeUpdateRequest] Attributes describing the signal assignee updates. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringSignalsBulkTriageUpdateResponse, Integer, Hash)>] SecurityMonitoringSignalsBulkTriageUpdateResponse data, response status code and response headers + def bulk_edit_security_monitoring_signals_assignee_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.bulk_edit_security_monitoring_signals_assignee ...' + 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 SecurityMonitoringAPI.bulk_edit_security_monitoring_signals_assignee" + end + # resource path + local_var_path = '/api/v2/security_monitoring/signals/bulk/assignee' + + # 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] || 'SecurityMonitoringSignalsBulkTriageUpdateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :bulk_edit_security_monitoring_signals_assignee, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#bulk_edit_security_monitoring_signals_assignee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Bulk update triage state of security signals. + # + # @see #bulk_edit_security_monitoring_signals_state_with_http_info + def bulk_edit_security_monitoring_signals_state(body, opts = {}) + data, _status_code, _headers = bulk_edit_security_monitoring_signals_state_with_http_info(body, opts) + data + end + + # Bulk update triage state of security signals. + # + # Change the triage states of multiple security signals at once. + # The maximum number of signals that can be updated in a single request is 199. + # + # @param body [SecurityMonitoringSignalsBulkStateUpdateRequest] Attributes describing the signal state updates. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringSignalsBulkTriageUpdateResponse, Integer, Hash)>] SecurityMonitoringSignalsBulkTriageUpdateResponse data, response status code and response headers + def bulk_edit_security_monitoring_signals_state_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.bulk_edit_security_monitoring_signals_state ...' + 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 SecurityMonitoringAPI.bulk_edit_security_monitoring_signals_state" + end + # resource path + local_var_path = '/api/v2/security_monitoring/signals/bulk/state' + + # 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] || 'SecurityMonitoringSignalsBulkTriageUpdateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :bulk_edit_security_monitoring_signals_state, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#bulk_edit_security_monitoring_signals_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Bulk export security monitoring rules. # # @see #bulk_export_security_monitoring_rules_with_http_info diff --git a/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_attributes.rb new file mode 100644 index 000000000000..f98650eff810 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_attributes.rb @@ -0,0 +1,133 @@ +=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 describing the new assignees for a bulk signal update. + class SecurityMonitoringSignalsBulkAssigneeUpdateAttributes + include BaseGenericModel + + # UUID of the user to assign to the signal. Use an empty string to unassign. + attr_reader :assignee + + # Version of the updated signal. If server side version is higher, update will be rejected. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee' => :'assignee', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee' => :'String', + :'version' => :'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::SecurityMonitoringSignalsBulkAssigneeUpdateAttributes` 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?(:'assignee') + self.assignee = attributes[:'assignee'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @assignee.nil? + true + end + + # Custom attribute writer method with validation + # @param assignee [Object] Object to be assigned + # @!visibility private + def assignee=(assignee) + if assignee.nil? + fail ArgumentError, 'invalid value for "assignee", assignee cannot be nil.' + end + @assignee = assignee + 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 && + assignee == o.assignee && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_data.rb new file mode 100644 index 000000000000..2c32e5664515 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_data.rb @@ -0,0 +1,154 @@ +=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 + # Data for updating the assignees for multiple security signals. + class SecurityMonitoringSignalsBulkAssigneeUpdateData + include BaseGenericModel + + # Attributes describing the new assignees for a bulk signal update. + attr_reader :attributes + + # The unique ID of the security signal. + attr_reader :id + + # The type of event. + 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' => :'SecurityMonitoringSignalsBulkAssigneeUpdateAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringSignalType' + } + 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::SecurityMonitoringSignalsBulkAssigneeUpdateData` 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 + + # 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 @id.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 id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/security_monitoring_signals_bulk_assignee_update_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_request.rb new file mode 100644 index 000000000000..f6a422aa37d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_assignee_update_request.rb @@ -0,0 +1,129 @@ +=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 + # Request body for updating the assignee of multiple security signals. + class SecurityMonitoringSignalsBulkAssigneeUpdateRequest + include BaseGenericModel + + # An array of signal assignee updates. + 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' => :'Array' + } + 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::SecurityMonitoringSignalsBulkAssigneeUpdateRequest` 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 + 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? + return false if @data.length > 199 + 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 + if data.length > 199 + fail ArgumentError, 'invalid value for "data", number of items must be less than or equal to 199.' + 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/security_monitoring_signals_bulk_state_update_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_state_update_data.rb new file mode 100644 index 000000000000..83beff51f660 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_state_update_data.rb @@ -0,0 +1,154 @@ +=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 + # Data for updating the state for multiple security signals. + class SecurityMonitoringSignalsBulkStateUpdateData + include BaseGenericModel + + # Attributes describing the change of state of a security signal. + attr_reader :attributes + + # The unique ID of the security signal. + attr_reader :id + + # The type of event. + 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' => :'SecurityMonitoringSignalStateUpdateAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringSignalType' + } + 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::SecurityMonitoringSignalsBulkStateUpdateData` 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 + + # 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 @id.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 id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/security_monitoring_signals_bulk_state_update_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_state_update_request.rb new file mode 100644 index 000000000000..72ac337db5fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_state_update_request.rb @@ -0,0 +1,129 @@ +=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 + # Request body for updating the triage states of multiple security signals. + class SecurityMonitoringSignalsBulkStateUpdateRequest + include BaseGenericModel + + # An array of signal state updates. + 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' => :'Array' + } + 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::SecurityMonitoringSignalsBulkStateUpdateRequest` 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 + 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? + return false if @data.length > 199 + 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 + if data.length > 199 + fail ArgumentError, 'invalid value for "data", number of items must be less than or equal to 199.' + 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/security_monitoring_signals_bulk_triage_event.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event.rb new file mode 100644 index 000000000000..0e9bcb88d9f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event.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 + # A single signal event entry in a bulk triage update response. + class SecurityMonitoringSignalsBulkTriageEvent + include BaseGenericModel + + # Triage attributes of a security signal returned in a bulk update response. + attr_reader :event + + # The unique ID of the security signal. + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'event' => :'event', + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'event' => :'SecurityMonitoringSignalsBulkTriageEventAttributes', + :'id' => :'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::SecurityMonitoringSignalsBulkTriageEvent` 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?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + 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 @event.nil? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param event [Object] Object to be assigned + # @!visibility private + def event=(event) + if event.nil? + fail ArgumentError, 'invalid value for "event", event cannot be nil.' + end + @event = event + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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 && + event == o.event && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [event, id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event_attributes.rb new file mode 100644 index 000000000000..c96b6d596d80 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_event_attributes.rb @@ -0,0 +1,248 @@ +=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 + # Triage attributes of a security signal returned in a bulk update response. + class SecurityMonitoringSignalsBulkTriageEventAttributes + include BaseGenericModel + + # Optional comment to display on archived signals. + attr_accessor :archive_comment + + # Timestamp of the last edit to the archive comment. + attr_accessor :archive_comment_timestamp + + # Object representing a given user entity. + attr_accessor :archive_comment_user + + # Reason a signal is archived. + attr_accessor :archive_reason + + # Object representing a given user entity. + attr_reader :assignee + + # The unique ID of the security signal. + attr_reader :id + + # Array of incidents that are associated with this signal. + attr_reader :incident_ids + + # The new triage state of the signal. + attr_reader :state + + # Timestamp of the last state update. + attr_accessor :state_update_timestamp + + # Object representing a given user entity. + attr_accessor :state_update_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'archive_comment' => :'archive_comment', + :'archive_comment_timestamp' => :'archive_comment_timestamp', + :'archive_comment_user' => :'archive_comment_user', + :'archive_reason' => :'archive_reason', + :'assignee' => :'assignee', + :'id' => :'id', + :'incident_ids' => :'incident_ids', + :'state' => :'state', + :'state_update_timestamp' => :'state_update_timestamp', + :'state_update_user' => :'state_update_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'archive_comment' => :'String', + :'archive_comment_timestamp' => :'Integer', + :'archive_comment_user' => :'SecurityMonitoringTriageUser', + :'archive_reason' => :'SecurityMonitoringSignalArchiveReason', + :'assignee' => :'SecurityMonitoringTriageUser', + :'id' => :'String', + :'incident_ids' => :'Array', + :'state' => :'SecurityMonitoringSignalState', + :'state_update_timestamp' => :'Integer', + :'state_update_user' => :'SecurityMonitoringTriageUser' + } + 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::SecurityMonitoringSignalsBulkTriageEventAttributes` 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?(:'archive_comment') + self.archive_comment = attributes[:'archive_comment'] + end + + if attributes.key?(:'archive_comment_timestamp') + self.archive_comment_timestamp = attributes[:'archive_comment_timestamp'] + end + + if attributes.key?(:'archive_comment_user') + self.archive_comment_user = attributes[:'archive_comment_user'] + end + + if attributes.key?(:'archive_reason') + self.archive_reason = attributes[:'archive_reason'] + end + + if attributes.key?(:'assignee') + self.assignee = attributes[:'assignee'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'incident_ids') + if (value = attributes[:'incident_ids']).is_a?(Array) + self.incident_ids = value + end + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'state_update_timestamp') + self.state_update_timestamp = attributes[:'state_update_timestamp'] + end + + if attributes.key?(:'state_update_user') + self.state_update_user = attributes[:'state_update_user'] + 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 @assignee.nil? + return false if @id.nil? + return false if @incident_ids.nil? + return false if @state.nil? + true + end + + # Custom attribute writer method with validation + # @param assignee [Object] Object to be assigned + # @!visibility private + def assignee=(assignee) + if assignee.nil? + fail ArgumentError, 'invalid value for "assignee", assignee cannot be nil.' + end + @assignee = assignee + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param incident_ids [Object] Object to be assigned + # @!visibility private + def incident_ids=(incident_ids) + if incident_ids.nil? + fail ArgumentError, 'invalid value for "incident_ids", incident_ids cannot be nil.' + end + @incident_ids = incident_ids + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + 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 && + archive_comment == o.archive_comment && + archive_comment_timestamp == o.archive_comment_timestamp && + archive_comment_user == o.archive_comment_user && + archive_reason == o.archive_reason && + assignee == o.assignee && + id == o.id && + incident_ids == o.incident_ids && + state == o.state && + state_update_timestamp == o.state_update_timestamp && + state_update_user == o.state_update_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [archive_comment, archive_comment_timestamp, archive_comment_user, archive_reason, assignee, id, incident_ids, state, state_update_timestamp, state_update_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_response.rb new file mode 100644 index 000000000000..75bd01137814 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_response.rb @@ -0,0 +1,165 @@ +=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 for a bulk triage update of security signals. + class SecurityMonitoringSignalsBulkTriageUpdateResponse + include BaseGenericModel + + # The result payload of a bulk signal triage update. + attr_reader :result + + # The status of the bulk operation. + attr_reader :status + + # The type of the response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'result' => :'result', + :'status' => :'status', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'result' => :'SecurityMonitoringSignalsBulkTriageUpdateResult', + :'status' => :'String', + :'type' => :'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::SecurityMonitoringSignalsBulkTriageUpdateResponse` 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?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @result.nil? + return false if @status.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param result [Object] Object to be assigned + # @!visibility private + def result=(result) + if result.nil? + fail ArgumentError, 'invalid value for "result", result cannot be nil.' + end + @result = result + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + result == o.result && + status == o.status && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [result, status, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_result.rb b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_result.rb new file mode 100644 index 000000000000..e290c18a547d --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_signals_bulk_triage_update_result.rb @@ -0,0 +1,146 @@ +=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 result payload of a bulk signal triage update. + class SecurityMonitoringSignalsBulkTriageUpdateResult + include BaseGenericModel + + # The number of signals updated. + attr_reader :count + + # The list of updated signals. + attr_reader :events + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'events' => :'events' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'events' => :'Array' + } + 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::SecurityMonitoringSignalsBulkTriageUpdateResult` 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?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + 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 @count.nil? + return false if @events.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param events [Object] Object to be assigned + # @!visibility private + def events=(events) + if events.nil? + fail ArgumentError, 'invalid value for "events", events cannot be nil.' + end + @events = events + 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 && + count == o.count && + events == o.events && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, events, additional_properties].hash + end + end +end