Skip to content

Commit 19ea310

Browse files
committed
chore: simplify code sample
1 parent 09225d4 commit 19ea310

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

README.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,40 +52,22 @@ import flat_api
5252
Please follow the [installation procedure](#installation--usage) and then run the following:
5353

5454
```python
55-
56-
import time
57-
import flat_api
5855
from pprint import pprint
56+
import flat_api
5957
from flat_api.api import account_api
60-
from flat_api.model.flat_error_response import FlatErrorResponse
61-
from flat_api.model.user_details import UserDetails
62-
# Defining the host is optional and defaults to https://api.flat.io/v2
63-
# See configuration.py for a list of all supported configuration parameters.
64-
configuration = flat_api.Configuration(
65-
host = "https://api.flat.io/v2"
66-
)
67-
68-
# The client must configure the authentication and authorization parameters
69-
# in accordance with the API server security policy.
70-
# Examples for each auth method are provided below, use the example that
71-
# satisfies your auth use case.
7258

73-
# Configure OAuth2 access token for authorization: OAuth2
7459
configuration = flat_api.Configuration(
75-
host = "https://api.flat.io/v2"
60+
access_token = 'YOUR_ACCESS_TOKEN'
7661
)
77-
configuration.access_token = 'YOUR_ACCESS_TOKEN'
78-
7962

8063
# Enter a context with an instance of the API client
8164
with flat_api.ApiClient(configuration) as api_client:
8265
# Create an instance of the API class
8366
api_instance = account_api.AccountApi(api_client)
84-
only_id = False # bool | Only return the user id (optional) (default to False)
8567

8668
try:
8769
# Get current user account
88-
api_response = api_instance.get_authenticated_user(only_id=only_id)
70+
api_response = api_instance.get_authenticated_user()
8971
pprint(api_response)
9072
except flat_api.ApiException as e:
9173
print("Exception when calling AccountApi->get_authenticated_user: %s\n" % e)

0 commit comments

Comments
 (0)