Skip to content

Commit

Permalink
fix: add list.py example showing updates in API
Browse files Browse the repository at this point in the history
Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma committed Dec 14, 2023
1 parent 245f73a commit 20260f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ target/

#Ipython Notebook
.ipynb_checkpoints
temp
3 changes: 2 additions & 1 deletion example/authentication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Python Flask API Auth0 integration example
"""
Python Flask API Auth0 integration example
"""

from functools import wraps
Expand Down
16 changes: 8 additions & 8 deletions temp/list.py → example/list.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3
"""
Example demonstrating how to list users using python client
"""

import time
from pprint import pprint
from frontier_api import *
from frontier_api.apis.tags import user_api
from frontier_api.model.rpc_status import RpcStatus
from frontier_api.model.v1beta1_list_users_response import V1beta1ListUsersResponse
from frontier_api.model.v1beta1_list_auth_strategies_response import V1beta1ListAuthStrategiesResponse
from frontier_api.api import user_api
from frontier_api.models.v1beta1_list_users_response import V1beta1ListUsersResponse

HOST = "http://127.0.0.1:7400"

Expand All @@ -20,11 +20,11 @@ def fetch_users():
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = user_api.FrontierServiceListUsers(api_client)
api_instance = user_api.UserApi(api_client)
try:
api_response = api_instance.frontier_service_list_users()
assert isinstance(api_response.body, V1beta1ListUsersResponse)
pprint(api_response.body)
assert isinstance(api_response, V1beta1ListUsersResponse)
pprint(api_response)
except ApiException as e:
print("Exception when calling user_api->FrontierServiceListUsers: %s\n" % e)

Expand Down

0 comments on commit 20260f5

Please sign in to comment.