Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove domain param from directories query #230

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/test_user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ def test_authenticate_with_refresh_token(
assert request_kwargs["json"] == {
**params,
**base_authentication_params,
"organization_id": None,
"grant_type": "refresh_token",
}

Expand Down
8 changes: 1 addition & 7 deletions workos/directory_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def get_directory(self, directory: str) -> SyncOrAsync[Directory]: ...

def list_directories(
self,
domain: Optional[str] = None,
search: Optional[str] = None,
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
before: Optional[str] = None,
Expand Down Expand Up @@ -250,7 +249,6 @@ def get_directory(self, directory: str) -> Directory:

def list_directories(
self,
domain: Optional[str] = None,
search: Optional[str] = None,
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
before: Optional[str] = None,
Expand All @@ -261,8 +259,7 @@ def list_directories(
"""Gets details for existing Directories.

Args:
domain (str): Domain of a Directory. (Optional)
organization: ID of an Organization (Optional)
organization_id: ID of an Organization (Optional)
search (str): Searchable text for a Directory. (Optional)
limit (int): Maximum number of records to return. (Optional)
before (str): Pagination cursor to receive records before a provided Directory ID. (Optional)
Expand All @@ -278,7 +275,6 @@ def list_directories(
"before": before,
"after": after,
"order": order,
"domain": domain,
"organization_id": organization_id,
"search": search,
}
Expand Down Expand Up @@ -478,7 +474,6 @@ async def get_directory(self, directory: str) -> Directory:

async def list_directories(
self,
domain: Optional[str] = None,
search: Optional[str] = None,
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
before: Optional[str] = None,
Expand All @@ -502,7 +497,6 @@ async def list_directories(
"""

list_params: DirectoryListFilters = {
"domain": domain,
"organization_id": organization_id,
"search": search,
"limit": limit,
Expand Down
17 changes: 3 additions & 14 deletions workos/resources/directory_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@


class Directory(WorkOSModel):
"""Representation of a Directory Response as returned by WorkOS through the Directory Sync feature.
Attributes:
OBJECT_FIELDS (list): List of fields a Directory is comprised of.
"""
"""Representation of a Directory Response as returned by WorkOS through the Directory Sync feature."""

id: str
object: Literal["directory"]
Expand All @@ -46,11 +43,7 @@ class Directory(WorkOSModel):


class DirectoryGroup(WorkOSModel):
"""Representation of a Directory Group as returned by WorkOS through the Directory Sync feature.

Attributes:
OBJECT_FIELDS (list): List of fields a DirectoryGroup is comprised of.
"""
"""Representation of a Directory Group as returned by WorkOS through the Directory Sync feature."""

id: str
object: Literal["directory_group"]
Expand All @@ -64,10 +57,6 @@ class DirectoryGroup(WorkOSModel):


class DirectoryUserWithGroups(DirectoryUser):
"""Representation of a Directory User as returned by WorkOS through the Directory Sync feature.

Attributes:
OBJECT_FIELDS (list): List of fields a DirectoryUser is comprised of.
"""
"""Representation of a Directory User as returned by WorkOS through the Directory Sync feature."""

groups: List[DirectoryGroup]
1 change: 1 addition & 0 deletions workos/user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def authenticate_with_organization_selection(
def authenticate_with_refresh_token(
self,
refresh_token: str,
organization_id: Optional[str] = None,
ip_address: Optional[str] = None,
user_agent: Optional[str] = None,
) -> RefreshTokenAuthenticationResponse: ...
Expand Down
Loading