diff --git a/.apigentools-info b/.apigentools-info index 0b198fad3d7..679e1ecdbb3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-06 18:09:30.835401", - "spec_repo_commit": "c020103f" + "regenerated": "2025-01-06 19:03:03.417793", + "spec_repo_commit": "b56ea2d7" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-06 18:09:30.850332", - "spec_repo_commit": "c020103f" + "regenerated": "2025-01-06 19:03:03.432332", + "spec_repo_commit": "b56ea2d7" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 295728842fb..ede090899d5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15109,6 +15109,12 @@ components: the error. example: Missing required attribute in body type: string + meta: + additionalProperties: {} + description: Non-standard meta-information about the error + type: object + source: + $ref: '#/components/schemas/JSONAPIErrorItemSource' status: description: Status code of the response. example: '400' @@ -15118,6 +15124,24 @@ components: example: Bad Request type: string type: object + JSONAPIErrorItemSource: + description: References to the source of the error. + properties: + header: + description: A string indicating the name of a single request header which + caused the error. + example: Authorization + type: string + parameter: + description: A string indicating which URI query parameter caused the error. + example: limit + type: string + pointer: + description: A JSON pointer to the value in the request document that caused + the error. + example: /data/attributes/title + type: string + type: object JSONAPIErrorResponse: description: API error response. properties: diff --git a/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItem.java b/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItem.java index d98ac7a5bb9..833a8d06cf2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItem.java @@ -19,6 +19,8 @@ /** API error response body */ @JsonPropertyOrder({ JSONAPIErrorItem.JSON_PROPERTY_DETAIL, + JSONAPIErrorItem.JSON_PROPERTY_META, + JSONAPIErrorItem.JSON_PROPERTY_SOURCE, JSONAPIErrorItem.JSON_PROPERTY_STATUS, JSONAPIErrorItem.JSON_PROPERTY_TITLE }) @@ -29,6 +31,12 @@ public class JSONAPIErrorItem { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + public static final String JSON_PROPERTY_META = "meta"; + private Map meta = null; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private JSONAPIErrorItemSource source; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; @@ -56,6 +64,57 @@ public void setDetail(String detail) { this.detail = detail; } + public JSONAPIErrorItem meta(Map meta) { + this.meta = meta; + return this; + } + + public JSONAPIErrorItem putMetaItem(String key, Object metaItem) { + if (this.meta == null) { + this.meta = new HashMap<>(); + } + this.meta.put(key, metaItem); + return this; + } + + /** + * Non-standard meta-information about the error + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMeta() { + return meta; + } + + public void setMeta(Map meta) { + this.meta = meta; + } + + public JSONAPIErrorItem source(JSONAPIErrorItemSource source) { + this.source = source; + this.unparsed |= source.unparsed; + return this; + } + + /** + * References to the source of the error. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JSONAPIErrorItemSource getSource() { + return source; + } + + public void setSource(JSONAPIErrorItemSource source) { + this.source = source; + } + public JSONAPIErrorItem status(String status) { this.status = status; return this; @@ -155,6 +214,8 @@ public boolean equals(Object o) { } JSONAPIErrorItem jsonapiErrorItem = (JSONAPIErrorItem) o; return Objects.equals(this.detail, jsonapiErrorItem.detail) + && Objects.equals(this.meta, jsonapiErrorItem.meta) + && Objects.equals(this.source, jsonapiErrorItem.source) && Objects.equals(this.status, jsonapiErrorItem.status) && Objects.equals(this.title, jsonapiErrorItem.title) && Objects.equals(this.additionalProperties, jsonapiErrorItem.additionalProperties); @@ -162,7 +223,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(detail, status, title, additionalProperties); + return Objects.hash(detail, meta, source, status, title, additionalProperties); } @Override @@ -170,6 +231,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class JSONAPIErrorItem {\n"); sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItemSource.java b/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItemSource.java new file mode 100644 index 00000000000..67085272a72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JSONAPIErrorItemSource.java @@ -0,0 +1,191 @@ +/* + * 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; + +/** References to the source of the error. */ +@JsonPropertyOrder({ + JSONAPIErrorItemSource.JSON_PROPERTY_HEADER, + JSONAPIErrorItemSource.JSON_PROPERTY_PARAMETER, + JSONAPIErrorItemSource.JSON_PROPERTY_POINTER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JSONAPIErrorItemSource { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HEADER = "header"; + private String header; + + public static final String JSON_PROPERTY_PARAMETER = "parameter"; + private String parameter; + + public static final String JSON_PROPERTY_POINTER = "pointer"; + private String pointer; + + public JSONAPIErrorItemSource header(String header) { + this.header = header; + return this; + } + + /** + * A string indicating the name of a single request header which caused the error. + * + * @return header + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeader() { + return header; + } + + public void setHeader(String header) { + this.header = header; + } + + public JSONAPIErrorItemSource parameter(String parameter) { + this.parameter = parameter; + return this; + } + + /** + * A string indicating which URI query parameter caused the error. + * + * @return parameter + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMETER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParameter() { + return parameter; + } + + public void setParameter(String parameter) { + this.parameter = parameter; + } + + public JSONAPIErrorItemSource pointer(String pointer) { + this.pointer = pointer; + return this; + } + + /** + * A JSON pointer to the value in the request document that caused the error. + * + * @return pointer + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POINTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPointer() { + return pointer; + } + + public void setPointer(String pointer) { + this.pointer = pointer; + } + + /** + * 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 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 JSONAPIErrorItemSource + */ + @JsonAnySetter + public JSONAPIErrorItemSource putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map 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 JSONAPIErrorItemSource object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JSONAPIErrorItemSource jsonapiErrorItemSource = (JSONAPIErrorItemSource) o; + return Objects.equals(this.header, jsonapiErrorItemSource.header) + && Objects.equals(this.parameter, jsonapiErrorItemSource.parameter) + && Objects.equals(this.pointer, jsonapiErrorItemSource.pointer) + && Objects.equals(this.additionalProperties, jsonapiErrorItemSource.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(header, parameter, pointer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JSONAPIErrorItemSource {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); + sb.append(" pointer: ").append(toIndentedString(pointer)).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 "); + } +}