@@ -17,8 +17,8 @@ from algoliasearch.{{packageName}}.models.{{#lambda.snakecase}}{{{.}}}{{/lambda.
17
17
18
18
{ {#modes} }
19
19
{ {#operations} }
20
- class { {classname} }{ {^isAsync } }Sync{ {/isAsync } }:
21
- """The Algolia '{ {classname} }{ {^isAsync } }Sync{ {/isAsync } }' class.
20
+ class { {classname} }{ {#isSync } }Sync{ {/isSync } }:
21
+ """The Algolia '{ {classname} }{ {#isSync } }Sync{ {/isSync } }' class.
22
22
23
23
Args:
24
24
app_id (str): The Algolia application ID to retrieve information from.
@@ -29,10 +29,10 @@ class {{classname}}{{^isAsync}}Sync{{/isAsync}}:
29
29
The initialized API client.
30
30
31
31
Example:
32
- _client = { {classname} }{ {^isAsync } }Sync{ {/isAsync } }("YOUR_ALGOLIA_APP_ID", "YOUR_ALGOLIA_API_KEY"{ {#hasRegionalHost} }, region="{ {#allowedRegions} }'{ {.} }'{ {^-last} } or { {/-last} }{ {/allowedRegions} }"{ {/hasRegionalHost} })
33
- _client_with_named_args = { {classname} }{ {^isAsync } }Sync{ {/isAsync } }(app_id="YOUR_ALGOLIA_APP_ID", api_key="YOUR_ALGOLIA_API_KEY"{ {#hasRegionalHost} }, region="{ {#allowedRegions} }'{ {.} }'{ {^-last} } or { {/-last} }{ {/allowedRegions} }"{ {/hasRegionalHost} })
32
+ _client = { {classname} }{ {#isSync } }Sync{ {/isSync } }("YOUR_ALGOLIA_APP_ID", "YOUR_ALGOLIA_API_KEY"{ {#hasRegionalHost} }, region="{ {#allowedRegions} }'{ {.} }'{ {^-last} } or { {/-last} }{ {/allowedRegions} }"{ {/hasRegionalHost} })
33
+ _client_with_named_args = { {classname} }{ {#isSync } }Sync{ {/isSync } }(app_id="YOUR_ALGOLIA_APP_ID", api_key="YOUR_ALGOLIA_API_KEY"{ {#hasRegionalHost} }, region="{ {#allowedRegions} }'{ {.} }'{ {^-last} } or { {/-last} }{ {/allowedRegions} }"{ {/hasRegionalHost} })
34
34
35
- See `{ {classname} }{ {^isAsync } }Sync{ {/isAsync } }.create_with_config` for advanced configuration.
35
+ See `{ {classname} }{ {#isSync } }Sync{ {/isSync } }.create_with_config` for advanced configuration.
36
36
"""
37
37
38
38
_transporter: Transporter
@@ -63,34 +63,34 @@ class {{classname}}{{^isAsync}}Sync{{/isAsync}}:
63
63
The initialized API client.
64
64
65
65
Example:
66
- _client_with_custom_config = { {classname} }{ {^isAsync } }Sync{ {/isAsync } }.create_with_config(config={ {#lambda.pascalcase} }{ {client} }Config{ {/lambda.pascalcase} }(...))
67
- _client_with_custom_config_and_transporter = { {classname} }{ {^isAsync } }Sync{ {/isAsync } }.create_with_config(config={ {#lambda.pascalcase} }{ {client} }Config{ {/lambda.pascalcase} }(...), transporter=Transporter(...))
66
+ _client_with_custom_config = { {classname} }{ {#isSync } }Sync{ {/isSync } }.create_with_config(config={ {#lambda.pascalcase} }{ {client} }Config{ {/lambda.pascalcase} }(...))
67
+ _client_with_custom_config_and_transporter = { {classname} }{ {#isSync } }Sync{ {/isSync } }.create_with_config(config={ {#lambda.pascalcase} }{ {client} }Config{ {/lambda.pascalcase} }(...), transporter=Transporter(...))
68
68
"""
69
69
if transporter is None:
70
70
transporter = Transporter(config)
71
71
72
- return { {classname} }{ {^isAsync } }Sync{ {/isAsync } }(app_id=config.app_id, api_key=config.api_key, { {#hasRegionalHost} }region=config.region, { {/hasRegionalHost} }transporter=transporter, config=config)
72
+ return { {classname} }{ {#isSync } }Sync{ {/isSync } }(app_id=config.app_id, api_key=config.api_key, { {#hasRegionalHost} }region=config.region, { {/hasRegionalHost} }transporter=transporter, config=config)
73
73
74
- { {#isAsync } }
74
+ { {^isSync } }
75
75
async def __aenter__(self) -> None:
76
76
return self
77
77
78
78
async def __aexit__(self, exc_type, exc_value, traceback) -> None:
79
79
"""Closes the underlying `transporter` of the API client."""
80
- { {#isAsync } }await { {/isAsync } }self.close()
80
+ { {^isSync } }await { {/isSync } }self.close()
81
81
82
82
async def close(self) -> None:
83
83
"""Closes the underlying `transporter` of the API client."""
84
- return { {#isAsync } }await { {/isAsync } }self._transporter.close()
85
- { {/isAsync } }
84
+ return { {^isSync } }await { {/isSync } }self._transporter.close()
85
+ { {/isSync } }
86
86
87
87
{ {#isSearchClient} }
88
88
{ {> search_helpers} }
89
89
{ {/isSearchClient} }
90
90
91
91
{ {#operation} }
92
92
93
- { {#isAsync } }async { {/isAsync } }def { {operationId} }_with_http_info{ {> partial_api_args} } -> ApiResponse[str]:
93
+ { {^isSync } }async { {/isSync } }def { {operationId} }_with_http_info{ {> partial_api_args} } -> ApiResponse[str]:
94
94
"""
95
95
{ {#isDeprecated} }
96
96
(Deprecated) { {operationId} }
@@ -151,7 +151,7 @@ class {{classname}}{{^isAsync}}Sync{{/isAsync}}:
151
151
_data = { {paramName} }
152
152
{ {/bodyParam} }
153
153
154
- return { {#isAsync } }await { {/isAsync } }self._transporter.request(
154
+ return { {^isSync } }await { {/isSync } }self._transporter.request(
155
155
verb=Verb.{ {httpMethod} },
156
156
path={ {#vendorExtensions} }'{ {{path} }}'{ {#pathParams} }.replace({ {=<% %>= } }'{ <% baseName%> } '<%={ { } }=%>, { {#x-is-custom-request} }{ {paramName} }{ {/x-is-custom-request} }{ {^x-is-custom-request} }quote(str({ {paramName} }), safe=''){ {/x-is-custom-request} }){ {/pathParams} },{ {/vendorExtensions} }
157
157
request_options=self._request_options.merge(
@@ -165,7 +165,7 @@ class {{classname}}{{^isAsync}}Sync{{/isAsync}}:
165
165
{ {/vendorExtensions} }
166
166
)
167
167
168
- { {#isAsync } }async { {/isAsync } }def { {operationId} }{ {> partial_api_args} } -> { {{returnType} }}{ {^returnType} }None{ {/returnType} }:
168
+ { {^isSync } }async { {/isSync } }def { {operationId} }{ {> partial_api_args} } -> { {{returnType} }}{ {^returnType} }None{ {/returnType} }:
169
169
"""
170
170
{ {#isDeprecated} }
171
171
(Deprecated) { {operationId} }
@@ -186,7 +186,7 @@ class {{classname}}{{^isAsync}}Sync{{/isAsync}}:
186
186
:return: Returns the deserialized response in a '{ {{returnType} }}' result object.
187
187
{ {/returnType} }
188
188
"""
189
- return ({ {#isAsync } }await { {/isAsync } }self.{ {operationId} }_with_http_info({ {#allParams} }{ {paramName} },{ {/allParams} }request_options)).deserialize({ {{returnType} }})
189
+ return ({ {^isSync } }await { {/isSync } }self.{ {operationId} }_with_http_info({ {#allParams} }{ {paramName} },{ {/allParams} }request_options)).deserialize({ {{returnType} }})
190
190
191
191
{ {/operation} }
192
192
{ {/operations} }
0 commit comments