Skip to content

Commit a44323f

Browse files
feat(python): add sync client (#3609) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent b6e273f commit a44323f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+30990
-450
lines changed

clients/algoliasearch-client-python/algoliasearch/abtesting/client.py

Lines changed: 789 additions & 1 deletion
Large diffs are not rendered by default.

clients/algoliasearch-client-python/algoliasearch/abtesting/config.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77

88

99
class AbtestingConfig(BaseConfig):
10-
def __init__(
11-
self,
12-
app_id: Optional[str] = None,
13-
api_key: Optional[str] = None,
14-
region: Optional[str] = None,
15-
) -> None:
10+
def __init__(self, app_id: str, api_key: str, region: Optional[str] = None) -> None:
1611
super().__init__(app_id, api_key)
1712

1813
user_agent = UserAgent().add("Abtesting")
@@ -24,14 +19,15 @@ def __init__(
2419
"content-type": "application/json",
2520
}
2621

27-
self.proxies = {
28-
"http": environ.get("HTTP_PROXY"),
29-
"https": environ.get("HTTPS_PROXY"),
30-
}
31-
if self.proxies["http"] is None:
32-
del self.proxies["http"]
33-
if self.proxies["https"] is None:
34-
del self.proxies["https"]
22+
http_proxy = environ.get("HTTP_PROXY")
23+
https_proxy = environ.get("HTTPS_PROXY")
24+
25+
self.proxies = {}
26+
27+
if http_proxy is not None:
28+
self.proxies["http"] = http_proxy
29+
if https_proxy is not None:
30+
self.proxies["https"] = https_proxy
3531

3632
self.region = region
3733
_regions = ["de", "us"]

0 commit comments

Comments
 (0)