@@ -80,14 +80,14 @@ class Intercom(SyncAPIClient):
8080 with_streaming_response : IntercomWithStreamedResponse
8181
8282 # client options
83- bearer_token : str
83+ api_key : str
8484
8585 _environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven
8686
8787 def __init__ (
8888 self ,
8989 * ,
90- bearer_token : str | None = None ,
90+ api_key : str | None = None ,
9191 environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven = NOT_GIVEN ,
9292 base_url : str | httpx .URL | None | NotGiven = NOT_GIVEN ,
9393 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
@@ -110,15 +110,15 @@ def __init__(
110110 ) -> None :
111111 """Construct a new synchronous intercom client instance.
112112
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.
114114 """
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 :
118118 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"
120120 )
121- self .bearer_token = bearer_token
121+ self .api_key = api_key
122122
123123 self ._environment = environment
124124
@@ -191,8 +191,8 @@ def qs(self) -> Querystring:
191191 @property
192192 @override
193193 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 } " }
196196
197197 @property
198198 @override
@@ -206,7 +206,7 @@ def default_headers(self) -> dict[str, str | Omit]:
206206 def copy (
207207 self ,
208208 * ,
209- bearer_token : str | None = None ,
209+ api_key : str | None = None ,
210210 environment : Literal ["production" , "environment_1" , "environment_2" ] | None = None ,
211211 base_url : str | httpx .URL | None = None ,
212212 timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
@@ -241,7 +241,7 @@ def copy(
241241
242242 http_client = http_client or self ._client
243243 return self .__class__ (
244- bearer_token = bearer_token or self .bearer_token ,
244+ api_key = api_key or self .api_key ,
245245 base_url = base_url or self .base_url ,
246246 environment = environment or self ._environment ,
247247 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
@@ -318,14 +318,14 @@ class AsyncIntercom(AsyncAPIClient):
318318 with_streaming_response : AsyncIntercomWithStreamedResponse
319319
320320 # client options
321- bearer_token : str
321+ api_key : str
322322
323323 _environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven
324324
325325 def __init__ (
326326 self ,
327327 * ,
328- bearer_token : str | None = None ,
328+ api_key : str | None = None ,
329329 environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven = NOT_GIVEN ,
330330 base_url : str | httpx .URL | None | NotGiven = NOT_GIVEN ,
331331 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
@@ -348,15 +348,15 @@ def __init__(
348348 ) -> None :
349349 """Construct a new async intercom client instance.
350350
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.
352352 """
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 :
356356 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"
358358 )
359- self .bearer_token = bearer_token
359+ self .api_key = api_key
360360
361361 self ._environment = environment
362362
@@ -429,8 +429,8 @@ def qs(self) -> Querystring:
429429 @property
430430 @override
431431 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 } " }
434434
435435 @property
436436 @override
@@ -444,7 +444,7 @@ def default_headers(self) -> dict[str, str | Omit]:
444444 def copy (
445445 self ,
446446 * ,
447- bearer_token : str | None = None ,
447+ api_key : str | None = None ,
448448 environment : Literal ["production" , "environment_1" , "environment_2" ] | None = None ,
449449 base_url : str | httpx .URL | None = None ,
450450 timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
@@ -479,7 +479,7 @@ def copy(
479479
480480 http_client = http_client or self ._client
481481 return self .__class__ (
482- bearer_token = bearer_token or self .bearer_token ,
482+ api_key = api_key or self .api_key ,
483483 base_url = base_url or self .base_url ,
484484 environment = environment or self ._environment ,
485485 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
0 commit comments