Skip to content

Commit

Permalink
Regenerate client from commit 2d1ebbf0 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jun 27, 2022
1 parent 41c071a commit 9846ead
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-27 13:32:29.495533",
"spec_repo_commit": "773b3560"
"regenerated": "2022-06-27 16:07:21.172854",
"spec_repo_commit": "2d1ebbf0"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-27 13:32:29.513761",
"spec_repo_commit": "773b3560"
"regenerated": "2022-06-27 16:07:21.185406",
"spec_repo_commit": "2d1ebbf0"
}
}
}
13 changes: 13 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6340,6 +6340,17 @@ components:
- cases
- message
type: object
SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv:
description: 'If true, signals in non-production environments have a lower severity
than what is defined by the rule case, which can reduce signal noise.
The severity is decreased by one level: `CRITICAL` in production becomes `HIGH`
in non-production, `HIGH` becomes `MEDIUM` and so on. `INFO` remains `INFO`.
The decrement is applied when the environment tag of the signal starts with
`staging`, `test` or `dev`.'
example: false
type: boolean
SecurityMonitoringRuleDetectionMethod:
description: The detection method.
enum:
Expand Down Expand Up @@ -6533,6 +6544,8 @@ components:
SecurityMonitoringRuleOptions:
description: Options on rules.
properties:
decreaseCriticalityBasedOnEnv:
$ref: '#/components/schemas/SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv'
detectionMethod:
$ref: '#/components/schemas/SecurityMonitoringRuleDetectionMethod'
evaluationWindow:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static void main(String[] args) {
.hasExtendedTitle(true)
.options(
new SecurityMonitoringRuleOptions()
.decreaseCriticalityBasedOnEnv(false)
.detectionMethod(SecurityMonitoringRuleDetectionMethod.THRESHOLD)
.evaluationWindow(SecurityMonitoringRuleEvaluationWindow.ZERO_MINUTES)
.hardcodedEvaluatorType(SecurityMonitoringRuleHardcodedEvaluatorType.LOG4SHELL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/** Options on rules. */
@JsonPropertyOrder({
SecurityMonitoringRuleOptions.JSON_PROPERTY_DECREASE_CRITICALITY_BASED_ON_ENV,
SecurityMonitoringRuleOptions.JSON_PROPERTY_DETECTION_METHOD,
SecurityMonitoringRuleOptions.JSON_PROPERTY_EVALUATION_WINDOW,
SecurityMonitoringRuleOptions.JSON_PROPERTY_HARDCODED_EVALUATOR_TYPE,
Expand All @@ -26,6 +27,10 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class SecurityMonitoringRuleOptions {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_DECREASE_CRITICALITY_BASED_ON_ENV =
"decreaseCriticalityBasedOnEnv";
private Boolean decreaseCriticalityBasedOnEnv;

public static final String JSON_PROPERTY_DETECTION_METHOD = "detectionMethod";
private SecurityMonitoringRuleDetectionMethod detectionMethod;

Expand All @@ -47,6 +52,33 @@ public class SecurityMonitoringRuleOptions {
public static final String JSON_PROPERTY_NEW_VALUE_OPTIONS = "newValueOptions";
private SecurityMonitoringRuleNewValueOptions newValueOptions;

public SecurityMonitoringRuleOptions decreaseCriticalityBasedOnEnv(
Boolean decreaseCriticalityBasedOnEnv) {
this.decreaseCriticalityBasedOnEnv = decreaseCriticalityBasedOnEnv;
return this;
}

/**
* If true, signals in non-production environments have a lower severity than what is defined by
* the rule case, which can reduce signal noise. The severity is decreased by one level: <code>
* CRITICAL</code> in production becomes <code>HIGH</code> in non-production, <code>HIGH</code>
* becomes <code>MEDIUM</code> and so on. <code>INFO</code> remains <code>INFO</code>. The
* decrement is applied when the environment tag of the signal starts with <code>staging</code>,
* <code>test</code> or <code>dev</code>.
*
* @return decreaseCriticalityBasedOnEnv
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DECREASE_CRITICALITY_BASED_ON_ENV)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getDecreaseCriticalityBasedOnEnv() {
return decreaseCriticalityBasedOnEnv;
}

public void setDecreaseCriticalityBasedOnEnv(Boolean decreaseCriticalityBasedOnEnv) {
this.decreaseCriticalityBasedOnEnv = decreaseCriticalityBasedOnEnv;
}

public SecurityMonitoringRuleOptions detectionMethod(
SecurityMonitoringRuleDetectionMethod detectionMethod) {
this.detectionMethod = detectionMethod;
Expand Down Expand Up @@ -237,7 +269,10 @@ public boolean equals(Object o) {
return false;
}
SecurityMonitoringRuleOptions securityMonitoringRuleOptions = (SecurityMonitoringRuleOptions) o;
return Objects.equals(this.detectionMethod, securityMonitoringRuleOptions.detectionMethod)
return Objects.equals(
this.decreaseCriticalityBasedOnEnv,
securityMonitoringRuleOptions.decreaseCriticalityBasedOnEnv)
&& Objects.equals(this.detectionMethod, securityMonitoringRuleOptions.detectionMethod)
&& Objects.equals(this.evaluationWindow, securityMonitoringRuleOptions.evaluationWindow)
&& Objects.equals(
this.hardcodedEvaluatorType, securityMonitoringRuleOptions.hardcodedEvaluatorType)
Expand All @@ -251,6 +286,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
decreaseCriticalityBasedOnEnv,
detectionMethod,
evaluationWindow,
hardcodedEvaluatorType,
Expand All @@ -264,6 +300,9 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SecurityMonitoringRuleOptions {\n");
sb.append(" decreaseCriticalityBasedOnEnv: ")
.append(toIndentedString(decreaseCriticalityBasedOnEnv))
.append("\n");
sb.append(" detectionMethod: ").append(toIndentedString(detectionMethod)).append("\n");
sb.append(" evaluationWindow: ").append(toIndentedString(evaluationWindow)).append("\n");
sb.append(" hardcodedEvaluatorType: ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,22 @@ Feature: Security Monitoring
Scenario: Update an existing rule returns "Bad Request" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Update an existing rule returns "Not Found" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Update an existing rule returns "OK" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 200 OK

0 comments on commit 9846ead

Please sign in to comment.