-
Notifications
You must be signed in to change notification settings - Fork 4
/
v1.d.ts
734 lines (734 loc) · 31.7 KB
/
v1.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
/// <reference types="node" />
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace businessmessages_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Business Messages API
*
*
*
* @example
* ```js
* const {google} = require('googleapis');
* const businessmessages = google.businessmessages('v1');
* ```
*/
export class Businessmessages {
context: APIRequestContext;
conversations: Resource$Conversations;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* Request to authenticate a conversation.
*/
export interface Schema$BusinessMessagesAuthenticationRequest {
/**
* Details for authentication via OAuth.
*/
oauth?: Schema$BusinessMessagesAuthenticationRequestOauth;
}
/**
* Details for authentication via OAuth.
*/
export interface Schema$BusinessMessagesAuthenticationRequestOauth {
/**
* Required. The [ID](https://www.oauth.com/oauth2-servers/client-registration/client-id-secret/) of the application that asks for authorization.
*/
clientId?: string | null;
/**
* Required. The [code challenge](https://tools.ietf.org/html/rfc7636#section-4.2) used to exchange access tokens.
*/
codeChallenge?: string | null;
/**
* Optional. The [code challenge method](https://www.oauth.com/oauth2-servers/pkce/authorization-request/) used to generate the code challenge. If this parameter is omitted, the server assumes `plain`.
*/
codeChallengeMethod?: string | null;
/**
* Required. An array that specifies the [scopes](https://oauth.net/2/scope/) of the request.
*/
scopes?: string[] | null;
}
/**
* Card content.
*/
export interface Schema$BusinessMessagesCardContent {
/**
* Optional. Description of the card. Maximum 2000 characters.
*/
description?: string | null;
/**
* Optional. Media to include in the card.
*/
media?: Schema$BusinessMessagesMedia;
/**
* Optional. List of suggestions to include in the card. Maximum 4 suggestions.
*/
suggestions?: Schema$BusinessMessagesSuggestion[];
/**
* Optional. Title of the card. Maximum 200 characters.
*/
title?: string | null;
}
/**
* Carousel of cards.
*/
export interface Schema$BusinessMessagesCarouselCard {
/**
* The list of contents for each card in the carousel. A carousel can have a minimum of 2 cards and a maximum 10 cards.
*/
cardContents?: Schema$BusinessMessagesCardContent[];
/**
* The width of the cards in the carousel.
*/
cardWidth?: string | null;
}
/**
* Message containing the content information.
*/
export interface Schema$BusinessMessagesContentInfo {
/**
* Text describing the details about the media for accessibility purposes.
*/
altText?: string | null;
/**
* Publicly reachable URL of the file. The platform determines the MIME type of the file from the content-type field in the HTTP headers when the platform fetches the file. The content-type field must be present and accurate in the HTTP response from the URL. Maximum 5 MB. Supported content types: image/jpeg, image/jpg, image/png
*/
fileUrl?: string | null;
/**
* If set, the platform fetches the file and thumbnail from the specified URLs, even if the platform has cached copies of the file (and/or of the thumbnail).
*/
forceRefresh?: boolean | null;
/**
* Optional. Publicly reachable URL of the thumbnail. If you don't provide a thumbnail URL, the platform displays a blank placeholder thumbnail until the user's device downloads the file. Maximum 25 KB. Supported content types: image/jpeg, image/jpg, image/png
*/
thumbnailUrl?: string | null;
}
/**
* Opens the user's default dialer app with the specified phone number filled in.
*/
export interface Schema$BusinessMessagesDialAction {
/**
* Required. The specified phone number, in [RFC 3966](https://tools.ietf.org/html/rfc3966) format. For example, "+1-201-555-0123".
*/
phoneNumber?: string | null;
}
/**
* An event in a conversation between an agent and a user.
*/
export interface Schema$BusinessMessagesEvent {
/**
* The type of the event.
*/
eventType?: string | null;
/**
* The name of the event, as set by Business Messages. Resolves to "conversations/{conversationId\}/events/{eventId\}", where {conversationId\} is the unique ID for the conversation and {eventId\} is the unique ID for the event.
*/
name?: string | null;
/**
* Details about the representative (human or chatbot) that sent the event.
*/
representative?: Schema$BusinessMessagesRepresentative;
}
/**
* An image.
*/
export interface Schema$BusinessMessagesImage {
/**
* Information about an image, including the URL of the image and the URL of the image's thumbnail.
*/
contentInfo?: Schema$BusinessMessagesContentInfo;
}
/**
* When tapped, sends a request for a live agent to join the conversation.
*/
export interface Schema$BusinessMessagesLiveAgentRequest {
}
/**
* A media file within a rich card.
*/
export interface Schema$BusinessMessagesMedia {
/**
* Information about a file, including the URL of the file and the URL of the file's thumbnail.
*/
contentInfo?: Schema$BusinessMessagesContentInfo;
/**
* The height of the media within a rich card.
*/
height?: string | null;
}
/**
* A message in a conversation between an agent and a user.
*/
export interface Schema$BusinessMessagesMessage {
/**
* Optional. If `true`, indicates that the message contains rich text. If the message contains invalid formatting, Business Messages returns an error.
*/
containsRichText?: boolean | null;
/**
* Optional. Fallback text that displays if the user's device doesn't support the message type or content.
*/
fallback?: string | null;
/**
* Image message.
*/
image?: Schema$BusinessMessagesImage;
/**
* Required. The unique identifier of the message, assigned by the agent. If a message attempts to use the same `messageId` as a previous message, Business Messages returns an `ALREADY_EXISTS` error.
*/
messageId?: string | null;
/**
* The name of the message, as set by Business Messages. Resolves to "conversations/{conversationId\}/messages/{messageId\}", where {conversationId\} is the unique ID for the conversation and {messageId\} is the unique ID for the message.
*/
name?: string | null;
/**
* Details about the representative (human or chatbot) that sent the message.
*/
representative?: Schema$BusinessMessagesRepresentative;
/**
* Rich Card message.
*/
richCard?: Schema$BusinessMessagesRichCard;
/**
* A list of suggested replies that appear as a list of suggestion chips following the associated message. Maximum 13 suggestions. The chips only display when the associated message is the most recent message within the conversation (including both agent and user messages). The user can tap a suggested reply to send the text reply to the agent.
*/
suggestions?: Schema$BusinessMessagesSuggestion[];
/**
* Text message.
*/
text?: string | null;
}
/**
* Opens the specified URL.
*/
export interface Schema$BusinessMessagesOpenUrlAction {
/**
* URL
*/
url?: string | null;
}
/**
* A receipt of the message.
*/
export interface Schema$BusinessMessagesReceipt {
/**
* The name of the receipt, as set by Business Messages. Resolves to "conversations/{conversationId\}/messages/{messageId\}/receipt", where {conversationId\} is the unique ID for the conversation and {messageId\} is the unique ID for the message.
*/
name?: string | null;
/**
* A receipt type.
*/
receiptType?: string | null;
}
/**
* Details about the representative (human or chatbot) that sent the message.
*/
export interface Schema$BusinessMessagesRepresentative {
/**
* Optional. The representative's avatar image, as a publicly available URL. Displays as a circle. Avatar images don't support personal information, such as depictions of representatives in photographs or illustrations. Use images that don't identify individuals, such as icons, logos, or fictitious illustrations. After an avatar image is used in a message, the image can't be modified or deleted. Images must be 1024x1024 px and have a maximum files size of 50 KB.
*/
avatarImage?: string | null;
/**
* Optional. Name of the representative.
*/
displayName?: string | null;
/**
* Required. The type of representative.
*/
representativeType?: string | null;
}
/**
* A standalone rich card or a carousel of rich cards sent from the agent to the user.
*/
export interface Schema$BusinessMessagesRichCard {
/**
* Carousel of cards.
*/
carouselCard?: Schema$BusinessMessagesCarouselCard;
/**
* Standalone card.
*/
standaloneCard?: Schema$BusinessMessagesStandaloneCard;
}
/**
* Standalone card.
*/
export interface Schema$BusinessMessagesStandaloneCard {
/**
* Card content.
*/
cardContent?: Schema$BusinessMessagesCardContent;
}
/**
* When tapped, initiates the corresponding native action on the device.
*/
export interface Schema$BusinessMessagesSuggestedAction {
/**
* Opens the user's default dialer app.
*/
dialAction?: Schema$BusinessMessagesDialAction;
/**
* Opens the specified URL.
*/
openUrlAction?: Schema$BusinessMessagesOpenUrlAction;
/**
* The string that the agent receives when a user taps the suggested action.
*/
postbackData?: string | null;
/**
* Text that is shown in the suggested action. Maximum 25 characters.
*/
text?: string | null;
}
/**
* When tapped, sends the text reply back to the agent.
*/
export interface Schema$BusinessMessagesSuggestedReply {
/**
* The string that the agent receives when a user taps the suggested reply.
*/
postbackData?: string | null;
/**
* Text that is shown in the suggested reply and sent to the agent when the user taps it. Maximum 25 characters.
*/
text?: string | null;
}
/**
* A suggestion within a chip list.
*/
export interface Schema$BusinessMessagesSuggestion {
/**
* A suggested action that initiates a native action on the device.
*/
action?: Schema$BusinessMessagesSuggestedAction;
/**
* A request to start authentication flow.
*/
authenticationRequest?: Schema$BusinessMessagesAuthenticationRequest;
/**
* A request to have a live agent join the conversation.
*/
liveAgentRequest?: Schema$BusinessMessagesLiveAgentRequest;
/**
* A suggestion for the user to reply with specified text.
*/
reply?: Schema$BusinessMessagesSuggestedReply;
}
/**
* A survey to measure customer satisfaction.
*/
export interface Schema$BusinessMessagesSurvey {
/**
* The name of the survey, as set by Business Messages. Resolves to "conversations/{conversationId\}/surveys/{surveyId\}", where {conversationId\} is the unique ID for the conversation and {surveyId\} is the unique ID for the survey.
*/
name?: string | null;
}
export class Resource$Conversations {
context: APIRequestContext;
events: Resource$Conversations$Events;
messages: Resource$Conversations$Messages;
surveys: Resource$Conversations$Surveys;
constructor(context: APIRequestContext);
}
export class Resource$Conversations$Events {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Creates an event in a conversation.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/businessmessages.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const businessmessages = google.businessmessages('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await businessmessages.conversations.events.create({
* // The unique identifier of the event, assigned by the agent. If an event has the same `eventId` as a previous event in the conversation, Business Messages returns an `ALREADY_EXISTS` error.
* eventId: 'placeholder-value',
* // Required. The conversation that contains the message. Resolves to "conversations/{conversationId\}".
* parent: 'conversations/my-conversation',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "name": "my_name",
* // "eventType": "my_eventType",
* // "representative": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name",
* // "eventType": "my_eventType",
* // "representative": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Conversations$Events$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Conversations$Events$Create, options?: MethodOptions): GaxiosPromise<Schema$BusinessMessagesEvent>;
create(params: Params$Resource$Conversations$Events$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Conversations$Events$Create, options: MethodOptions | BodyResponseCallback<Schema$BusinessMessagesEvent>, callback: BodyResponseCallback<Schema$BusinessMessagesEvent>): void;
create(params: Params$Resource$Conversations$Events$Create, callback: BodyResponseCallback<Schema$BusinessMessagesEvent>): void;
create(callback: BodyResponseCallback<Schema$BusinessMessagesEvent>): void;
}
export interface Params$Resource$Conversations$Events$Create extends StandardParameters {
/**
* The unique identifier of the event, assigned by the agent. If an event has the same `eventId` as a previous event in the conversation, Business Messages returns an `ALREADY_EXISTS` error.
*/
eventId?: string;
/**
* Required. The conversation that contains the message. Resolves to "conversations/{conversationId\}".
*/
parent?: string;
/**
* Request body metadata
*/
requestBody?: Schema$BusinessMessagesEvent;
}
export class Resource$Conversations$Messages {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Sends a message from an agent to a user. If a conversation doesn't exist or an agent tries to send a message in a conversation that it isn't authorized to participate in, returns a `PERMISSION DENIED` error.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/businessmessages.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const businessmessages = google.businessmessages('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await businessmessages.conversations.messages.create({
* // Optional. A flag to send the specified fallback text instead of other message content. Only available to agents that aren't launched. If the flag is true and fallback text isn't specified, Business Messages returns an error.
* forceFallback: 'placeholder-value',
* // Required. The conversation that contains the message. Resolves to "conversations/{conversationId\}".
* parent: 'conversations/my-conversation',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "name": "my_name",
* // "messageId": "my_messageId",
* // "text": "my_text",
* // "image": {},
* // "richCard": {},
* // "representative": {},
* // "suggestions": [],
* // "fallback": "my_fallback",
* // "containsRichText": false
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name",
* // "messageId": "my_messageId",
* // "text": "my_text",
* // "image": {},
* // "richCard": {},
* // "representative": {},
* // "suggestions": [],
* // "fallback": "my_fallback",
* // "containsRichText": false
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Conversations$Messages$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Conversations$Messages$Create, options?: MethodOptions): GaxiosPromise<Schema$BusinessMessagesMessage>;
create(params: Params$Resource$Conversations$Messages$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Conversations$Messages$Create, options: MethodOptions | BodyResponseCallback<Schema$BusinessMessagesMessage>, callback: BodyResponseCallback<Schema$BusinessMessagesMessage>): void;
create(params: Params$Resource$Conversations$Messages$Create, callback: BodyResponseCallback<Schema$BusinessMessagesMessage>): void;
create(callback: BodyResponseCallback<Schema$BusinessMessagesMessage>): void;
/**
* Sends a receipt for a message from an agent to a user.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/businessmessages.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const businessmessages = google.businessmessages('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await businessmessages.conversations.messages.updateReceipt({
* // The name of the receipt, as set by Business Messages. Resolves to "conversations/{conversationId\}/messages/{messageId\}/receipt", where {conversationId\} is the unique ID for the conversation and {messageId\} is the unique ID for the message.
* name: 'conversations/my-conversation/messages/my-message/receipt',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "name": "my_name",
* // "receiptType": "my_receiptType"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name",
* // "receiptType": "my_receiptType"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
updateReceipt(params: Params$Resource$Conversations$Messages$Updatereceipt, options: StreamMethodOptions): GaxiosPromise<Readable>;
updateReceipt(params?: Params$Resource$Conversations$Messages$Updatereceipt, options?: MethodOptions): GaxiosPromise<Schema$BusinessMessagesReceipt>;
updateReceipt(params: Params$Resource$Conversations$Messages$Updatereceipt, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
updateReceipt(params: Params$Resource$Conversations$Messages$Updatereceipt, options: MethodOptions | BodyResponseCallback<Schema$BusinessMessagesReceipt>, callback: BodyResponseCallback<Schema$BusinessMessagesReceipt>): void;
updateReceipt(params: Params$Resource$Conversations$Messages$Updatereceipt, callback: BodyResponseCallback<Schema$BusinessMessagesReceipt>): void;
updateReceipt(callback: BodyResponseCallback<Schema$BusinessMessagesReceipt>): void;
}
export interface Params$Resource$Conversations$Messages$Create extends StandardParameters {
/**
* Optional. A flag to send the specified fallback text instead of other message content. Only available to agents that aren't launched. If the flag is true and fallback text isn't specified, Business Messages returns an error.
*/
forceFallback?: boolean;
/**
* Required. The conversation that contains the message. Resolves to "conversations/{conversationId\}".
*/
parent?: string;
/**
* Request body metadata
*/
requestBody?: Schema$BusinessMessagesMessage;
}
export interface Params$Resource$Conversations$Messages$Updatereceipt extends StandardParameters {
/**
* The name of the receipt, as set by Business Messages. Resolves to "conversations/{conversationId\}/messages/{messageId\}/receipt", where {conversationId\} is the unique ID for the conversation and {messageId\} is the unique ID for the message.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$BusinessMessagesReceipt;
}
export class Resource$Conversations$Surveys {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Creates a customer satisfaction survey in a conversation. If an agent sends multiple surveys in the same conversation within 24 hours, surveys after the first return a `RESOURCE_EXHAUSTED` error. If the client doesn't support the survey feature, survey returns a `FAILED_PRECONDITION` error.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/businessmessages.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const businessmessages = google.businessmessages('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await businessmessages.conversations.surveys.create({
* // Required. The conversation that contains the survey. Resolves to "conversations/{conversationId\}".
* parent: 'conversations/my-conversation',
* // The unique identifier of the survey, assigned by the agent. If a survey attempts to use the same `surveyId` as a previous survey, Business Messages returns an `ALREADY_EXISTS` error.
* surveyId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "name": "my_name"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Conversations$Surveys$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Conversations$Surveys$Create, options?: MethodOptions): GaxiosPromise<Schema$BusinessMessagesSurvey>;
create(params: Params$Resource$Conversations$Surveys$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Conversations$Surveys$Create, options: MethodOptions | BodyResponseCallback<Schema$BusinessMessagesSurvey>, callback: BodyResponseCallback<Schema$BusinessMessagesSurvey>): void;
create(params: Params$Resource$Conversations$Surveys$Create, callback: BodyResponseCallback<Schema$BusinessMessagesSurvey>): void;
create(callback: BodyResponseCallback<Schema$BusinessMessagesSurvey>): void;
}
export interface Params$Resource$Conversations$Surveys$Create extends StandardParameters {
/**
* Required. The conversation that contains the survey. Resolves to "conversations/{conversationId\}".
*/
parent?: string;
/**
* The unique identifier of the survey, assigned by the agent. If a survey attempts to use the same `surveyId` as a previous survey, Business Messages returns an `ALREADY_EXISTS` error.
*/
surveyId?: string;
/**
* Request body metadata
*/
requestBody?: Schema$BusinessMessagesSurvey;
}
export {};
}