Skip to content

Commit 99f7698

Browse files
committed
chore: regenerate and lint cleanup
1 parent 6e874b3 commit 99f7698

File tree

16 files changed

+128
-171
lines changed

16 files changed

+128
-171
lines changed

.openapi-generator-ignore

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
git_push.sh
22
test/*
3-
!test/__init__.py
4-
!test/test_open_fga_api.py
5-
!test/test_configuration.py
6-
!test/test_credentials.py
7-
!test/test_client.py
8-
!test/test_client_sync.py
9-
!test/test_open_fga_api_sync.py
10-
!test/test_validation.py
11-
!test/test_oauth2.py
12-
!test/test_oauth2_sync.py
133
.github/workflows/python.yml
144
.gitlab-ci.yml
155
.travis.yml
166
tox.ini
177
setup.cfg
188
setup.py
199
requirements.txt
20-
test-requirements.txt
10+
test-requirements.txt
11+
openfga_sdk/__init__.py
12+
openfga_sdk/api/__init__.py
13+
openfga_sdk/api/open_fga_api
14+
openfga_sdk/sync/open_fga_api.py
15+
openfga_sdk/api_client.py
16+
openfga_sdk/configuration.py
17+
openfga_sdk/constants.py
18+
openfga_sdk/exceptions.py
19+
openfga_sdk/rest.py

.openapi-generator/FILES

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
.codecov.yml
2-
.fossa.yml
32
.github/CODEOWNERS
43
.github/ISSUE_TEMPLATE/bug_report.yaml
54
.github/ISSUE_TEMPLATE/config.yaml
65
.github/ISSUE_TEMPLATE/feature_request.yaml
76
.gitignore
8-
.snyk
9-
CHANGELOG.md
107
CONTRIBUTING.md
118
LICENSE
129
README.md
@@ -100,53 +97,7 @@ docs/WriteAuthorizationModelResponse.md
10097
docs/WriteRequest.md
10198
docs/WriteRequestDeletes.md
10299
docs/WriteRequestWrites.md
103-
docs/opentelemetry.md
104-
example/Makefile
105-
example/README.md
106-
example/example1/example1.py
107-
example/example1/requirements.txt
108-
example/example1/setup.cfg
109-
example/example1/setup.py
110-
example/opentelemetry/.env.example
111-
example/opentelemetry/.gitignore
112-
example/opentelemetry/README.md
113-
example/opentelemetry/main.py
114-
example/opentelemetry/requirements.txt
115-
example/opentelemetry/setup.cfg
116-
example/opentelemetry/setup.py
117-
example/streamed-list-objects/README.md
118-
example/streamed-list-objects/example.py
119-
example/streamed-list-objects/model.json
120-
openfga_sdk/__init__.py
121-
openfga_sdk/api/__init__.py
122100
openfga_sdk/api/open_fga_api.py
123-
openfga_sdk/api/open_fga_api_sync.py
124-
openfga_sdk/api_client.py
125-
openfga_sdk/client/__init__.py
126-
openfga_sdk/client/client.py
127-
openfga_sdk/client/configuration.py
128-
openfga_sdk/client/models/__init__.py
129-
openfga_sdk/client/models/assertion.py
130-
openfga_sdk/client/models/batch_check_item.py
131-
openfga_sdk/client/models/batch_check_request.py
132-
openfga_sdk/client/models/batch_check_response.py
133-
openfga_sdk/client/models/batch_check_single_response.py
134-
openfga_sdk/client/models/check_request.py
135-
openfga_sdk/client/models/client_batch_check_response.py
136-
openfga_sdk/client/models/expand_request.py
137-
openfga_sdk/client/models/list_objects_request.py
138-
openfga_sdk/client/models/list_relations_request.py
139-
openfga_sdk/client/models/list_users_request.py
140-
openfga_sdk/client/models/read_changes_request.py
141-
openfga_sdk/client/models/tuple.py
142-
openfga_sdk/client/models/write_request.py
143-
openfga_sdk/client/models/write_response.py
144-
openfga_sdk/client/models/write_single_response.py
145-
openfga_sdk/client/models/write_transaction_opts.py
146-
openfga_sdk/configuration.py
147-
openfga_sdk/credentials.py
148-
openfga_sdk/exceptions.py
149-
openfga_sdk/help.py
150101
openfga_sdk/models/__init__.py
151102
openfga_sdk/models/aborted_message_response.py
152103
openfga_sdk/models/any.py
@@ -236,42 +187,3 @@ openfga_sdk/models/write_authorization_model_response.py
236187
openfga_sdk/models/write_request.py
237188
openfga_sdk/models/write_request_deletes.py
238189
openfga_sdk/models/write_request_writes.py
239-
openfga_sdk/oauth2.py
240-
openfga_sdk/rest.py
241-
openfga_sdk/sync/__init__.py
242-
openfga_sdk/sync/api_client.py
243-
openfga_sdk/sync/client/__init__.py
244-
openfga_sdk/sync/client/client.py
245-
openfga_sdk/sync/oauth2.py
246-
openfga_sdk/sync/rest.py
247-
openfga_sdk/telemetry/__init__.py
248-
openfga_sdk/telemetry/attributes.py
249-
openfga_sdk/telemetry/configuration.py
250-
openfga_sdk/telemetry/counters.py
251-
openfga_sdk/telemetry/histograms.py
252-
openfga_sdk/telemetry/metrics.py
253-
openfga_sdk/telemetry/telemetry.py
254-
openfga_sdk/validation.py
255-
pyproject.toml
256-
test/_/configuration_test.py
257-
test/_/credentials_test.py
258-
test/_/oauth2_test.py
259-
test/_/rest_test.py
260-
test/_/validation_test.py
261-
test/__init__.py
262-
test/api/__init__.py
263-
test/client/__init__.py
264-
test/client/client_test.py
265-
test/sync/__init__.py
266-
test/sync/client/__init__.py
267-
test/sync/client/client_test.py
268-
test/sync/oauth2_test.py
269-
test/sync/open_fga_api_test.py
270-
test/sync/rest_test.py
271-
test/telemetry/attributes_test.py
272-
test/telemetry/configuration_test.py
273-
test/telemetry/counters_test.py
274-
test/telemetry/histograms_test.py
275-
test/telemetry/metrics_test.py
276-
test/telemetry/telemetry_test.py
277-
test/test_open_fga_api.py

CONTRIBUTING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,23 @@ By participating and contributing to this project, you are expected to uphold ou
2323

2424
### Making Changes
2525

26-
When contributing to a repository, the first step is to open an issue on [sdk-generator](https://github.com/openfga/sdk-generator) to discuss the change you wish to make before making them.
26+
When contributing to a repository, the first step is to open [an issue](https://github.com/openfga/python-sdk/issues) to discuss the change you wish to make before making them.
2727

2828
### Opening Issues
2929

3030
Before you submit a new issue please make sure to search all open and closed issues. It is possible your feature request/issue has already been answered. Make sure to also check the [OpenFGA discussions](https://github.com/orgs/openfga/discussions).
3131

32-
That repo includes an issue template that will walk through all the places to check before submitting your issue here. Please follow the instructions there to make sure this is not a duplicate issue and that we have everything we need to research and reproduce this problem.
32+
The repo includes an issue template that will walk through all the places to check before submitting your issue here. Please follow the instructions there to make sure this is not a duplicate issue and that we have everything we need to research and reproduce this problem.
33+
34+
If you have found a bug or if you have a feature request, please report them in the [repo issues](https://github.com/openfga/python-sdk/issues). Cross-SDK bugs and feature requests can be additionally reported in the [sdk-generator repo](https://github.com/openfga/sdk-generator/issues) issues section, where the individual SDK issue is then linked.
35+
36+
**Please do not report security vulnerabilities on the public GitHub issue tracker.**
3337

3438
### Submitting Pull Requests
3539

36-
While we accept Pull Requests on this repository, the SDKs are autogenerated so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well.
40+
Feel free to submit a Pull Request against this repository. Please make sure to follow the existing code style and include tests where applicable.
41+
42+
Some files in this repository are autogenerated. These files have a comment at the top indicating that they are autogenerated and should not be modified directly - the files are usually identified by a header marking them as such, or by their inclusion in [`.openapi-generator/FILES`](./.openapi-generator/FILES). Changes to these files should be made in the [sdk-generator](https://github.com/openfga/sdk-generator) repository in tandem, so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well.
3743

3844
## Getting in touch
3945

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This is an autogenerated python SDK for OpenFGA. It provides a wrapper around th
1818
- [Installation](#installation)
1919
- [Getting Started](#getting-started)
2020
- [Initializing the API Client](#initializing-the-api-client)
21+
- [Custom Headers](#custom-headers)
2122
- [Get your Store ID](#get-your-store-id)
2223
- [Calling the API](#calling-the-api)
2324
- [Stores](#stores)
@@ -1365,13 +1366,7 @@ This SDK supports producing metrics that can be consumed as part of an [OpenTele
13651366

13661367
## Contributing
13671368

1368-
### Issues
1369-
1370-
If you have found a bug or if you have a feature request, please report them on the [sdk-generator repo](https://github.com/openfga/sdk-generator/issues) issues section. Please do not report security vulnerabilities on the public GitHub issue tracker.
1371-
1372-
### Pull Requests
1373-
1374-
While we accept Pull Requests on this repository, the SDKs are autogenerated so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well.
1369+
See [CONTRIBUTING](./CONTRIBUTING.md) for details.
13751370

13761371
## Author
13771372

openfga_sdk/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
from openfga_sdk.constants import SDK_VERSION as __version__
2-
31
from openfga_sdk.api.open_fga_api import OpenFgaApi
42
from openfga_sdk.api_client import ApiClient
53
from openfga_sdk.client.client import OpenFgaClient
64
from openfga_sdk.client.configuration import ClientConfiguration
75
from openfga_sdk.configuration import Configuration
6+
from openfga_sdk.constants import SDK_VERSION
87
from openfga_sdk.exceptions import (
98
ApiAttributeError,
109
ApiException,
@@ -132,6 +131,8 @@
132131
)
133132

134133

134+
__version__ = SDK_VERSION
135+
135136
__all__ = [
136137
"OpenFgaClient",
137138
"ClientConfiguration",

openfga_sdk/api_client.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
from openfga_sdk import oauth2, rest
1818
from openfga_sdk.configuration import Configuration
19+
from openfga_sdk.constants import (
20+
MAX_BACKOFF_TIME_IN_SEC,
21+
RETRY_HEADER_MAX_ALLOWABLE_DURATION_IN_SEC,
22+
)
23+
from openfga_sdk.constants import USER_AGENT as DEFAULT_USER_AGENT
1924
from openfga_sdk.exceptions import (
2025
ApiException,
2126
ApiValueError,
@@ -25,11 +30,6 @@
2530
)
2631
from openfga_sdk.telemetry import Telemetry
2732
from openfga_sdk.telemetry.attributes import TelemetryAttribute, TelemetryAttributes
28-
from openfga_sdk.constants import USER_AGENT as DEFAULT_USER_AGENT
29-
from openfga_sdk.constants import (
30-
MAX_BACKOFF_TIME_IN_SEC,
31-
RETRY_HEADER_MAX_ALLOWABLE_DURATION_IN_SEC,
32-
)
3333

3434

3535
def random_time(loop_count, min_wait_in_ms) -> float:
@@ -415,7 +415,10 @@ def _parse_retry_after_header(self, headers) -> int:
415415
except ApiException:
416416
wait_time_in_sec = int(retry_after_header)
417417

418-
if wait_time_in_sec > RETRY_HEADER_MAX_ALLOWABLE_DURATION_IN_SEC or wait_time_in_sec < 1:
418+
if (
419+
wait_time_in_sec > RETRY_HEADER_MAX_ALLOWABLE_DURATION_IN_SEC
420+
or wait_time_in_sec < 1
421+
):
419422
raise ValueError("Retry-After header is invalid")
420423

421424
return math.ceil(wait_time_in_sec)

openfga_sdk/client/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
construct_write_single_response,
3434
)
3535
from openfga_sdk.client.models.write_transaction_opts import WriteTransactionOpts
36+
from openfga_sdk.constants import (
37+
CLIENT_BULK_REQUEST_ID_HEADER,
38+
CLIENT_MAX_BATCH_SIZE,
39+
CLIENT_MAX_METHOD_PARALLEL_REQUESTS,
40+
CLIENT_METHOD_HEADER,
41+
)
3642
from openfga_sdk.exceptions import (
3743
AuthenticationError,
3844
FgaValidationException,
@@ -62,12 +68,6 @@
6268
)
6369
from openfga_sdk.models.write_request import WriteRequest
6470
from openfga_sdk.validation import is_well_formed_ulid_string
65-
from openfga_sdk.constants import (
66-
CLIENT_METHOD_HEADER,
67-
CLIENT_BULK_REQUEST_ID_HEADER,
68-
CLIENT_MAX_METHOD_PARALLEL_REQUESTS,
69-
CLIENT_MAX_BATCH_SIZE,
70-
)
7171

7272

7373
def _chuck_array(array, max_size):

openfga_sdk/configuration.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
import urllib3
88

9+
from openfga_sdk.constants import (
10+
DEFAULT_MAX_RETRY,
11+
DEFAULT_MIN_WAIT_IN_MS,
12+
MAX_BACKOFF_TIME_IN_SEC,
13+
RETRY_MAX_ALLOWED_NUMBER,
14+
SDK_VERSION,
15+
)
916
from openfga_sdk.exceptions import ApiValueError, FgaValidationException
1017
from openfga_sdk.telemetry.attributes import TelemetryAttribute
1118
from openfga_sdk.telemetry.configuration import (
@@ -17,13 +24,6 @@
1724
from openfga_sdk.telemetry.counters import TelemetryCounter
1825
from openfga_sdk.telemetry.histograms import TelemetryHistogram
1926
from openfga_sdk.validation import is_well_formed_ulid_string
20-
from openfga_sdk.constants import (
21-
DEFAULT_MAX_RETRY,
22-
DEFAULT_MIN_WAIT_IN_MS,
23-
MAX_BACKOFF_TIME_IN_SEC,
24-
RETRY_MAX_ALLOWED_NUMBER,
25-
SDK_VERSION,
26-
)
2727

2828

2929
class RetryParams:
@@ -39,7 +39,12 @@ class RetryParams:
3939
:param max_wait_in_sec: Maximum wait (in seconds) between retry
4040
"""
4141

42-
def __init__(self, max_retry=DEFAULT_MAX_RETRY, min_wait_in_ms=DEFAULT_MIN_WAIT_IN_MS, max_wait_in_sec=MAX_BACKOFF_TIME_IN_SEC):
42+
def __init__(
43+
self,
44+
max_retry=DEFAULT_MAX_RETRY,
45+
min_wait_in_ms=DEFAULT_MIN_WAIT_IN_MS,
46+
max_wait_in_sec=MAX_BACKOFF_TIME_IN_SEC,
47+
):
4348
self._max_retry = max_retry
4449
self._min_wait_in_ms = min_wait_in_ms
4550
self._max_wait_in_sec = max_wait_in_sec
@@ -192,7 +197,7 @@ def __init__(
192197
| dict[TelemetryAttribute | str, bool]
193198
| None,
194199
]
195-
| None
200+
| None,
196201
]
197202
| None
198203
) = None,

0 commit comments

Comments
 (0)