@@ -80,14 +80,14 @@ class Intercom(SyncAPIClient):
80
80
with_streaming_response : IntercomWithStreamedResponse
81
81
82
82
# client options
83
- bearer_token : str
83
+ api_key : str
84
84
85
85
_environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven
86
86
87
87
def __init__ (
88
88
self ,
89
89
* ,
90
- bearer_token : str | None = None ,
90
+ api_key : str | None = None ,
91
91
environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven = NOT_GIVEN ,
92
92
base_url : str | httpx .URL | None | NotGiven = NOT_GIVEN ,
93
93
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
@@ -110,15 +110,15 @@ def __init__(
110
110
) -> None :
111
111
"""Construct a new synchronous intercom client instance.
112
112
113
- This automatically infers the `bearer_token ` argument from the `INTERCOM_TEST_1_BEARER_TOKEN ` environment variable if it is not provided.
113
+ This automatically infers the `api_key ` argument from the `INTERCOM_API_KEY ` environment variable if it is not provided.
114
114
"""
115
- if bearer_token is None :
116
- bearer_token = os .environ .get ("INTERCOM_TEST_1_BEARER_TOKEN " )
117
- if bearer_token is None :
115
+ if api_key is None :
116
+ api_key = os .environ .get ("INTERCOM_API_KEY " )
117
+ if api_key is None :
118
118
raise IntercomError (
119
- "The bearer_token client option must be set either by passing bearer_token to the client or by setting the INTERCOM_TEST_1_BEARER_TOKEN environment variable"
119
+ "The api_key client option must be set either by passing api_key to the client or by setting the INTERCOM_API_KEY environment variable"
120
120
)
121
- self .bearer_token = bearer_token
121
+ self .api_key = api_key
122
122
123
123
self ._environment = environment
124
124
@@ -191,8 +191,8 @@ def qs(self) -> Querystring:
191
191
@property
192
192
@override
193
193
def auth_headers (self ) -> dict [str , str ]:
194
- bearer_token = self .bearer_token
195
- return {"Authorization" : f"Bearer { bearer_token } " }
194
+ api_key = self .api_key
195
+ return {"Authorization" : f"Bearer { api_key } " }
196
196
197
197
@property
198
198
@override
@@ -206,7 +206,7 @@ def default_headers(self) -> dict[str, str | Omit]:
206
206
def copy (
207
207
self ,
208
208
* ,
209
- bearer_token : str | None = None ,
209
+ api_key : str | None = None ,
210
210
environment : Literal ["production" , "environment_1" , "environment_2" ] | None = None ,
211
211
base_url : str | httpx .URL | None = None ,
212
212
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
@@ -241,7 +241,7 @@ def copy(
241
241
242
242
http_client = http_client or self ._client
243
243
return self .__class__ (
244
- bearer_token = bearer_token or self .bearer_token ,
244
+ api_key = api_key or self .api_key ,
245
245
base_url = base_url or self .base_url ,
246
246
environment = environment or self ._environment ,
247
247
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
@@ -318,14 +318,14 @@ class AsyncIntercom(AsyncAPIClient):
318
318
with_streaming_response : AsyncIntercomWithStreamedResponse
319
319
320
320
# client options
321
- bearer_token : str
321
+ api_key : str
322
322
323
323
_environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven
324
324
325
325
def __init__ (
326
326
self ,
327
327
* ,
328
- bearer_token : str | None = None ,
328
+ api_key : str | None = None ,
329
329
environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven = NOT_GIVEN ,
330
330
base_url : str | httpx .URL | None | NotGiven = NOT_GIVEN ,
331
331
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
@@ -348,15 +348,15 @@ def __init__(
348
348
) -> None :
349
349
"""Construct a new async intercom client instance.
350
350
351
- This automatically infers the `bearer_token ` argument from the `INTERCOM_TEST_1_BEARER_TOKEN ` environment variable if it is not provided.
351
+ This automatically infers the `api_key ` argument from the `INTERCOM_API_KEY ` environment variable if it is not provided.
352
352
"""
353
- if bearer_token is None :
354
- bearer_token = os .environ .get ("INTERCOM_TEST_1_BEARER_TOKEN " )
355
- if bearer_token is None :
353
+ if api_key is None :
354
+ api_key = os .environ .get ("INTERCOM_API_KEY " )
355
+ if api_key is None :
356
356
raise IntercomError (
357
- "The bearer_token client option must be set either by passing bearer_token to the client or by setting the INTERCOM_TEST_1_BEARER_TOKEN environment variable"
357
+ "The api_key client option must be set either by passing api_key to the client or by setting the INTERCOM_API_KEY environment variable"
358
358
)
359
- self .bearer_token = bearer_token
359
+ self .api_key = api_key
360
360
361
361
self ._environment = environment
362
362
@@ -429,8 +429,8 @@ def qs(self) -> Querystring:
429
429
@property
430
430
@override
431
431
def auth_headers (self ) -> dict [str , str ]:
432
- bearer_token = self .bearer_token
433
- return {"Authorization" : f"Bearer { bearer_token } " }
432
+ api_key = self .api_key
433
+ return {"Authorization" : f"Bearer { api_key } " }
434
434
435
435
@property
436
436
@override
@@ -444,7 +444,7 @@ def default_headers(self) -> dict[str, str | Omit]:
444
444
def copy (
445
445
self ,
446
446
* ,
447
- bearer_token : str | None = None ,
447
+ api_key : str | None = None ,
448
448
environment : Literal ["production" , "environment_1" , "environment_2" ] | None = None ,
449
449
base_url : str | httpx .URL | None = None ,
450
450
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
@@ -479,7 +479,7 @@ def copy(
479
479
480
480
http_client = http_client or self ._client
481
481
return self .__class__ (
482
- bearer_token = bearer_token or self .bearer_token ,
482
+ api_key = api_key or self .api_key ,
483
483
base_url = base_url or self .base_url ,
484
484
environment = environment or self ._environment ,
485
485
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
0 commit comments