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
33 changes: 33 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75138,6 +75138,8 @@ components:
example: 1
format: int64
type: integer
weekdayPositions:
$ref: "#/components/schemas/SyntheticsDowntimeWeekdayPositions"
weekdays:
$ref: "#/components/schemas/SyntheticsDowntimeWeekdays"
required:
Expand All @@ -75155,6 +75157,8 @@ components:
type: integer
until:
$ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate"
weekdayPositions:
$ref: "#/components/schemas/SyntheticsDowntimeWeekdayPositions"
weekdays:
$ref: "#/components/schemas/SyntheticsDowntimeWeekdays"
required:
Expand Down Expand Up @@ -75266,6 +75270,32 @@ components:
- FRIDAY
- SATURDAY
- SUNDAY
SyntheticsDowntimeWeekdayPosition:
description: >-
The position of a weekday within a month for a monthly Synthetics downtime recurrence. `1` through `4` select the first through fourth occurrence of the weekday in the month, and `-1` selects the last occurrence.
enum:
- 1
- 2
- 3
- 4
- -1
example: 1
format: int64
type: integer
x-enum-varnames:
- FIRST
- SECOND
- THIRD
- FOURTH
- LAST
SyntheticsDowntimeWeekdayPositions:
description: >-
Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with `weekdays` to schedule occurrences such as "the first Monday of the month".
example:
- 1
items:
$ref: "#/components/schemas/SyntheticsDowntimeWeekdayPosition"
type: array
SyntheticsDowntimeWeekdays:
description: Days of the week for a Synthetics downtime recurrence schedule.
example:
Expand Down Expand Up @@ -143383,6 +143413,7 @@ paths:
operator: AND
permissions:
- synthetics_write
- synthetics_default_settings_write
/api/v2/synthetics/downtimes/{downtime_id}:
delete:
description: Delete a Synthetics downtime by its ID.
Expand Down Expand Up @@ -143425,6 +143456,7 @@ paths:
operator: AND
permissions:
- synthetics_write
- synthetics_default_settings_write
get:
description: Get a Synthetics downtime by its ID.
operationId: GetSyntheticsDowntime
Expand Down Expand Up @@ -143598,6 +143630,7 @@ paths:
operator: AND
permissions:
- synthetics_write
- synthetics_default_settings_write
/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}:
delete:
description: Disassociate a Synthetics test from a downtime.
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 @@ -33121,6 +33121,13 @@ datadog\_api\_client.v2.model.synthetics\_downtime\_weekday module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.synthetics\_downtime\_weekday\_position module
----------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.synthetics\_downtimes\_response module
--------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
if TYPE_CHECKING:
from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate
from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency
from datadog_api_client.v2.model.synthetics_downtime_weekday_position import SyntheticsDowntimeWeekdayPosition
from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday


Expand All @@ -24,19 +25,22 @@ class SyntheticsDowntimeTimeSlotRecurrenceRequest(ModelNormal):
def openapi_types(_):
from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate
from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency
from datadog_api_client.v2.model.synthetics_downtime_weekday_position import SyntheticsDowntimeWeekdayPosition
from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday

return {
"end": (SyntheticsDowntimeTimeSlotDate,),
"frequency": (SyntheticsDowntimeFrequency,),
"interval": (int,),
"weekday_positions": ([SyntheticsDowntimeWeekdayPosition],),
"weekdays": ([SyntheticsDowntimeWeekday],),
}

attribute_map = {
"end": "end",
"frequency": "frequency",
"interval": "interval",
"weekday_positions": "weekdayPositions",
"weekdays": "weekdays",
}

Expand All @@ -45,6 +49,7 @@ def __init__(
frequency: SyntheticsDowntimeFrequency,
end: Union[SyntheticsDowntimeTimeSlotDate, UnsetType] = unset,
interval: Union[int, UnsetType] = unset,
weekday_positions: Union[List[SyntheticsDowntimeWeekdayPosition], UnsetType] = unset,
weekdays: Union[List[SyntheticsDowntimeWeekday], UnsetType] = unset,
**kwargs,
):
Expand All @@ -60,13 +65,18 @@ def __init__(
:param interval: The interval between recurrences, relative to the frequency.
:type interval: int, optional

:param weekday_positions: Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with ``weekdays`` to schedule occurrences such as "the first Monday of the month".
:type weekday_positions: [SyntheticsDowntimeWeekdayPosition], optional

:param weekdays: Days of the week for a Synthetics downtime recurrence schedule.
:type weekdays: [SyntheticsDowntimeWeekday], optional
"""
if end is not unset:
kwargs["end"] = end
if interval is not unset:
kwargs["interval"] = interval
if weekday_positions is not unset:
kwargs["weekday_positions"] = weekday_positions
if weekdays is not unset:
kwargs["weekdays"] = weekdays
super().__init__(kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
if TYPE_CHECKING:
from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency
from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate
from datadog_api_client.v2.model.synthetics_downtime_weekday_position import SyntheticsDowntimeWeekdayPosition
from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday


Expand All @@ -24,19 +25,22 @@ class SyntheticsDowntimeTimeSlotRecurrenceResponse(ModelNormal):
def openapi_types(_):
from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency
from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate
from datadog_api_client.v2.model.synthetics_downtime_weekday_position import SyntheticsDowntimeWeekdayPosition
from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday

return {
"frequency": (SyntheticsDowntimeFrequency,),
"interval": (int,),
"until": (SyntheticsDowntimeTimeSlotDate,),
"weekday_positions": ([SyntheticsDowntimeWeekdayPosition],),
"weekdays": ([SyntheticsDowntimeWeekday],),
}

attribute_map = {
"frequency": "frequency",
"interval": "interval",
"until": "until",
"weekday_positions": "weekdayPositions",
"weekdays": "weekdays",
}

Expand All @@ -46,6 +50,7 @@ def __init__(
interval: int,
weekdays: List[SyntheticsDowntimeWeekday],
until: Union[SyntheticsDowntimeTimeSlotDate, UnsetType] = unset,
weekday_positions: Union[List[SyntheticsDowntimeWeekdayPosition], UnsetType] = unset,
**kwargs,
):
"""
Expand All @@ -60,11 +65,16 @@ def __init__(
:param until: A specific date and time used to define the start or end of a Synthetics downtime time slot.
:type until: SyntheticsDowntimeTimeSlotDate, optional

:param weekday_positions: Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with ``weekdays`` to schedule occurrences such as "the first Monday of the month".
:type weekday_positions: [SyntheticsDowntimeWeekdayPosition], optional

:param weekdays: Days of the week for a Synthetics downtime recurrence schedule.
:type weekdays: [SyntheticsDowntimeWeekday]
"""
if until is not unset:
kwargs["until"] = until
if weekday_positions is not unset:
kwargs["weekday_positions"] = weekday_positions
super().__init__(kwargs)

self_.frequency = frequency
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class SyntheticsDowntimeWeekdayPosition(ModelSimple):
"""
The position of a weekday within a month for a monthly Synthetics downtime recurrence. `1` through `4` select the first through fourth occurrence of the weekday in the month, and `-1` selects the last occurrence.

:param value: Must be one of [1, 2, 3, 4, -1].
:type value: int
"""

allowed_values = {
1,
2,
3,
4,
-1,
}
FIRST: ClassVar["SyntheticsDowntimeWeekdayPosition"]
SECOND: ClassVar["SyntheticsDowntimeWeekdayPosition"]
THIRD: ClassVar["SyntheticsDowntimeWeekdayPosition"]
FOURTH: ClassVar["SyntheticsDowntimeWeekdayPosition"]
LAST: ClassVar["SyntheticsDowntimeWeekdayPosition"]

@cached_property
def openapi_types(_):
return {
"value": (int,),
}


SyntheticsDowntimeWeekdayPosition.FIRST = SyntheticsDowntimeWeekdayPosition(1)
SyntheticsDowntimeWeekdayPosition.SECOND = SyntheticsDowntimeWeekdayPosition(2)
SyntheticsDowntimeWeekdayPosition.THIRD = SyntheticsDowntimeWeekdayPosition(3)
SyntheticsDowntimeWeekdayPosition.FOURTH = SyntheticsDowntimeWeekdayPosition(4)
SyntheticsDowntimeWeekdayPosition.LAST = SyntheticsDowntimeWeekdayPosition(-1)
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 @@ -6761,6 +6761,7 @@
from datadog_api_client.v2.model.synthetics_downtime_time_slot_request import SyntheticsDowntimeTimeSlotRequest
from datadog_api_client.v2.model.synthetics_downtime_time_slot_response import SyntheticsDowntimeTimeSlotResponse
from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday
from datadog_api_client.v2.model.synthetics_downtime_weekday_position import SyntheticsDowntimeWeekdayPosition
from datadog_api_client.v2.model.synthetics_downtimes_response import SyntheticsDowntimesResponse
from datadog_api_client.v2.model.synthetics_fast_test_result import SyntheticsFastTestResult
from datadog_api_client.v2.model.synthetics_fast_test_result_attributes import SyntheticsFastTestResultAttributes
Expand Down Expand Up @@ -12446,6 +12447,7 @@
"SyntheticsDowntimeTimeSlotRequest",
"SyntheticsDowntimeTimeSlotResponse",
"SyntheticsDowntimeWeekday",
"SyntheticsDowntimeWeekdayPosition",
"SyntheticsDowntimesResponse",
"SyntheticsFastTestResult",
"SyntheticsFastTestResultAttributes",
Expand Down
Loading