Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -44808,7 +44804,6 @@ components:
- type
- priority
- detection_parameters
- detection_frequency
- mitigation_type
- mitigation_parameters
- created_at
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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: []
Expand All @@ -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"
Expand Down Expand Up @@ -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: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions features/v2/governance_console.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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',
Expand All @@ -119,7 +115,6 @@ def self.openapi_types
:'created_at' => :'Time',
:'created_by' => :'String',
:'description' => :'String',
:'detection_frequency' => :'String',
:'detection_parameters' => :'Hash<String, Object>',
:'insights' => :'Array<String>',
:'last_detection_at' => :'Time',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 &&
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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'
Expand All @@ -50,7 +46,6 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'detection_frequency' => :'String',
:'detection_parameters' => :'Hash<String, Object>',
:'mitigation_parameters' => :'Hash<String, Object>',
:'mitigation_type' => :'String'
Expand All @@ -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
Expand Down Expand Up @@ -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 &&
Expand All @@ -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
Loading