conversations.mjs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. import { APIResource } from "../../core/resource.mjs";
  3. import * as ItemsAPI from "./items.mjs";
  4. import { Items, } from "./items.mjs";
  5. import { path } from "../../internal/utils/path.mjs";
  6. export class Conversations extends APIResource {
  7. constructor() {
  8. super(...arguments);
  9. this.items = new ItemsAPI.Items(this._client);
  10. }
  11. /**
  12. * Create a conversation.
  13. */
  14. create(body = {}, options) {
  15. return this._client.post('/conversations', { body, ...options });
  16. }
  17. /**
  18. * Get a conversation
  19. */
  20. retrieve(conversationID, options) {
  21. return this._client.get(path `/conversations/${conversationID}`, options);
  22. }
  23. /**
  24. * Update a conversation
  25. */
  26. update(conversationID, body, options) {
  27. return this._client.post(path `/conversations/${conversationID}`, { body, ...options });
  28. }
  29. /**
  30. * Delete a conversation. Items in the conversation will not be deleted.
  31. */
  32. delete(conversationID, options) {
  33. return this._client.delete(path `/conversations/${conversationID}`, options);
  34. }
  35. }
  36. Conversations.Items = Items;
  37. //# sourceMappingURL=conversations.mjs.map