Skip to content

Fix downtimes v2 schema and add missing field canceled #1568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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.5",
"regenerated": "2023-07-10 14:14:46.515708",
"spec_repo_commit": "19d6892e"
"regenerated": "2023-07-10 14:43:41.796864",
"spec_repo_commit": "96fb94b8"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-10 14:14:46.590885",
"spec_repo_commit": "19d6892e"
"regenerated": "2023-07-10 14:43:41.894242",
"spec_repo_commit": "96fb94b8"
}
}
}
10 changes: 8 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3974,7 +3974,13 @@ components:
DowntimeResponseAttributes:
description: Downtime details.
properties:
created_at:
canceled:
description: Time that the downtime was canceled.
example: 2020-01-02T03:04:05.282979+0000
format: date-time
nullable: true
type: string
created:
description: Creation time of the downtime.
example: 2020-01-02T03:04:05.282979+0000
format: date-time
Expand All @@ -3983,7 +3989,7 @@ components:
$ref: '#/components/schemas/DowntimeDisplayTimezone'
message:
$ref: '#/components/schemas/DowntimeMessage'
modified_at:
modified:
description: Time that the downtime was last modified.
example: 2020-01-02T03:04:05.282979+0000
format: date-time
Expand Down
36 changes: 22 additions & 14 deletions src/datadog_api_client/v2/model/downtime_response_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ def openapi_types(_):
from datadog_api_client.v2.model.downtime_status import DowntimeStatus

return {
"created_at": (datetime,),
"canceled": (datetime, none_type),
"created": (datetime,),
"display_timezone": (str,),
"message": (str,),
"modified_at": (datetime,),
"modified": (datetime,),
"monitor_identifier": (DowntimeMonitorIdentifier,),
"mute_first_recovery_notification": (bool,),
"notify_end_states": ([DowntimeNotifyEndStateTypes],),
Expand All @@ -51,10 +52,11 @@ def openapi_types(_):
}

attribute_map = {
"created_at": "created_at",
"canceled": "canceled",
"created": "created",
"display_timezone": "display_timezone",
"message": "message",
"modified_at": "modified_at",
"modified": "modified",
"monitor_identifier": "monitor_identifier",
"mute_first_recovery_notification": "mute_first_recovery_notification",
"notify_end_states": "notify_end_states",
Expand All @@ -66,10 +68,11 @@ def openapi_types(_):

def __init__(
self_,
created_at: Union[datetime, UnsetType] = unset,
canceled: Union[datetime, none_type, UnsetType] = unset,
created: Union[datetime, UnsetType] = unset,
display_timezone: Union[str, none_type, UnsetType] = unset,
message: Union[str, none_type, UnsetType] = unset,
modified_at: Union[datetime, UnsetType] = unset,
modified: Union[datetime, UnsetType] = unset,
monitor_identifier: Union[
DowntimeMonitorIdentifier, DowntimeMonitorIdentifierId, DowntimeMonitorIdentifierTags, UnsetType
] = unset,
Expand All @@ -86,8 +89,11 @@ def __init__(
"""
Downtime details.

:param created_at: Creation time of the downtime.
:type created_at: datetime, optional
:param canceled: Time that the downtime was canceled.
:type canceled: datetime, none_type, optional

:param created: Creation time of the downtime.
:type created: datetime, optional

:param display_timezone: The timezone in which to display the downtime's start and end times in Datadog applications. This is not used
as an offset for scheduling.
Expand All @@ -97,8 +103,8 @@ def __init__(
by using the same ``@username`` notation as events.
:type message: str, none_type, optional

:param modified_at: Time that the downtime was last modified.
:type modified_at: datetime, optional
:param modified: Time that the downtime was last modified.
:type modified: datetime, optional

:param monitor_identifier: Monitor identifier for the downtime.
:type monitor_identifier: DowntimeMonitorIdentifier, optional
Expand All @@ -123,14 +129,16 @@ def __init__(
:param status: The current status of the downtime.
:type status: DowntimeStatus, optional
"""
if created_at is not unset:
kwargs["created_at"] = created_at
if canceled is not unset:
kwargs["canceled"] = canceled
if created is not unset:
kwargs["created"] = created
if display_timezone is not unset:
kwargs["display_timezone"] = display_timezone
if message is not unset:
kwargs["message"] = message
if modified_at is not unset:
kwargs["modified_at"] = modified_at
if modified is not unset:
kwargs["modified"] = modified
if monitor_identifier is not unset:
kwargs["monitor_identifier"] = monitor_identifier
if mute_first_recovery_notification is not unset:
Expand Down