Skip to content

Commit 16ee21a

Browse files
committed
Manually update types to not wrap body params in a body property
1 parent 17630a1 commit 16ee21a

File tree

13 files changed

+194
-294
lines changed

13 files changed

+194
-294
lines changed

src/api/resources/articles/client/Client.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,17 +350,15 @@ export class Articles {
350350
* @example
351351
* await client.articles.update({
352352
* article_id: "123",
353-
* body: {
354-
* title: "Christmas is here!",
355-
* body: "<p>New gifts in store for the jolly season</p>"
356-
* }
353+
* title: "Christmas is here!",
354+
* body: "<p>New gifts in store for the jolly season</p>"
357355
* })
358356
*/
359357
public async update(
360358
request: Intercom.UpdateArticleRequest,
361359
requestOptions?: Articles.RequestOptions
362360
): Promise<Intercom.Article> {
363-
const { article_id: articleId, body: _body } = request;
361+
const { article_id: articleId, ..._body } = request;
364362
const _response = await (this._options.fetcher ?? core.fetcher)({
365363
url: urlJoin(
366364
(await core.Supplier.get(this._options.environment)) ?? environments.IntercomEnvironment.UsProduction,

src/api/resources/articles/client/requests/UpdateArticleRequest.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,13 @@ import * as Intercom from "../../../../index";
88
* @example
99
* {
1010
* article_id: "123",
11-
* body: {
12-
* title: "Christmas is here!",
13-
* body: "<p>New gifts in store for the jolly season</p>"
14-
* }
15-
* }
16-
*
17-
* @example
18-
* {
19-
* article_id: "123",
20-
* body: {
21-
* title: "Christmas is here!",
22-
* body: "<p>New gifts in store for the jolly season</p>"
23-
* }
11+
* title: "Christmas is here!",
12+
* body: "<p>New gifts in store for the jolly season</p>"
2413
* }
2514
*/
26-
export interface UpdateArticleRequest {
15+
export type UpdateArticleRequest = {
2716
/**
2817
* The unique identifier for the article which is given by Intercom.
2918
*/
3019
article_id: string;
31-
body?: Intercom.UpdateArticleRequestBody;
32-
}
20+
} & Intercom.UpdateArticleRequestBody;

src/api/resources/conversations/client/Client.ts

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -658,52 +658,44 @@ export class Conversations {
658658
* @example
659659
* await client.conversations.reply({
660660
* conversation_id: "123 or \"last\"",
661-
* body: {
662-
* message_type: "comment",
663-
* type: "user",
664-
* body: "Thanks again :)",
665-
* intercom_user_id: "667d60f18a68186f43bafdf4"
666-
* }
661+
* message_type: "comment",
662+
* type: "user",
663+
* body: "Thanks again :)",
664+
* intercom_user_id: "667d60f18a68186f43bafdf4"
667665
* })
668666
*
669667
* @example
670668
* await client.conversations.reply({
671669
* conversation_id: "123 or \"last\"",
672-
* body: {
673-
* message_type: "note",
674-
* type: "admin",
675-
* body: "<html> <body> <h2>An Unordered HTML List</h2> <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> <h2>An Ordered HTML List</h2> <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> </body> </html>",
676-
* admin_id: "3156780"
677-
* }
670+
* message_type: "note",
671+
* type: "admin",
672+
* body: "<html> <body> <h2>An Unordered HTML List</h2> <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> <h2>An Ordered HTML List</h2> <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> </body> </html>",
673+
* admin_id: "3156780"
678674
* })
679675
*
680676
* @example
681677
* await client.conversations.reply({
682678
* conversation_id: "123 or \"last\"",
683-
* body: {
684-
* message_type: "comment",
685-
* type: "user",
686-
* body: "Thanks again :)",
687-
* intercom_user_id: "667d60f78a68186f43bafdf7"
688-
* }
679+
* message_type: "comment",
680+
* type: "user",
681+
* body: "Thanks again :)",
682+
* intercom_user_id: "667d60f78a68186f43bafdf7"
689683
* })
690684
*
691685
* @example
692686
* await client.conversations.reply({
693687
* conversation_id: "123 or \"last\"",
694-
* body: {
695-
* message_type: "comment",
696-
* type: "user",
697-
* body: "Thanks again :)",
698-
* intercom_user_id: "667d60f98a68186f43bafdf8"
699-
* }
688+
* message_type: "comment",
689+
* type: "user",
690+
* body: "Thanks again :)",
691+
* intercom_user_id: "667d60f98a68186f43bafdf8"
700692
* })
701693
*/
702694
public async reply(
703695
request: Intercom.ReplyToConversationRequest,
704696
requestOptions?: Conversations.RequestOptions
705697
): Promise<Intercom.Conversation> {
706-
const { conversation_id: conversationId, body: _body } = request;
698+
const { conversation_id: conversationId, ..._body } = request;
707699
const _response = await (this._options.fetcher ?? core.fetcher)({
708700
url: urlJoin(
709701
(await core.Supplier.get(this._options.environment)) ?? environments.IntercomEnvironment.UsProduction,
@@ -781,32 +773,29 @@ export class Conversations {
781773
* @example
782774
* await client.conversations.manage({
783775
* conversation_id: "123",
784-
* body: {
785-
* message_type: "assignment",
786-
* type: "admin",
787-
* admin_id: "12345",
788-
* assignee_id: "4324241",
789-
* body: "Goodbye :)"
790-
* }
776+
* message_type: "assignment",
777+
* type: "admin",
778+
* admin_id: "12345",
779+
* assignee_id: "4324241",
780+
* body: "Goodbye :)"
791781
* })
792782
*
793783
* @example
794784
* await client.conversations.manage({
795785
* conversation_id: "123",
796-
* body: {
797-
* message_type: "assignment",
798-
* type: "admin",
799-
* admin_id: "12345",
800-
* assignee_id: "4324241",
801-
* body: "Let me pass you over to one of my colleagues."
802-
* }
786+
* message_type: "assignment",
787+
* type: "admin",
788+
* admin_id: "12345",
789+
* assignee_id: "4324241",
790+
* body: "Let me pass you over to one of my colleagues."
791+
* })
803792
* })
804793
*/
805794
public async manage(
806795
request: Intercom.ManageConversationPartsRequest,
807796
requestOptions?: Conversations.RequestOptions
808797
): Promise<Intercom.Conversation> {
809-
const { conversation_id: conversationId, body: _body } = request;
798+
const { conversation_id: conversationId, ..._body } = request;
810799
const _response = await (this._options.fetcher ?? core.fetcher)({
811800
url: urlJoin(
812801
(await core.Supplier.get(this._options.environment)) ?? environments.IntercomEnvironment.UsProduction,

src/api/resources/conversations/client/requests/ManageConversationPartsRequest.ts

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,56 @@ import * as Intercom from "../../../../index";
88
* @example
99
* {
1010
* conversation_id: "123",
11-
* body: {
12-
* message_type: "assignment",
13-
* type: "admin",
14-
* admin_id: "12345",
15-
* assignee_id: "4324241",
16-
* body: "Goodbye :)"
17-
* }
11+
* message_type: "assignment",
12+
* type: "admin",
13+
* admin_id: "12345",
14+
* assignee_id: "4324241",
15+
* body: "Goodbye :)"
1816
* }
1917
*
2018
* @example
2119
* {
2220
* conversation_id: "123",
23-
* body: {
24-
* message_type: "assignment",
25-
* type: "admin",
26-
* admin_id: "12345",
27-
* assignee_id: "4324241",
28-
* body: "Let me pass you over to one of my colleagues."
29-
* }
21+
* message_type: "assignment",
22+
* type: "admin",
23+
* admin_id: "12345",
24+
* assignee_id: "4324241",
25+
* body: "Let me pass you over to one of my colleagues."
3026
* }
3127
*
3228
* @example
3329
* {
3430
* conversation_id: "123",
35-
* body: {
36-
* message_type: "assignment",
37-
* type: "admin",
38-
* admin_id: "12345",
39-
* assignee_id: "4324241",
40-
* body: "Let me pass you over to one of my colleagues."
41-
* }
31+
* message_type: "assignment",
32+
* type: "admin",
33+
* admin_id: "12345",
34+
* assignee_id: "4324241",
35+
* body: "Let me pass you over to one of my colleagues."
4236
* }
4337
*
4438
* @example
4539
* {
4640
* conversation_id: "123",
47-
* body: {
48-
* message_type: "assignment",
49-
* type: "admin",
50-
* admin_id: "12345",
51-
* assignee_id: "4324241",
52-
* body: "Let me pass you over to one of my colleagues."
53-
* }
41+
* message_type: "assignment",
42+
* type: "admin",
43+
* admin_id: "12345",
44+
* assignee_id: "4324241",
45+
* body: "Let me pass you over to one of my colleagues."
5446
* }
5547
*
5648
* @example
5749
* {
5850
* conversation_id: "123",
59-
* body: {
60-
* message_type: "assignment",
61-
* type: "admin",
62-
* admin_id: "12345",
63-
* assignee_id: "4324241",
64-
* body: "Goodbye :)"
65-
* }
51+
* message_type: "assignment",
52+
* type: "admin",
53+
* admin_id: "12345",
54+
* assignee_id: "4324241",
55+
* body: "Goodbye :)"
6656
* }
6757
*/
68-
export interface ManageConversationPartsRequest {
58+
export type ManageConversationPartsRequest = {
6959
/**
7060
* The identifier for the conversation as given by Intercom.
7161
*/
7262
conversation_id: string;
73-
body: Intercom.ConversationsManageRequestBody;
74-
}
63+
} & Intercom.ConversationsManageRequestBody;

src/api/resources/conversations/client/requests/ReplyToConversationRequest.ts

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,84 +8,69 @@ import * as Intercom from "../../../../index";
88
* @example
99
* {
1010
* conversation_id: "123 or \"last\"",
11-
* body: {
12-
* message_type: "comment",
13-
* type: "user",
14-
* body: "Thanks again :)",
15-
* intercom_user_id: "667d60f18a68186f43bafdf4"
16-
* }
11+
* message_type: "comment",
12+
* type: "user",
13+
* body: "Thanks again :)",
14+
* intercom_user_id: "667d60f18a68186f43bafdf4"
1715
* }
1816
*
1917
* @example
2018
* {
2119
* conversation_id: "123 or \"last\"",
22-
* body: {
23-
* message_type: "note",
24-
* type: "admin",
25-
* body: "<html> <body> <h2>An Unordered HTML List</h2> <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> <h2>An Ordered HTML List</h2> <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> </body> </html>",
26-
* admin_id: "3156780"
27-
* }
20+
* message_type: "note",
21+
* type: "admin",
22+
* body: "<html> <body> <h2>An Unordered HTML List</h2> <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> <h2>An Ordered HTML List</h2> <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> </body> </html>",
23+
* admin_id: "3156780"
2824
* }
2925
*
3026
* @example
3127
* {
3228
* conversation_id: "123 or \"last\"",
33-
* body: {
34-
* message_type: "comment",
35-
* type: "user",
36-
* body: "Thanks again :)",
37-
* intercom_user_id: "667d60f78a68186f43bafdf7"
38-
* }
29+
* message_type: "comment",
30+
* type: "user",
31+
* body: "Thanks again :)",
32+
* intercom_user_id: "667d60f78a68186f43bafdf7"
3933
* }
4034
*
4135
* @example
4236
* {
4337
* conversation_id: "123 or \"last\"",
44-
* body: {
45-
* message_type: "comment",
46-
* type: "user",
47-
* body: "Thanks again :)",
48-
* intercom_user_id: "667d60f98a68186f43bafdf8"
49-
* }
38+
* message_type: "comment",
39+
* type: "user",
40+
* body: "Thanks again :)",
41+
* intercom_user_id: "667d60f98a68186f43bafdf8"
5042
* }
5143
*
5244
* @example
5345
* {
5446
* conversation_id: "123 or \"last\"",
55-
* body: {
56-
* message_type: "comment",
57-
* type: "user",
58-
* body: "Thanks again :)",
59-
* intercom_user_id: "667d60f18a68186f43bafdf4"
60-
* }
47+
* message_type: "comment",
48+
* type: "user",
49+
* body: "Thanks again :)",
50+
* intercom_user_id: "667d60f18a68186f43bafdf4"
6151
* }
6252
*
6353
* @example
6454
* {
6555
* conversation_id: "123 or \"last\"",
66-
* body: {
67-
* message_type: "comment",
68-
* type: "user",
69-
* body: "Thanks again :)",
70-
* intercom_user_id: "667d60f18a68186f43bafdf4"
71-
* }
56+
* message_type: "comment",
57+
* type: "user",
58+
* body: "Thanks again :)",
59+
* intercom_user_id: "667d60f18a68186f43bafdf4"
7260
* }
7361
*
7462
* @example
7563
* {
7664
* conversation_id: "123 or \"last\"",
77-
* body: {
78-
* message_type: "comment",
79-
* type: "user",
80-
* body: "Thanks again :)",
81-
* intercom_user_id: "667d60f18a68186f43bafdf4"
82-
* }
65+
* message_type: "comment",
66+
* type: "user",
67+
* body: "Thanks again :)",
68+
* intercom_user_id: "667d60f18a68186f43bafdf4"
8369
* }
8470
*/
85-
export interface ReplyToConversationRequest {
71+
export type ReplyToConversationRequest = {
8672
/**
8773
* The Intercom provisioned identifier for the conversation or the string "last" to reply to the last part of the conversation
8874
*/
8975
conversation_id: string;
90-
body: Intercom.ReplyConversationRequest;
91-
}
76+
} & Intercom.ReplyConversationRequest;

0 commit comments

Comments
 (0)