Skip to content

Commit

Permalink
[Librarian] Regenerated @ 45fa5159053e1c1f62f6d613f3b67a9239b43a5f 25…
Browse files Browse the repository at this point in the history
…51818144b7f525e66740ded45831b930db82b8
  • Loading branch information
twilio-dx committed Dec 5, 2024
1 parent b463f4e commit f18db95
Show file tree
Hide file tree
Showing 6 changed files with 443 additions and 25 deletions.
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
twilio-node changelog
=====================

[2024-12-05] Version 5.3.7
--------------------------
**Api**
- Add optional parameter `intelligence_service` to `transcription`
- Updated `phone_number_sid` to be populated for sip trunking terminating calls.

**Numbers**
- Add Update Hosted Number Order V2 API endpoint
- Update Port in docs

**Twiml**
- Add optional parameter `intelligence_service` to `<Transcription>`
- Add support for new `<ConversationRelay>` and `<Assistant>` noun
- Add `events` attribute to `<Dial>` verb


[2024-11-15] Version 5.3.6
--------------------------
**Library - Chore**
Expand Down
4 changes: 4 additions & 0 deletions src/rest/api/v2010/account/call/transcription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export interface TranscriptionListInstanceCreateOptions {
hints?: string;
/** The provider will add punctuation to recognition result */
enableAutomaticPunctuation?: boolean;
/** The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. */
intelligenceService?: string;
}

export interface TranscriptionContext {
Expand Down Expand Up @@ -397,6 +399,8 @@ export function TranscriptionListInstance(
data["EnableAutomaticPunctuation"] = serialize.bool(
params["enableAutomaticPunctuation"]
);
if (params["intelligenceService"] !== undefined)
data["IntelligenceService"] = params["intelligenceService"];

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
Expand Down
20 changes: 11 additions & 9 deletions src/rest/numbers/V1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNum
import { PortingPortabilityListInstance } from "./v1/portingPortability";
import { PortingWebhookConfigurationListInstance } from "./v1/portingWebhookConfiguration";
import { PortingWebhookConfigurationDeleteListInstance } from "./v1/portingWebhookConfigurationDelete";
import { PortingWebhookConfigurationFetchListInstance } from "./v1/portingWebhookConfigurationFetch";
import { SigningRequestConfigurationListInstance } from "./v1/signingRequestConfiguration";
import { WebhookListInstance } from "./v1/webhook";

export default class V1 extends Version {
/**
Expand All @@ -48,10 +48,10 @@ export default class V1 extends Version {
protected _portingWebhookConfigurations?: PortingWebhookConfigurationListInstance;
/** portingWebhookConfigurationsDelete - { Twilio.Numbers.V1.PortingWebhookConfigurationDeleteListInstance } resource */
protected _portingWebhookConfigurationsDelete?: PortingWebhookConfigurationDeleteListInstance;
/** portingWebhookConfigurationFetch - { Twilio.Numbers.V1.PortingWebhookConfigurationFetchListInstance } resource */
protected _portingWebhookConfigurationFetch?: PortingWebhookConfigurationFetchListInstance;
/** signingRequestConfigurations - { Twilio.Numbers.V1.SigningRequestConfigurationListInstance } resource */
protected _signingRequestConfigurations?: SigningRequestConfigurationListInstance;
/** webhook - { Twilio.Numbers.V1.WebhookListInstance } resource */
protected _webhook?: WebhookListInstance;

/** Getter for bulkEligibilities resource */
get bulkEligibilities(): BulkEligibilityListInstance {
Expand Down Expand Up @@ -104,17 +104,19 @@ export default class V1 extends Version {
return this._portingWebhookConfigurationsDelete;
}

/** Getter for portingWebhookConfigurationFetch resource */
get portingWebhookConfigurationFetch(): PortingWebhookConfigurationFetchListInstance {
this._portingWebhookConfigurationFetch =
this._portingWebhookConfigurationFetch ||
PortingWebhookConfigurationFetchListInstance(this);
return this._portingWebhookConfigurationFetch;
}

/** Getter for signingRequestConfigurations resource */
get signingRequestConfigurations(): SigningRequestConfigurationListInstance {
this._signingRequestConfigurations =
this._signingRequestConfigurations ||
SigningRequestConfigurationListInstance(this);
return this._signingRequestConfigurations;
}

/** Getter for webhook resource */
get webhook(): WebhookListInstance {
this._webhook = this._webhook || WebhookListInstance(this);
return this._webhook;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,26 @@ const deserialize = require("../../../base/deserialize");
const serialize = require("../../../base/serialize");
import { isValidPathParam } from "../../../base/utility";

export interface WebhookSolution {}
export interface PortingWebhookConfigurationFetchSolution {}

export interface WebhookListInstance {
export interface PortingWebhookConfigurationFetchListInstance {
_version: V1;
_solution: WebhookSolution;
_solution: PortingWebhookConfigurationFetchSolution;
_uri: string;

/**
* Fetch a WebhookInstance
* Fetch a PortingWebhookConfigurationFetchInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed WebhookInstance
* @returns Resolves to processed PortingWebhookConfigurationFetchInstance
*/
fetch(
callback?: (error: Error | null, item?: WebhookInstance) => any
): Promise<WebhookInstance>;
callback?: (
error: Error | null,
item?: PortingWebhookConfigurationFetchInstance
) => any
): Promise<PortingWebhookConfigurationFetchInstance>;

/**
* Provide a user-friendly representation
Expand All @@ -43,24 +46,30 @@ export interface WebhookListInstance {
[inspect.custom](_depth: any, options: InspectOptions): any;
}

export function WebhookListInstance(version: V1): WebhookListInstance {
const instance = {} as WebhookListInstance;
export function PortingWebhookConfigurationFetchListInstance(
version: V1
): PortingWebhookConfigurationFetchListInstance {
const instance = {} as PortingWebhookConfigurationFetchListInstance;

instance._version = version;
instance._solution = {};
instance._uri = `/Porting/Configuration/Webhook`;

instance.fetch = function fetch(
callback?: (error: Error | null, items: WebhookInstance) => any
): Promise<WebhookInstance> {
callback?: (
error: Error | null,
items: PortingWebhookConfigurationFetchInstance
) => any
): Promise<PortingWebhookConfigurationFetchInstance> {
let operationVersion = version,
operationPromise = operationVersion.fetch({
uri: instance._uri,
method: "get",
});

operationPromise = operationPromise.then(
(payload) => new WebhookInstance(operationVersion, payload)
(payload) =>
new PortingWebhookConfigurationFetchInstance(operationVersion, payload)
);

operationPromise = instance._version.setPromiseCallback(
Expand All @@ -84,9 +93,10 @@ export function WebhookListInstance(version: V1): WebhookListInstance {
return instance;
}

interface WebhookPayload extends WebhookResource {}
interface PortingWebhookConfigurationFetchPayload
extends PortingWebhookConfigurationFetchResource {}

interface WebhookResource {
interface PortingWebhookConfigurationFetchResource {
url: string;
port_in_target_url: string;
port_out_target_url: string;
Expand All @@ -95,8 +105,11 @@ interface WebhookResource {
port_out_target_date_created: Date;
}

export class WebhookInstance {
constructor(protected _version: V1, payload: WebhookResource) {
export class PortingWebhookConfigurationFetchInstance {
constructor(
protected _version: V1,
payload: PortingWebhookConfigurationFetchResource
) {
this.url = payload.url;
this.portInTargetUrl = payload.port_in_target_url;
this.portOutTargetUrl = payload.port_out_target_url;
Expand Down
139 changes: 139 additions & 0 deletions src/rest/numbers/v2/hostedNumberOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,28 @@ import { PhoneNumberCapabilities } from "../../../interfaces";

export type HostedNumberOrderStatus =
| "received"
| "pending-verification"
| "verified"
| "pending-loa"
| "carrier-processing"
| "completed"
| "failed"
| "action-required";

export type HostedNumberOrderVerificationType = "phone-call";

/**
* Options to pass to update a HostedNumberOrderInstance
*/
export interface HostedNumberOrderContextUpdateOptions {
/** */
status: HostedNumberOrderStatus;
/** The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. */
verificationCallDelay?: number;
/** The numerical extension to dial when making the ownership verification call. */
verificationCallExtension?: string;
}

/**
* Options to pass to create a HostedNumberOrderInstance
*/
Expand Down Expand Up @@ -159,6 +174,19 @@ export interface HostedNumberOrderContext {
callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any
): Promise<HostedNumberOrderInstance>;

/**
* Update a HostedNumberOrderInstance
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed HostedNumberOrderInstance
*/
update(
params: HostedNumberOrderContextUpdateOptions,
callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any
): Promise<HostedNumberOrderInstance>;

/**
* Provide a user-friendly representation
*/
Expand Down Expand Up @@ -226,6 +254,54 @@ export class HostedNumberOrderContextImpl implements HostedNumberOrderContext {
return operationPromise;
}

update(
params: HostedNumberOrderContextUpdateOptions,
callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any
): Promise<HostedNumberOrderInstance> {
if (params === null || params === undefined) {
throw new Error('Required parameter "params" missing.');
}

if (params["status"] === null || params["status"] === undefined) {
throw new Error("Required parameter \"params['status']\" missing.");
}

let data: any = {};

data["Status"] = params["status"];
if (params["verificationCallDelay"] !== undefined)
data["VerificationCallDelay"] = params["verificationCallDelay"];
if (params["verificationCallExtension"] !== undefined)
data["VerificationCallExtension"] = params["verificationCallExtension"];

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 HostedNumberOrderInstance(
operationVersion,
payload,
instance._solution.sid
)
);

operationPromise = instance._version.setPromiseCallback(
operationPromise,
callback
);
return operationPromise;
}

/**
* Provide a user-friendly representation
*
Expand Down Expand Up @@ -264,6 +340,12 @@ interface HostedNumberOrderResource {
contact_phone_number: string;
bulk_hosting_request_sid: string;
next_step: string;
verification_attempts: number;
verification_call_sids: Array<string>;
verification_call_delay: number;
verification_call_extension: string;
verification_code: string;
verification_type: HostedNumberOrderVerificationType;
}

export class HostedNumberOrderInstance {
Expand Down Expand Up @@ -294,6 +376,16 @@ export class HostedNumberOrderInstance {
this.contactPhoneNumber = payload.contact_phone_number;
this.bulkHostingRequestSid = payload.bulk_hosting_request_sid;
this.nextStep = payload.next_step;
this.verificationAttempts = deserialize.integer(
payload.verification_attempts
);
this.verificationCallSids = payload.verification_call_sids;
this.verificationCallDelay = deserialize.integer(
payload.verification_call_delay
);
this.verificationCallExtension = payload.verification_call_extension;
this.verificationCode = payload.verification_code;
this.verificationType = payload.verification_type;

this._solution = { sid: sid || this.sid };
}
Expand Down Expand Up @@ -368,6 +460,27 @@ export class HostedNumberOrderInstance {
* The next step you need to take to complete the hosted number order and request it successfully.
*/
nextStep: string;
/**
* The number of attempts made to verify ownership via a call for the hosted phone number.
*/
verificationAttempts: number;
/**
* The Call SIDs that identify the calls placed to verify ownership.
*/
verificationCallSids: Array<string>;
/**
* The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
*/
verificationCallDelay: number;
/**
* The numerical extension to dial when making the ownership verification call.
*/
verificationCallExtension: string;
/**
* The digits the user must pass in the ownership verification call.
*/
verificationCode: string;
verificationType: HostedNumberOrderVerificationType;

private get _proxy(): HostedNumberOrderContext {
this._context =
Expand Down Expand Up @@ -402,6 +515,26 @@ export class HostedNumberOrderInstance {
return this._proxy.fetch(callback);
}

/**
* Update a HostedNumberOrderInstance
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed HostedNumberOrderInstance
*/
update(
params: HostedNumberOrderContextUpdateOptions,
callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any
): Promise<HostedNumberOrderInstance>;

update(
params?: any,
callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any
): Promise<HostedNumberOrderInstance> {
return this._proxy.update(params, callback);
}

/**
* Provide a user-friendly representation
*
Expand All @@ -428,6 +561,12 @@ export class HostedNumberOrderInstance {
contactPhoneNumber: this.contactPhoneNumber,
bulkHostingRequestSid: this.bulkHostingRequestSid,
nextStep: this.nextStep,
verificationAttempts: this.verificationAttempts,
verificationCallSids: this.verificationCallSids,
verificationCallDelay: this.verificationCallDelay,
verificationCallExtension: this.verificationCallExtension,
verificationCode: this.verificationCode,
verificationType: this.verificationType,
};
}

Expand Down
Loading

0 comments on commit f18db95

Please sign in to comment.