Skip to content

Commit 1e71e79

Browse files
committed
fix: tetss and refactor
1 parent 256d6e1 commit 1e71e79

File tree

7 files changed

+575
-448
lines changed

7 files changed

+575
-448
lines changed

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,35 +1289,35 @@ async with OpenFgaClient(configuration) as fga_client:
12891289
"resource": "resource:123",
12901290
}
12911291

1292-
response = await fga_client.execute_api_request({
1293-
"operation_name": "CustomEndpoint",
1294-
"method": "POST",
1295-
"path": "/stores/{store_id}/custom-endpoint",
1296-
"path_params": {"store_id": FGA_STORE_ID},
1297-
"query_params": {"page_size": "20"},
1298-
"body": request_body,
1299-
"headers": {"X-Experimental-Feature": "enabled"},
1300-
})
1292+
response = await fga_client.execute_api_request(
1293+
operation_name="CustomEndpoint",
1294+
method="POST",
1295+
path="/stores/{store_id}/custom-endpoint",
1296+
path_params={"store_id": FGA_STORE_ID},
1297+
query_params={"page_size": "20"},
1298+
body=request_body,
1299+
headers={"X-Experimental-Feature": "enabled"},
1300+
)
13011301
```
13021302

13031303
#### Example: Calling a custom endpoint with POST
13041304

13051305
```python
13061306
# Call a custom endpoint using path parameters
1307-
response = await fga_client.execute_api_request({
1308-
"operation_name": "CustomEndpoint", # For telemetry/logging
1309-
"method": "POST",
1310-
"path": "/stores/{store_id}/custom-endpoint",
1311-
"path_params": {"store_id": FGA_STORE_ID},
1312-
"body": {
1307+
response = await fga_client.execute_api_request(
1308+
operation_name="CustomEndpoint", # For telemetry/logging
1309+
method="POST",
1310+
path="/stores/{store_id}/custom-endpoint",
1311+
path_params={"store_id": FGA_STORE_ID},
1312+
body={
13131313
"user": "user:bob",
13141314
"action": "custom_action",
13151315
"resource": "resource:123",
13161316
},
1317-
"query_params": {
1317+
query_params={
13181318
"page_size": 20,
13191319
},
1320-
})
1320+
)
13211321

13221322
# Access the response data
13231323
if response.status == 200:
@@ -1329,15 +1329,15 @@ if response.status == 200:
13291329

13301330
```python
13311331
# Get a list of stores with query parameters
1332-
stores_response = await fga_client.execute_api_request({
1333-
"operation_name": "ListStores",
1334-
"method": "GET",
1335-
"path": "/stores",
1336-
"query_params": {
1332+
stores_response = await fga_client.execute_api_request(
1333+
operation_name="ListStores",
1334+
method="GET",
1335+
path="/stores",
1336+
query_params={
13371337
"page_size": 10,
13381338
"continuation_token": "eyJwayI6...",
13391339
},
1340-
})
1340+
)
13411341

13421342
stores = stores_response.json()
13431343
print("Stores:", stores)
@@ -1349,25 +1349,25 @@ Path parameters are specified in the path using `{param_name}` syntax and are re
13491349

13501350
```python
13511351
# Using explicit path parameters
1352-
response = await fga_client.execute_api_request({
1353-
"operation_name": "GetAuthorizationModel",
1354-
"method": "GET",
1355-
"path": "/stores/{store_id}/authorization-models/{model_id}",
1356-
"path_params": {
1352+
response = await fga_client.execute_api_request(
1353+
operation_name="GetAuthorizationModel",
1354+
method="GET",
1355+
path="/stores/{store_id}/authorization-models/{model_id}",
1356+
path_params={
13571357
"store_id": "your-store-id",
13581358
"model_id": "your-model-id",
13591359
},
1360-
})
1360+
)
13611361

13621362
# Using automatic store_id substitution
1363-
response = await fga_client.execute_api_request({
1364-
"operation_name": "GetAuthorizationModel",
1365-
"method": "GET",
1366-
"path": "/stores/{store_id}/authorization-models/{model_id}",
1367-
"path_params": {
1363+
response = await fga_client.execute_api_request(
1364+
operation_name="GetAuthorizationModel",
1365+
method="GET",
1366+
path="/stores/{store_id}/authorization-models/{model_id}",
1367+
path_params={
13681368
"model_id": "your-model-id",
13691369
},
1370-
})
1370+
)
13711371
```
13721372

13731373
### Retries

0 commit comments

Comments
 (0)