Skip to content

Commit f604a08

Browse files
authored
Merge a349586 into 34c78b0
2 parents 34c78b0 + a349586 commit f604a08

File tree

8 files changed

+94
-269
lines changed

8 files changed

+94
-269
lines changed

playground/python/app/search.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
from asyncio import run
22
from os import environ
3-
from base64 import b64decode
43

54
from algoliasearch.search.client import SearchClient
6-
from algoliasearch.search.models.search_params_object import SearchParamsObject
7-
from algoliasearch.search.models.secured_api_key_restrictions import (
8-
SecuredApiKeyRestrictions,
9-
)
105
from algoliasearch.search import __version__
116
from dotenv import load_dotenv
127

@@ -22,20 +17,10 @@ async def main():
2217
print("client initialized", client)
2318

2419
try:
25-
# resp = await client.search(search_method_params={
26-
# "requests": [{"indexName": "api-clients-automation"}]
27-
# })
28-
# print(resp.to_dict())
29-
print(
30-
b64decode(await client.generate_secured_api_key(
31-
"foo",
32-
SecuredApiKeyRestrictions(
33-
restrictIndices=["foo"],
34-
filters="bar",
35-
searchParams=SearchParamsObject(attributesToRetrieve=["baz"]),
36-
),
37-
))
38-
)
20+
resp = await client.search(search_method_params={
21+
"requests": [{"indexName": "api-clients-automation"}]
22+
})
23+
print(resp.to_dict())
3924
finally:
4025
await client.close()
4126

templates/python/imports.mustache

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@ from typing import (
3333
Dict,
3434
Iterator,
3535
List,
36-
Literal,
36+
Set,
3737
Optional,
3838
Tuple,
3939
Union,
4040
)
4141

42+
from typing_extensions import Annotated
43+
4244
if version_info >= (3, 11):
43-
from typing import Self, Annotated
45+
from typing import Self
4446
else:
45-
from typing_extensions import Self, Annotated
47+
from typing_extensions import Self
4648

4749
from algoliasearch.http.helpers import create_iterable, create_iterable_sync, RetryTimeout
4850
from algoliasearch.http.serializer import bodySerializer, QueryParametersSerializer

templates/python/model_enum.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum):
77
{{#allowableValues}}
88
{{#enumVars}}
99
{{{name}}} = {{{value}}}
10+
1011
{{/enumVars}}
1112

1213
@classmethod
@@ -22,4 +23,4 @@ class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum):
2223
if value is no_arg:
2324
return cls.{{{.}}}
2425
{{/defaultValue}}
25-
{{/allowableValues}}
26+
{{/allowableValues}}

0 commit comments

Comments
 (0)