@@ -79,14 +79,7 @@ def with_streaming_response(self) -> ChatsResourceWithStreamingResponse:
7979 def create (
8080 self ,
8181 * ,
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 ,
82+ params : chat_create_params .Params | Omit = omit ,
9083 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9184 # The extra values given here take precedence over values defined on the client or passed to this method.
9285 extra_headers : Headers | None = None ,
@@ -99,26 +92,6 @@ def create(
9992 user data (mode='start').
10093
10194 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-
12295 extra_headers: Send extra headers
12396
12497 extra_query: Add additional query parameters to the request
@@ -129,19 +102,7 @@ def create(
129102 """
130103 return self ._post (
131104 "/v1/chats" ,
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- ),
105+ body = maybe_transform (params , chat_create_params .ChatCreateParams ),
145106 options = make_request_options (
146107 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
147108 ),
@@ -422,14 +383,7 @@ def with_streaming_response(self) -> AsyncChatsResourceWithStreamingResponse:
422383 async def create (
423384 self ,
424385 * ,
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 ,
386+ params : chat_create_params .Params | Omit = omit ,
433387 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
434388 # The extra values given here take precedence over values defined on the client or passed to this method.
435389 extra_headers : Headers | None = None ,
@@ -442,26 +396,6 @@ async def create(
442396 user data (mode='start').
443397
444398 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-
465399 extra_headers: Send extra headers
466400
467401 extra_query: Add additional query parameters to the request
@@ -472,19 +406,7 @@ async def create(
472406 """
473407 return await self ._post (
474408 "/v1/chats" ,
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- ),
409+ body = await async_maybe_transform (params , chat_create_params .ChatCreateParams ),
488410 options = make_request_options (
489411 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
490412 ),
0 commit comments