From 31e018900d3a2c406fc8e2a0022360a70beadfab Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 6 Nov 2023 14:51:56 +0000 Subject: [PATCH] [Librarian] Regenerated @ 5eb406c4977c9f6976e6053cb5b581056f541a59 --- CHANGES.md | 18 + src/rest/flexApi/V1.ts | 10 + src/rest/flexApi/v1/provisioningStatus.ts | 196 ++++++++++ .../v2/transcript/operatorResult.ts | 7 + src/rest/messaging/v1/tollfreeVerification.ts | 41 +++ src/rest/serverless/v1/service/build.ts | 8 +- src/rest/trusthub/V1.ts | 11 + .../v1/complianceTollfreeInquiries.ts | 341 ++++++++++++++++++ 8 files changed, 631 insertions(+), 1 deletion(-) create mode 100644 src/rest/flexApi/v1/provisioningStatus.ts create mode 100644 src/rest/trusthub/v1/complianceTollfreeInquiries.ts diff --git a/CHANGES.md b/CHANGES.md index 9392e5acc8..4c86cb6f19 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,24 @@ twilio-node changelog ===================== +[2023-11-06] Version 4.19.1 +--------------------------- +**Flex** +- Adding `provisioning_status` for Email Manager + +**Intelligence** +- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection. + +**Messaging** +- Add DELETE support to Tollfree Verification resource + +**Serverless** +- Add node18 as a valid Build runtime + +**Verify** +- Update Verify TOTP maturity to GA. + + [2023-10-19] Version 4.19.0 --------------------------- **Library - Chore** diff --git a/src/rest/flexApi/V1.ts b/src/rest/flexApi/V1.ts index fd203e280f..153a8a2c35 100644 --- a/src/rest/flexApi/V1.ts +++ b/src/rest/flexApi/V1.ts @@ -29,6 +29,7 @@ import { InsightsSettingsAnswerSetsListInstance } from "./v1/insightsSettingsAns import { InsightsSettingsCommentListInstance } from "./v1/insightsSettingsComment"; import { InsightsUserRolesListInstance } from "./v1/insightsUserRoles"; import { InteractionListInstance } from "./v1/interaction"; +import { ProvisioningStatusListInstance } from "./v1/provisioningStatus"; import { WebChannelListInstance } from "./v1/webChannel"; export default class V1 extends Version { @@ -71,6 +72,8 @@ export default class V1 extends Version { protected _insightsUserRoles?: InsightsUserRolesListInstance; /** interaction - { Twilio.FlexApi.V1.InteractionListInstance } resource */ protected _interaction?: InteractionListInstance; + /** provisioningStatus - { Twilio.FlexApi.V1.ProvisioningStatusListInstance } resource */ + protected _provisioningStatus?: ProvisioningStatusListInstance; /** webChannel - { Twilio.FlexApi.V1.WebChannelListInstance } resource */ protected _webChannel?: WebChannelListInstance; @@ -180,6 +183,13 @@ export default class V1 extends Version { return this._interaction; } + /** Getter for provisioningStatus resource */ + get provisioningStatus(): ProvisioningStatusListInstance { + this._provisioningStatus = + this._provisioningStatus || ProvisioningStatusListInstance(this); + return this._provisioningStatus; + } + /** Getter for webChannel resource */ get webChannel(): WebChannelListInstance { this._webChannel = this._webChannel || WebChannelListInstance(this); diff --git a/src/rest/flexApi/v1/provisioningStatus.ts b/src/rest/flexApi/v1/provisioningStatus.ts new file mode 100644 index 0000000000..24abfc729b --- /dev/null +++ b/src/rest/flexApi/v1/provisioningStatus.ts @@ -0,0 +1,196 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +import { isValidPathParam } from "../../../base/utility"; + +export type ProvisioningStatusStatus = + | "active" + | "in-progress" + | "not-configured" + | "failed"; + +export interface ProvisioningStatusContext { + /** + * Fetch a ProvisioningStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ProvisioningStatusInstance + */ + fetch( + callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export interface ProvisioningStatusContextSolution {} + +export class ProvisioningStatusContextImpl + implements ProvisioningStatusContext +{ + protected _solution: ProvisioningStatusContextSolution; + protected _uri: string; + + constructor(protected _version: V1) { + this._solution = {}; + this._uri = `/account/provision/status`; + } + + fetch( + callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any + ): Promise { + const instance = this; + let operationVersion = instance._version, + operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + + operationPromise = operationPromise.then( + (payload) => new ProvisioningStatusInstance(operationVersion, payload) + ); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + } + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} + +interface ProvisioningStatusPayload extends ProvisioningStatusResource {} + +interface ProvisioningStatusResource { + status: ProvisioningStatusStatus; + url: string; +} + +export class ProvisioningStatusInstance { + protected _solution: ProvisioningStatusContextSolution; + protected _context?: ProvisioningStatusContext; + + constructor(protected _version: V1, payload: ProvisioningStatusResource) { + this.status = payload.status; + this.url = payload.url; + + this._solution = {}; + } + + status: ProvisioningStatusStatus; + /** + * The absolute URL of the resource. + */ + url: string; + + private get _proxy(): ProvisioningStatusContext { + this._context = + this._context || new ProvisioningStatusContextImpl(this._version); + return this._context; + } + + /** + * Fetch a ProvisioningStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ProvisioningStatusInstance + */ + fetch( + callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any + ): Promise { + return this._proxy.fetch(callback); + } + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + status: this.status, + url: this.url, + }; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} + +export interface ProvisioningStatusSolution {} + +export interface ProvisioningStatusListInstance { + _version: V1; + _solution: ProvisioningStatusSolution; + _uri: string; + + (): ProvisioningStatusContext; + get(): ProvisioningStatusContext; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export function ProvisioningStatusListInstance( + version: V1 +): ProvisioningStatusListInstance { + const instance = (() => instance.get()) as ProvisioningStatusListInstance; + + instance.get = function get(): ProvisioningStatusContext { + return new ProvisioningStatusContextImpl(version); + }; + + instance._version = version; + instance._solution = {}; + instance._uri = ``; + + instance.toJSON = function toJSON() { + return instance._solution; + }; + + instance[inspect.custom] = function inspectImpl( + _depth: any, + options: InspectOptions + ) { + return inspect(instance.toJSON(), options); + }; + + return instance; +} diff --git a/src/rest/intelligence/v2/transcript/operatorResult.ts b/src/rest/intelligence/v2/transcript/operatorResult.ts index fc64bf2aac..e167dce110 100644 --- a/src/rest/intelligence/v2/transcript/operatorResult.ts +++ b/src/rest/intelligence/v2/transcript/operatorResult.ts @@ -213,6 +213,7 @@ interface OperatorResultResource { predicted_probability: number; label_probabilities: any; extract_results: any; + text_generation_results: any; transcript_sid: string; url: string; } @@ -239,6 +240,7 @@ export class OperatorResultInstance { this.predictedProbability = payload.predicted_probability; this.labelProbabilities = payload.label_probabilities; this.extractResults = payload.extract_results; + this.textGenerationResults = payload.text_generation_results; this.transcriptSid = payload.transcript_sid; this.url = payload.url; @@ -293,6 +295,10 @@ export class OperatorResultInstance { * List of text extraction results. This might be available on classify-extract model outputs. */ extractResults: any; + /** + * Output of a text generation operator for example Conversation Sumamary. + */ + textGenerationResults: any; /** * A 34 character string that uniquely identifies this Transcript. */ @@ -362,6 +368,7 @@ export class OperatorResultInstance { predictedProbability: this.predictedProbability, labelProbabilities: this.labelProbabilities, extractResults: this.extractResults, + textGenerationResults: this.textGenerationResults, transcriptSid: this.transcriptSid, url: this.url, }; diff --git a/src/rest/messaging/v1/tollfreeVerification.ts b/src/rest/messaging/v1/tollfreeVerification.ts index b5a6f4b1eb..caddf98dc1 100644 --- a/src/rest/messaging/v1/tollfreeVerification.ts +++ b/src/rest/messaging/v1/tollfreeVerification.ts @@ -182,6 +182,17 @@ export interface TollfreeVerificationListInstancePageOptions { } export interface TollfreeVerificationContext { + /** + * Remove a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove( + callback?: (error: Error | null, item?: boolean) => any + ): Promise; + /** * Fetch a TollfreeVerificationInstance * @@ -242,6 +253,23 @@ export class TollfreeVerificationContextImpl this._uri = `/Tollfree/Verifications/${sid}`; } + remove( + callback?: (error: Error | null, item?: boolean) => any + ): Promise { + const instance = this; + let operationVersion = instance._version, + operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + } + fetch( callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any ): Promise { @@ -605,6 +633,19 @@ export class TollfreeVerificationInstance { return this._context; } + /** + * Remove a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove( + callback?: (error: Error | null, item?: boolean) => any + ): Promise { + return this._proxy.remove(callback); + } + /** * Fetch a TollfreeVerificationInstance * diff --git a/src/rest/serverless/v1/service/build.ts b/src/rest/serverless/v1/service/build.ts index 0efb47b657..548d93fb70 100644 --- a/src/rest/serverless/v1/service/build.ts +++ b/src/rest/serverless/v1/service/build.ts @@ -21,7 +21,13 @@ const serialize = require("../../../../base/serialize"); import { isValidPathParam } from "../../../../base/utility"; import { BuildStatusListInstance } from "./build/buildStatus"; -export type BuildRuntime = "node8" | "node10" | "node12" | "node14" | "node16"; +export type BuildRuntime = + | "node8" + | "node10" + | "node12" + | "node14" + | "node16" + | "node18"; export type BuildStatus = "building" | "completed" | "failed"; diff --git a/src/rest/trusthub/V1.ts b/src/rest/trusthub/V1.ts index 19fdb93795..a6abf92499 100644 --- a/src/rest/trusthub/V1.ts +++ b/src/rest/trusthub/V1.ts @@ -15,6 +15,7 @@ import TrusthubBase from "../TrusthubBase"; import Version from "../../base/Version"; import { ComplianceInquiriesListInstance } from "./v1/complianceInquiries"; +import { ComplianceTollfreeInquiriesListInstance } from "./v1/complianceTollfreeInquiries"; import { CustomerProfilesListInstance } from "./v1/customerProfiles"; import { EndUserListInstance } from "./v1/endUser"; import { EndUserTypeListInstance } from "./v1/endUserType"; @@ -35,6 +36,8 @@ export default class V1 extends Version { /** complianceInquiries - { Twilio.Trusthub.V1.ComplianceInquiriesListInstance } resource */ protected _complianceInquiries?: ComplianceInquiriesListInstance; + /** complianceTollfreeInquiries - { Twilio.Trusthub.V1.ComplianceTollfreeInquiriesListInstance } resource */ + protected _complianceTollfreeInquiries?: ComplianceTollfreeInquiriesListInstance; /** customerProfiles - { Twilio.Trusthub.V1.CustomerProfilesListInstance } resource */ protected _customerProfiles?: CustomerProfilesListInstance; /** endUsers - { Twilio.Trusthub.V1.EndUserListInstance } resource */ @@ -57,6 +60,14 @@ export default class V1 extends Version { return this._complianceInquiries; } + /** Getter for complianceTollfreeInquiries resource */ + get complianceTollfreeInquiries(): ComplianceTollfreeInquiriesListInstance { + this._complianceTollfreeInquiries = + this._complianceTollfreeInquiries || + ComplianceTollfreeInquiriesListInstance(this); + return this._complianceTollfreeInquiries; + } + /** Getter for customerProfiles resource */ get customerProfiles(): CustomerProfilesListInstance { this._customerProfiles = diff --git a/src/rest/trusthub/v1/complianceTollfreeInquiries.ts b/src/rest/trusthub/v1/complianceTollfreeInquiries.ts new file mode 100644 index 0000000000..a373c5491a --- /dev/null +++ b/src/rest/trusthub/v1/complianceTollfreeInquiries.ts @@ -0,0 +1,341 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +import { isValidPathParam } from "../../../base/utility"; + +/** + * Options to pass to update a ComplianceTollfreeInquiriesInstance + */ +export interface ComplianceTollfreeInquiriesContextUpdateOptions { + /** The Tollfree phone number to be verified */ + did: string; +} + +/** + * Options to pass to create a ComplianceTollfreeInquiriesInstance + */ +export interface ComplianceTollfreeInquiriesListInstanceCreateOptions { + /** The Tollfree phone number to be verified */ + did: string; +} + +export interface ComplianceTollfreeInquiriesContext { + /** + * Update a ComplianceTollfreeInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceTollfreeInquiriesInstance + */ + update( + params: ComplianceTollfreeInquiriesContextUpdateOptions, + callback?: ( + error: Error | null, + item?: ComplianceTollfreeInquiriesInstance + ) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export interface ComplianceTollfreeInquiriesContextSolution { + tollfreeId: string; +} + +export class ComplianceTollfreeInquiriesContextImpl + implements ComplianceTollfreeInquiriesContext +{ + protected _solution: ComplianceTollfreeInquiriesContextSolution; + protected _uri: string; + + constructor(protected _version: V1, tollfreeId: string) { + if (!isValidPathParam(tollfreeId)) { + throw new Error("Parameter 'tollfreeId' is not valid."); + } + + this._solution = { tollfreeId }; + this._uri = `/ComplianceInquiries/Tollfree/${tollfreeId}/Initialize`; + } + + update( + params: ComplianceTollfreeInquiriesContextUpdateOptions, + callback?: ( + error: Error | null, + item?: ComplianceTollfreeInquiriesInstance + ) => any + ): Promise { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + + if (params["did"] === null || params["did"] === undefined) { + throw new Error("Required parameter \"params['did']\" missing."); + } + + let data: any = {}; + + data["Did"] = params["did"]; + + const headers: any = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + + const instance = this; + let operationVersion = instance._version, + operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + + operationPromise = operationPromise.then( + (payload) => + new ComplianceTollfreeInquiriesInstance( + operationVersion, + payload, + instance._solution.tollfreeId + ) + ); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + } + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} + +interface ComplianceTollfreeInquiriesPayload + extends ComplianceTollfreeInquiriesResource {} + +interface ComplianceTollfreeInquiriesResource { + inquiry_id: string; + inquiry_session_token: string; + tollfree_id: string; + url: string; +} + +export class ComplianceTollfreeInquiriesInstance { + protected _solution: ComplianceTollfreeInquiriesContextSolution; + protected _context?: ComplianceTollfreeInquiriesContext; + + constructor( + protected _version: V1, + payload: ComplianceTollfreeInquiriesResource, + tollfreeId?: string + ) { + this.inquiryId = payload.inquiry_id; + this.inquirySessionToken = payload.inquiry_session_token; + this.tollfreeId = payload.tollfree_id; + this.url = payload.url; + + this._solution = { tollfreeId: tollfreeId || this.tollfreeId }; + } + + /** + * The unique ID used to start an embedded compliance registration session. + */ + inquiryId: string; + /** + * The session token used to start an embedded compliance registration session. + */ + inquirySessionToken: string; + /** + * The TolfreeId matching the Tollfree Profile that should be resumed or resubmitted for editing. + */ + tollfreeId: string; + /** + * The URL of this resource. + */ + url: string; + + private get _proxy(): ComplianceTollfreeInquiriesContext { + this._context = + this._context || + new ComplianceTollfreeInquiriesContextImpl( + this._version, + this._solution.tollfreeId + ); + return this._context; + } + + /** + * Update a ComplianceTollfreeInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceTollfreeInquiriesInstance + */ + update( + params: ComplianceTollfreeInquiriesContextUpdateOptions, + callback?: ( + error: Error | null, + item?: ComplianceTollfreeInquiriesInstance + ) => any + ): Promise; + + update( + params?: any, + callback?: ( + error: Error | null, + item?: ComplianceTollfreeInquiriesInstance + ) => any + ): Promise { + return this._proxy.update(params, callback); + } + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + inquiryId: this.inquiryId, + inquirySessionToken: this.inquirySessionToken, + tollfreeId: this.tollfreeId, + url: this.url, + }; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} + +export interface ComplianceTollfreeInquiriesSolution {} + +export interface ComplianceTollfreeInquiriesListInstance { + _version: V1; + _solution: ComplianceTollfreeInquiriesSolution; + _uri: string; + + (tollfreeId: string): ComplianceTollfreeInquiriesContext; + get(tollfreeId: string): ComplianceTollfreeInquiriesContext; + + /** + * Create a ComplianceTollfreeInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceTollfreeInquiriesInstance + */ + create( + params: ComplianceTollfreeInquiriesListInstanceCreateOptions, + callback?: ( + error: Error | null, + item?: ComplianceTollfreeInquiriesInstance + ) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export function ComplianceTollfreeInquiriesListInstance( + version: V1 +): ComplianceTollfreeInquiriesListInstance { + const instance = ((tollfreeId) => + instance.get(tollfreeId)) as ComplianceTollfreeInquiriesListInstance; + + instance.get = function get(tollfreeId): ComplianceTollfreeInquiriesContext { + return new ComplianceTollfreeInquiriesContextImpl(version, tollfreeId); + }; + + instance._version = version; + instance._solution = {}; + instance._uri = `/ComplianceInquiries/Tollfree/Initialize`; + + instance.create = function create( + params: ComplianceTollfreeInquiriesListInstanceCreateOptions, + callback?: ( + error: Error | null, + items: ComplianceTollfreeInquiriesInstance + ) => any + ): Promise { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + + if (params["did"] === null || params["did"] === undefined) { + throw new Error("Required parameter \"params['did']\" missing."); + } + + let data: any = {}; + + data["Did"] = params["did"]; + + const headers: any = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + + let operationVersion = version, + operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + + operationPromise = operationPromise.then( + (payload) => + new ComplianceTollfreeInquiriesInstance(operationVersion, payload) + ); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + }; + + instance.toJSON = function toJSON() { + return instance._solution; + }; + + instance[inspect.custom] = function inspectImpl( + _depth: any, + options: InspectOptions + ) { + return inspect(instance.toJSON(), options); + }; + + return instance; +}