diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 397d1a8cdca0..e7929de2e14f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -44735,10 +44735,6 @@ components: description: A human-readable description of what the control detects. example: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." type: string - detection_frequency: - description: How often detections are evaluated for the control. - example: "daily" - type: string detection_parameters: $ref: "#/components/schemas/GovernanceControlParametersMap" nullable: true @@ -44808,7 +44804,6 @@ components: - type - priority - detection_parameters - - detection_frequency - mitigation_type - mitigation_parameters - created_at @@ -45167,17 +45162,14 @@ components: - label type: object GovernanceControlSupportedValueArray: - description: The supported values for an enumerated parameter. + description: The supported values for an enumerated parameter. `null` when the parameter is not an enumerated type. items: $ref: "#/components/schemas/GovernanceControlSupportedValue" + nullable: true type: array GovernanceControlUpdateAttributes: description: The attributes of a governance control that can be updated. Only the attributes present in the request are modified. properties: - detection_frequency: - description: How often detections should be evaluated for the control. - example: "daily" - type: string detection_parameters: $ref: "#/components/schemas/GovernanceControlParametersMap" nullable: true @@ -145322,7 +145314,6 @@ paths: created_at: "2024-01-15T09:30:00Z" created_by: "11111111-2222-3333-4444-555555555555" description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." - detection_frequency: "daily" detection_parameters: api_key_threshold: 30 insights: [] @@ -145352,7 +145343,7 @@ paths: display_name: "Unused API Key Threshold" name: "api_key_threshold" required: false - supported_values: [] + supported_values: type: "integer" type: "Proactive" id: "unused_api_keys" @@ -145422,7 +145413,6 @@ paths: created_at: "2024-01-15T09:30:00Z" created_by: "11111111-2222-3333-4444-555555555555" description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." - detection_frequency: "daily" detection_parameters: api_key_threshold: 30 insights: [] @@ -145442,7 +145432,7 @@ paths: display_name: "Unused API Key Threshold" name: "api_key_threshold" required: false - supported_values: [] + supported_values: type: "integer" type: "Proactive" id: "unused_api_keys" @@ -145533,7 +145523,6 @@ paths: created_at: "2024-01-15T09:30:00Z" created_by: "11111111-2222-3333-4444-555555555555" description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials." - detection_frequency: "daily" detection_parameters: api_key_threshold: 60 insights: [] diff --git a/examples/v2/governance-console/UpdateGovernanceControl.rb b/examples/v2/governance-console/UpdateGovernanceControl.rb index a3b1594161cd..9725781d496c 100644 --- a/examples/v2/governance-console/UpdateGovernanceControl.rb +++ b/examples/v2/governance-console/UpdateGovernanceControl.rb @@ -9,7 +9,6 @@ body = DatadogAPIClient::V2::GovernanceControlUpdateRequest.new({ data: DatadogAPIClient::V2::GovernanceControlUpdateData.new({ attributes: DatadogAPIClient::V2::GovernanceControlUpdateAttributes.new({ - detection_frequency: "daily", mitigation_type: "revoke_api_key", }), type: DatadogAPIClient::V2::GovernanceControlResourceType::GOVERNANCE_CONTROL, diff --git a/features/v2/governance_console.feature b/features/v2/governance_console.feature index 075b0f0e4cb3..7db27be44d82 100644 --- a/features/v2/governance_console.feature +++ b/features/v2/governance_console.feature @@ -175,7 +175,7 @@ Feature: Governance Console Given operation "UpdateGovernanceControl" enabled And new "UpdateGovernanceControl" request And request contains "detection_type" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key"}, "type": "governance_control"}} + And body with value {"data": {"attributes": {"mitigation_type": "revoke_api_key"}, "type": "governance_control"}} When the request is sent Then the response status is 400 Bad Request @@ -184,7 +184,7 @@ Feature: Governance Console Given operation "UpdateGovernanceControl" enabled And new "UpdateGovernanceControl" request And request contains "detection_type" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key"}, "type": "governance_control"}} + And body with value {"data": {"attributes": {"mitigation_type": "revoke_api_key"}, "type": "governance_control"}} When the request is sent Then the response status is 404 Not Found @@ -193,7 +193,7 @@ Feature: Governance Console Given operation "UpdateGovernanceControl" enabled And new "UpdateGovernanceControl" request And request contains "detection_type" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"detection_frequency": "daily", "mitigation_type": "revoke_api_key"}, "type": "governance_control"}} + And body with value {"data": {"attributes": {"mitigation_type": "revoke_api_key"}, "type": "governance_control"}} When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/v2/models/governance_control_attributes.rb b/lib/datadog_api_client/v2/models/governance_control_attributes.rb index 3def91138a69..6e7f9b5ef4d7 100644 --- a/lib/datadog_api_client/v2/models/governance_control_attributes.rb +++ b/lib/datadog_api_client/v2/models/governance_control_attributes.rb @@ -36,9 +36,6 @@ class GovernanceControlAttributes # A human-readable description of what the control detects. attr_reader :description - # How often detections are evaluated for the control. - attr_reader :detection_frequency - # A free-form map of parameter names to their configured values. attr_reader :detection_parameters @@ -92,7 +89,6 @@ def self.attribute_map :'created_at' => :'created_at', :'created_by' => :'created_by', :'description' => :'description', - :'detection_frequency' => :'detection_frequency', :'detection_parameters' => :'detection_parameters', :'insights' => :'insights', :'last_detection_at' => :'last_detection_at', @@ -119,7 +115,6 @@ def self.openapi_types :'created_at' => :'Time', :'created_by' => :'String', :'description' => :'String', - :'detection_frequency' => :'String', :'detection_parameters' => :'Hash', :'insights' => :'Array', :'last_detection_at' => :'Time', @@ -183,10 +178,6 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end - if attributes.key?(:'detection_frequency') - self.detection_frequency = attributes[:'detection_frequency'] - end - if attributes.key?(:'detection_parameters') self.detection_parameters = attributes[:'detection_parameters'] end @@ -259,7 +250,6 @@ def valid? return false if @created_at.nil? return false if @created_by.nil? return false if @description.nil? - return false if @detection_frequency.nil? return false if @detection_parameters.nil? return false if @insights.nil? return false if @mitigated_detections_count.nil? @@ -326,16 +316,6 @@ def description=(description) @description = description end - # Custom attribute writer method with validation - # @param detection_frequency [Object] Object to be assigned - # @!visibility private - def detection_frequency=(detection_frequency) - if detection_frequency.nil? - fail ArgumentError, 'invalid value for "detection_frequency", detection_frequency cannot be nil.' - end - @detection_frequency = detection_frequency - end - # Custom attribute writer method with validation # @param detection_parameters [Object] Object to be assigned # @!visibility private @@ -497,7 +477,6 @@ def ==(o) created_at == o.created_at && created_by == o.created_by && description == o.description && - detection_frequency == o.detection_frequency && detection_parameters == o.detection_parameters && insights == o.insights && last_detection_at == o.last_detection_at && @@ -519,7 +498,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [active_detections_count, category, created_at, created_by, description, detection_frequency, detection_parameters, insights, last_detection_at, mitigated_detections_count, mitigation_parameters, mitigation_type, mitigations, name, priority, product, resource_type, resource_type_display_name, supported_detection_parameters, type, additional_properties].hash + [active_detections_count, category, created_at, created_by, description, detection_parameters, insights, last_detection_at, mitigated_detections_count, mitigation_parameters, mitigation_type, mitigations, name, priority, product, resource_type, resource_type_display_name, supported_detection_parameters, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/governance_control_parameter_definition.rb b/lib/datadog_api_client/v2/models/governance_control_parameter_definition.rb index 8b1d22c2f931..9bed27066ea9 100644 --- a/lib/datadog_api_client/v2/models/governance_control_parameter_definition.rb +++ b/lib/datadog_api_client/v2/models/governance_control_parameter_definition.rb @@ -36,8 +36,8 @@ class GovernanceControlParameterDefinition # Whether the parameter must be provided. attr_reader :required - # The supported values for an enumerated parameter. - attr_reader :supported_values + # The supported values for an enumerated parameter. `null` when the parameter is not an enumerated type. + attr_accessor :supported_values # The type of the parameter, such as `integer`, `string`, `boolean`, `enum`, or `pattern_list`. attr_reader :type @@ -72,6 +72,14 @@ def self.openapi_types } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'supported_values', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -130,7 +138,6 @@ def valid? return false if @display_name.nil? return false if @name.nil? return false if @required.nil? - return false if @supported_values.nil? return false if @type.nil? true end @@ -185,16 +192,6 @@ def required=(required) @required = required end - # Custom attribute writer method with validation - # @param supported_values [Object] Object to be assigned - # @!visibility private - def supported_values=(supported_values) - if supported_values.nil? - fail ArgumentError, 'invalid value for "supported_values", supported_values cannot be nil.' - end - @supported_values = supported_values - end - # Custom attribute writer method with validation # @param type [Object] Object to be assigned # @!visibility private diff --git a/lib/datadog_api_client/v2/models/governance_control_update_attributes.rb b/lib/datadog_api_client/v2/models/governance_control_update_attributes.rb index b3644cd23629..6ebc92050de9 100644 --- a/lib/datadog_api_client/v2/models/governance_control_update_attributes.rb +++ b/lib/datadog_api_client/v2/models/governance_control_update_attributes.rb @@ -21,9 +21,6 @@ module DatadogAPIClient::V2 class GovernanceControlUpdateAttributes include BaseGenericModel - # How often detections should be evaluated for the control. - attr_accessor :detection_frequency - # A free-form map of parameter names to their configured values. attr_accessor :detection_parameters @@ -39,7 +36,6 @@ class GovernanceControlUpdateAttributes # @!visibility private def self.attribute_map { - :'detection_frequency' => :'detection_frequency', :'detection_parameters' => :'detection_parameters', :'mitigation_parameters' => :'mitigation_parameters', :'mitigation_type' => :'mitigation_type' @@ -50,7 +46,6 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'detection_frequency' => :'String', :'detection_parameters' => :'Hash', :'mitigation_parameters' => :'Hash', :'mitigation_type' => :'String' @@ -75,10 +70,6 @@ def initialize(attributes = {}) end } - if attributes.key?(:'detection_frequency') - self.detection_frequency = attributes[:'detection_frequency'] - end - if attributes.key?(:'detection_parameters') self.detection_parameters = attributes[:'detection_parameters'] end @@ -118,7 +109,6 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - detection_frequency == o.detection_frequency && detection_parameters == o.detection_parameters && mitigation_parameters == o.mitigation_parameters && mitigation_type == o.mitigation_type && @@ -129,7 +119,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [detection_frequency, detection_parameters, mitigation_parameters, mitigation_type, additional_properties].hash + [detection_parameters, mitigation_parameters, mitigation_type, additional_properties].hash end end end