99from ..core .jsonable_encoder import jsonable_encoder
1010from ..core .pydantic_utilities import parse_obj_as
1111from ..core .request_options import RequestOptions
12+ from ..core .serialization import convert_and_respect_annotation_metadata
1213from ..errors .unprocessable_entity_error import UnprocessableEntityError
1314from ..types .call_tool_response import CallToolResponse
1415from ..types .connection_type import ConnectionType
2425from ..types .mcp_server_name import McpServerName
2526from ..types .status_response import StatusResponse
2627from ..types .tool_format import ToolFormat
28+ from .types .authdata import Authdata
2729
2830# this is used as the default value for optional parameters
2931OMIT = typing .cast (typing .Any , ...)
@@ -637,20 +639,21 @@ def get_all_mcp_servers(
637639 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
638640 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response_json )
639641
640- def set_instance_auth_token (
641- self , * , instance_id : str , auth_token : str , request_options : typing .Optional [RequestOptions ] = None
642+ def set_instance_auth (
643+ self , * , instance_id : str , auth_data : Authdata , request_options : typing .Optional [RequestOptions ] = None
642644 ) -> HttpResponse [StatusResponse ]:
643645 """
644- Sets an authentication token for a specific instance.
646+ Sets authentication data for a specific instance.
647+ Accepts either API key authentication or general authentication data.
645648 This updates the auth_metadata for the specified instance.
646649
647650 Parameters
648651 ----------
649652 instance_id : str
650653 The unique identifier for the connection instance
651654
652- auth_token : str
653- The authentication token to save
655+ auth_data : Authdata
656+ Authentication data
654657
655658 request_options : typing.Optional[RequestOptions]
656659 Request-specific configuration.
@@ -661,11 +664,13 @@ def set_instance_auth_token(
661664 Successful Response
662665 """
663666 _response = self ._client_wrapper .httpx_client .request (
664- "mcp-server/instance/set-auth-token " ,
667+ "mcp-server/instance/set-auth" ,
665668 method = "POST" ,
666669 json = {
667670 "instanceId" : instance_id ,
668- "authToken" : auth_token ,
671+ "authData" : convert_and_respect_annotation_metadata (
672+ object_ = auth_data , annotation = Authdata , direction = "write"
673+ ),
669674 },
670675 headers = {
671676 "content-type" : "application/json" ,
@@ -1443,20 +1448,21 @@ async def get_all_mcp_servers(
14431448 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
14441449 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response_json )
14451450
1446- async def set_instance_auth_token (
1447- self , * , instance_id : str , auth_token : str , request_options : typing .Optional [RequestOptions ] = None
1451+ async def set_instance_auth (
1452+ self , * , instance_id : str , auth_data : Authdata , request_options : typing .Optional [RequestOptions ] = None
14481453 ) -> AsyncHttpResponse [StatusResponse ]:
14491454 """
1450- Sets an authentication token for a specific instance.
1455+ Sets authentication data for a specific instance.
1456+ Accepts either API key authentication or general authentication data.
14511457 This updates the auth_metadata for the specified instance.
14521458
14531459 Parameters
14541460 ----------
14551461 instance_id : str
14561462 The unique identifier for the connection instance
14571463
1458- auth_token : str
1459- The authentication token to save
1464+ auth_data : Authdata
1465+ Authentication data
14601466
14611467 request_options : typing.Optional[RequestOptions]
14621468 Request-specific configuration.
@@ -1467,11 +1473,13 @@ async def set_instance_auth_token(
14671473 Successful Response
14681474 """
14691475 _response = await self ._client_wrapper .httpx_client .request (
1470- "mcp-server/instance/set-auth-token " ,
1476+ "mcp-server/instance/set-auth" ,
14711477 method = "POST" ,
14721478 json = {
14731479 "instanceId" : instance_id ,
1474- "authToken" : auth_token ,
1480+ "authData" : convert_and_respect_annotation_metadata (
1481+ object_ = auth_data , annotation = Authdata , direction = "write"
1482+ ),
14751483 },
14761484 headers = {
14771485 "content-type" : "application/json" ,
0 commit comments