conversations.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. "use strict";
  2. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  3. Object.defineProperty(exports, "__esModule", { value: true });
  4. exports.Conversations = void 0;
  5. const tslib_1 = require("../../internal/tslib.js");
  6. const resource_1 = require("../../core/resource.js");
  7. const ItemsAPI = tslib_1.__importStar(require("./items.js"));
  8. const items_1 = require("./items.js");
  9. const path_1 = require("../../internal/utils/path.js");
  10. class Conversations extends resource_1.APIResource {
  11. constructor() {
  12. super(...arguments);
  13. this.items = new ItemsAPI.Items(this._client);
  14. }
  15. /**
  16. * Create a conversation.
  17. */
  18. create(body = {}, options) {
  19. return this._client.post('/conversations', { body, ...options });
  20. }
  21. /**
  22. * Get a conversation
  23. */
  24. retrieve(conversationID, options) {
  25. return this._client.get((0, path_1.path) `/conversations/${conversationID}`, options);
  26. }
  27. /**
  28. * Update a conversation
  29. */
  30. update(conversationID, body, options) {
  31. return this._client.post((0, path_1.path) `/conversations/${conversationID}`, { body, ...options });
  32. }
  33. /**
  34. * Delete a conversation. Items in the conversation will not be deleted.
  35. */
  36. delete(conversationID, options) {
  37. return this._client.delete((0, path_1.path) `/conversations/${conversationID}`, options);
  38. }
  39. }
  40. exports.Conversations = Conversations;
  41. Conversations.Items = items_1.Items;
  42. //# sourceMappingURL=conversations.js.map