Skip to content

Commit 91e418e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 20b3bfd of spec repo
1 parent 3d77f00 commit 91e418e

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9168,6 +9168,11 @@ components:
91689168
CaseCreateAttributes:
91699169
description: Case creation attributes
91709170
properties:
9171+
custom_attributes:
9172+
additionalProperties:
9173+
$ref: '#/components/schemas/CustomAttributeValue'
9174+
description: Case custom attributes
9175+
type: object
91719176
description:
91729177
description: Description
91739178
type: string

src/datadog_api_client/v2/model/case_create_attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union, TYPE_CHECKING
6+
from typing import Dict, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -14,22 +14,26 @@
1414

1515

1616
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.custom_attribute_value import CustomAttributeValue
1718
from datadog_api_client.v2.model.case_priority import CasePriority
1819

1920

2021
class CaseCreateAttributes(ModelNormal):
2122
@cached_property
2223
def openapi_types(_):
24+
from datadog_api_client.v2.model.custom_attribute_value import CustomAttributeValue
2325
from datadog_api_client.v2.model.case_priority import CasePriority
2426

2527
return {
28+
"custom_attributes": ({str: (CustomAttributeValue,)},),
2629
"description": (str,),
2730
"priority": (CasePriority,),
2831
"title": (str,),
2932
"type_id": (str,),
3033
}
3134

3235
attribute_map = {
36+
"custom_attributes": "custom_attributes",
3337
"description": "description",
3438
"priority": "priority",
3539
"title": "title",
@@ -40,13 +44,17 @@ def __init__(
4044
self_,
4145
title: str,
4246
type_id: str,
47+
custom_attributes: Union[Dict[str, CustomAttributeValue], UnsetType] = unset,
4348
description: Union[str, UnsetType] = unset,
4449
priority: Union[CasePriority, UnsetType] = unset,
4550
**kwargs,
4651
):
4752
"""
4853
Case creation attributes
4954
55+
:param custom_attributes: Case custom attributes
56+
:type custom_attributes: {str: (CustomAttributeValue,)}, optional
57+
5058
:param description: Description
5159
:type description: str, optional
5260
@@ -59,6 +67,8 @@ def __init__(
5967
:param type_id: Case type UUID
6068
:type type_id: str
6169
"""
70+
if custom_attributes is not unset:
71+
kwargs["custom_attributes"] = custom_attributes
6272
if description is not unset:
6373
kwargs["description"] = description
6474
if priority is not unset:

tests/v2/features/given.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"parameters": [
169169
{
170170
"name": "body",
171-
"value": "{\n \"data\": {\n \"attributes\": {\n \"title\": \"My new case\",\n \"type_id\": \"00000000-0000-0000-0000-000000000001\",\n \"priority\": \"P4\"\n },\n \"relationships\": {\n \"project\": {\n \"data\": {\n \"id\": \"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\n \"type\": \"project\"\n }\n }\n },\n \"type\": \"case\"\n }\n}"
171+
"value": "{\n \"data\": {\n \"attributes\": {\n \"title\": \"My new case\",\n \"type_id\": \"00000000-0000-0000-0000-000000000001\",\n \"priority\": \"P4\",\n \"custom_attributes\": {\n \"severity\": {\n \"type\": \"SELECT\",\n \"value\": \"High\",\n \"is_multi\": false\n },\n \"affected_systems\": {\n \"type\": \"TEXT\",\n \"value\": [\"Web API\", \"Mobile App\"],\n \"is_multi\": true\n }\n }\n },\n \"relationships\": {\n \"project\": {\n \"data\": {\n \"id\": \"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\n \"type\": \"project\"\n }\n }\n },\n \"type\": \"case\"\n }\n}"
172172
}
173173
],
174174
"source": "data",
@@ -181,7 +181,7 @@
181181
"parameters": [
182182
{
183183
"name": "body",
184-
"value": "{\n \"data\": {\n \"attributes\": {\n \"title\": \"My new case\",\n \"type_id\": \"{{ case_type.id }}\",\n \"priority\": \"P4\"\n },\n \"relationships\": {\n \"project\": {\n \"data\": {\n \"id\": \"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\n \"type\": \"project\"\n }\n }\n },\n \"type\": \"case\"\n }\n}"
184+
"value": "{\n \"data\": {\n \"attributes\": {\n \"title\": \"My new case\",\n \"type_id\": \"{{ case_type.id }}\",\n \"priority\": \"P4\",\n \"custom_attributes\": {\n \"impact\": {\n \"type\": \"SELECT\",\n \"value\": \"Critical\",\n \"is_multi\": false\n },\n \"tags\": {\n \"type\": \"TEXT\",\n \"value\": [\"security\", \"urgent\"],\n \"is_multi\": true\n }\n }\n },\n \"relationships\": {\n \"project\": {\n \"data\": {\n \"id\": \"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\n \"type\": \"project\"\n }\n }\n },\n \"type\": \"case\"\n }\n}"
185185
}
186186
],
187187
"source": "data",

0 commit comments

Comments
 (0)