diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 397d1a8cdca..e7929de2e14 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.java b/examples/v2/governance-console/UpdateGovernanceControl.java index e40c742efe9..3bae1cac0ce 100644 --- a/examples/v2/governance-console/UpdateGovernanceControl.java +++ b/examples/v2/governance-console/UpdateGovernanceControl.java @@ -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 { diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java index 4bdefa92118..21d0a33885b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlAttributes.java @@ -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, @@ -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 detectionParameters = new HashMap(); @@ -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 detectionParameters, @JsonProperty(required = true, value = JSON_PROPERTY_INSIGHTS) List insights, @@ -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; @@ -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 detectionParameters) { this.detectionParameters = detectionParameters; return this; @@ -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) @@ -722,7 +694,6 @@ public int hashCode() { createdAt, createdBy, description, - detectionFrequency, detectionParameters, insights, lastDetectionAt, @@ -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"); diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlParameterDefinition.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlParameterDefinition.java index 44a12d6fce7..a81adbd6e40 100644 --- a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlParameterDefinition.java +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlParameterDefinition.java @@ -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; } @@ -195,10 +197,12 @@ public GovernanceControlParameterDefinition addSupportedValuesItem( } /** - * The supported values for an enumerated parameter. + * The supported values for an enumerated parameter. null 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 getSupportedValues() { diff --git a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateAttributes.java index 62da1facd7b..86412e642e0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/GovernanceControlUpdateAttributes.java @@ -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 @@ -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 detectionParameters = null; @@ -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 detectionParameters) { this.detectionParameters = detectionParameters; @@ -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) @@ -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"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/governance_console.feature b/src/test/resources/com/datadog/api/client/v2/api/governance_console.feature index 075b0f0e4cb..7db27be44d8 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/governance_console.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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