diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 122c27ff508f..d3670288b4da 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13031,99 +13031,6 @@ components: type: string x-enum-varnames: - ITEMS - BulkMuteFindingsRequest: - description: The new bulk mute finding request. - properties: - data: - $ref: "#/components/schemas/BulkMuteFindingsRequestData" - required: - - data - type: object - BulkMuteFindingsRequestAttributes: - additionalProperties: false - description: The mute properties to be updated. - properties: - mute: - $ref: "#/components/schemas/BulkMuteFindingsRequestProperties" - required: - - mute - type: object - BulkMuteFindingsRequestData: - description: Data object containing the new bulk mute properties of the finding. - properties: - attributes: - $ref: "#/components/schemas/BulkMuteFindingsRequestAttributes" - id: - description: UUID to identify the request - example: dbe5f567-192b-4404-b908-29b70e1c9f76 - type: string - meta: - $ref: "#/components/schemas/BulkMuteFindingsRequestMeta" - type: - $ref: "#/components/schemas/FindingType" - required: - - id - - type - - attributes - - meta - type: object - BulkMuteFindingsRequestMeta: - description: Meta object containing the findings to be updated. - properties: - findings: - description: Array of findings. - items: - $ref: "#/components/schemas/BulkMuteFindingsRequestMetaFindings" - type: array - type: object - BulkMuteFindingsRequestMetaFindings: - description: Finding object containing the finding information. - properties: - finding_id: - $ref: "#/components/schemas/FindingID" - type: object - BulkMuteFindingsRequestProperties: - additionalProperties: false - description: Object containing the new mute properties of the findings. - properties: - description: - description: Additional information about the reason why those findings are muted or unmuted. This field has a maximum limit of 280 characters. - type: string - expiration_date: - description: |- - The expiration date of the mute or unmute action (Unix ms). It must be set to a value greater than the current timestamp. - If this field is not provided, the finding will be muted or unmuted indefinitely, which is equivalent to setting the expiration date to 9999999999999. - example: 1778721573794 - format: int64 - type: integer - muted: - description: Whether those findings should be muted or unmuted. - example: true - type: boolean - reason: - $ref: "#/components/schemas/FindingMuteReason" - required: - - muted - - reason - type: object - BulkMuteFindingsResponse: - description: The expected response schema. - properties: - data: - $ref: "#/components/schemas/BulkMuteFindingsResponseData" - required: - - data - type: object - BulkMuteFindingsResponseData: - description: Data object containing the ID of the request that was updated. - properties: - id: - description: UUID used to identify the request - example: 93bfeb70-af47-424d-908a-948d3f08e37f - type: string - type: - $ref: "#/components/schemas/FindingType" - type: object BulkPutAppsDatastoreItemsRequest: description: Request to insert multiple items into a datastore in a single operation. properties: @@ -148552,84 +148459,6 @@ paths: Use the [search security findings endpoint](https://docs.datadoghq.com/api/latest/security-monitoring/#search-security-findings), which is based on the [new security findings schema](https://docs.datadoghq.com/security/guide/findings-schema/), to search security findings. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - patch: - description: |- - Mute or unmute findings. - operationId: MuteFindings - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - mute: - expiration_date: 1778721573794 - muted: true - reason: ACCEPTED_RISK - id: dbe5f567-192b-4404-b908-29b70e1c9f76 - meta: - findings: - - finding_id: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== - type: finding - schema: - $ref: "#/components/schemas/BulkMuteFindingsRequest" - description: |- - ### Attributes - - All findings are updated with the same attributes. The request body must include at least two attributes: `muted` and `reason`. - The allowed reasons depend on whether the finding is being muted or unmuted: - - To mute a finding: `PENDING_FIX`, `FALSE_POSITIVE`, `ACCEPTED_RISK`, `OTHER`. - - To unmute a finding : `NO_PENDING_FIX`, `HUMAN_ERROR`, `NO_LONGER_ACCEPTED_RISK`, `OTHER`. - - ### Meta - - The request body must include a list of the finding IDs to be updated. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - id: abc-123 - type: finding - schema: - $ref: "#/components/schemas/BulkMuteFindingsResponse" - description: OK - "400": - $ref: "#/components/responses/FindingsBadRequestResponse" - "403": - $ref: "#/components/responses/FindingsForbiddenResponse" - "404": - $ref: "#/components/responses/FindingsNotFoundResponse" - "422": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: "Invalid Request: The server understands the request syntax but cannot process it due to invalid data." - "429": - $ref: "#/components/responses/FindingsTooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] - summary: Mute or unmute a batch of findings - tags: - - "Security Monitoring" - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - security_monitoring_findings_write - - appsec_vm_write - x-unstable: |- - **Note**: This endpoint is in public beta. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/posture_management/findings/{finding_id}: get: description: Returns a single finding with message and resource configuration. diff --git a/cassettes/features/v2/security_monitoring/Mute-or-unmute-a-batch-of-findings-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Mute-or-unmute-a-batch-of-findings-returns-OK-response.frozen deleted file mode 100644 index 107d76546622..000000000000 --- a/cassettes/features/v2/security_monitoring/Mute-or-unmute-a-batch-of-findings-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2023-10-27T12:59:49.496Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Mute-or-unmute-a-batch-of-findings-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Mute-or-unmute-a-batch-of-findings-returns-OK-response.yml deleted file mode 100644 index 3a99d2d0ef48..000000000000 --- a/cassettes/features/v2/security_monitoring/Mute-or-unmute-a-batch-of-findings-returns-OK-response.yml +++ /dev/null @@ -1,24 +0,0 @@ -http_interactions: -- recorded_at: Fri, 27 Oct 2023 12:59:49 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"mute":{"expiration_date":1778721573794,"muted":true,"reason":"ACCEPTED_RISK"}},"id":"dbe5f567-192b-4404-b908-29b70e1c9f76","meta":{"findings":[{"finding_id":"ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]},"type":"finding"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: PATCH - uri: https://api.datadoghq.com/api/v2/posture_management/findings - response: - body: - encoding: UTF-8 - string: '{"data":{"id":"dbe5f567-192b-4404-b908-29b70e1c9f76","type":"finding"}}' - headers: - Content-Type: - - application/vnd.api+json - status: - code: 200 - message: OK -recorded_with: VCR 6.0.0 diff --git a/examples/v2/security-monitoring/MuteFindings.rb b/examples/v2/security-monitoring/MuteFindings.rb deleted file mode 100644 index a8382cef9223..000000000000 --- a/examples/v2/security-monitoring/MuteFindings.rb +++ /dev/null @@ -1,29 +0,0 @@ -# Mute or unmute a batch of findings returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.mute_findings".to_sym] = true -end -api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new - -body = DatadogAPIClient::V2::BulkMuteFindingsRequest.new({ - data: DatadogAPIClient::V2::BulkMuteFindingsRequestData.new({ - attributes: DatadogAPIClient::V2::BulkMuteFindingsRequestAttributes.new({ - mute: DatadogAPIClient::V2::BulkMuteFindingsRequestProperties.new({ - expiration_date: 1778721573794, - muted: true, - reason: DatadogAPIClient::V2::FindingMuteReason::ACCEPTED_RISK, - }), - }), - id: "dbe5f567-192b-4404-b908-29b70e1c9f76", - meta: DatadogAPIClient::V2::BulkMuteFindingsRequestMeta.new({ - findings: [ - DatadogAPIClient::V2::BulkMuteFindingsRequestMetaFindings.new({ - finding_id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", - }), - ], - }), - type: DatadogAPIClient::V2::FindingType::FINDING, - }), -}) -p api_instance.mute_findings(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1fcbbe05dce3..c902680ba88e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2017,9 +2017,6 @@ "filter_vulnerability_type" => "Array", "detailed_findings" => "Boolean", }, - "v2.MuteFindings" => { - "body" => "BulkMuteFindingsRequest", - }, "v2.GetFinding" => { "finding_id" => "String", "snapshot_timestamp" => "Integer", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index bae8918780ee..4b53fadbcdc3 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -2359,38 +2359,6 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-security-posture-management - Scenario: Mute or unmute a batch of findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response - Given operation "MuteFindings" enabled - And new "MuteFindings" request - And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings": [{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} - When the request is sent - Then the response status is 400 Bad Request: The server cannot process the request due to invalid syntax in the request. - - @generated @skip @team:DataDog/cloud-security-posture-management - Scenario: Mute or unmute a batch of findings returns "Invalid Request: The server understands the request syntax but cannot process it due to invalid data." response - Given operation "MuteFindings" enabled - And new "MuteFindings" request - And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings": [{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} - When the request is sent - Then the response status is 422 Invalid Request: The server understands the request syntax but cannot process it due to invalid data. - - @generated @skip @team:DataDog/cloud-security-posture-management - Scenario: Mute or unmute a batch of findings returns "Not Found: The requested finding cannot be found." response - Given operation "MuteFindings" enabled - And new "MuteFindings" request - And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings": [{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} - When the request is sent - Then the response status is 404 Not Found: The requested finding cannot be found. - - @replay-only @team:DataDog/cloud-security-posture-management - Scenario: Mute or unmute a batch of findings returns "OK" response - Given operation "MuteFindings" enabled - And new "MuteFindings" request - And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings":[{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} - When the request is sent - Then the response status is 200 OK - @generated @skip @team:DataDog/k9-investigation Scenario: Mute or unmute security findings returns "Accepted" response Given new "MuteSecurityFindings" request diff --git a/features/v2/undo.json b/features/v2/undo.json index d4fc6eda6e7f..dd2cf5b3d46a 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5479,12 +5479,6 @@ "type": "safe" } }, - "MuteFindings": { - "tag": "Security Monitoring", - "undo": { - "type": "safe" - } - }, "GetFinding": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 832ee7adb038..0c764b74f293 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -378,7 +378,6 @@ def initialize "v2.list_static_analysis_codegen_rulesets": false, "v2.list_vulnerabilities": false, "v2.list_vulnerable_assets": false, - "v2.mute_findings": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, "v2.update_findings_assignee": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d7f350831ca9..f2f699d1c277 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1782,14 +1782,6 @@ def overrides "v2.bulk_delete_apps_datastore_items_request_data" => "BulkDeleteAppsDatastoreItemsRequestData", "v2.bulk_delete_apps_datastore_items_request_data_attributes" => "BulkDeleteAppsDatastoreItemsRequestDataAttributes", "v2.bulk_delete_apps_datastore_items_request_data_type" => "BulkDeleteAppsDatastoreItemsRequestDataType", - "v2.bulk_mute_findings_request" => "BulkMuteFindingsRequest", - "v2.bulk_mute_findings_request_attributes" => "BulkMuteFindingsRequestAttributes", - "v2.bulk_mute_findings_request_data" => "BulkMuteFindingsRequestData", - "v2.bulk_mute_findings_request_meta" => "BulkMuteFindingsRequestMeta", - "v2.bulk_mute_findings_request_meta_findings" => "BulkMuteFindingsRequestMetaFindings", - "v2.bulk_mute_findings_request_properties" => "BulkMuteFindingsRequestProperties", - "v2.bulk_mute_findings_response" => "BulkMuteFindingsResponse", - "v2.bulk_mute_findings_response_data" => "BulkMuteFindingsResponseData", "v2.bulk_put_apps_datastore_items_request" => "BulkPutAppsDatastoreItemsRequest", "v2.bulk_put_apps_datastore_items_request_data" => "BulkPutAppsDatastoreItemsRequestData", "v2.bulk_put_apps_datastore_items_request_data_attributes" => "BulkPutAppsDatastoreItemsRequestDataAttributes", 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 f89fba934f5b..10ac7edad5bc 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -8137,79 +8137,6 @@ def list_vulnerable_assets_with_http_info(opts = {}) return data, status_code, headers end - # Mute or unmute a batch of findings. - # - # @see #mute_findings_with_http_info - def mute_findings(body, opts = {}) - data, _status_code, _headers = mute_findings_with_http_info(body, opts) - data - end - - # Mute or unmute a batch of findings. - # - # Mute or unmute findings. - # - # @param body [BulkMuteFindingsRequest] ### Attributes All findings are updated with the same attributes. The request body must include at least two attributes: `muted` and `reason`. The allowed reasons depend on whether the finding is being muted or unmuted: - To mute a finding: `PENDING_FIX`, `FALSE_POSITIVE`, `ACCEPTED_RISK`, `OTHER`. - To unmute a finding : `NO_PENDING_FIX`, `HUMAN_ERROR`, `NO_LONGER_ACCEPTED_RISK`, `OTHER`. ### Meta The request body must include a list of the finding IDs to be updated. - # @param opts [Hash] the optional parameters - # @return [Array<(BulkMuteFindingsResponse, Integer, Hash)>] BulkMuteFindingsResponse data, response status code and response headers - def mute_findings_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.mute_findings".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.mute_findings") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.mute_findings")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.mute_findings ...' - 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.mute_findings" - end - # resource path - local_var_path = '/api/v2/posture_management/findings' - - # 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] || 'BulkMuteFindingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :mute_findings, - :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#mute_findings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Mute or unmute security findings. # # @see #mute_security_findings_with_http_info diff --git a/lib/datadog_api_client/v2/models/bulk_mute_findings_request.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_request.rb deleted file mode 100644 index e21a3bfdd852..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_request.rb +++ /dev/null @@ -1,123 +0,0 @@ -=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 new bulk mute finding request. - class BulkMuteFindingsRequest - include BaseGenericModel - - # Data object containing the new bulk mute properties of the finding. - 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' => :'BulkMuteFindingsRequestData' - } - 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::BulkMuteFindingsRequest` 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/bulk_mute_findings_request_attributes.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_request_attributes.rb deleted file mode 100644 index 477fa9af6149..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_attributes.rb +++ /dev/null @@ -1,98 +0,0 @@ -=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 mute properties to be updated. - class BulkMuteFindingsRequestAttributes - include BaseGenericModel - - # Object containing the new mute properties of the findings. - attr_reader :mute - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'mute' => :'mute' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'mute' => :'BulkMuteFindingsRequestProperties' - } - 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::BulkMuteFindingsRequestAttributes` initialize method" - end - - # 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)) - fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::BulkMuteFindingsRequestAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'mute') - self.mute = attributes[:'mute'] - 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 @mute.nil? - true - end - - # Custom attribute writer method with validation - # @param mute [Object] Object to be assigned - # @!visibility private - def mute=(mute) - if mute.nil? - fail ArgumentError, 'invalid value for "mute", mute cannot be nil.' - end - @mute = mute - 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 && - mute == o.mute - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [mute].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_data.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_request_data.rb deleted file mode 100644 index 4c7d3b94c7c8..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_data.rb +++ /dev/null @@ -1,186 +0,0 @@ -=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 object containing the new bulk mute properties of the finding. - class BulkMuteFindingsRequestData - include BaseGenericModel - - # The mute properties to be updated. - attr_reader :attributes - - # UUID to identify the request - attr_reader :id - - # Meta object containing the findings to be updated. - attr_reader :meta - - # The JSON:API type for findings. - 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', - :'id' => :'id', - :'meta' => :'meta', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'attributes' => :'BulkMuteFindingsRequestAttributes', - :'id' => :'String', - :'meta' => :'BulkMuteFindingsRequestMeta', - :'type' => :'FindingType' - } - 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::BulkMuteFindingsRequestData` 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?(:'meta') - self.meta = attributes[:'meta'] - 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? - return false if @meta.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 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 meta [Object] Object to be assigned - # @!visibility private - def meta=(meta) - if meta.nil? - fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' - end - @meta = meta - 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 && - id == o.id && - meta == o.meta && - 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, meta, type, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_meta.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_request_meta.rb deleted file mode 100644 index e4d817fcead8..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_meta.rb +++ /dev/null @@ -1,107 +0,0 @@ -=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 - # Meta object containing the findings to be updated. - class BulkMuteFindingsRequestMeta - include BaseGenericModel - - # Array of findings. - attr_accessor :findings - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'findings' => :'findings' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'findings' => :'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::BulkMuteFindingsRequestMeta` 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?(:'findings') - if (value = attributes[:'findings']).is_a?(Array) - self.findings = value - end - 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 && - findings == o.findings && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [findings, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_meta_findings.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_request_meta_findings.rb deleted file mode 100644 index 6503907c9d7d..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_meta_findings.rb +++ /dev/null @@ -1,105 +0,0 @@ -=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 - # Finding object containing the finding information. - class BulkMuteFindingsRequestMetaFindings - include BaseGenericModel - - # The unique ID for this finding. - attr_accessor :finding_id - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'finding_id' => :'finding_id' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'finding_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::BulkMuteFindingsRequestMetaFindings` 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?(:'finding_id') - self.finding_id = attributes[:'finding_id'] - 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 && - finding_id == o.finding_id && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [finding_id, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_properties.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_request_properties.rb deleted file mode 100644 index af5414bf3bbc..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_request_properties.rb +++ /dev/null @@ -1,140 +0,0 @@ -=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 - # Object containing the new mute properties of the findings. - class BulkMuteFindingsRequestProperties - include BaseGenericModel - - # Additional information about the reason why those findings are muted or unmuted. This field has a maximum limit of 280 characters. - attr_accessor :description - - # The expiration date of the mute or unmute action (Unix ms). It must be set to a value greater than the current timestamp. - # If this field is not provided, the finding will be muted or unmuted indefinitely, which is equivalent to setting the expiration date to 9999999999999. - attr_accessor :expiration_date - - # Whether those findings should be muted or unmuted. - attr_reader :muted - - # The reason why this finding is muted or unmuted. - attr_reader :reason - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'description' => :'description', - :'expiration_date' => :'expiration_date', - :'muted' => :'muted', - :'reason' => :'reason' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'description' => :'String', - :'expiration_date' => :'Integer', - :'muted' => :'Boolean', - :'reason' => :'FindingMuteReason' - } - 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::BulkMuteFindingsRequestProperties` initialize method" - end - - # 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)) - fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::BulkMuteFindingsRequestProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'muted') - self.muted = attributes[:'muted'] - end - - if attributes.key?(:'reason') - self.reason = attributes[:'reason'] - 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 @muted.nil? - return false if @reason.nil? - true - end - - # Custom attribute writer method with validation - # @param muted [Object] Object to be assigned - # @!visibility private - def muted=(muted) - if muted.nil? - fail ArgumentError, 'invalid value for "muted", muted cannot be nil.' - end - @muted = muted - end - - # Custom attribute writer method with validation - # @param reason [Object] Object to be assigned - # @!visibility private - def reason=(reason) - if reason.nil? - fail ArgumentError, 'invalid value for "reason", reason cannot be nil.' - end - @reason = reason - 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 && - description == o.description && - expiration_date == o.expiration_date && - muted == o.muted && - reason == o.reason - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [description, expiration_date, muted, reason].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/bulk_mute_findings_response.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_response.rb deleted file mode 100644 index d8972d0ff5a9..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_response.rb +++ /dev/null @@ -1,123 +0,0 @@ -=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 expected response schema. - class BulkMuteFindingsResponse - include BaseGenericModel - - # Data object containing the ID of the request that was updated. - 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' => :'BulkMuteFindingsResponseData' - } - 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::BulkMuteFindingsResponse` 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/bulk_mute_findings_response_data.rb b/lib/datadog_api_client/v2/models/bulk_mute_findings_response_data.rb deleted file mode 100644 index 30a39d0317f4..000000000000 --- a/lib/datadog_api_client/v2/models/bulk_mute_findings_response_data.rb +++ /dev/null @@ -1,115 +0,0 @@ -=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 object containing the ID of the request that was updated. - class BulkMuteFindingsResponseData - include BaseGenericModel - - # UUID used to identify the request - attr_accessor :id - - # The JSON:API type for findings. - attr_accessor :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'id' => :'String', - :'type' => :'FindingType' - } - 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::BulkMuteFindingsResponseData` 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?(:'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 && - 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 - [id, type, additional_properties].hash - end - end -end