Skip to content

Commit

Permalink
Regenerate client from commit 7edfcfcc of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Sep 25, 2023
1 parent 922f10b commit a5444b0
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 6 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": "2023-09-25 12:12:20.967342",
"spec_repo_commit": "5d002e79"
"regenerated": "2023-09-25 14:29:01.449361",
"spec_repo_commit": "7edfcfcc"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-09-25 12:12:20.981814",
"spec_repo_commit": "5d002e79"
"regenerated": "2023-09-25 14:29:01.463277",
"spec_repo_commit": "7edfcfcc"
}
}
}
25 changes: 25 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6852,9 +6852,34 @@ components:
MonitorOptionsSchedulingOptions:
description: Configuration options for scheduling.
properties:
custom_schedule:
$ref: '#/components/schemas/MonitorOptionsSchedulingOptionsCustomSchedule'
evaluation_window:
$ref: '#/components/schemas/MonitorOptionsSchedulingOptionsEvaluationWindow'
type: object
MonitorOptionsSchedulingOptionsCustomSchedule:
description: Configuration options for the custom schedule.
properties:
recurrences:
$ref: '#/components/schemas/MonitorOptionsSchedulingOptionsCustomScheduleRecurrences'
type: object
MonitorOptionsSchedulingOptionsCustomScheduleRecurrences:
description: Configuration recurrences set on the monitor options for custom
schedule.
properties:
rrule:
description: Defines the recurrence rule (RRULE) for a given schedule.
example: FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
type: string
start:
description: Defines the timestamp on when the schedule should start.
example: '2023-08-31T16:30:00'
type: string
timezone:
description: Defines the timezone the schedule runs on.
example: Europe/Paris
type: string
type: object
MonitorOptionsSchedulingOptionsEvaluationWindow:
description: Configuration options for the evaluation window. If `hour_starts`
is set, no other fields may be set. Otherwise, `day_starts` and `month_starts`
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,20 @@ monitor\_options\_scheduling\_options
:members:
:show-inheritance:

monitor\_options\_scheduling\_options\_custom\_schedule
-------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule
:members:
:show-inheritance:

monitor\_options\_scheduling\_options\_custom\_schedule\_recurrences
--------------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule_recurrences
:members:
:show-inheritance:

monitor\_options\_scheduling\_options\_evaluation\_window
---------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@


if TYPE_CHECKING:
from datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule import (
MonitorOptionsSchedulingOptionsCustomSchedule,
)
from datadog_api_client.v1.model.monitor_options_scheduling_options_evaluation_window import (
MonitorOptionsSchedulingOptionsEvaluationWindow,
)
Expand All @@ -22,27 +25,40 @@
class MonitorOptionsSchedulingOptions(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule import (
MonitorOptionsSchedulingOptionsCustomSchedule,
)
from datadog_api_client.v1.model.monitor_options_scheduling_options_evaluation_window import (
MonitorOptionsSchedulingOptionsEvaluationWindow,
)

return {
"custom_schedule": (MonitorOptionsSchedulingOptionsCustomSchedule,),
"evaluation_window": (MonitorOptionsSchedulingOptionsEvaluationWindow,),
}

attribute_map = {
"custom_schedule": "custom_schedule",
"evaluation_window": "evaluation_window",
}

def __init__(
self_, evaluation_window: Union[MonitorOptionsSchedulingOptionsEvaluationWindow, UnsetType] = unset, **kwargs
self_,
custom_schedule: Union[MonitorOptionsSchedulingOptionsCustomSchedule, UnsetType] = unset,
evaluation_window: Union[MonitorOptionsSchedulingOptionsEvaluationWindow, UnsetType] = unset,
**kwargs,
):
"""
Configuration options for scheduling.
:param custom_schedule: Configuration options for the custom schedule.
:type custom_schedule: MonitorOptionsSchedulingOptionsCustomSchedule, optional
:param evaluation_window: Configuration options for the evaluation window. If ``hour_starts`` is set, no other fields may be set. Otherwise, ``day_starts`` and ``month_starts`` must be set together.
:type evaluation_window: MonitorOptionsSchedulingOptionsEvaluationWindow, optional
"""
if custom_schedule is not unset:
kwargs["custom_schedule"] = custom_schedule
if evaluation_window is not unset:
kwargs["evaluation_window"] = evaluation_window
super().__init__(kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule_recurrences import (
MonitorOptionsSchedulingOptionsCustomScheduleRecurrences,
)


class MonitorOptionsSchedulingOptionsCustomSchedule(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule_recurrences import (
MonitorOptionsSchedulingOptionsCustomScheduleRecurrences,
)

return {
"recurrences": (MonitorOptionsSchedulingOptionsCustomScheduleRecurrences,),
}

attribute_map = {
"recurrences": "recurrences",
}

def __init__(
self_, recurrences: Union[MonitorOptionsSchedulingOptionsCustomScheduleRecurrences, UnsetType] = unset, **kwargs
):
"""
Configuration options for the custom schedule.
:param recurrences: Configuration recurrences set on the monitor options for custom schedule.
:type recurrences: MonitorOptionsSchedulingOptionsCustomScheduleRecurrences, optional
"""
if recurrences is not unset:
kwargs["recurrences"] = recurrences
super().__init__(kwargs)
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 MonitorOptionsSchedulingOptionsCustomScheduleRecurrences(ModelNormal):
@cached_property
def openapi_types(_):
return {
"rrule": (str,),
"start": (str,),
"timezone": (str,),
}

attribute_map = {
"rrule": "rrule",
"start": "start",
"timezone": "timezone",
}

def __init__(
self_,
rrule: Union[str, UnsetType] = unset,
start: Union[str, UnsetType] = unset,
timezone: Union[str, UnsetType] = unset,
**kwargs,
):
"""
Configuration recurrences set on the monitor options for custom schedule.
:param rrule: Defines the recurrence rule (RRULE) for a given schedule.
:type rrule: str, optional
:param start: Defines the timestamp on when the schedule should start.
:type start: str, optional
:param timezone: Defines the timezone the schedule runs on.
:type timezone: str, optional
"""
if rrule is not unset:
kwargs["rrule"] = rrule
if start is not unset:
kwargs["start"] = start
if timezone is not unset:
kwargs["timezone"] = timezone
super().__init__(kwargs)
8 changes: 8 additions & 0 deletions src/datadog_api_client/v1/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@
from datadog_api_client.v1.model.monitor_options_aggregation import MonitorOptionsAggregation
from datadog_api_client.v1.model.monitor_options_notification_presets import MonitorOptionsNotificationPresets
from datadog_api_client.v1.model.monitor_options_scheduling_options import MonitorOptionsSchedulingOptions
from datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule import (
MonitorOptionsSchedulingOptionsCustomSchedule,
)
from datadog_api_client.v1.model.monitor_options_scheduling_options_custom_schedule_recurrences import (
MonitorOptionsSchedulingOptionsCustomScheduleRecurrences,
)
from datadog_api_client.v1.model.monitor_options_scheduling_options_evaluation_window import (
MonitorOptionsSchedulingOptionsEvaluationWindow,
)
Expand Down Expand Up @@ -1220,6 +1226,8 @@
"MonitorOptionsAggregation",
"MonitorOptionsNotificationPresets",
"MonitorOptionsSchedulingOptions",
"MonitorOptionsSchedulingOptionsCustomSchedule",
"MonitorOptionsSchedulingOptionsCustomScheduleRecurrences",
"MonitorOptionsSchedulingOptionsEvaluationWindow",
"MonitorOverallStates",
"MonitorRenotifyStatusType",
Expand Down
2 changes: 1 addition & 1 deletion tests/v1/features/monitors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Feature: Monitors
Scenario: Edit a monitor returns "Bad Request" response
Given new "UpdateMonitor" request
And request contains "monitor_id" parameter from "REPLACE.ME"
And body with value {"options": {"escalation_message": "none", "evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
And body with value {"options": {"escalation_message": "none", "evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": {"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
When the request is sent
Then the response status is 400 Bad Request

Expand Down

0 comments on commit a5444b0

Please sign in to comment.