twilio 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest/Assistants.d.ts +4 -0
- package/lib/rest/Assistants.js +8 -0
- package/lib/rest/AssistantsBase.d.ts +13 -0
- package/lib/rest/AssistantsBase.js +31 -0
- package/lib/rest/Twilio.d.ts +5 -0
- package/lib/rest/Twilio.js +6 -0
- package/lib/rest/assistants/V1.d.ts +35 -0
- package/lib/rest/assistants/V1.js +60 -0
- package/lib/rest/assistants/v1/assistant/feedback.d.ts +231 -0
- package/lib/rest/assistants/v1/assistant/feedback.js +161 -0
- package/lib/rest/assistants/v1/assistant.d.ts +466 -0
- package/lib/rest/assistants/v1/assistant.js +284 -0
- package/lib/rest/assistants/v1/knowledge/chunk.d.ts +167 -0
- package/lib/rest/assistants/v1/knowledge/chunk.js +130 -0
- package/lib/rest/assistants/v1/knowledge.d.ts +385 -0
- package/lib/rest/assistants/v1/knowledge.js +273 -0
- package/lib/rest/assistants/v1/policy.d.ts +202 -0
- package/lib/rest/assistants/v1/policy.js +138 -0
- package/lib/rest/assistants/v1/session/message.d.ts +197 -0
- package/lib/rest/assistants/v1/session/message.js +140 -0
- package/lib/rest/assistants/v1/session.d.ts +231 -0
- package/lib/rest/assistants/v1/session.js +194 -0
- package/lib/rest/assistants/v1/tool.d.ts +378 -0
- package/lib/rest/assistants/v1/tool.js +242 -0
- package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
- package/lib/rest/content/v1/content/approvalFetch.js +14 -14
- package/lib/rest/intelligence/v2/operatorType.d.ts +1 -1
- package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +12 -18
- package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +3 -6
- package/lib/rest/marketplace/v1/moduleDataManagement.d.ts +14 -6
- package/lib/rest/marketplace/v1/moduleDataManagement.js +4 -0
- package/lib/rest/numbers/v2/bundleClone.d.ts +1 -1
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const AssistantsBase_1 = __importDefault(require("./AssistantsBase"));
|
|
6
|
+
class Assistants extends AssistantsBase_1.default {
|
|
7
|
+
}
|
|
8
|
+
module.exports = Assistants;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Domain from "../base/Domain";
|
|
2
|
+
import V1 from "./assistants/V1";
|
|
3
|
+
declare class AssistantsBase extends Domain {
|
|
4
|
+
_v1?: V1;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize assistants domain
|
|
7
|
+
*
|
|
8
|
+
* @param twilio - The twilio client
|
|
9
|
+
*/
|
|
10
|
+
constructor(twilio: any);
|
|
11
|
+
get v1(): V1;
|
|
12
|
+
}
|
|
13
|
+
export = AssistantsBase;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
const Domain_1 = __importDefault(require("../base/Domain"));
|
|
16
|
+
const V1_1 = __importDefault(require("./assistants/V1"));
|
|
17
|
+
class AssistantsBase extends Domain_1.default {
|
|
18
|
+
/**
|
|
19
|
+
* Initialize assistants domain
|
|
20
|
+
*
|
|
21
|
+
* @param twilio - The twilio client
|
|
22
|
+
*/
|
|
23
|
+
constructor(twilio) {
|
|
24
|
+
super(twilio, "https://assistants.twilio.com");
|
|
25
|
+
}
|
|
26
|
+
get v1() {
|
|
27
|
+
this._v1 = this._v1 || new V1_1.default(this);
|
|
28
|
+
return this._v1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
module.exports = AssistantsBase;
|
package/lib/rest/Twilio.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Client, ClientOpts, RequestOpts } from "../base/BaseTwilio";
|
|
2
2
|
import Accounts from "./Accounts";
|
|
3
3
|
import Api from "./Api";
|
|
4
|
+
import Assistants from "./Assistants";
|
|
4
5
|
import Bulkexports from "./Bulkexports";
|
|
5
6
|
import Chat from "./Chat";
|
|
6
7
|
import Content from "./Content";
|
|
@@ -67,6 +68,8 @@ declare class Twilio extends Client {
|
|
|
67
68
|
_accounts?: Accounts;
|
|
68
69
|
/** (Twilio.Api) - api domain */
|
|
69
70
|
_api?: Api;
|
|
71
|
+
/** (Twilio.Assistants) - assistants domain */
|
|
72
|
+
_assistants?: Assistants;
|
|
70
73
|
/** (Twilio.Bulkexports) - bulkexports domain */
|
|
71
74
|
_bulkexports?: Bulkexports;
|
|
72
75
|
/** (Twilio.Chat) - chat domain */
|
|
@@ -151,6 +154,8 @@ declare class Twilio extends Client {
|
|
|
151
154
|
get accounts(): Accounts;
|
|
152
155
|
/** Getter for (Twilio.Api) domain */
|
|
153
156
|
get api(): Api;
|
|
157
|
+
/** Getter for (Twilio.Assistants) domain */
|
|
158
|
+
get assistants(): Assistants;
|
|
154
159
|
/** Getter for (Twilio.Bulkexports) domain */
|
|
155
160
|
get bulkexports(): Bulkexports;
|
|
156
161
|
/** Getter for (Twilio.Chat) domain */
|
package/lib/rest/Twilio.js
CHANGED
|
@@ -34,6 +34,7 @@ class Twilio extends BaseTwilio_1.Client {
|
|
|
34
34
|
if (this.opts?.lazyLoading === false) {
|
|
35
35
|
this.accounts;
|
|
36
36
|
this.api;
|
|
37
|
+
this.assistants;
|
|
37
38
|
this.bulkexports;
|
|
38
39
|
this.chat;
|
|
39
40
|
this.content;
|
|
@@ -79,6 +80,11 @@ class Twilio extends BaseTwilio_1.Client {
|
|
|
79
80
|
get api() {
|
|
80
81
|
return this._api ?? (this._api = new (require("./Api"))(this));
|
|
81
82
|
}
|
|
83
|
+
/** Getter for (Twilio.Assistants) domain */
|
|
84
|
+
get assistants() {
|
|
85
|
+
return (this._assistants ??
|
|
86
|
+
(this._assistants = new (require("./Assistants"))(this)));
|
|
87
|
+
}
|
|
82
88
|
/** Getter for (Twilio.Bulkexports) domain */
|
|
83
89
|
get bulkexports() {
|
|
84
90
|
return (this._bulkexports ??
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import AssistantsBase from "../AssistantsBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { AssistantListInstance } from "./v1/assistant";
|
|
4
|
+
import { KnowledgeListInstance } from "./v1/knowledge";
|
|
5
|
+
import { PolicyListInstance } from "./v1/policy";
|
|
6
|
+
import { SessionListInstance } from "./v1/session";
|
|
7
|
+
import { ToolListInstance } from "./v1/tool";
|
|
8
|
+
export default class V1 extends Version {
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the V1 version of Assistants
|
|
11
|
+
*
|
|
12
|
+
* @param domain - The Twilio (Twilio.Assistants) domain
|
|
13
|
+
*/
|
|
14
|
+
constructor(domain: AssistantsBase);
|
|
15
|
+
/** assistants - { Twilio.Assistants.V1.AssistantListInstance } resource */
|
|
16
|
+
protected _assistants?: AssistantListInstance;
|
|
17
|
+
/** knowledge - { Twilio.Assistants.V1.KnowledgeListInstance } resource */
|
|
18
|
+
protected _knowledge?: KnowledgeListInstance;
|
|
19
|
+
/** policies - { Twilio.Assistants.V1.PolicyListInstance } resource */
|
|
20
|
+
protected _policies?: PolicyListInstance;
|
|
21
|
+
/** sessions - { Twilio.Assistants.V1.SessionListInstance } resource */
|
|
22
|
+
protected _sessions?: SessionListInstance;
|
|
23
|
+
/** tools - { Twilio.Assistants.V1.ToolListInstance } resource */
|
|
24
|
+
protected _tools?: ToolListInstance;
|
|
25
|
+
/** Getter for assistants resource */
|
|
26
|
+
get assistants(): AssistantListInstance;
|
|
27
|
+
/** Getter for knowledge resource */
|
|
28
|
+
get knowledge(): KnowledgeListInstance;
|
|
29
|
+
/** Getter for policies resource */
|
|
30
|
+
get policies(): PolicyListInstance;
|
|
31
|
+
/** Getter for sessions resource */
|
|
32
|
+
get sessions(): SessionListInstance;
|
|
33
|
+
/** Getter for tools resource */
|
|
34
|
+
get tools(): ToolListInstance;
|
|
35
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Assistants
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
|
+
const assistant_1 = require("./v1/assistant");
|
|
21
|
+
const knowledge_1 = require("./v1/knowledge");
|
|
22
|
+
const policy_1 = require("./v1/policy");
|
|
23
|
+
const session_1 = require("./v1/session");
|
|
24
|
+
const tool_1 = require("./v1/tool");
|
|
25
|
+
class V1 extends Version_1.default {
|
|
26
|
+
/**
|
|
27
|
+
* Initialize the V1 version of Assistants
|
|
28
|
+
*
|
|
29
|
+
* @param domain - The Twilio (Twilio.Assistants) domain
|
|
30
|
+
*/
|
|
31
|
+
constructor(domain) {
|
|
32
|
+
super(domain, "v1");
|
|
33
|
+
}
|
|
34
|
+
/** Getter for assistants resource */
|
|
35
|
+
get assistants() {
|
|
36
|
+
this._assistants = this._assistants || (0, assistant_1.AssistantListInstance)(this);
|
|
37
|
+
return this._assistants;
|
|
38
|
+
}
|
|
39
|
+
/** Getter for knowledge resource */
|
|
40
|
+
get knowledge() {
|
|
41
|
+
this._knowledge = this._knowledge || (0, knowledge_1.KnowledgeListInstance)(this);
|
|
42
|
+
return this._knowledge;
|
|
43
|
+
}
|
|
44
|
+
/** Getter for policies resource */
|
|
45
|
+
get policies() {
|
|
46
|
+
this._policies = this._policies || (0, policy_1.PolicyListInstance)(this);
|
|
47
|
+
return this._policies;
|
|
48
|
+
}
|
|
49
|
+
/** Getter for sessions resource */
|
|
50
|
+
get sessions() {
|
|
51
|
+
this._sessions = this._sessions || (0, session_1.SessionListInstance)(this);
|
|
52
|
+
return this._sessions;
|
|
53
|
+
}
|
|
54
|
+
/** Getter for tools resource */
|
|
55
|
+
get tools() {
|
|
56
|
+
this._tools = this._tools || (0, tool_1.ToolListInstance)(this);
|
|
57
|
+
return this._tools;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.default = V1;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
|
4
|
+
import Response from "../../../../http/response";
|
|
5
|
+
import V1 from "../../V1";
|
|
6
|
+
export declare class AssistantsV1ServiceCreateFeedbackRequest {
|
|
7
|
+
/**
|
|
8
|
+
* The message ID.
|
|
9
|
+
*/
|
|
10
|
+
"messageId"?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The score to be given(0-1).
|
|
13
|
+
*/
|
|
14
|
+
"score"?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The Session ID.
|
|
17
|
+
*/
|
|
18
|
+
"sessionId": string;
|
|
19
|
+
/**
|
|
20
|
+
* The text to be given as feedback.
|
|
21
|
+
*/
|
|
22
|
+
"text"?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options to pass to create a FeedbackInstance
|
|
26
|
+
*/
|
|
27
|
+
export interface FeedbackListInstanceCreateOptions {
|
|
28
|
+
/** */
|
|
29
|
+
assistantsV1ServiceCreateFeedbackRequest: AssistantsV1ServiceCreateFeedbackRequest;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Options to pass to each
|
|
33
|
+
*/
|
|
34
|
+
export interface FeedbackListInstanceEachOptions {
|
|
35
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
36
|
+
pageSize?: number;
|
|
37
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
38
|
+
callback?: (item: FeedbackInstance, done: (err?: Error) => void) => void;
|
|
39
|
+
/** Function to be called upon completion of streaming */
|
|
40
|
+
done?: Function;
|
|
41
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
42
|
+
limit?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Options to pass to list
|
|
46
|
+
*/
|
|
47
|
+
export interface FeedbackListInstanceOptions {
|
|
48
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
49
|
+
pageSize?: number;
|
|
50
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
51
|
+
limit?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options to pass to page
|
|
55
|
+
*/
|
|
56
|
+
export interface FeedbackListInstancePageOptions {
|
|
57
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
58
|
+
pageSize?: number;
|
|
59
|
+
/** Page Number, this value is simply for client state */
|
|
60
|
+
pageNumber?: number;
|
|
61
|
+
/** PageToken provided by the API */
|
|
62
|
+
pageToken?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface FeedbackSolution {
|
|
65
|
+
id: string;
|
|
66
|
+
}
|
|
67
|
+
export interface FeedbackListInstance {
|
|
68
|
+
_version: V1;
|
|
69
|
+
_solution: FeedbackSolution;
|
|
70
|
+
_uri: string;
|
|
71
|
+
/**
|
|
72
|
+
* Create a FeedbackInstance
|
|
73
|
+
*
|
|
74
|
+
* @param params - Body for request
|
|
75
|
+
* @param callback - Callback to handle processed record
|
|
76
|
+
*
|
|
77
|
+
* @returns Resolves to processed FeedbackInstance
|
|
78
|
+
*/
|
|
79
|
+
create(params: AssistantsV1ServiceCreateFeedbackRequest, callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise<FeedbackInstance>;
|
|
80
|
+
/**
|
|
81
|
+
* Streams FeedbackInstance records from the API.
|
|
82
|
+
*
|
|
83
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
84
|
+
* is reached.
|
|
85
|
+
*
|
|
86
|
+
* The results are passed into the callback function, so this operation is memory
|
|
87
|
+
* efficient.
|
|
88
|
+
*
|
|
89
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
90
|
+
* function.
|
|
91
|
+
*
|
|
92
|
+
* @param { FeedbackListInstanceEachOptions } [params] - Options for request
|
|
93
|
+
* @param { function } [callback] - Function to process each record
|
|
94
|
+
*/
|
|
95
|
+
each(callback?: (item: FeedbackInstance, done: (err?: Error) => void) => void): void;
|
|
96
|
+
each(params: FeedbackListInstanceEachOptions, callback?: (item: FeedbackInstance, done: (err?: Error) => void) => void): void;
|
|
97
|
+
/**
|
|
98
|
+
* Retrieve a single target page of FeedbackInstance records from the API.
|
|
99
|
+
*
|
|
100
|
+
* The request is executed immediately.
|
|
101
|
+
*
|
|
102
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
103
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
104
|
+
*/
|
|
105
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: FeedbackPage) => any): Promise<FeedbackPage>;
|
|
106
|
+
/**
|
|
107
|
+
* Lists FeedbackInstance records from the API as a list.
|
|
108
|
+
*
|
|
109
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
110
|
+
* function.
|
|
111
|
+
*
|
|
112
|
+
* @param { FeedbackListInstanceOptions } [params] - Options for request
|
|
113
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
114
|
+
*/
|
|
115
|
+
list(callback?: (error: Error | null, items: FeedbackInstance[]) => any): Promise<FeedbackInstance[]>;
|
|
116
|
+
list(params: FeedbackListInstanceOptions, callback?: (error: Error | null, items: FeedbackInstance[]) => any): Promise<FeedbackInstance[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Retrieve a single page of FeedbackInstance records from the API.
|
|
119
|
+
*
|
|
120
|
+
* The request is executed immediately.
|
|
121
|
+
*
|
|
122
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
123
|
+
* function.
|
|
124
|
+
*
|
|
125
|
+
* @param { FeedbackListInstancePageOptions } [params] - Options for request
|
|
126
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
127
|
+
*/
|
|
128
|
+
page(callback?: (error: Error | null, items: FeedbackPage) => any): Promise<FeedbackPage>;
|
|
129
|
+
page(params: FeedbackListInstancePageOptions, callback?: (error: Error | null, items: FeedbackPage) => any): Promise<FeedbackPage>;
|
|
130
|
+
/**
|
|
131
|
+
* Provide a user-friendly representation
|
|
132
|
+
*/
|
|
133
|
+
toJSON(): any;
|
|
134
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
135
|
+
}
|
|
136
|
+
export declare function FeedbackListInstance(version: V1, id: string): FeedbackListInstance;
|
|
137
|
+
interface FeedbackPayload extends TwilioResponsePayload {
|
|
138
|
+
feedbacks: FeedbackResource[];
|
|
139
|
+
}
|
|
140
|
+
interface FeedbackResource {
|
|
141
|
+
assistant_id: string;
|
|
142
|
+
id: string;
|
|
143
|
+
account_sid: string;
|
|
144
|
+
user_sid: string;
|
|
145
|
+
message_id: string;
|
|
146
|
+
score: number;
|
|
147
|
+
session_id: string;
|
|
148
|
+
text: string;
|
|
149
|
+
date_created: Date;
|
|
150
|
+
date_updated: Date;
|
|
151
|
+
}
|
|
152
|
+
export declare class FeedbackInstance {
|
|
153
|
+
protected _version: V1;
|
|
154
|
+
constructor(_version: V1, payload: FeedbackResource, id: string);
|
|
155
|
+
/**
|
|
156
|
+
* The Assistant ID.
|
|
157
|
+
*/
|
|
158
|
+
assistantId: string;
|
|
159
|
+
/**
|
|
160
|
+
* The Feedback ID.
|
|
161
|
+
*/
|
|
162
|
+
id: string;
|
|
163
|
+
/**
|
|
164
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Feedback.
|
|
165
|
+
*/
|
|
166
|
+
accountSid: string;
|
|
167
|
+
/**
|
|
168
|
+
* The SID of the User created the Feedback.
|
|
169
|
+
*/
|
|
170
|
+
userSid: string;
|
|
171
|
+
/**
|
|
172
|
+
* The Message ID.
|
|
173
|
+
*/
|
|
174
|
+
messageId: string;
|
|
175
|
+
/**
|
|
176
|
+
* The Score to provide as Feedback (0-1)
|
|
177
|
+
*/
|
|
178
|
+
score: number;
|
|
179
|
+
/**
|
|
180
|
+
* The Session ID.
|
|
181
|
+
*/
|
|
182
|
+
sessionId: string;
|
|
183
|
+
/**
|
|
184
|
+
* The text to be given as feedback.
|
|
185
|
+
*/
|
|
186
|
+
text: string;
|
|
187
|
+
/**
|
|
188
|
+
* The date and time in GMT when the Feedback was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
189
|
+
*/
|
|
190
|
+
dateCreated: Date;
|
|
191
|
+
/**
|
|
192
|
+
* The date and time in GMT when the Feedback was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
193
|
+
*/
|
|
194
|
+
dateUpdated: Date;
|
|
195
|
+
/**
|
|
196
|
+
* Provide a user-friendly representation
|
|
197
|
+
*
|
|
198
|
+
* @returns Object
|
|
199
|
+
*/
|
|
200
|
+
toJSON(): {
|
|
201
|
+
assistantId: string;
|
|
202
|
+
id: string;
|
|
203
|
+
accountSid: string;
|
|
204
|
+
userSid: string;
|
|
205
|
+
messageId: string;
|
|
206
|
+
score: number;
|
|
207
|
+
sessionId: string;
|
|
208
|
+
text: string;
|
|
209
|
+
dateCreated: Date;
|
|
210
|
+
dateUpdated: Date;
|
|
211
|
+
};
|
|
212
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
213
|
+
}
|
|
214
|
+
export declare class FeedbackPage extends Page<V1, FeedbackPayload, FeedbackResource, FeedbackInstance> {
|
|
215
|
+
/**
|
|
216
|
+
* Initialize the FeedbackPage
|
|
217
|
+
*
|
|
218
|
+
* @param version - Version of the resource
|
|
219
|
+
* @param response - Response from the API
|
|
220
|
+
* @param solution - Path solution
|
|
221
|
+
*/
|
|
222
|
+
constructor(version: V1, response: Response<string>, solution: FeedbackSolution);
|
|
223
|
+
/**
|
|
224
|
+
* Build an instance of FeedbackInstance
|
|
225
|
+
*
|
|
226
|
+
* @param payload - Payload response from the API
|
|
227
|
+
*/
|
|
228
|
+
getInstance(payload: FeedbackResource): FeedbackInstance;
|
|
229
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
230
|
+
}
|
|
231
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Assistants
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.FeedbackPage = exports.FeedbackInstance = exports.FeedbackListInstance = exports.AssistantsV1ServiceCreateFeedbackRequest = void 0;
|
|
20
|
+
const util_1 = require("util");
|
|
21
|
+
const Page_1 = __importDefault(require("../../../../base/Page"));
|
|
22
|
+
const deserialize = require("../../../../base/deserialize");
|
|
23
|
+
const serialize = require("../../../../base/serialize");
|
|
24
|
+
const utility_1 = require("../../../../base/utility");
|
|
25
|
+
class AssistantsV1ServiceCreateFeedbackRequest {
|
|
26
|
+
}
|
|
27
|
+
exports.AssistantsV1ServiceCreateFeedbackRequest = AssistantsV1ServiceCreateFeedbackRequest;
|
|
28
|
+
function FeedbackListInstance(version, id) {
|
|
29
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
30
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
31
|
+
}
|
|
32
|
+
const instance = {};
|
|
33
|
+
instance._version = version;
|
|
34
|
+
instance._solution = { id };
|
|
35
|
+
instance._uri = `/Assistants/${id}/Feedbacks`;
|
|
36
|
+
instance.create = function create(params, callback) {
|
|
37
|
+
if (params === null || params === undefined) {
|
|
38
|
+
throw new Error('Required parameter "params" missing.');
|
|
39
|
+
}
|
|
40
|
+
let data = {};
|
|
41
|
+
data = params;
|
|
42
|
+
const headers = {};
|
|
43
|
+
headers["Content-Type"] = "application/json";
|
|
44
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
45
|
+
uri: instance._uri,
|
|
46
|
+
method: "post",
|
|
47
|
+
data,
|
|
48
|
+
headers,
|
|
49
|
+
});
|
|
50
|
+
operationPromise = operationPromise.then((payload) => new FeedbackInstance(operationVersion, payload, instance._solution.id));
|
|
51
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
52
|
+
return operationPromise;
|
|
53
|
+
};
|
|
54
|
+
instance.page = function page(params, callback) {
|
|
55
|
+
if (params instanceof Function) {
|
|
56
|
+
callback = params;
|
|
57
|
+
params = {};
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
params = params || {};
|
|
61
|
+
}
|
|
62
|
+
let data = {};
|
|
63
|
+
if (params["pageSize"] !== undefined)
|
|
64
|
+
data["PageSize"] = params["pageSize"];
|
|
65
|
+
if (params.pageNumber !== undefined)
|
|
66
|
+
data["Page"] = params.pageNumber;
|
|
67
|
+
if (params.pageToken !== undefined)
|
|
68
|
+
data["PageToken"] = params.pageToken;
|
|
69
|
+
const headers = {};
|
|
70
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
71
|
+
uri: instance._uri,
|
|
72
|
+
method: "get",
|
|
73
|
+
params: data,
|
|
74
|
+
headers,
|
|
75
|
+
});
|
|
76
|
+
operationPromise = operationPromise.then((payload) => new FeedbackPage(operationVersion, payload, instance._solution));
|
|
77
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
78
|
+
return operationPromise;
|
|
79
|
+
};
|
|
80
|
+
instance.each = instance._version.each;
|
|
81
|
+
instance.list = instance._version.list;
|
|
82
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
83
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
84
|
+
method: "get",
|
|
85
|
+
uri: targetUrl,
|
|
86
|
+
});
|
|
87
|
+
let pagePromise = operationPromise.then((payload) => new FeedbackPage(instance._version, payload, instance._solution));
|
|
88
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
89
|
+
return pagePromise;
|
|
90
|
+
};
|
|
91
|
+
instance.toJSON = function toJSON() {
|
|
92
|
+
return instance._solution;
|
|
93
|
+
};
|
|
94
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
95
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
96
|
+
};
|
|
97
|
+
return instance;
|
|
98
|
+
}
|
|
99
|
+
exports.FeedbackListInstance = FeedbackListInstance;
|
|
100
|
+
class FeedbackInstance {
|
|
101
|
+
constructor(_version, payload, id) {
|
|
102
|
+
this._version = _version;
|
|
103
|
+
this.assistantId = payload.assistant_id;
|
|
104
|
+
this.id = payload.id;
|
|
105
|
+
this.accountSid = payload.account_sid;
|
|
106
|
+
this.userSid = payload.user_sid;
|
|
107
|
+
this.messageId = payload.message_id;
|
|
108
|
+
this.score = payload.score;
|
|
109
|
+
this.sessionId = payload.session_id;
|
|
110
|
+
this.text = payload.text;
|
|
111
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
112
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Provide a user-friendly representation
|
|
116
|
+
*
|
|
117
|
+
* @returns Object
|
|
118
|
+
*/
|
|
119
|
+
toJSON() {
|
|
120
|
+
return {
|
|
121
|
+
assistantId: this.assistantId,
|
|
122
|
+
id: this.id,
|
|
123
|
+
accountSid: this.accountSid,
|
|
124
|
+
userSid: this.userSid,
|
|
125
|
+
messageId: this.messageId,
|
|
126
|
+
score: this.score,
|
|
127
|
+
sessionId: this.sessionId,
|
|
128
|
+
text: this.text,
|
|
129
|
+
dateCreated: this.dateCreated,
|
|
130
|
+
dateUpdated: this.dateUpdated,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
[util_1.inspect.custom](_depth, options) {
|
|
134
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.FeedbackInstance = FeedbackInstance;
|
|
138
|
+
class FeedbackPage extends Page_1.default {
|
|
139
|
+
/**
|
|
140
|
+
* Initialize the FeedbackPage
|
|
141
|
+
*
|
|
142
|
+
* @param version - Version of the resource
|
|
143
|
+
* @param response - Response from the API
|
|
144
|
+
* @param solution - Path solution
|
|
145
|
+
*/
|
|
146
|
+
constructor(version, response, solution) {
|
|
147
|
+
super(version, response, solution);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Build an instance of FeedbackInstance
|
|
151
|
+
*
|
|
152
|
+
* @param payload - Payload response from the API
|
|
153
|
+
*/
|
|
154
|
+
getInstance(payload) {
|
|
155
|
+
return new FeedbackInstance(this._version, payload, this._solution.id);
|
|
156
|
+
}
|
|
157
|
+
[util_1.inspect.custom](depth, options) {
|
|
158
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.FeedbackPage = FeedbackPage;
|