@@ -93,15 +93,14 @@ func (r *ChatService) ListAutoPaging(ctx context.Context, query ChatListParams,
9393
9494// Archive or unarchive a chat. Set archived=true to move to archive,
9595// archived=false to move back to inbox
96- func (r * ChatService ) Archive (ctx context.Context , chatID string , body ChatArchiveParams , opts ... option.RequestOption ) (err error ) {
96+ func (r * ChatService ) Archive (ctx context.Context , chatID string , body ChatArchiveParams , opts ... option.RequestOption ) (res * ChatArchiveResponse , err error ) {
9797 opts = slices .Concat (r .Options , opts )
98- opts = append ([]option.RequestOption {option .WithHeader ("Accept" , "*/*" )}, opts ... )
9998 if chatID == "" {
10099 err = errors .New ("missing required chatID parameter" )
101100 return
102101 }
103102 path := fmt .Sprintf ("v1/chats/%s/archive" , chatID )
104- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , nil , opts ... )
103+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
105104 return
106105}
107106
@@ -135,10 +134,6 @@ type Chat struct {
135134 ID string `json:"id,required"`
136135 // Account ID this chat belongs to.
137136 AccountID string `json:"accountID,required"`
138- // Display-only human-readable network name (e.g., 'WhatsApp', 'Messenger').
139- //
140- // Deprecated: deprecated
141- Network string `json:"network,required"`
142137 // Chat participants information.
143138 Participants ChatParticipants `json:"participants,required"`
144139 // Display title of the chat as computed by the client/server.
@@ -165,7 +160,6 @@ type Chat struct {
165160 JSON struct {
166161 ID respjson.Field
167162 AccountID respjson.Field
168- Network respjson.Field
169163 Participants respjson.Field
170164 Title respjson.Field
171165 Type respjson.Field
@@ -254,6 +248,25 @@ func (r *ChatListResponse) UnmarshalJSON(data []byte) error {
254248 return apijson .UnmarshalRoot (data , r )
255249}
256250
251+ type ChatArchiveResponse struct {
252+ // Indicates the operation completed successfully
253+ //
254+ // Any of true.
255+ Success bool `json:"success,required"`
256+ // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
257+ JSON struct {
258+ Success respjson.Field
259+ ExtraFields map [string ]respjson.Field
260+ raw string
261+ } `json:"-"`
262+ }
263+
264+ // Returns the unmodified JSON received from the API
265+ func (r ChatArchiveResponse ) RawJSON () string { return r .JSON .raw }
266+ func (r * ChatArchiveResponse ) UnmarshalJSON (data []byte ) error {
267+ return apijson .UnmarshalRoot (data , r )
268+ }
269+
257270type ChatNewParams struct {
258271 // Account to create the chat on.
259272 AccountID string `json:"accountID,required"`
0 commit comments