Skip to content

Commit

Permalink
Add meta and source fields to JSONAPIErrorItem (#2332)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 7, 2025
1 parent 4d30a42 commit 54c21bd
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 5 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.6",
"regenerated": "2025-01-06 18:09:27.833401",
"spec_repo_commit": "c020103f"
"regenerated": "2025-01-06 19:03:08.173026",
"spec_repo_commit": "b56ea2d7"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-06 18:09:27.848470",
"spec_repo_commit": "c020103f"
"regenerated": "2025-01-06 19:03:08.194805",
"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
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6353,6 +6353,13 @@ datadog\_api\_client.v2.model.jsonapi\_error\_item module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.jsonapi\_error\_item\_source module
-----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.jsonapi_error_item_source
:members:
:show-inheritance:

datadog\_api\_client.v2.model.jsonapi\_error\_response module
-------------------------------------------------------------

Expand Down
43 changes: 42 additions & 1 deletion src/datadog_api_client/v2/model/jsonapi_error_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,65 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union
from typing import Any, Dict, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
date,
datetime,
none_type,
unset,
UnsetType,
UUID,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource


class JSONAPIErrorItem(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource

return {
"detail": (str,),
"meta": (
{
str: (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
)
},
),
"source": (JSONAPIErrorItemSource,),
"status": (str,),
"title": (str,),
}

attribute_map = {
"detail": "detail",
"meta": "meta",
"source": "source",
"status": "status",
"title": "title",
}

def __init__(
self_,
detail: Union[str, UnsetType] = unset,
meta: Union[Dict[str, Any], UnsetType] = unset,
source: Union[JSONAPIErrorItemSource, UnsetType] = unset,
status: Union[str, UnsetType] = unset,
title: Union[str, UnsetType] = unset,
**kwargs,
Expand All @@ -41,6 +72,12 @@ def __init__(
:param detail: A human-readable explanation specific to this occurrence of the error.
:type detail: str, optional
:param meta: Non-standard meta-information about the error
:type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
:param source: References to the source of the error.
:type source: JSONAPIErrorItemSource, optional
:param status: Status code of the response.
:type status: str, optional
Expand All @@ -49,6 +86,10 @@ def __init__(
"""
if detail is not unset:
kwargs["detail"] = detail
if meta is not unset:
kwargs["meta"] = meta
if source is not unset:
kwargs["source"] = source
if status is not unset:
kwargs["status"] = status
if title is not unset:
Expand Down
56 changes: 56 additions & 0 deletions src/datadog_api_client/v2/model/jsonapi_error_item_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.
from __future__ import annotations

from typing import Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class JSONAPIErrorItemSource(ModelNormal):
@cached_property
def openapi_types(_):
return {
"header": (str,),
"parameter": (str,),
"pointer": (str,),
}

attribute_map = {
"header": "header",
"parameter": "parameter",
"pointer": "pointer",
}

def __init__(
self_,
header: Union[str, UnsetType] = unset,
parameter: Union[str, UnsetType] = unset,
pointer: Union[str, UnsetType] = unset,
**kwargs,
):
"""
References to the source of the error.
:param header: A string indicating the name of a single request header which caused the error.
:type header: str, optional
:param parameter: A string indicating which URI query parameter caused the error.
:type parameter: str, optional
:param pointer: A JSON pointer to the value in the request document that caused the error.
:type pointer: str, optional
"""
if header is not unset:
kwargs["header"] = header
if parameter is not unset:
kwargs["parameter"] = parameter
if pointer is not unset:
kwargs["pointer"] = pointer
super().__init__(kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@
from datadog_api_client.v2.model.interface_attributes import InterfaceAttributes
from datadog_api_client.v2.model.interface_attributes_status import InterfaceAttributesStatus
from datadog_api_client.v2.model.jsonapi_error_item import JSONAPIErrorItem
from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource
from datadog_api_client.v2.model.jsonapi_error_response import JSONAPIErrorResponse
from datadog_api_client.v2.model.jira_integration_metadata import JiraIntegrationMetadata
from datadog_api_client.v2.model.jira_integration_metadata_issues_item import JiraIntegrationMetadataIssuesItem
Expand Down Expand Up @@ -3224,6 +3225,7 @@
"InterfaceAttributes",
"InterfaceAttributesStatus",
"JSONAPIErrorItem",
"JSONAPIErrorItemSource",
"JSONAPIErrorResponse",
"JiraIntegrationMetadata",
"JiraIntegrationMetadataIssuesItem",
Expand Down

0 comments on commit 54c21bd

Please sign in to comment.