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
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.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"
}
}
}
24 changes: 24 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand All @@ -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<String, Object> meta = null;

public static final String JSON_PROPERTY_SOURCE = "source";
private JSONAPIErrorItemSource source;

public static final String JSON_PROPERTY_STATUS = "status";
private String status;

Expand Down Expand Up @@ -56,6 +64,57 @@ public void setDetail(String detail) {
this.detail = detail;
}

public JSONAPIErrorItem meta(Map<String, Object> 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<String, Object> getMeta() {
return meta;
}

public void setMeta(Map<String, Object> 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;
Expand Down Expand Up @@ -155,21 +214,25 @@ 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);
}

@Override
public int hashCode() {
return Objects.hash(detail, status, title, additionalProperties);
return Objects.hash(detail, meta, source, status, title, additionalProperties);
}

@Override
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: ")
Expand Down
Original file line number Diff line number Diff line change
@@ -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<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 JSONAPIErrorItemSource
*/
@JsonAnySetter
public JSONAPIErrorItemSource 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 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 ");
}
}
Loading