Skip to content
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
15 changes: 8 additions & 7 deletions README_management_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ client = ManagementClient(
users = client.get_users()

# Get a specific user
user = client.get_user("user_id")
user = client.get_user(id="user_id")

# Get organizations
organizations = client.get_organizations()
Expand Down Expand Up @@ -86,10 +86,10 @@ The Management Client automatically generates methods for all available API endp

### Users
- `get_users()` - Get all users
- `get_user(user_id)` - Get a specific user
- `get_user(id=user_id)` - Get a specific user
- `create_user(**data)` - Create a new user
- `update_user(user_id, **data)` - Update a user
- `delete_user(user_id)` - Delete a user
- `update_user(id=user_id, **data)` - Update a user
- `delete_user(id=user_id)` - Delete a user

### Organizations
- `get_organizations()` - Get all organizations
Expand Down Expand Up @@ -144,9 +144,10 @@ if next_token:

```python
user_data = {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"profile": {
"given_name": "John",
"family_name": "Doe"
},
"identities": [
{
"type": "email",
Expand Down
2 changes: 1 addition & 1 deletion examples/management_client_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_management_client():
if users_response and 'users' in users_response and users_response['users']:
user_id = users_response['users'][0].get('id')
if user_id:
user = client.get_user(user_id)
user = client.get_user(id=user_id)
print_response(f"User {user_id} Response", user)
print("✅ Get specific user API call successful")
else:
Expand Down
10 changes: 8 additions & 2 deletions kinde_sdk/management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Management API module uses a dynamic method generation approach to create a
```
kinde_sdk/management/
├── __init__.py # Exports ManagementClient and ManagementTokenManager
├── client.py # Dynamic API client
├── management_client.py # Dynamic API client
└── management_token_manager.py # Handles auth token management
```

Expand Down Expand Up @@ -64,6 +64,12 @@ for resource, endpoints in self.API_ENDPOINTS.items():
| Update | PATCH | `/resource/{id}` | `update_resource(id, **data)` |
| Delete | DELETE | `/resource/{id}` | `delete_resource(id)` |

'users': {
'list': ('GET', '/users'),
# single-user operations use query param `id` with /user
'get': ('GET', '/user'),
# ...
},
### Request Processing

1. Path parameters: Filled from positional arguments
Expand Down Expand Up @@ -137,7 +143,7 @@ Errors from the API are passed through to the caller:

```python
try:
user = management.get_user(user_id)
user = management.get_user(id=user_id)
except Exception as e:
# Handle API-specific errors here
logger.error(f"API error: {e}")
Expand Down