Skip to content

Commit 7deb113

Browse files
authored
Merge pull request #121 from abdelrahman-zaki/main
docs(management): update examples and README for corrected users endpoints
2 parents 2eee0a9 + 481caf2 commit 7deb113

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

README_management_client.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ client = ManagementClient(
5353
users = client.get_users()
5454

5555
# Get a specific user
56-
user = client.get_user("user_id")
56+
user = client.get_user(id="user_id")
5757

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

8787
### Users
8888
- `get_users()` - Get all users
89-
- `get_user(user_id)` - Get a specific user
89+
- `get_user(id=user_id)` - Get a specific user
9090
- `create_user(**data)` - Create a new user
91-
- `update_user(user_id, **data)` - Update a user
92-
- `delete_user(user_id)` - Delete a user
91+
- `update_user(id=user_id, **data)` - Update a user
92+
- `delete_user(id=user_id)` - Delete a user
9393

9494
### Organizations
9595
- `get_organizations()` - Get all organizations
@@ -144,9 +144,10 @@ if next_token:
144144

145145
```python
146146
user_data = {
147-
"first_name": "John",
148-
"last_name": "Doe",
149-
"email": "john.doe@example.com",
147+
"profile": {
148+
"given_name": "John",
149+
"family_name": "Doe"
150+
},
150151
"identities": [
151152
{
152153
"type": "email",

examples/management_client_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_management_client():
180180
if users_response and 'users' in users_response and users_response['users']:
181181
user_id = users_response['users'][0].get('id')
182182
if user_id:
183-
user = client.get_user(user_id)
183+
user = client.get_user(id=user_id)
184184
print_response(f"User {user_id} Response", user)
185185
print("✅ Get specific user API call successful")
186186
else:

kinde_sdk/management/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Management API module uses a dynamic method generation approach to create a
77
```
88
kinde_sdk/management/
99
├── __init__.py # Exports ManagementClient and ManagementTokenManager
10-
├── client.py # Dynamic API client
10+
├── management_client.py # Dynamic API client
1111
└── management_token_manager.py # Handles auth token management
1212
```
1313

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

67+
'users': {
68+
'list': ('GET', '/users'),
69+
# single-user operations use query param `id` with /user
70+
'get': ('GET', '/user'),
71+
# ...
72+
},
6773
### Request Processing
6874

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

138144
```python
139145
try:
140-
user = management.get_user(user_id)
146+
user = management.get_user(id=user_id)
141147
except Exception as e:
142148
# Handle API-specific errors here
143149
logger.error(f"API error: {e}")

0 commit comments

Comments
 (0)