Skip to content
Open
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
226 changes: 50 additions & 176 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

56 changes: 0 additions & 56 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1320,20 +1320,6 @@ datadog\_api\_client.v2.model.attachment\_data\_relationships module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.attachment\_data\_relationships\_last\_modified\_by\_user module
----------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.attachment\_data\_relationships\_last\_modified\_by\_user\_data module
----------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.attachment\_included module
---------------------------------------------------------

Expand Down Expand Up @@ -21739,13 +21725,6 @@ datadog\_api\_client.v2.model.security\_monitoring\_list\_rules\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.security\_monitoring\_paginated\_suppressions\_response module
--------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.security\_monitoring\_reference\_table module
---------------------------------------------------------------------------

Expand Down Expand Up @@ -22383,13 +22362,6 @@ datadog\_api\_client.v2.model.security\_monitoring\_suppression\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.security\_monitoring\_suppression\_sort module
----------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.security\_monitoring\_suppression\_type module
----------------------------------------------------------------------------

Expand Down Expand Up @@ -22418,20 +22390,6 @@ datadog\_api\_client.v2.model.security\_monitoring\_suppression\_update\_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.security\_monitoring\_suppressions\_meta module
-----------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.security\_monitoring\_suppressions\_page\_meta module
-----------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.security\_monitoring\_suppressions\_response module
---------------------------------------------------------------------------------

Expand Down Expand Up @@ -26135,13 +26093,6 @@ datadog\_api\_client.v2.model.user module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.user140420082644000 module
--------------------------------------------------------

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

datadog\_api\_client.v2.model.user\_attributes module
-----------------------------------------------------

Expand Down Expand Up @@ -26408,13 +26359,6 @@ datadog\_api\_client.v2.model.user\_teams\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.user\_type module
-----------------------------------------------

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

datadog\_api\_client.v2.model.user\_update\_attributes module
-------------------------------------------------------------

Expand Down
11 changes: 7 additions & 4 deletions examples/v2/incidents/CreateIncidentAttachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Create incident attachment returns "Created" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import (
Expand All @@ -15,16 +16,18 @@
)
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

body = CreateAttachmentRequest(
data=CreateAttachmentRequestData(
attributes=CreateAttachmentRequestDataAttributes(
attachment=CreateAttachmentRequestDataAttributesAttachment(
document_url="https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
title="Postmortem-IR-123",
document_url="https://app.datadoghq.com/notebook/ExampleIncident/Example-Incident",
title="Example-Incident",
),
attachment_type=AttachmentDataAttributesAttachmentType.POSTMORTEM,
),
id="00000000-0000-0000-0000-000000000000",
type=IncidentAttachmentType.INCIDENT_ATTACHMENTS,
),
)
Expand All @@ -33,6 +36,6 @@
configuration.unstable_operations["create_incident_attachment"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.create_incident_attachment(incident_id="incident_id", body=body)
response = api_instance.create_incident_attachment(incident_id=INCIDENT_DATA_ID, body=body)

print(response)
11 changes: 9 additions & 2 deletions examples/v2/incidents/DeleteIncidentAttachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
Delete incident attachment returns "No Content" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# there is a valid "incident_attachment" in the system
INCIDENT_ATTACHMENT_DATA_ID = environ["INCIDENT_ATTACHMENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["delete_incident_attachment"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
api_instance.delete_incident_attachment(
incident_id="incident_id",
attachment_id="00000000-0000-0000-0000-000000000002",
incident_id=INCIDENT_DATA_ID,
attachment_id=INCIDENT_ATTACHMENT_DATA_ID,
)
6 changes: 5 additions & 1 deletion examples/v2/incidents/ListIncidentAttachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
List incident attachments returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["list_incident_attachments"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.list_incident_attachments(
incident_id="incident_id",
incident_id=INCIDENT_DATA_ID,
)

print(response)
14 changes: 11 additions & 3 deletions examples/v2/incidents/UpdateIncidentAttachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Update incident attachment returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType
Expand All @@ -12,14 +13,21 @@
PatchAttachmentRequestDataAttributesAttachment,
)

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# there is a valid "incident_attachment" in the system
INCIDENT_ATTACHMENT_DATA_ID = environ["INCIDENT_ATTACHMENT_DATA_ID"]

body = PatchAttachmentRequest(
data=PatchAttachmentRequestData(
attributes=PatchAttachmentRequestDataAttributes(
attachment=PatchAttachmentRequestDataAttributesAttachment(
document_url="https://app.datadoghq.com/notebook/124/Postmortem-IR-124",
title="Postmortem-IR-124",
document_url="https://app.datadoghq.com/notebook/124/Example-Incident",
title="Example-Incident",
),
),
id=INCIDENT_ATTACHMENT_DATA_ID,
type=IncidentAttachmentType.INCIDENT_ATTACHMENTS,
),
)
Expand All @@ -29,7 +37,7 @@
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.update_incident_attachment(
incident_id="incident_id", attachment_id="00000000-0000-0000-0000-000000000002", body=body
incident_id=INCIDENT_DATA_ID, attachment_id=INCIDENT_ATTACHMENT_DATA_ID, body=body
)

print(response)

This file was deleted.

This file was deleted.

This file was deleted.

37 changes: 6 additions & 31 deletions src/datadog_api_client/v2/api/incidents_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
from datadog_api_client.configuration import Configuration
from datadog_api_client.model_utils import (
date,
datetime,
set_attribute_from_path,
get_attribute_from_path,
none_type,
UnsetType,
unset,
UUID,
Expand Down Expand Up @@ -340,18 +337,7 @@ def __init__(self, api_client=None):
},
"attachment_id": {
"required": True,
"openapi_types": (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
),
"openapi_types": (str,),
"attribute": "attachment_id",
"location": "path",
},
Expand Down Expand Up @@ -999,18 +985,7 @@ def __init__(self, api_client=None):
},
"attachment_id": {
"required": True,
"openapi_types": (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
),
"openapi_types": (str,),
"attribute": "attachment_id",
"location": "path",
},
Expand Down Expand Up @@ -1389,14 +1364,14 @@ def delete_incident(
def delete_incident_attachment(
self,
incident_id: str,
attachment_id: Any,
attachment_id: str,
) -> None:
"""Delete incident attachment.

:param incident_id: The UUID of the incident.
:type incident_id: str
:param attachment_id: The ID of the attachment.
:type attachment_id: bool, date, datetime, dict, float, int, list, str, UUID, none_type
:type attachment_id: str
:rtype: None
"""
kwargs: Dict[str, Any] = {}
Expand Down Expand Up @@ -2027,7 +2002,7 @@ def update_incident(
def update_incident_attachment(
self,
incident_id: str,
attachment_id: Any,
attachment_id: str,
body: PatchAttachmentRequest,
*,
include: Union[str, UnsetType] = unset,
Expand All @@ -2037,7 +2012,7 @@ def update_incident_attachment(
:param incident_id: The UUID of the incident.
:type incident_id: str
:param attachment_id: The ID of the attachment.
:type attachment_id: bool, date, datetime, dict, float, int, list, str, UUID, none_type
:type attachment_id: str
:type body: PatchAttachmentRequest
:param include: Resource to include in the response. Supported value: ``last_modified_by_user``.
:type include: str, optional
Expand Down
Loading