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
29 changes: 29 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59300,6 +59300,33 @@ components:
type: string
x-enum-varnames:
- HISTORICALDETECTIONSJOB
HistoricalJobFailure:
description: |-
Details about why the job failed. Only present when the job has failed and won't be retried.
properties:
hint:
description: A suggestion to fix the failure.
example: Narrow the time range or reduce the data scanned.
type: string
reason:
$ref: "#/components/schemas/HistoricalJobFailureReason"
type: object
HistoricalJobFailureReason:
description: The reason why the job failed.
enum:
- rule_configuration
- query_too_expensive
- internal_error
example: query_too_expensive
type: string
x-enum-descriptions:
- The rule, or the dataset it references, can't run as written.
- The query scans too much data.
- An internal error occurred. These are usually temporary.
x-enum-varnames:
- RULE_CONFIGURATION
- QUERY_TOO_EXPENSIVE
- INTERNAL_ERROR
HistoricalJobListMeta:
description: Metadata about the list of jobs.
properties:
Expand Down Expand Up @@ -59426,6 +59453,8 @@ components:
createdFromRuleId:
description: ID of the rule used to create the job (if it is created from a rule).
type: string
failure:
$ref: "#/components/schemas/HistoricalJobFailure"
jobDefinition:
$ref: "#/components/schemas/JobDefinition"
jobName:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/*
* 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.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
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.HashMap;
import java.util.Map;
import java.util.Objects;

/** Details about why the job failed. Only present when the job has failed and won't be retried. */
@JsonPropertyOrder({
HistoricalJobFailure.JSON_PROPERTY_HINT,
HistoricalJobFailure.JSON_PROPERTY_REASON
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class HistoricalJobFailure {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_HINT = "hint";
private String hint;

public static final String JSON_PROPERTY_REASON = "reason";
private HistoricalJobFailureReason reason;

public HistoricalJobFailure hint(String hint) {
this.hint = hint;
return this;
}

/**
* A suggestion to fix the failure.
*
* @return hint
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_HINT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getHint() {
return hint;
}

public void setHint(String hint) {
this.hint = hint;
}

public HistoricalJobFailure reason(HistoricalJobFailureReason reason) {
this.reason = reason;
this.unparsed |= !reason.isValid();
return this;
}

/**
* The reason why the job failed.
*
* @return reason
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_REASON)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public HistoricalJobFailureReason getReason() {
return reason;
}

public void setReason(HistoricalJobFailureReason reason) {
if (!reason.isValid()) {
this.unparsed = true;
}
this.reason = reason;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
*/
private Map<String, Object> additionalProperties;

/**
* Set the additional (undeclared) property with the specified name and value. If the property
* does not already exist, create it otherwise replace it.
*
* @param key The arbitrary key to set
* @param value The associated value
* @return HistoricalJobFailure
*/
@JsonAnySetter
public HistoricalJobFailure putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}

/**
* Return the additional (undeclared) property with the specified name.
*
* @param key The arbitrary key to get
* @return The specific additional property for the given key
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}

/** Return true if this HistoricalJobFailure object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HistoricalJobFailure historicalJobFailure = (HistoricalJobFailure) o;
return Objects.equals(this.hint, historicalJobFailure.hint)
&& Objects.equals(this.reason, historicalJobFailure.reason)
&& Objects.equals(this.additionalProperties, historicalJobFailure.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(hint, reason, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class HistoricalJobFailure {\n");
sb.append(" hint: ").append(toIndentedString(hint)).append("\n");
sb.append(" reason: ").append(toIndentedString(reason)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.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
@@ -0,0 +1,62 @@
/*
* 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.datadog.api.client.ModelEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/** The reason why the job failed. */
@JsonSerialize(using = HistoricalJobFailureReason.HistoricalJobFailureReasonSerializer.class)
public class HistoricalJobFailureReason extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(
Arrays.asList("rule_configuration", "query_too_expensive", "internal_error"));

public static final HistoricalJobFailureReason RULE_CONFIGURATION =
new HistoricalJobFailureReason("rule_configuration");
public static final HistoricalJobFailureReason QUERY_TOO_EXPENSIVE =
new HistoricalJobFailureReason("query_too_expensive");
public static final HistoricalJobFailureReason INTERNAL_ERROR =
new HistoricalJobFailureReason("internal_error");

HistoricalJobFailureReason(String value) {
super(value, allowedValues);
}

public static class HistoricalJobFailureReasonSerializer
extends StdSerializer<HistoricalJobFailureReason> {
public HistoricalJobFailureReasonSerializer(Class<HistoricalJobFailureReason> t) {
super(t);
}

public HistoricalJobFailureReasonSerializer() {
this(null);
}

@Override
public void serialize(
HistoricalJobFailureReason value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static HistoricalJobFailureReason fromValue(String value) {
return new HistoricalJobFailureReason(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
HistoricalJobResponseAttributes.JSON_PROPERTY_CREATED_BY_HANDLE,
HistoricalJobResponseAttributes.JSON_PROPERTY_CREATED_BY_NAME,
HistoricalJobResponseAttributes.JSON_PROPERTY_CREATED_FROM_RULE_ID,
HistoricalJobResponseAttributes.JSON_PROPERTY_FAILURE,
HistoricalJobResponseAttributes.JSON_PROPERTY_JOB_DEFINITION,
HistoricalJobResponseAttributes.JSON_PROPERTY_JOB_NAME,
HistoricalJobResponseAttributes.JSON_PROPERTY_JOB_STATUS,
Expand All @@ -45,6 +46,9 @@ public class HistoricalJobResponseAttributes {
public static final String JSON_PROPERTY_CREATED_FROM_RULE_ID = "createdFromRuleId";
private String createdFromRuleId;

public static final String JSON_PROPERTY_FAILURE = "failure";
private HistoricalJobFailure failure;

public static final String JSON_PROPERTY_JOB_DEFINITION = "jobDefinition";
private JobDefinition jobDefinition;

Expand Down Expand Up @@ -147,6 +151,31 @@ public void setCreatedFromRuleId(String createdFromRuleId) {
this.createdFromRuleId = createdFromRuleId;
}

public HistoricalJobResponseAttributes failure(HistoricalJobFailure failure) {
this.failure = failure;
this.unparsed |= failure.unparsed;
return this;
}

/**
* Details about why the job failed. Only present when the job has failed and won't be retried.
*
* @return failure
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FAILURE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public HistoricalJobFailure getFailure() {
return failure;
}

public void setFailure(HistoricalJobFailure failure) {
this.failure = failure;
if (failure != null) {
this.unparsed |= failure.unparsed;
}
}

public HistoricalJobResponseAttributes jobDefinition(JobDefinition jobDefinition) {
this.jobDefinition = jobDefinition;
this.unparsed |= jobDefinition.unparsed;
Expand Down Expand Up @@ -338,6 +367,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.createdByHandle, historicalJobResponseAttributes.createdByHandle)
&& Objects.equals(this.createdByName, historicalJobResponseAttributes.createdByName)
&& Objects.equals(this.createdFromRuleId, historicalJobResponseAttributes.createdFromRuleId)
&& Objects.equals(this.failure, historicalJobResponseAttributes.failure)
&& Objects.equals(this.jobDefinition, historicalJobResponseAttributes.jobDefinition)
&& Objects.equals(this.jobName, historicalJobResponseAttributes.jobName)
&& Objects.equals(this.jobStatus, historicalJobResponseAttributes.jobStatus)
Expand All @@ -355,6 +385,7 @@ public int hashCode() {
createdByHandle,
createdByName,
createdFromRuleId,
failure,
jobDefinition,
jobName,
jobStatus,
Expand All @@ -372,6 +403,7 @@ public String toString() {
sb.append(" createdByHandle: ").append(toIndentedString(createdByHandle)).append("\n");
sb.append(" createdByName: ").append(toIndentedString(createdByName)).append("\n");
sb.append(" createdFromRuleId: ").append(toIndentedString(createdFromRuleId)).append("\n");
sb.append(" failure: ").append(toIndentedString(failure)).append("\n");
sb.append(" jobDefinition: ").append(toIndentedString(jobDefinition)).append("\n");
sb.append(" jobName: ").append(toIndentedString(jobName)).append("\n");
sb.append(" jobStatus: ").append(toIndentedString(jobStatus)).append("\n");
Expand Down
Loading