|
21 | 21 | from datadog_api_client.v2.model.escalation_policy import EscalationPolicy |
22 | 22 | from datadog_api_client.v2.model.escalation_policy_create_request import EscalationPolicyCreateRequest |
23 | 23 | 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 |
24 | 28 | from datadog_api_client.v2.model.schedules import Schedules |
25 | 29 | from datadog_api_client.v2.model.schedule_list_item import ScheduleListItem |
26 | 30 | from datadog_api_client.v2.model.schedule import Schedule |
@@ -349,6 +353,29 @@ def __init__(self, api_client=None): |
349 | 353 | api_client=api_client, |
350 | 354 | ) |
351 | 355 |
|
| 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 | + |
352 | 379 | self._get_on_call_schedule_endpoint = _Endpoint( |
353 | 380 | settings={ |
354 | 381 | "response_type": (Schedule,), |
@@ -632,6 +659,49 @@ def __init__(self, api_client=None): |
632 | 659 | api_client=api_client, |
633 | 660 | ) |
634 | 661 |
|
| 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 | + |
635 | 705 | self._list_on_call_schedules_endpoint = _Endpoint( |
636 | 706 | settings={ |
637 | 707 | "response_type": (Schedules,), |
@@ -1143,6 +1213,23 @@ def get_on_call_escalation_policy( |
1143 | 1213 |
|
1144 | 1214 | return self._get_on_call_escalation_policy_endpoint.call_with_http_info(**kwargs) |
1145 | 1215 |
|
| 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 | + |
1146 | 1233 | def get_on_call_schedule( |
1147 | 1234 | self, |
1148 | 1235 | schedule_id: str, |
@@ -1480,6 +1567,93 @@ def list_on_call_escalation_policies_with_pagination( |
1480 | 1567 | } |
1481 | 1568 | return endpoint.call_with_http_info_paginated(pagination) |
1482 | 1569 |
|
| 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 | + |
1483 | 1657 | def list_on_call_schedules( |
1484 | 1658 | self, |
1485 | 1659 | *, |
|
0 commit comments