Skip to content

Commit ff274b2

Browse files
committed
feat(api): update via SDK Studio
1 parent 354e56b commit ff274b2

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ from intercom import Intercom
3030
client = Intercom(
3131
# This is the default and can be omitted
3232
access_token=os.environ.get("INTERCOM_ACCESS_TOKEN"),
33-
# or 'production' | 'environment_2'; defaults to "production".
34-
environment="environment_1",
33+
# or 'us' | 'au'; defaults to "us".
34+
environment="eu",
3535
)
3636

3737
admin_with_app = client.me.retrieve()
@@ -55,8 +55,8 @@ from intercom import AsyncIntercom
5555
client = AsyncIntercom(
5656
# This is the default and can be omitted
5757
access_token=os.environ.get("INTERCOM_ACCESS_TOKEN"),
58-
# or 'production' | 'environment_2'; defaults to "production".
59-
environment="environment_1",
58+
# or 'us' | 'au'; defaults to "us".
59+
environment="eu",
6060
)
6161

6262

src/intercom/_client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
]
4747

4848
ENVIRONMENTS: Dict[str, str] = {
49-
"production": "https://api.intercom.io",
50-
"environment_1": "https://api.eu.intercom.io",
51-
"environment_2": "https://api.au.intercom.io",
49+
"us": "https://api.intercom.io",
50+
"eu": "https://api.eu.intercom.io",
51+
"au": "https://api.au.intercom.io",
5252
}
5353

5454

@@ -82,13 +82,13 @@ class Intercom(SyncAPIClient):
8282
# client options
8383
access_token: str
8484

85-
_environment: Literal["production", "environment_1", "environment_2"] | NotGiven
85+
_environment: Literal["us", "eu", "au"] | NotGiven
8686

8787
def __init__(
8888
self,
8989
*,
9090
access_token: str | None = None,
91-
environment: Literal["production", "environment_1", "environment_2"] | NotGiven = NOT_GIVEN,
91+
environment: Literal["us", "eu", "au"] | NotGiven = NOT_GIVEN,
9292
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
9393
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
9494
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -139,7 +139,7 @@ def __init__(
139139
elif base_url_env is not None:
140140
base_url = base_url_env
141141
else:
142-
self._environment = environment = "production"
142+
self._environment = environment = "us"
143143

144144
try:
145145
base_url = ENVIRONMENTS[environment]
@@ -207,7 +207,7 @@ def copy(
207207
self,
208208
*,
209209
access_token: str | None = None,
210-
environment: Literal["production", "environment_1", "environment_2"] | None = None,
210+
environment: Literal["us", "eu", "au"] | None = None,
211211
base_url: str | httpx.URL | None = None,
212212
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
213213
http_client: httpx.Client | None = None,
@@ -320,13 +320,13 @@ class AsyncIntercom(AsyncAPIClient):
320320
# client options
321321
access_token: str
322322

323-
_environment: Literal["production", "environment_1", "environment_2"] | NotGiven
323+
_environment: Literal["us", "eu", "au"] | NotGiven
324324

325325
def __init__(
326326
self,
327327
*,
328328
access_token: str | None = None,
329-
environment: Literal["production", "environment_1", "environment_2"] | NotGiven = NOT_GIVEN,
329+
environment: Literal["us", "eu", "au"] | NotGiven = NOT_GIVEN,
330330
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
331331
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
332332
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -377,7 +377,7 @@ def __init__(
377377
elif base_url_env is not None:
378378
base_url = base_url_env
379379
else:
380-
self._environment = environment = "production"
380+
self._environment = environment = "us"
381381

382382
try:
383383
base_url = ENVIRONMENTS[environment]
@@ -445,7 +445,7 @@ def copy(
445445
self,
446446
*,
447447
access_token: str | None = None,
448-
environment: Literal["production", "environment_1", "environment_2"] | None = None,
448+
environment: Literal["us", "eu", "au"] | None = None,
449449
base_url: str | httpx.URL | None = None,
450450
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
451451
http_client: httpx.AsyncClient | None = None,

tests/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,10 @@ def test_base_url_env(self) -> None:
565565
# explicit environment arg requires explicitness
566566
with update_env(INTERCOM_BASE_URL="http://localhost:5000/from/env"):
567567
with pytest.raises(ValueError, match=r"you must pass base_url=None"):
568-
Intercom(access_token=access_token, _strict_response_validation=True, environment="production")
568+
Intercom(access_token=access_token, _strict_response_validation=True, environment="us")
569569

570570
client = Intercom(
571-
base_url=None, access_token=access_token, _strict_response_validation=True, environment="production"
571+
base_url=None, access_token=access_token, _strict_response_validation=True, environment="us"
572572
)
573573
assert str(client.base_url).startswith("https://api.intercom.io")
574574

@@ -1276,10 +1276,10 @@ def test_base_url_env(self) -> None:
12761276
# explicit environment arg requires explicitness
12771277
with update_env(INTERCOM_BASE_URL="http://localhost:5000/from/env"):
12781278
with pytest.raises(ValueError, match=r"you must pass base_url=None"):
1279-
AsyncIntercom(access_token=access_token, _strict_response_validation=True, environment="production")
1279+
AsyncIntercom(access_token=access_token, _strict_response_validation=True, environment="us")
12801280

12811281
client = AsyncIntercom(
1282-
base_url=None, access_token=access_token, _strict_response_validation=True, environment="production"
1282+
base_url=None, access_token=access_token, _strict_response_validation=True, environment="us"
12831283
)
12841284
assert str(client.base_url).startswith("https://api.intercom.io")
12851285

0 commit comments

Comments
 (0)