Skip to content

Commit 8f68871

Browse files
dd-octo-sts[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 6b4b72c of spec repo (#4199)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 2a26e46 commit 8f68871

93 files changed

Lines changed: 3966 additions & 58 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 882 additions & 19 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Get On-Call Page returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.on_call_api import OnCallApi
8+
9+
configuration = Configuration()
10+
configuration.access_token = environ["DD_BEARER_TOKEN"]
11+
with ApiClient(configuration) as api_client:
12+
api_instance = OnCallApi(api_client)
13+
response = api_instance.get_on_call_page(
14+
page_id="f63eb677-07ce-46ab-b2e0-80ca1ffe91bf",
15+
)
16+
17+
print(response)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
List On-Call Pages returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.on_call_api import OnCallApi
8+
9+
configuration = Configuration()
10+
configuration.access_token = environ["DD_BEARER_TOKEN"]
11+
with ApiClient(configuration) as api_client:
12+
api_instance = OnCallApi(api_client)
13+
response = api_instance.list_on_call_pages(
14+
filter_query="key:1",
15+
)
16+
17+
print(response)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
List On-Call Pages returns "OK" response with pagination
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.on_call_api import OnCallApi
8+
9+
configuration = Configuration()
10+
configuration.access_token = environ["DD_BEARER_TOKEN"]
11+
with ApiClient(configuration) as api_client:
12+
api_instance = OnCallApi(api_client)
13+
items = api_instance.list_on_call_pages_with_pagination()
14+
for item in items:
15+
print(item)

‎src/datadog_api_client/v2/api/on_call_api.py‎

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
from datadog_api_client.v2.model.escalation_policy import EscalationPolicy
2222
from datadog_api_client.v2.model.escalation_policy_create_request import EscalationPolicyCreateRequest
2323
from datadog_api_client.v2.model.escalation_policy_update_request import EscalationPolicyUpdateRequest
24+
from datadog_api_client.v2.model.on_call_pages_response import OnCallPagesResponse
25+
from datadog_api_client.v2.model.on_call_pages_sort import OnCallPagesSort
26+
from datadog_api_client.v2.model.on_call_page_data import OnCallPageData
27+
from datadog_api_client.v2.model.on_call_page_response import OnCallPageResponse
2428
from datadog_api_client.v2.model.schedules import Schedules
2529
from datadog_api_client.v2.model.schedule_list_item import ScheduleListItem
2630
from datadog_api_client.v2.model.schedule import Schedule
@@ -349,6 +353,29 @@ def __init__(self, api_client=None):
349353
api_client=api_client,
350354
)
351355

356+
self._get_on_call_page_endpoint = _Endpoint(
357+
settings={
358+
"response_type": (OnCallPageResponse,),
359+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
360+
"endpoint_path": "/api/v2/on-call/pages/{page_id}",
361+
"operation_id": "get_on_call_page",
362+
"http_method": "GET",
363+
"version": "v2",
364+
},
365+
params_map={
366+
"page_id": {
367+
"required": True,
368+
"openapi_types": (str,),
369+
"attribute": "page_id",
370+
"location": "path",
371+
},
372+
},
373+
headers_map={
374+
"accept": ["application/json"],
375+
},
376+
api_client=api_client,
377+
)
378+
352379
self._get_on_call_schedule_endpoint = _Endpoint(
353380
settings={
354381
"response_type": (Schedule,),
@@ -632,6 +659,49 @@ def __init__(self, api_client=None):
632659
api_client=api_client,
633660
)
634661

662+
self._list_on_call_pages_endpoint = _Endpoint(
663+
settings={
664+
"response_type": (OnCallPagesResponse,),
665+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
666+
"endpoint_path": "/api/v2/on-call/pages",
667+
"operation_id": "list_on_call_pages",
668+
"http_method": "GET",
669+
"version": "v2",
670+
},
671+
params_map={
672+
"page_size": {
673+
"validation": {
674+
"inclusive_maximum": 1000,
675+
},
676+
"openapi_types": (int,),
677+
"attribute": "page[size]",
678+
"location": "query",
679+
},
680+
"page_number": {
681+
"validation": {
682+
"inclusive_minimum": 0,
683+
},
684+
"openapi_types": (int,),
685+
"attribute": "page[number]",
686+
"location": "query",
687+
},
688+
"filter_query": {
689+
"openapi_types": (str,),
690+
"attribute": "filter[query]",
691+
"location": "query",
692+
},
693+
"sort": {
694+
"openapi_types": (OnCallPagesSort,),
695+
"attribute": "sort",
696+
"location": "query",
697+
},
698+
},
699+
headers_map={
700+
"accept": ["application/json"],
701+
},
702+
api_client=api_client,
703+
)
704+
635705
self._list_on_call_schedules_endpoint = _Endpoint(
636706
settings={
637707
"response_type": (Schedules,),
@@ -1143,6 +1213,23 @@ def get_on_call_escalation_policy(
11431213

11441214
return self._get_on_call_escalation_policy_endpoint.call_with_http_info(**kwargs)
11451215

1216+
def get_on_call_page(
1217+
self,
1218+
page_id: str,
1219+
) -> OnCallPageResponse:
1220+
"""Get On-Call Page.
1221+
1222+
Get the details of an On-Call Page.
1223+
1224+
:param page_id: The ID of the Page, or its key.
1225+
:type page_id: str
1226+
:rtype: OnCallPageResponse
1227+
"""
1228+
kwargs: Dict[str, Any] = {}
1229+
kwargs["page_id"] = page_id
1230+
1231+
return self._get_on_call_page_endpoint.call_with_http_info(**kwargs)
1232+
11461233
def get_on_call_schedule(
11471234
self,
11481235
schedule_id: str,
@@ -1480,6 +1567,93 @@ def list_on_call_escalation_policies_with_pagination(
14801567
}
14811568
return endpoint.call_with_http_info_paginated(pagination)
14821569

1570+
def list_on_call_pages(
1571+
self,
1572+
*,
1573+
page_size: Union[int, UnsetType] = unset,
1574+
page_number: Union[int, UnsetType] = unset,
1575+
filter_query: Union[str, UnsetType] = unset,
1576+
sort: Union[OnCallPagesSort, UnsetType] = unset,
1577+
) -> OnCallPagesResponse:
1578+
"""List On-Call Pages.
1579+
1580+
Retrieve a paginated list of On-Call Pages, optionally filtered by a search query and sorted by a field.
1581+
1582+
:param page_size: Number of On-Call Pages to return per page of results. The maximum allowed value is 1000.
1583+
:type page_size: int, optional
1584+
:param page_number: Page of results to return, starting at 0. ``page[number]`` multiplied by ``page[size]`` must be less than 50000.
1585+
:type page_number: int, optional
1586+
:param filter_query: Search query to filter Pages. Supports filters such as ``status`` , ``urgency`` , ``team`` , ``service`` , and ``tags`` , for example ``status:triggered``.
1587+
:type filter_query: str, optional
1588+
:param sort: Sort Pages by the given field. Only one field is allowed.
1589+
:type sort: OnCallPagesSort, optional
1590+
:rtype: OnCallPagesResponse
1591+
"""
1592+
kwargs: Dict[str, Any] = {}
1593+
if page_size is not unset:
1594+
kwargs["page_size"] = page_size
1595+
1596+
if page_number is not unset:
1597+
kwargs["page_number"] = page_number
1598+
1599+
if filter_query is not unset:
1600+
kwargs["filter_query"] = filter_query
1601+
1602+
if sort is not unset:
1603+
kwargs["sort"] = sort
1604+
1605+
return self._list_on_call_pages_endpoint.call_with_http_info(**kwargs)
1606+
1607+
def list_on_call_pages_with_pagination(
1608+
self,
1609+
*,
1610+
page_size: Union[int, UnsetType] = unset,
1611+
page_number: Union[int, UnsetType] = unset,
1612+
filter_query: Union[str, UnsetType] = unset,
1613+
sort: Union[OnCallPagesSort, UnsetType] = unset,
1614+
) -> collections.abc.Iterable[OnCallPageData]:
1615+
"""List On-Call Pages.
1616+
1617+
Provide a paginated version of :meth:`list_on_call_pages`, returning all items.
1618+
1619+
:param page_size: Number of On-Call Pages to return per page of results. The maximum allowed value is 1000.
1620+
:type page_size: int, optional
1621+
:param page_number: Page of results to return, starting at 0. ``page[number]`` multiplied by ``page[size]`` must be less than 50000.
1622+
:type page_number: int, optional
1623+
:param filter_query: Search query to filter Pages. Supports filters such as ``status`` , ``urgency`` , ``team`` , ``service`` , and ``tags`` , for example ``status:triggered``.
1624+
:type filter_query: str, optional
1625+
:param sort: Sort Pages by the given field. Only one field is allowed.
1626+
:type sort: OnCallPagesSort, optional
1627+
1628+
:return: A generator of paginated results.
1629+
:rtype: collections.abc.Iterable[OnCallPageData]
1630+
"""
1631+
kwargs: Dict[str, Any] = {}
1632+
if page_size is not unset:
1633+
kwargs["page_size"] = page_size
1634+
1635+
if page_number is not unset:
1636+
kwargs["page_number"] = page_number
1637+
1638+
if filter_query is not unset:
1639+
kwargs["filter_query"] = filter_query
1640+
1641+
if sort is not unset:
1642+
kwargs["sort"] = sort
1643+
1644+
local_page_size = get_attribute_from_path(kwargs, "page_size", 100)
1645+
endpoint = self._list_on_call_pages_endpoint
1646+
set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map)
1647+
pagination = {
1648+
"limit_value": local_page_size,
1649+
"results_path": "data",
1650+
"page_param": "page_number",
1651+
"page_start": 0,
1652+
"endpoint": endpoint,
1653+
"kwargs": kwargs,
1654+
}
1655+
return endpoint.call_with_http_info_paginated(pagination)
1656+
14831657
def list_on_call_schedules(
14841658
self,
14851659
*,

‎src/datadog_api_client/v2/model/create_notification_channel_data.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848
:param attributes: Attributes for creating an on-call notification channel.
4949
:type attributes: CreateNotificationChannelAttributes, optional
5050
51-
:param type: Indicates that the resource is of type 'notification_channels'.
51+
:param type: Indicates that the resource is of type ``notification_channels``.
5252
:type type: NotificationChannelType
5353
"""
5454
if attributes is not unset:

‎src/datadog_api_client/v2/model/create_on_call_notification_rule_request_data.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060
:param relationships: Relationship object for creating a notification rule
6161
:type relationships: OnCallNotificationRuleRelationships, optional
6262
63-
:param type: Indicates that the resource is of type 'notification_rules'.
63+
:param type: Indicates that the resource is of type ``notification_rules``.
6464
:type type: OnCallNotificationRuleType
6565
"""
6666
if attributes is not unset:

‎src/datadog_api_client/v2/model/create_override_request_data.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
:param relationships: Relationships to set when creating an on-call schedule override.
5555
:type relationships: CreateOverrideRequestRelationships, optional
5656
57-
:param type: Indicates that the resource is of type 'overrides'.
57+
:param type: Indicates that the resource is of type ``overrides``.
5858
:type type: OverrideDataType
5959
"""
6060
if relationships is not unset:

‎src/datadog_api_client/v2/model/escalation_policy_create_request_data_attributes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(
6868
:param name: Specifies the name for the new escalation policy.
6969
:type name: str
7070
71-
:param resolve_page_on_policy_end: Indicates whether the page is automatically resolved when the policy ends.
71+
:param resolve_page_on_policy_end: Indicates whether the Page is automatically resolved when the policy ends.
7272
:type resolve_page_on_policy_end: bool, optional
7373
7474
:param retries: Specifies how many times the escalation sequence is retried if there is no response.

‎src/datadog_api_client/v2/model/escalation_policy_data_attributes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
:param name: Specifies the name of the escalation policy.
5555
:type name: str
5656
57-
:param resolve_page_on_policy_end: Indicates whether the page is automatically resolved when the policy ends.
57+
:param resolve_page_on_policy_end: Indicates whether the Page is automatically resolved when the policy ends.
5858
:type resolve_page_on_policy_end: bool, optional
5959
6060
:param retries: Specifies how many times the escalation sequence is retried if there is no response.

0 commit comments

Comments
 (0)