@@ -79,7 +79,14 @@ def with_streaming_response(self) -> ChatsResourceWithStreamingResponse:
7979 def create (
8080 self ,
8181 * ,
82- chat : chat_create_params .Chat | Omit = omit ,
82+ account_id : str ,
83+ allow_invite : bool | Omit = omit ,
84+ message_text : str | Omit = omit ,
85+ mode : Literal ["create" , "start" ] | Omit = omit ,
86+ participant_ids : SequenceNotStr [str ] | Omit = omit ,
87+ title : str | Omit = omit ,
88+ type : Literal ["single" , "group" ] | Omit = omit ,
89+ user : chat_create_params .User | Omit = omit ,
8390 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8491 # The extra values given here take precedence over values defined on the client or passed to this method.
8592 extra_headers : Headers | None = None ,
@@ -92,6 +99,26 @@ def create(
9299 user data (mode='start').
93100
94101 Args:
102+ account_id: Account to create or start the chat on.
103+
104+ allow_invite: Whether invite-based DM creation is allowed when required by the platform. Used
105+ for mode='start'.
106+
107+ message_text: Optional first message content if the platform requires it to create the chat.
108+
109+ mode: Operation mode. Defaults to 'create' when omitted.
110+
111+ participant_ids: Required when mode='create'. User IDs to include in the new chat.
112+
113+ title: Optional title for group chats when mode='create'; ignored for single chats on
114+ most platforms.
115+
116+ type: Required when mode='create'. 'single' requires exactly one participantID;
117+ 'group' supports multiple participants and optional title.
118+
119+ user: Required when mode='start'. Merged user-like contact payload used to resolve the
120+ best identifier.
121+
95122 extra_headers: Send extra headers
96123
97124 extra_query: Add additional query parameters to the request
@@ -102,7 +129,19 @@ def create(
102129 """
103130 return self ._post (
104131 "/v1/chats" ,
105- body = maybe_transform (chat , chat_create_params .ChatCreateParams ),
132+ body = maybe_transform (
133+ {
134+ "account_id" : account_id ,
135+ "allow_invite" : allow_invite ,
136+ "message_text" : message_text ,
137+ "mode" : mode ,
138+ "participant_ids" : participant_ids ,
139+ "title" : title ,
140+ "type" : type ,
141+ "user" : user ,
142+ },
143+ chat_create_params .ChatCreateParams ,
144+ ),
106145 options = make_request_options (
107146 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
108147 ),
@@ -383,7 +422,14 @@ def with_streaming_response(self) -> AsyncChatsResourceWithStreamingResponse:
383422 async def create (
384423 self ,
385424 * ,
386- chat : chat_create_params .Chat | Omit = omit ,
425+ account_id : str ,
426+ allow_invite : bool | Omit = omit ,
427+ message_text : str | Omit = omit ,
428+ mode : Literal ["create" , "start" ] | Omit = omit ,
429+ participant_ids : SequenceNotStr [str ] | Omit = omit ,
430+ title : str | Omit = omit ,
431+ type : Literal ["single" , "group" ] | Omit = omit ,
432+ user : chat_create_params .User | Omit = omit ,
387433 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
388434 # The extra values given here take precedence over values defined on the client or passed to this method.
389435 extra_headers : Headers | None = None ,
@@ -396,6 +442,26 @@ async def create(
396442 user data (mode='start').
397443
398444 Args:
445+ account_id: Account to create or start the chat on.
446+
447+ allow_invite: Whether invite-based DM creation is allowed when required by the platform. Used
448+ for mode='start'.
449+
450+ message_text: Optional first message content if the platform requires it to create the chat.
451+
452+ mode: Operation mode. Defaults to 'create' when omitted.
453+
454+ participant_ids: Required when mode='create'. User IDs to include in the new chat.
455+
456+ title: Optional title for group chats when mode='create'; ignored for single chats on
457+ most platforms.
458+
459+ type: Required when mode='create'. 'single' requires exactly one participantID;
460+ 'group' supports multiple participants and optional title.
461+
462+ user: Required when mode='start'. Merged user-like contact payload used to resolve the
463+ best identifier.
464+
399465 extra_headers: Send extra headers
400466
401467 extra_query: Add additional query parameters to the request
@@ -406,7 +472,19 @@ async def create(
406472 """
407473 return await self ._post (
408474 "/v1/chats" ,
409- body = await async_maybe_transform (chat , chat_create_params .ChatCreateParams ),
475+ body = await async_maybe_transform (
476+ {
477+ "account_id" : account_id ,
478+ "allow_invite" : allow_invite ,
479+ "message_text" : message_text ,
480+ "mode" : mode ,
481+ "participant_ids" : participant_ids ,
482+ "title" : title ,
483+ "type" : type ,
484+ "user" : user ,
485+ },
486+ chat_create_params .ChatCreateParams ,
487+ ),
410488 options = make_request_options (
411489 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
412490 ),
0 commit comments