Skip to content
Open
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
34 changes: 32 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20960,6 +20960,29 @@ components:
type: string
type: array
type: object
DeploymentRuleOptionsFaultyDeploymentDetectionResponse:
additionalProperties: false
description: Faulty deployment detection options returned in deployment rule
responses. The `excluded_resources` field is always present, which allows
disambiguating this type from monitor options when both share a `duration`
field.
properties:
duration:
description: The duration for faulty deployment detection.
example: 3600
format: int64
type: integer
excluded_resources:
description: Resources to exclude from faulty deployment detection.
example:
- resource1
- resource2
items:
type: string
type: array
required:
- excluded_resources
type: object
DeploymentRuleOptionsMonitor:
additionalProperties: false
description: Monitor options for deployment rules.
Expand Down Expand Up @@ -21022,7 +21045,7 @@ components:
example: My deployment rule
type: string
options:
$ref: '#/components/schemas/DeploymentRulesOptions'
$ref: '#/components/schemas/DeploymentRulesOptionsResponse'
type:
$ref: '#/components/schemas/DeploymentRuleResponseDataAttributesType'
updated_at:
Expand Down Expand Up @@ -21087,11 +21110,18 @@ components:
- id
type: object
DeploymentRulesOptions:
description: Options for deployment rule response representing either faulty
description: Options for deployment rule requests representing either faulty
deployment detection or monitor options.
oneOf:
- $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection'
- $ref: '#/components/schemas/DeploymentRuleOptionsMonitor'
DeploymentRulesOptionsResponse:
description: Options returned in deployment rule responses representing either
faulty deployment detection or monitor options. Faulty deployment detection
responses always include `excluded_resources`, making the two variants unambiguous.
oneOf:
- $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetectionResponse'
- $ref: '#/components/schemas/DeploymentRuleOptionsMonitor'
DetachCaseRequest:
description: Request for detaching security findings from their case.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public CreateDeploymentRuleParamsDataAttributes options(DeploymentRulesOptions o
}

/**
* Options for deployment rule response representing either faulty deployment detection or monitor
* Options for deployment rule requests representing either faulty deployment detection or monitor
* options.
*
* @return options
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/

package com.datadog.api.client.v2.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
* Faulty deployment detection options returned in deployment rule responses. The <code>
* excluded_resources</code> field is always present, which allows disambiguating this type from
* monitor options when both share a <code>duration</code> field.
*/
@JsonPropertyOrder({
DeploymentRuleOptionsFaultyDeploymentDetectionResponse.JSON_PROPERTY_DURATION,
DeploymentRuleOptionsFaultyDeploymentDetectionResponse.JSON_PROPERTY_EXCLUDED_RESOURCES
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class DeploymentRuleOptionsFaultyDeploymentDetectionResponse {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_DURATION = "duration";
private Long duration;

public static final String JSON_PROPERTY_EXCLUDED_RESOURCES = "excluded_resources";
private List<String> excludedResources = new ArrayList<>();

public DeploymentRuleOptionsFaultyDeploymentDetectionResponse() {}

@JsonCreator
public DeploymentRuleOptionsFaultyDeploymentDetectionResponse(
@JsonProperty(required = true, value = JSON_PROPERTY_EXCLUDED_RESOURCES)
List<String> excludedResources) {
this.excludedResources = excludedResources;
}

public DeploymentRuleOptionsFaultyDeploymentDetectionResponse duration(Long duration) {
this.duration = duration;
return this;
}

/**
* The duration for faulty deployment detection.
*
* @return duration
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DURATION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getDuration() {
return duration;
}

public void setDuration(Long duration) {
this.duration = duration;
}

public DeploymentRuleOptionsFaultyDeploymentDetectionResponse excludedResources(
List<String> excludedResources) {
this.excludedResources = excludedResources;
return this;
}

public DeploymentRuleOptionsFaultyDeploymentDetectionResponse addExcludedResourcesItem(
String excludedResourcesItem) {
this.excludedResources.add(excludedResourcesItem);
return this;
}

/**
* Resources to exclude from faulty deployment detection.
*
* @return excludedResources
*/
@JsonProperty(JSON_PROPERTY_EXCLUDED_RESOURCES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List<String> getExcludedResources() {
return excludedResources;
}

public void setExcludedResources(List<String> excludedResources) {
this.excludedResources = excludedResources;
}

/**
* Return true if this DeploymentRuleOptionsFaultyDeploymentDetectionResponse object is equal to
* o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DeploymentRuleOptionsFaultyDeploymentDetectionResponse
deploymentRuleOptionsFaultyDeploymentDetectionResponse =
(DeploymentRuleOptionsFaultyDeploymentDetectionResponse) o;
return Objects.equals(
this.duration, deploymentRuleOptionsFaultyDeploymentDetectionResponse.duration)
&& Objects.equals(
this.excludedResources,
deploymentRuleOptionsFaultyDeploymentDetectionResponse.excludedResources);
}

@Override
public int hashCode() {
return Objects.hash(duration, excludedResources);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DeploymentRuleOptionsFaultyDeploymentDetectionResponse {\n");
sb.append(" duration: ").append(toIndentedString(duration)).append("\n");
sb.append(" excludedResources: ").append(toIndentedString(excludedResources)).append("\n");
sb.append('}');
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class DeploymentRuleResponseDataAttributes {
private String name;

public static final String JSON_PROPERTY_OPTIONS = "options";
private DeploymentRulesOptions options;
private DeploymentRulesOptionsResponse options;

public static final String JSON_PROPERTY_TYPE = "type";
private DeploymentRuleResponseDataAttributesType type;
Expand All @@ -71,7 +71,8 @@ public DeploymentRuleResponseDataAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun,
@JsonProperty(required = true, value = JSON_PROPERTY_GATE_ID) String gateId,
@JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name,
@JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) DeploymentRulesOptions options,
@JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS)
DeploymentRulesOptionsResponse options,
@JsonProperty(required = true, value = JSON_PROPERTY_TYPE)
DeploymentRuleResponseDataAttributesType type) {
this.createdAt = createdAt;
Expand Down Expand Up @@ -188,25 +189,26 @@ public void setName(String name) {
this.name = name;
}

public DeploymentRuleResponseDataAttributes options(DeploymentRulesOptions options) {
public DeploymentRuleResponseDataAttributes options(DeploymentRulesOptionsResponse options) {
this.options = options;
this.unparsed |= options.unparsed;
return this;
}

/**
* Options for deployment rule response representing either faulty deployment detection or monitor
* options.
* Options returned in deployment rule responses representing either faulty deployment detection
* or monitor options. Faulty deployment detection responses always include <code>
* excluded_resources</code>, making the two variants unambiguous.
*
* @return options
*/
@JsonProperty(JSON_PROPERTY_OPTIONS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public DeploymentRulesOptions getOptions() {
public DeploymentRulesOptionsResponse getOptions() {
return options;
}

public void setOptions(DeploymentRulesOptions options) {
public void setOptions(DeploymentRulesOptionsResponse options) {
this.options = options;
}

Expand Down
Loading
Loading