diff --git a/.last-synced-sha b/.last-synced-sha index 047fc7ee..1e1c7499 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -a10d9ecb766d2dd996aecb19aa9c801d78bb7c26 +13aaa9a125fc87d1ed23acd5ef740382510296be diff --git a/.oagen-manifest.json b/.oagen-manifest.json index 5232cb40..6a3ab77a 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -1,7 +1,7 @@ { "version": 2, "language": "python", - "generatedAt": "2026-05-11T15:56:51.952Z", + "generatedAt": "2026-05-18T17:54:41.865Z", "files": [ "src/workos/_client.py", "src/workos/admin_portal/__init__.py", diff --git a/src/workos/authorization/_resource.py b/src/workos/authorization/_resource.py index cd7afcd8..7e2a1d40 100644 --- a/src/workos/authorization/_resource.py +++ b/src/workos/authorization/_resource.py @@ -331,6 +331,9 @@ def list_role_assignments( before: Optional[str] = None, after: Optional[str] = None, order: Optional[Union[PaginationOrder, str]] = "desc", + resource_id: Optional[str] = None, + resource_external_id: Optional[str] = None, + resource_type_slug: Optional[str] = None, request_options: Optional[RequestOptions] = None, ) -> SyncPage[UserRoleAssignment]: """List role assignments @@ -343,6 +346,9 @@ def list_role_assignments( before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. order: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to `desc`. + resource_id: Filter assignments by the ID of the resource. + resource_external_id: Filter assignments by the external ID of the resource. + resource_type_slug: Filter assignments by the slug of the resource type. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -362,6 +368,9 @@ def list_role_assignments( "before": before, "after": after, "order": enum_value(order) if order is not None else None, + "resource_id": resource_id, + "resource_external_id": resource_external_id, + "resource_type_slug": resource_type_slug, }.items() if v is not None } @@ -1103,6 +1112,7 @@ def list_role_assignments_for_resource_by_external_id( before: Optional[str] = None, after: Optional[str] = None, order: Optional[Union[PaginationOrder, str]] = "desc", + role_slug: Optional[str] = None, request_options: Optional[RequestOptions] = None, ) -> SyncPage[UserRoleAssignment]: """List role assignments for a resource by external ID @@ -1117,6 +1127,7 @@ def list_role_assignments_for_resource_by_external_id( before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. order: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to `desc`. + role_slug: Filter assignments by the slug of the role. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -1136,6 +1147,7 @@ def list_role_assignments_for_resource_by_external_id( "before": before, "after": after, "order": enum_value(order) if order is not None else None, + "role_slug": role_slug, }.items() if v is not None } @@ -1165,7 +1177,6 @@ def list_resources( organization_id: Optional[str] = None, resource_type_slug: Optional[str] = None, resource_external_id: Optional[str] = None, - search: Optional[str] = None, parent: Optional[Union[ParentById, ParentByExternalId]] = None, request_options: Optional[RequestOptions] = None, ) -> SyncPage[AuthorizationResource]: @@ -1181,7 +1192,6 @@ def list_resources( organization_id: Filter resources by organization ID. resource_type_slug: Filter resources by resource type slug. resource_external_id: Filter resources by external ID. - search: Search resources by name. parent: Identifies the parent. One of: ParentById, ParentByExternalId. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. @@ -1205,7 +1215,6 @@ def list_resources( "organization_id": organization_id, "resource_type_slug": resource_type_slug, "resource_external_id": resource_external_id, - "search": search, }.items() if v is not None } @@ -1496,6 +1505,7 @@ def list_role_assignments_for_resource( before: Optional[str] = None, after: Optional[str] = None, order: Optional[Union[PaginationOrder, str]] = "desc", + role_slug: Optional[str] = None, request_options: Optional[RequestOptions] = None, ) -> SyncPage[UserRoleAssignment]: """List role assignments for a resource @@ -1508,6 +1518,7 @@ def list_role_assignments_for_resource( before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. order: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to `desc`. + role_slug: Filter assignments by the slug of the role. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -1527,6 +1538,7 @@ def list_role_assignments_for_resource( "before": before, "after": after, "order": enum_value(order) if order is not None else None, + "role_slug": role_slug, }.items() if v is not None } @@ -2229,6 +2241,9 @@ async def list_role_assignments( before: Optional[str] = None, after: Optional[str] = None, order: Optional[Union[PaginationOrder, str]] = "desc", + resource_id: Optional[str] = None, + resource_external_id: Optional[str] = None, + resource_type_slug: Optional[str] = None, request_options: Optional[RequestOptions] = None, ) -> AsyncPage[UserRoleAssignment]: """List role assignments @@ -2241,6 +2256,9 @@ async def list_role_assignments( before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. order: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to `desc`. + resource_id: Filter assignments by the ID of the resource. + resource_external_id: Filter assignments by the external ID of the resource. + resource_type_slug: Filter assignments by the slug of the resource type. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -2260,6 +2278,9 @@ async def list_role_assignments( "before": before, "after": after, "order": enum_value(order) if order is not None else None, + "resource_id": resource_id, + "resource_external_id": resource_external_id, + "resource_type_slug": resource_type_slug, }.items() if v is not None } @@ -3001,6 +3022,7 @@ async def list_role_assignments_for_resource_by_external_id( before: Optional[str] = None, after: Optional[str] = None, order: Optional[Union[PaginationOrder, str]] = "desc", + role_slug: Optional[str] = None, request_options: Optional[RequestOptions] = None, ) -> AsyncPage[UserRoleAssignment]: """List role assignments for a resource by external ID @@ -3015,6 +3037,7 @@ async def list_role_assignments_for_resource_by_external_id( before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. order: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to `desc`. + role_slug: Filter assignments by the slug of the role. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -3034,6 +3057,7 @@ async def list_role_assignments_for_resource_by_external_id( "before": before, "after": after, "order": enum_value(order) if order is not None else None, + "role_slug": role_slug, }.items() if v is not None } @@ -3063,7 +3087,6 @@ async def list_resources( organization_id: Optional[str] = None, resource_type_slug: Optional[str] = None, resource_external_id: Optional[str] = None, - search: Optional[str] = None, parent: Optional[Union[ParentById, ParentByExternalId]] = None, request_options: Optional[RequestOptions] = None, ) -> AsyncPage[AuthorizationResource]: @@ -3079,7 +3102,6 @@ async def list_resources( organization_id: Filter resources by organization ID. resource_type_slug: Filter resources by resource type slug. resource_external_id: Filter resources by external ID. - search: Search resources by name. parent: Identifies the parent. One of: ParentById, ParentByExternalId. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. @@ -3103,7 +3125,6 @@ async def list_resources( "organization_id": organization_id, "resource_type_slug": resource_type_slug, "resource_external_id": resource_external_id, - "search": search, }.items() if v is not None } @@ -3394,6 +3415,7 @@ async def list_role_assignments_for_resource( before: Optional[str] = None, after: Optional[str] = None, order: Optional[Union[PaginationOrder, str]] = "desc", + role_slug: Optional[str] = None, request_options: Optional[RequestOptions] = None, ) -> AsyncPage[UserRoleAssignment]: """List role assignments for a resource @@ -3406,6 +3428,7 @@ async def list_role_assignments_for_resource( before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. order: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to `desc`. + role_slug: Filter assignments by the slug of the role. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -3425,6 +3448,7 @@ async def list_role_assignments_for_resource( "before": before, "after": after, "order": enum_value(order) if order is not None else None, + "role_slug": role_slug, }.items() if v is not None } diff --git a/src/workos/groups/_resource.py b/src/workos/groups/_resource.py index cb86fd26..cfa5c456 100644 --- a/src/workos/groups/_resource.py +++ b/src/workos/groups/_resource.py @@ -308,6 +308,7 @@ def create_group_organization_membership( Group Raises: + BadRequestError: If the request is malformed (400). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). UnprocessableEntityError: If the request data is unprocessable (422). @@ -663,6 +664,7 @@ async def create_group_organization_membership( Group Raises: + BadRequestError: If the request is malformed (400). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). UnprocessableEntityError: If the request data is unprocessable (422). diff --git a/src/workos/sso/_resource.py b/src/workos/sso/_resource.py index c088011a..00b110c3 100644 --- a/src/workos/sso/_resource.py +++ b/src/workos/sso/_resource.py @@ -172,7 +172,7 @@ def get_authorization_url( organization: Used to initiate SSO for an organization. The value should be a WorkOS organization ID. You can persist the WorkOS organization ID with application user or team identifiers. WorkOS will use the organization ID to determine the appropriate connection and the IdP to direct the user to for authentication. domain_hint: Can be used to pre-fill the domain field when initiating authentication with Microsoft OAuth or with a Google SAML connection type. - login_hint: Can be used to pre-fill the username/email address field of the IdP sign-in page for the user, if you know their username ahead of time. Currently supported for OAuth, OpenID Connect, Okta, and Entra ID connections. + login_hint: Can be used to pre-fill the username/email address field of the IdP sign-in page for the user, if you know their username ahead of time. Currently supported for OAuth, OpenID Connect, Okta, Entra ID, and custom SAML connections. nonce: A random string generated by the client that is used to mitigate replay attacks. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. @@ -589,7 +589,7 @@ def get_authorization_url( organization: Used to initiate SSO for an organization. The value should be a WorkOS organization ID. You can persist the WorkOS organization ID with application user or team identifiers. WorkOS will use the organization ID to determine the appropriate connection and the IdP to direct the user to for authentication. domain_hint: Can be used to pre-fill the domain field when initiating authentication with Microsoft OAuth or with a Google SAML connection type. - login_hint: Can be used to pre-fill the username/email address field of the IdP sign-in page for the user, if you know their username ahead of time. Currently supported for OAuth, OpenID Connect, Okta, and Entra ID connections. + login_hint: Can be used to pre-fill the username/email address field of the IdP sign-in page for the user, if you know their username ahead of time. Currently supported for OAuth, OpenID Connect, Okta, Entra ID, and custom SAML connections. nonce: A random string generated by the client that is used to mitigate replay attacks. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. diff --git a/tests/test_authorization.py b/tests/test_authorization.py index dbaae3cf..2805ab1f 100644 --- a/tests/test_authorization.py +++ b/tests/test_authorization.py @@ -210,12 +210,23 @@ def test_list_role_assignments_encodes_query_params(self, workos, httpx_mock): before="cursor before", after="cursor/after", order=PaginationOrder("value_order"), + resource_id="value resource_id/test", + resource_external_id="value resource_external_id/test", + resource_type_slug="value resource_type_slug/test", ) request = httpx_mock.get_request() assert request.url.params["limit"] == "10" assert request.url.params["before"] == "cursor before" assert request.url.params["after"] == "cursor/after" assert request.url.params["order"] == "value_order" + assert request.url.params["resource_id"] == "value resource_id/test" + assert ( + request.url.params["resource_external_id"] + == "value resource_external_id/test" + ) + assert ( + request.url.params["resource_type_slug"] == "value resource_type_slug/test" + ) def test_assign_role(self, workos, httpx_mock): httpx_mock.add_response( @@ -531,12 +542,14 @@ def test_list_role_assignments_for_resource_by_external_id_encodes_query_params( before="cursor before", after="cursor/after", order=PaginationOrder("value_order"), + role_slug="value role_slug/test", ) request = httpx_mock.get_request() assert request.url.params["limit"] == "10" assert request.url.params["before"] == "cursor before" assert request.url.params["after"] == "cursor/after" assert request.url.params["order"] == "value_order" + assert request.url.params["role_slug"] == "value role_slug/test" def test_list_resources(self, workos, httpx_mock): httpx_mock.add_response( @@ -568,7 +581,6 @@ def test_list_resources_encodes_query_params(self, workos, httpx_mock): organization_id="value organization_id/test", resource_type_slug="value resource_type_slug/test", resource_external_id="value resource_external_id/test", - search="value search/test", ) request = httpx_mock.get_request() assert ( @@ -586,7 +598,6 @@ def test_list_resources_encodes_query_params(self, workos, httpx_mock): request.url.params["resource_external_id"] == "value resource_external_id/test" ) - assert request.url.params["search"] == "value search/test" def test_create_resource(self, workos, httpx_mock): httpx_mock.add_response( @@ -721,12 +732,14 @@ def test_list_role_assignments_for_resource_encodes_query_params( before="cursor before", after="cursor/after", order=PaginationOrder("value_order"), + role_slug="value role_slug/test", ) request = httpx_mock.get_request() assert request.url.params["limit"] == "10" assert request.url.params["before"] == "cursor before" assert request.url.params["after"] == "cursor/after" assert request.url.params["order"] == "value_order" + assert request.url.params["role_slug"] == "value role_slug/test" def test_list_environment_roles(self, workos, httpx_mock): httpx_mock.add_response( @@ -1182,12 +1195,23 @@ async def test_list_role_assignments_encodes_query_params( before="cursor before", after="cursor/after", order=PaginationOrder("value_order"), + resource_id="value resource_id/test", + resource_external_id="value resource_external_id/test", + resource_type_slug="value resource_type_slug/test", ) request = httpx_mock.get_request() assert request.url.params["limit"] == "10" assert request.url.params["before"] == "cursor before" assert request.url.params["after"] == "cursor/after" assert request.url.params["order"] == "value_order" + assert request.url.params["resource_id"] == "value resource_id/test" + assert ( + request.url.params["resource_external_id"] + == "value resource_external_id/test" + ) + assert ( + request.url.params["resource_type_slug"] == "value resource_type_slug/test" + ) @pytest.mark.asyncio async def test_assign_role(self, async_workos, httpx_mock): @@ -1500,12 +1524,14 @@ async def test_list_role_assignments_for_resource_by_external_id_encodes_query_p before="cursor before", after="cursor/after", order=PaginationOrder("value_order"), + role_slug="value role_slug/test", ) request = httpx_mock.get_request() assert request.url.params["limit"] == "10" assert request.url.params["before"] == "cursor before" assert request.url.params["after"] == "cursor/after" assert request.url.params["order"] == "value_order" + assert request.url.params["role_slug"] == "value role_slug/test" @pytest.mark.asyncio async def test_list_resources(self, async_workos, httpx_mock): @@ -1538,7 +1564,6 @@ async def test_list_resources_encodes_query_params(self, async_workos, httpx_moc organization_id="value organization_id/test", resource_type_slug="value resource_type_slug/test", resource_external_id="value resource_external_id/test", - search="value search/test", ) request = httpx_mock.get_request() assert ( @@ -1556,7 +1581,6 @@ async def test_list_resources_encodes_query_params(self, async_workos, httpx_moc request.url.params["resource_external_id"] == "value resource_external_id/test" ) - assert request.url.params["search"] == "value search/test" @pytest.mark.asyncio async def test_create_resource(self, async_workos, httpx_mock): @@ -1695,12 +1719,14 @@ async def test_list_role_assignments_for_resource_encodes_query_params( before="cursor before", after="cursor/after", order=PaginationOrder("value_order"), + role_slug="value role_slug/test", ) request = httpx_mock.get_request() assert request.url.params["limit"] == "10" assert request.url.params["before"] == "cursor before" assert request.url.params["after"] == "cursor/after" assert request.url.params["order"] == "value_order" + assert request.url.params["role_slug"] == "value role_slug/test" @pytest.mark.asyncio async def test_list_environment_roles(self, async_workos, httpx_mock):