Skip to content
Draft
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
19 changes: 14 additions & 5 deletions auth0/management/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
from ..rest import RestClient, RestClientOptions
from ..types import TimeoutType

from .models import (
Client,
CreateClientRequestContent,
CreateClientResponseContent,
GetClientResponseContent,
UpdateClientRequestContent,
UpdateClientResponseContent,
RotateClientSecretResponseContent,
)

class Clients:
"""Auth0 applications endpoints
Expand Down Expand Up @@ -59,7 +68,7 @@ def all(
page: int | None = None,
per_page: int | None = None,
extra_params: dict[str, Any] | None = None,
) -> list[dict[str, Any]]:
) -> list[Client]:
"""Retrieves a list of all the applications.

Important: The client_secret and encryption_key attributes can only be
Expand Down Expand Up @@ -93,7 +102,7 @@ def all(

return self.client.get(self._url(), params=params)

def create(self, body: dict[str, Any]) -> dict[str, Any]:
def create(self, body: CreateClientRequestContent) -> CreateClientResponseContent:
"""Create a new application.

Args:
Expand All @@ -106,7 +115,7 @@ def create(self, body: dict[str, Any]) -> dict[str, Any]:

def get(
self, id: str, fields: list[str] | None = None, include_fields: bool = True
) -> dict[str, Any]:
) -> GetClientResponseContent:
"""Retrieves an application by its id.

Important: The client_secret, encryption_key and signing_keys
Expand Down Expand Up @@ -143,7 +152,7 @@ def delete(self, id: str) -> Any:

return self.client.delete(self._url(id))

def update(self, id: str, body: dict[str, Any]) -> dict[str, Any]:
def update(self, id: str, body: UpdateClientRequestContent) -> UpdateClientResponseContent:
"""Modifies an application.

Important: The client_secret, encryption_key and signing_keys
Expand All @@ -159,7 +168,7 @@ def update(self, id: str, body: dict[str, Any]) -> dict[str, Any]:

return self.client.patch(self._url(id), data=body)

def rotate_secret(self, id: str) -> dict[str, Any]:
def rotate_secret(self, id: str) -> RotateClientSecretResponseContent:
"""Rotate a client secret. The generated secret is NOT base64 encoded.

Args:
Expand Down
Loading