Skip to content

Commit

Permalink
update sideconversation
Browse files Browse the repository at this point in the history
  • Loading branch information
onhate committed Dec 29, 2023
1 parent 43cbcf1 commit ff38357
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/clients/core/sideconversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ const {ApiTypes} = require('../../constants');
* @property {Object.<string, string>} [external_ids] - A key-value object where all values are strings. Used for message metadata
*/

/**
* @typedef {object} UpdateSideConversation
* @property {string} [subject] - The subject of the side conversation
* @property {'open' | 'closed'} [state] - A plain text string describing the side conversation
*/

/**
* @typedef {object} SideConversation
* @property {string} created_at - The time the side conversation was created
Expand Down Expand Up @@ -103,6 +109,23 @@ class SideConversations extends Client {
);
}

/**
* Update to a Side Conversation.
* @param {number} ticketId - The ID of the ticket.
* @param {string} sideConversationId - The ID of the side conversation.
* @param {{side_conversation: Partial<UpdateSideConversation>}} update - The update object.
* @returns {Promise<{result: SideConversationResponse}>} The updated ticket details.
* @async
* @throws {Error} If the details are not provided or invalid.
* @see https://developer.zendesk.com/api-reference/ticketing/side_conversation/side_conversation/#update-side-conversation
*/
async update(ticketId, sideConversationId, update) {
return this.put(
['tickets', ticketId, 'side_conversations', sideConversationId],
update,
);
}

/**
* List all the Side Conversations tickets.
* @param ticketID
Expand Down

0 comments on commit ff38357

Please sign in to comment.