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 @@ -20,9 +20,7 @@ public static void main(String[] args) {
.data(
new GovernanceControlUpdateData()
.attributes(
new GovernanceControlUpdateAttributes()
.detectionFrequency("daily")
.mitigationType("revoke_api_key"))
new GovernanceControlUpdateAttributes().mitigationType("revoke_api_key"))
.type(GovernanceControlResourceType.GOVERNANCE_CONTROL));

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
GovernanceControlAttributes.JSON_PROPERTY_CREATED_AT,
GovernanceControlAttributes.JSON_PROPERTY_CREATED_BY,
GovernanceControlAttributes.JSON_PROPERTY_DESCRIPTION,
GovernanceControlAttributes.JSON_PROPERTY_DETECTION_FREQUENCY,
GovernanceControlAttributes.JSON_PROPERTY_DETECTION_PARAMETERS,
GovernanceControlAttributes.JSON_PROPERTY_INSIGHTS,
GovernanceControlAttributes.JSON_PROPERTY_LAST_DETECTION_AT,
Expand Down Expand Up @@ -62,9 +61,6 @@ public class GovernanceControlAttributes {
public static final String JSON_PROPERTY_DESCRIPTION = "description";
private String description;

public static final String JSON_PROPERTY_DETECTION_FREQUENCY = "detection_frequency";
private String detectionFrequency;

public static final String JSON_PROPERTY_DETECTION_PARAMETERS = "detection_parameters";
private Map<String, Object> detectionParameters = new HashMap<String, Object>();

Expand Down Expand Up @@ -121,8 +117,6 @@ public GovernanceControlAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt,
@JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy,
@JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description,
@JsonProperty(required = true, value = JSON_PROPERTY_DETECTION_FREQUENCY)
String detectionFrequency,
@JsonProperty(required = true, value = JSON_PROPERTY_DETECTION_PARAMETERS)
Map<String, Object> detectionParameters,
@JsonProperty(required = true, value = JSON_PROPERTY_INSIGHTS) List<String> insights,
Expand All @@ -149,7 +143,6 @@ public GovernanceControlAttributes(
this.createdAt = createdAt;
this.createdBy = createdBy;
this.description = description;
this.detectionFrequency = detectionFrequency;
this.detectionParameters = detectionParameters;
this.insights = insights;
this.lastDetectionAt = lastDetectionAt;
Expand Down Expand Up @@ -274,26 +267,6 @@ public void setDescription(String description) {
this.description = description;
}

public GovernanceControlAttributes detectionFrequency(String detectionFrequency) {
this.detectionFrequency = detectionFrequency;
return this;
}

/**
* How often detections are evaluated for the control.
*
* @return detectionFrequency
*/
@JsonProperty(JSON_PROPERTY_DETECTION_FREQUENCY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getDetectionFrequency() {
return detectionFrequency;
}

public void setDetectionFrequency(String detectionFrequency) {
this.detectionFrequency = detectionFrequency;
}

public GovernanceControlAttributes detectionParameters(Map<String, Object> detectionParameters) {
this.detectionParameters = detectionParameters;
return this;
Expand Down Expand Up @@ -690,7 +663,6 @@ public boolean equals(Object o) {
&& Objects.equals(this.createdAt, governanceControlAttributes.createdAt)
&& Objects.equals(this.createdBy, governanceControlAttributes.createdBy)
&& Objects.equals(this.description, governanceControlAttributes.description)
&& Objects.equals(this.detectionFrequency, governanceControlAttributes.detectionFrequency)
&& Objects.equals(this.detectionParameters, governanceControlAttributes.detectionParameters)
&& Objects.equals(this.insights, governanceControlAttributes.insights)
&& Objects.equals(this.lastDetectionAt, governanceControlAttributes.lastDetectionAt)
Expand Down Expand Up @@ -722,7 +694,6 @@ public int hashCode() {
createdAt,
createdBy,
description,
detectionFrequency,
detectionParameters,
insights,
lastDetectionAt,
Expand Down Expand Up @@ -751,7 +722,6 @@ public String toString() {
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" detectionFrequency: ").append(toIndentedString(detectionFrequency)).append("\n");
sb.append(" detectionParameters: ")
.append(toIndentedString(detectionParameters))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ public GovernanceControlParameterDefinition(
this.name = name;
this.required = required;
this.supportedValues = supportedValues;
for (GovernanceControlSupportedValue item : supportedValues) {
this.unparsed |= item.unparsed;
if (supportedValues != null) {
for (GovernanceControlSupportedValue item : supportedValues) {
this.unparsed |= item.unparsed;
}
}
this.type = type;
}
Expand Down Expand Up @@ -195,10 +197,12 @@ public GovernanceControlParameterDefinition addSupportedValuesItem(
}

/**
* The supported values for an enumerated parameter.
* The supported values for an enumerated parameter. <code>null</code> when the parameter is not
* an enumerated type.
*
* @return supportedValues
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SUPPORTED_VALUES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List<GovernanceControlSupportedValue> getSupportedValues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* request are modified.
*/
@JsonPropertyOrder({
GovernanceControlUpdateAttributes.JSON_PROPERTY_DETECTION_FREQUENCY,
GovernanceControlUpdateAttributes.JSON_PROPERTY_DETECTION_PARAMETERS,
GovernanceControlUpdateAttributes.JSON_PROPERTY_MITIGATION_PARAMETERS,
GovernanceControlUpdateAttributes.JSON_PROPERTY_MITIGATION_TYPE
Expand All @@ -30,9 +29,6 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class GovernanceControlUpdateAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_DETECTION_FREQUENCY = "detection_frequency";
private String detectionFrequency;

public static final String JSON_PROPERTY_DETECTION_PARAMETERS = "detection_parameters";
private Map<String, Object> detectionParameters = null;

Expand All @@ -42,27 +38,6 @@ public class GovernanceControlUpdateAttributes {
public static final String JSON_PROPERTY_MITIGATION_TYPE = "mitigation_type";
private String mitigationType;

public GovernanceControlUpdateAttributes detectionFrequency(String detectionFrequency) {
this.detectionFrequency = detectionFrequency;
return this;
}

/**
* How often detections should be evaluated for the control.
*
* @return detectionFrequency
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DETECTION_FREQUENCY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getDetectionFrequency() {
return detectionFrequency;
}

public void setDetectionFrequency(String detectionFrequency) {
this.detectionFrequency = detectionFrequency;
}

public GovernanceControlUpdateAttributes detectionParameters(
Map<String, Object> detectionParameters) {
this.detectionParameters = detectionParameters;
Expand Down Expand Up @@ -204,8 +179,6 @@ public boolean equals(Object o) {
GovernanceControlUpdateAttributes governanceControlUpdateAttributes =
(GovernanceControlUpdateAttributes) o;
return Objects.equals(
this.detectionFrequency, governanceControlUpdateAttributes.detectionFrequency)
&& Objects.equals(
this.detectionParameters, governanceControlUpdateAttributes.detectionParameters)
&& Objects.equals(
this.mitigationParameters, governanceControlUpdateAttributes.mitigationParameters)
Expand All @@ -217,18 +190,13 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
detectionFrequency,
detectionParameters,
mitigationParameters,
mitigationType,
additionalProperties);
detectionParameters, mitigationParameters, mitigationType, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GovernanceControlUpdateAttributes {\n");
sb.append(" detectionFrequency: ").append(toIndentedString(detectionFrequency)).append("\n");
sb.append(" detectionParameters: ")
.append(toIndentedString(detectionParameters))
.append("\n");
Expand Down
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
Loading