@@ -80,14 +80,14 @@ class Intercom(SyncAPIClient):
8080 with_streaming_response : IntercomWithStreamedResponse
8181
8282 # client options
83- api_key : str
83+ access_token : str
8484
8585 _environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven
8686
8787 def __init__ (
8888 self ,
8989 * ,
90- api_key : str | None = None ,
90+ access_token : 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 `api_key ` argument from the `INTERCOM_API_KEY ` environment variable if it is not provided.
113+ This automatically infers the `access_token ` argument from the `INTERCOM_ACCESS_TOKEN ` environment variable if it is not provided.
114114 """
115- if api_key is None :
116- api_key = os .environ .get ("INTERCOM_API_KEY " )
117- if api_key is None :
115+ if access_token is None :
116+ access_token = os .environ .get ("INTERCOM_ACCESS_TOKEN " )
117+ if access_token is None :
118118 raise IntercomError (
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"
119+ "The access_token client option must be set either by passing access_token to the client or by setting the INTERCOM_ACCESS_TOKEN environment variable"
120120 )
121- self .api_key = api_key
121+ self .access_token = access_token
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- api_key = self .api_key
195- return {"Authorization" : f"Bearer { api_key } " }
194+ access_token = self .access_token
195+ return {"Authorization" : f"Bearer { access_token } " }
196196
197197 @property
198198 @override
@@ -206,7 +206,7 @@ def default_headers(self) -> dict[str, str | Omit]:
206206 def copy (
207207 self ,
208208 * ,
209- api_key : str | None = None ,
209+ access_token : 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- api_key = api_key or self .api_key ,
244+ access_token = access_token or self .access_token ,
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- api_key : str
321+ access_token : str
322322
323323 _environment : Literal ["production" , "environment_1" , "environment_2" ] | NotGiven
324324
325325 def __init__ (
326326 self ,
327327 * ,
328- api_key : str | None = None ,
328+ access_token : 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 `api_key ` argument from the `INTERCOM_API_KEY ` environment variable if it is not provided.
351+ This automatically infers the `access_token ` argument from the `INTERCOM_ACCESS_TOKEN ` environment variable if it is not provided.
352352 """
353- if api_key is None :
354- api_key = os .environ .get ("INTERCOM_API_KEY " )
355- if api_key is None :
353+ if access_token is None :
354+ access_token = os .environ .get ("INTERCOM_ACCESS_TOKEN " )
355+ if access_token is None :
356356 raise IntercomError (
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"
357+ "The access_token client option must be set either by passing access_token to the client or by setting the INTERCOM_ACCESS_TOKEN environment variable"
358358 )
359- self .api_key = api_key
359+ self .access_token = access_token
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- api_key = self .api_key
433- return {"Authorization" : f"Bearer { api_key } " }
432+ access_token = self .access_token
433+ return {"Authorization" : f"Bearer { access_token } " }
434434
435435 @property
436436 @override
@@ -444,7 +444,7 @@ def default_headers(self) -> dict[str, str | Omit]:
444444 def copy (
445445 self ,
446446 * ,
447- api_key : str | None = None ,
447+ access_token : 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- api_key = api_key or self .api_key ,
482+ access_token = access_token or self .access_token ,
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