|
91 | 91 | from .models.ml_prompt_results_page import MlPromptResultsPage |
92 | 92 | from .models.oauth2_client_info import OAuth2ClientInfo |
93 | 93 | from .models.org import Org |
| 94 | +from .models.org_admin_details import OrgAdminDetails |
94 | 95 | from .models.org_details import OrgDetails |
95 | 96 | from .models.org_member import OrgMember |
96 | 97 | from .models.org_member_results_page import OrgMemberResultsPage |
|
153 | 154 | from .models.update_shortlink_request import UpdateShortlinkRequest |
154 | 155 | from .models.update_user import UpdateUser |
155 | 156 | from .models.user import User |
| 157 | +from .models.user_admin_details import UserAdminDetails |
156 | 158 | from .models.user_identifier import UserIdentifier |
157 | 159 | from .models.user_org_info import UserOrgInfo |
158 | 160 | from .models.user_org_role import UserOrgRole |
@@ -6101,6 +6103,34 @@ def get_any_org( |
6101 | 6103 | # Validate into a Pydantic model (works for BaseModel and RootModel) |
6102 | 6104 | return Org.model_validate(json_data) |
6103 | 6105 |
|
| 6106 | + def org_admin_details_get( |
| 6107 | + self, |
| 6108 | + id: Uuid, |
| 6109 | + ) -> OrgAdminDetails: |
| 6110 | + """Zoo admins can retrieve extended information about any organization, while non-admins receive a 404 to avoid leaking existence.""" |
| 6111 | + |
| 6112 | + url = "{}/orgs/{id}/admin/details".format(self.client.base_url, id=id) |
| 6113 | + |
| 6114 | + _client = self.client.get_http_client() |
| 6115 | + |
| 6116 | + response = _client.get( |
| 6117 | + url=url, |
| 6118 | + headers=self.client.get_headers(), |
| 6119 | + ) |
| 6120 | + |
| 6121 | + if not response.is_success: |
| 6122 | + from ..response_helpers import raise_for_status |
| 6123 | + |
| 6124 | + raise_for_status(response) |
| 6125 | + |
| 6126 | + if not response.content: |
| 6127 | + return None # type: ignore |
| 6128 | + |
| 6129 | + json_data = response.json() |
| 6130 | + |
| 6131 | + # Validate into a Pydantic model (works for BaseModel and RootModel) |
| 6132 | + return OrgAdminDetails.model_validate(json_data) |
| 6133 | + |
6104 | 6134 | def update_enterprise_pricing_for_org( |
6105 | 6135 | self, |
6106 | 6136 | id: Uuid, |
@@ -6858,6 +6888,34 @@ async def get_any_org( |
6858 | 6888 | # Validate into a Pydantic model (works for BaseModel and RootModel) |
6859 | 6889 | return Org.model_validate(json_data) |
6860 | 6890 |
|
| 6891 | + async def org_admin_details_get( |
| 6892 | + self, |
| 6893 | + id: Uuid, |
| 6894 | + ) -> OrgAdminDetails: |
| 6895 | + """Zoo admins can retrieve extended information about any organization, while non-admins receive a 404 to avoid leaking existence.""" |
| 6896 | + |
| 6897 | + url = "{}/orgs/{id}/admin/details".format(self.client.base_url, id=id) |
| 6898 | + |
| 6899 | + _client = self.client.get_http_client() |
| 6900 | + |
| 6901 | + response = await _client.get( |
| 6902 | + url=url, |
| 6903 | + headers=self.client.get_headers(), |
| 6904 | + ) |
| 6905 | + |
| 6906 | + if not response.is_success: |
| 6907 | + from ..response_helpers import raise_for_status |
| 6908 | + |
| 6909 | + raise_for_status(response) |
| 6910 | + |
| 6911 | + if not response.content: |
| 6912 | + return None # type: ignore |
| 6913 | + |
| 6914 | + json_data = response.json() |
| 6915 | + |
| 6916 | + # Validate into a Pydantic model (works for BaseModel and RootModel) |
| 6917 | + return OrgAdminDetails.model_validate(json_data) |
| 6918 | + |
6861 | 6919 | async def update_enterprise_pricing_for_org( |
6862 | 6920 | self, |
6863 | 6921 | id: Uuid, |
@@ -10706,6 +10764,34 @@ def get_user( |
10706 | 10764 | # Validate into a Pydantic model (works for BaseModel and RootModel) |
10707 | 10765 | return User.model_validate(json_data) |
10708 | 10766 |
|
| 10767 | + def user_admin_details_get( |
| 10768 | + self, |
| 10769 | + id: UserIdentifier, |
| 10770 | + ) -> UserAdminDetails: |
| 10771 | + """Zoo admins can retrieve extended information about any user, while non-admins receive a 404 to avoid leaking the existence of the resource.""" |
| 10772 | + |
| 10773 | + url = "{}/users/{id}/admin/details".format(self.client.base_url, id=id) |
| 10774 | + |
| 10775 | + _client = self.client.get_http_client() |
| 10776 | + |
| 10777 | + response = _client.get( |
| 10778 | + url=url, |
| 10779 | + headers=self.client.get_headers(), |
| 10780 | + ) |
| 10781 | + |
| 10782 | + if not response.is_success: |
| 10783 | + from ..response_helpers import raise_for_status |
| 10784 | + |
| 10785 | + raise_for_status(response) |
| 10786 | + |
| 10787 | + if not response.content: |
| 10788 | + return None # type: ignore |
| 10789 | + |
| 10790 | + json_data = response.json() |
| 10791 | + |
| 10792 | + # Validate into a Pydantic model (works for BaseModel and RootModel) |
| 10793 | + return UserAdminDetails.model_validate(json_data) |
| 10794 | + |
10709 | 10795 | def update_subscription_for_user( |
10710 | 10796 | self, |
10711 | 10797 | id: UserIdentifier, |
@@ -11461,6 +11547,34 @@ async def get_user( |
11461 | 11547 | # Validate into a Pydantic model (works for BaseModel and RootModel) |
11462 | 11548 | return User.model_validate(json_data) |
11463 | 11549 |
|
| 11550 | + async def user_admin_details_get( |
| 11551 | + self, |
| 11552 | + id: UserIdentifier, |
| 11553 | + ) -> UserAdminDetails: |
| 11554 | + """Zoo admins can retrieve extended information about any user, while non-admins receive a 404 to avoid leaking the existence of the resource.""" |
| 11555 | + |
| 11556 | + url = "{}/users/{id}/admin/details".format(self.client.base_url, id=id) |
| 11557 | + |
| 11558 | + _client = self.client.get_http_client() |
| 11559 | + |
| 11560 | + response = await _client.get( |
| 11561 | + url=url, |
| 11562 | + headers=self.client.get_headers(), |
| 11563 | + ) |
| 11564 | + |
| 11565 | + if not response.is_success: |
| 11566 | + from ..response_helpers import raise_for_status |
| 11567 | + |
| 11568 | + raise_for_status(response) |
| 11569 | + |
| 11570 | + if not response.content: |
| 11571 | + return None # type: ignore |
| 11572 | + |
| 11573 | + json_data = response.json() |
| 11574 | + |
| 11575 | + # Validate into a Pydantic model (works for BaseModel and RootModel) |
| 11576 | + return UserAdminDetails.model_validate(json_data) |
| 11577 | + |
11464 | 11578 | async def update_subscription_for_user( |
11465 | 11579 | self, |
11466 | 11580 | id: UserIdentifier, |
|
0 commit comments