|
37 | 37 | from ....types.auth_rules.auth_rule import AuthRule |
38 | 38 | from ....types.auth_rules.event_stream import EventStream |
39 | 39 | from ....types.auth_rules.v2_list_results_response import V2ListResultsResponse |
| 40 | +from ....types.auth_rules.v2_list_versions_response import V2ListVersionsResponse |
40 | 41 | from ....types.auth_rules.v2_retrieve_report_response import V2RetrieveReportResponse |
41 | 42 | from ....types.auth_rules.v2_retrieve_features_response import V2RetrieveFeaturesResponse |
42 | 43 |
|
@@ -738,6 +739,40 @@ def list_results( |
738 | 739 | model=cast(Any, V2ListResultsResponse), # Union types cannot be passed in as arguments in the type system |
739 | 740 | ) |
740 | 741 |
|
| 742 | + def list_versions( |
| 743 | + self, |
| 744 | + auth_rule_token: str, |
| 745 | + *, |
| 746 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 747 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 748 | + extra_headers: Headers | None = None, |
| 749 | + extra_query: Query | None = None, |
| 750 | + extra_body: Body | None = None, |
| 751 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 752 | + ) -> V2ListVersionsResponse: |
| 753 | + """ |
| 754 | + Returns all versions of an auth rule, sorted by version number descending |
| 755 | + (newest first). |
| 756 | +
|
| 757 | + Args: |
| 758 | + extra_headers: Send extra headers |
| 759 | +
|
| 760 | + extra_query: Add additional query parameters to the request |
| 761 | +
|
| 762 | + extra_body: Add additional JSON properties to the request |
| 763 | +
|
| 764 | + timeout: Override the client-level default timeout for this request, in seconds |
| 765 | + """ |
| 766 | + if not auth_rule_token: |
| 767 | + raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}") |
| 768 | + return self._get( |
| 769 | + f"/v2/auth_rules/{auth_rule_token}/versions", |
| 770 | + options=make_request_options( |
| 771 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 772 | + ), |
| 773 | + cast_to=V2ListVersionsResponse, |
| 774 | + ) |
| 775 | + |
741 | 776 | def promote( |
742 | 777 | self, |
743 | 778 | auth_rule_token: str, |
@@ -1582,6 +1617,40 @@ def list_results( |
1582 | 1617 | model=cast(Any, V2ListResultsResponse), # Union types cannot be passed in as arguments in the type system |
1583 | 1618 | ) |
1584 | 1619 |
|
| 1620 | + async def list_versions( |
| 1621 | + self, |
| 1622 | + auth_rule_token: str, |
| 1623 | + *, |
| 1624 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1625 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1626 | + extra_headers: Headers | None = None, |
| 1627 | + extra_query: Query | None = None, |
| 1628 | + extra_body: Body | None = None, |
| 1629 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1630 | + ) -> V2ListVersionsResponse: |
| 1631 | + """ |
| 1632 | + Returns all versions of an auth rule, sorted by version number descending |
| 1633 | + (newest first). |
| 1634 | +
|
| 1635 | + Args: |
| 1636 | + extra_headers: Send extra headers |
| 1637 | +
|
| 1638 | + extra_query: Add additional query parameters to the request |
| 1639 | +
|
| 1640 | + extra_body: Add additional JSON properties to the request |
| 1641 | +
|
| 1642 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1643 | + """ |
| 1644 | + if not auth_rule_token: |
| 1645 | + raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}") |
| 1646 | + return await self._get( |
| 1647 | + f"/v2/auth_rules/{auth_rule_token}/versions", |
| 1648 | + options=make_request_options( |
| 1649 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1650 | + ), |
| 1651 | + cast_to=V2ListVersionsResponse, |
| 1652 | + ) |
| 1653 | + |
1585 | 1654 | async def promote( |
1586 | 1655 | self, |
1587 | 1656 | auth_rule_token: str, |
@@ -1756,6 +1825,9 @@ def __init__(self, v2: V2) -> None: |
1756 | 1825 | self.list_results = _legacy_response.to_raw_response_wrapper( |
1757 | 1826 | v2.list_results, |
1758 | 1827 | ) |
| 1828 | + self.list_versions = _legacy_response.to_raw_response_wrapper( |
| 1829 | + v2.list_versions, |
| 1830 | + ) |
1759 | 1831 | self.promote = _legacy_response.to_raw_response_wrapper( |
1760 | 1832 | v2.promote, |
1761 | 1833 | ) |
@@ -1796,6 +1868,9 @@ def __init__(self, v2: AsyncV2) -> None: |
1796 | 1868 | self.list_results = _legacy_response.async_to_raw_response_wrapper( |
1797 | 1869 | v2.list_results, |
1798 | 1870 | ) |
| 1871 | + self.list_versions = _legacy_response.async_to_raw_response_wrapper( |
| 1872 | + v2.list_versions, |
| 1873 | + ) |
1799 | 1874 | self.promote = _legacy_response.async_to_raw_response_wrapper( |
1800 | 1875 | v2.promote, |
1801 | 1876 | ) |
@@ -1836,6 +1911,9 @@ def __init__(self, v2: V2) -> None: |
1836 | 1911 | self.list_results = to_streamed_response_wrapper( |
1837 | 1912 | v2.list_results, |
1838 | 1913 | ) |
| 1914 | + self.list_versions = to_streamed_response_wrapper( |
| 1915 | + v2.list_versions, |
| 1916 | + ) |
1839 | 1917 | self.promote = to_streamed_response_wrapper( |
1840 | 1918 | v2.promote, |
1841 | 1919 | ) |
@@ -1876,6 +1954,9 @@ def __init__(self, v2: AsyncV2) -> None: |
1876 | 1954 | self.list_results = async_to_streamed_response_wrapper( |
1877 | 1955 | v2.list_results, |
1878 | 1956 | ) |
| 1957 | + self.list_versions = async_to_streamed_response_wrapper( |
| 1958 | + v2.list_versions, |
| 1959 | + ) |
1879 | 1960 | self.promote = async_to_streamed_response_wrapper( |
1880 | 1961 | v2.promote, |
1881 | 1962 | ) |
|
0 commit comments