Skip to content

Commit f4dc600

Browse files
Merge branch 'main' into dependabot/uv/uv-d665ee01e3
2 parents f98a80b + dcd74f5 commit f4dc600

18 files changed

Lines changed: 109 additions & 38 deletions

.openapi-generator-ignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ openfga_sdk/api/open_fga_api
1414
openfga_sdk/sync/open_fga_api.py
1515
openfga_sdk/api_client.py
1616
openfga_sdk/configuration.py
17+
openfga_sdk/_version.py
1718
openfga_sdk/exceptions.py
18-
openfga_sdk/rest.py
19+
openfga_sdk/rest.py
20+
VERSION.txt

.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
CONTRIBUTING.md
88
LICENSE
99
README.md
10-
VERSION.txt
1110
docs/AbortedMessageResponse.md
1211
docs/Any.md
1312
docs/Assertion.md

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,7 @@ response = await fga_client.execute_api_request(
13811381
)
13821382
```
13831383

1384+
13841385
### Retries
13851386

13861387
If a network request fails with a 429 or 5xx error from the server, the SDK will automatically retry the request up to 3 times with a minimum wait time of 100 milliseconds between each attempt.

openfga_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from openfga_sdk._version import SDK_VERSION
12
from openfga_sdk.api.open_fga_api import OpenFgaApi
23
from openfga_sdk.api_client import ApiClient
34
from openfga_sdk.client.client import OpenFgaClient
45
from openfga_sdk.client.configuration import ClientConfiguration
56
from openfga_sdk.client.models.raw_response import RawResponse
67
from openfga_sdk.configuration import Configuration
7-
from openfga_sdk.constants import SDK_VERSION
88
from openfga_sdk.exceptions import (
99
ApiAttributeError,
1010
ApiException,

openfga_sdk/_version.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Python SDK for OpenFGA
3+
4+
API version: 1.x
5+
Website: https://openfga.dev
6+
Documentation: https://openfga.dev/docs
7+
Support: https://openfga.dev/community
8+
License: [Apache-2.0](https://github.com/openfga/python-sdk/blob/main/LICENSE)
9+
"""
10+
11+
from typing import Final
12+
13+
14+
# Version of the OpenFGA Python SDK.
15+
SDK_VERSION: Final[str] = "0.10.3" # x-release-please-version
16+
17+
# User agent used in HTTP requests.
18+
USER_AGENT: Final[str] = f"openfga-sdk python/{SDK_VERSION}"

openfga_sdk/api/open_fga_api.py

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ async def batch_check_with_http_info(self, body, **kwargs):
447447

448448
local_var_params = locals()
449449

450-
all_params = ["body"]
450+
all_params = [
451+
"body",
452+
]
451453
all_params.extend(self._COMMON_PARAMS)
452454

453455
for key, val in local_var_params["kwargs"].items():
@@ -457,6 +459,7 @@ async def batch_check_with_http_info(self, body, **kwargs):
457459
)
458460
local_var_params[key] = val
459461
del local_var_params["kwargs"]
462+
# verify the required parameter 'body' is set
460463
if (
461464
self.api_client.client_side_validation
462465
and local_var_params.get("body") is None
@@ -541,7 +544,9 @@ async def check_with_http_info(self, body, **kwargs):
541544

542545
local_var_params = locals()
543546

544-
all_params = ["body"]
547+
all_params = [
548+
"body",
549+
]
545550
all_params.extend(self._COMMON_PARAMS)
546551

547552
for key, val in local_var_params["kwargs"].items():
@@ -551,6 +556,7 @@ async def check_with_http_info(self, body, **kwargs):
551556
)
552557
local_var_params[key] = val
553558
del local_var_params["kwargs"]
559+
# verify the required parameter 'body' is set
554560
if (
555561
self.api_client.client_side_validation
556562
and local_var_params.get("body") is None
@@ -635,7 +641,9 @@ async def create_store_with_http_info(self, body, **kwargs):
635641

636642
local_var_params = locals()
637643

638-
all_params = ["body"]
644+
all_params = [
645+
"body",
646+
]
639647
all_params.extend(self._COMMON_PARAMS)
640648

641649
for key, val in local_var_params["kwargs"].items():
@@ -645,6 +653,14 @@ async def create_store_with_http_info(self, body, **kwargs):
645653
)
646654
local_var_params[key] = val
647655
del local_var_params["kwargs"]
656+
# verify the required parameter 'body' is set
657+
if (
658+
self.api_client.client_side_validation
659+
and local_var_params.get("body") is None
660+
):
661+
raise ApiValueError(
662+
"Missing the required parameter `body` when calling `create_store`"
663+
)
648664
return await self._execute(
649665
method="POST",
650666
path="/stores",
@@ -799,7 +815,9 @@ async def expand_with_http_info(self, body, **kwargs):
799815

800816
local_var_params = locals()
801817

802-
all_params = ["body"]
818+
all_params = [
819+
"body",
820+
]
803821
all_params.extend(self._COMMON_PARAMS)
804822

805823
for key, val in local_var_params["kwargs"].items():
@@ -809,6 +827,7 @@ async def expand_with_http_info(self, body, **kwargs):
809827
)
810828
local_var_params[key] = val
811829
del local_var_params["kwargs"]
830+
# verify the required parameter 'body' is set
812831
if (
813832
self.api_client.client_side_validation
814833
and local_var_params.get("body") is None
@@ -975,7 +994,9 @@ async def list_objects_with_http_info(self, body, **kwargs):
975994

976995
local_var_params = locals()
977996

978-
all_params = ["body"]
997+
all_params = [
998+
"body",
999+
]
9791000
all_params.extend(self._COMMON_PARAMS)
9801001

9811002
for key, val in local_var_params["kwargs"].items():
@@ -985,6 +1006,7 @@ async def list_objects_with_http_info(self, body, **kwargs):
9851006
)
9861007
local_var_params[key] = val
9871008
del local_var_params["kwargs"]
1009+
# verify the required parameter 'body' is set
9881010
if (
9891011
self.api_client.client_side_validation
9901012
and local_var_params.get("body") is None
@@ -1077,7 +1099,11 @@ async def list_stores_with_http_info(self, **kwargs):
10771099

10781100
local_var_params = locals()
10791101

1080-
all_params = ["page_size", "continuation_token", "name"]
1102+
all_params = [
1103+
"page_size",
1104+
"continuation_token",
1105+
"name",
1106+
]
10811107
all_params.extend(self._COMMON_PARAMS)
10821108

10831109
for key, val in local_var_params["kwargs"].items():
@@ -1168,7 +1194,9 @@ async def list_users_with_http_info(self, body, **kwargs):
11681194

11691195
local_var_params = locals()
11701196

1171-
all_params = ["body"]
1197+
all_params = [
1198+
"body",
1199+
]
11721200
all_params.extend(self._COMMON_PARAMS)
11731201

11741202
for key, val in local_var_params["kwargs"].items():
@@ -1178,6 +1206,7 @@ async def list_users_with_http_info(self, body, **kwargs):
11781206
)
11791207
local_var_params[key] = val
11801208
del local_var_params["kwargs"]
1209+
# verify the required parameter 'body' is set
11811210
if (
11821211
self.api_client.client_side_validation
11831212
and local_var_params.get("body") is None
@@ -1262,7 +1291,9 @@ async def read_with_http_info(self, body, **kwargs):
12621291

12631292
local_var_params = locals()
12641293

1265-
all_params = ["body"]
1294+
all_params = [
1295+
"body",
1296+
]
12661297
all_params.extend(self._COMMON_PARAMS)
12671298

12681299
for key, val in local_var_params["kwargs"].items():
@@ -1272,6 +1303,7 @@ async def read_with_http_info(self, body, **kwargs):
12721303
)
12731304
local_var_params[key] = val
12741305
del local_var_params["kwargs"]
1306+
# verify the required parameter 'body' is set
12751307
if (
12761308
self.api_client.client_side_validation
12771309
and local_var_params.get("body") is None
@@ -1358,7 +1390,9 @@ async def read_assertions_with_http_info(self, authorization_model_id, **kwargs)
13581390

13591391
local_var_params = locals()
13601392

1361-
all_params = ["authorization_model_id"]
1393+
all_params = [
1394+
"authorization_model_id",
1395+
]
13621396
all_params.extend(self._COMMON_PARAMS)
13631397

13641398
for key, val in local_var_params["kwargs"].items():
@@ -1451,7 +1485,9 @@ async def read_authorization_model_with_http_info(self, id, **kwargs):
14511485

14521486
local_var_params = locals()
14531487

1454-
all_params = ["id"]
1488+
all_params = [
1489+
"id",
1490+
]
14551491
all_params.extend(self._COMMON_PARAMS)
14561492

14571493
for key, val in local_var_params["kwargs"].items():
@@ -1548,7 +1584,10 @@ async def read_authorization_models_with_http_info(self, **kwargs):
15481584

15491585
local_var_params = locals()
15501586

1551-
all_params = ["page_size", "continuation_token"]
1587+
all_params = [
1588+
"page_size",
1589+
"continuation_token",
1590+
]
15521591
all_params.extend(self._COMMON_PARAMS)
15531592

15541593
for key, val in local_var_params["kwargs"].items():
@@ -1654,7 +1693,12 @@ async def read_changes_with_http_info(self, **kwargs):
16541693

16551694
local_var_params = locals()
16561695

1657-
all_params = ["type", "page_size", "continuation_token", "start_time"]
1696+
all_params = [
1697+
"type",
1698+
"page_size",
1699+
"continuation_token",
1700+
"start_time",
1701+
]
16581702
all_params.extend(self._COMMON_PARAMS)
16591703

16601704
for key, val in local_var_params["kwargs"].items():
@@ -1752,7 +1796,9 @@ async def streamed_list_objects_with_http_info(self, body, **kwargs):
17521796

17531797
local_var_params = locals()
17541798

1755-
all_params = ["body"]
1799+
all_params = [
1800+
"body",
1801+
]
17561802
all_params.extend(self._COMMON_PARAMS)
17571803

17581804
for key, val in local_var_params["kwargs"].items():
@@ -1762,6 +1808,7 @@ async def streamed_list_objects_with_http_info(self, body, **kwargs):
17621808
)
17631809
local_var_params[key] = val
17641810
del local_var_params["kwargs"]
1811+
# verify the required parameter 'body' is set
17651812
if (
17661813
self.api_client.client_side_validation
17671814
and local_var_params.get("body") is None
@@ -1846,7 +1893,9 @@ async def write_with_http_info(self, body, **kwargs):
18461893

18471894
local_var_params = locals()
18481895

1849-
all_params = ["body"]
1896+
all_params = [
1897+
"body",
1898+
]
18501899
all_params.extend(self._COMMON_PARAMS)
18511900

18521901
for key, val in local_var_params["kwargs"].items():
@@ -1856,6 +1905,7 @@ async def write_with_http_info(self, body, **kwargs):
18561905
)
18571906
local_var_params[key] = val
18581907
del local_var_params["kwargs"]
1908+
# verify the required parameter 'body' is set
18591909
if (
18601910
self.api_client.client_side_validation
18611911
and local_var_params.get("body") is None
@@ -1948,7 +1998,10 @@ async def write_assertions_with_http_info(
19481998

19491999
local_var_params = locals()
19502000

1951-
all_params = ["authorization_model_id", "body"]
2001+
all_params = [
2002+
"authorization_model_id",
2003+
"body",
2004+
]
19522005
all_params.extend(self._COMMON_PARAMS)
19532006

19542007
for key, val in local_var_params["kwargs"].items():
@@ -1965,6 +2018,7 @@ async def write_assertions_with_http_info(
19652018
raise ApiValueError(
19662019
"Missing the required parameter `authorization_model_id` when calling `write_assertions`"
19672020
)
2021+
# verify the required parameter 'body' is set
19682022
if (
19692023
self.api_client.client_side_validation
19702024
and local_var_params.get("body") is None
@@ -2049,7 +2103,9 @@ async def write_authorization_model_with_http_info(self, body, **kwargs):
20492103

20502104
local_var_params = locals()
20512105

2052-
all_params = ["body"]
2106+
all_params = [
2107+
"body",
2108+
]
20532109
all_params.extend(self._COMMON_PARAMS)
20542110

20552111
for key, val in local_var_params["kwargs"].items():
@@ -2059,6 +2115,7 @@ async def write_authorization_model_with_http_info(self, body, **kwargs):
20592115
)
20602116
local_var_params[key] = val
20612117
del local_var_params["kwargs"]
2118+
# verify the required parameter 'body' is set
20622119
if (
20632120
self.api_client.client_side_validation
20642121
and local_var_params.get("body") is None

openfga_sdk/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
import openfga_sdk.models
1616

1717
from openfga_sdk import oauth2, rest
18+
from openfga_sdk._version import USER_AGENT as DEFAULT_USER_AGENT
1819
from openfga_sdk.configuration import Configuration
1920
from openfga_sdk.constants import (
2021
MAX_BACKOFF_TIME_IN_SEC,
2122
RETRY_HEADER_MAX_ALLOWABLE_DURATION_IN_SEC,
2223
)
23-
from openfga_sdk.constants import USER_AGENT as DEFAULT_USER_AGENT
2424
from openfga_sdk.exceptions import (
2525
ApiException,
2626
ApiValueError,

openfga_sdk/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
import urllib3
88

9+
from openfga_sdk._version import SDK_VERSION
910
from openfga_sdk.constants import (
1011
DEFAULT_MAX_RETRY,
1112
DEFAULT_MIN_WAIT_IN_MS,
1213
MAX_BACKOFF_TIME_IN_SEC,
1314
RETRY_MAX_ALLOWED_NUMBER,
14-
SDK_VERSION,
1515
)
1616
from openfga_sdk.exceptions import ApiValueError, FgaValidationException
1717
from openfga_sdk.telemetry.attributes import TelemetryAttribute

openfga_sdk/constants.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
from typing import Final
1414

1515

16-
# Version of the OpenFGA Python SDK.
17-
SDK_VERSION: Final[str] = "0.10.3" # x-release-please-version
18-
19-
# User agent used in HTTP requests.
20-
21-
USER_AGENT: Final[str] = "openfga-sdk python/0.10.3" # x-release-please-version
22-
2316
# Example API domain for documentation/tests.
2417
SAMPLE_BASE_DOMAIN: Final[str] = "fga.example"
2518

openfga_sdk/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import urllib3
88

9+
from openfga_sdk._version import USER_AGENT
910
from openfga_sdk.configuration import Configuration
1011
from openfga_sdk.constants import (
1112
TOKEN_EXPIRY_JITTER_IN_SEC,
1213
TOKEN_EXPIRY_THRESHOLD_BUFFER_IN_SEC,
13-
USER_AGENT,
1414
)
1515
from openfga_sdk.credentials import Credentials
1616
from openfga_sdk.exceptions import AuthenticationError

0 commit comments

Comments
 (0)