Skip to content

Commit

Permalink
[Librarian] Regenerated @ 84b4cd4c23a96109c715a2512bbe8238fae5c394 4f…
Browse files Browse the repository at this point in the history
…23177c4c946a9a5cdaf592718766a9b4816075
  • Loading branch information
twilio-dx committed Jun 18, 2024
1 parent 7d1f4ec commit d079a99
Show file tree
Hide file tree
Showing 13 changed files with 309 additions and 90 deletions.
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
twilio-node changelog
=====================

[2024-06-18] Version 5.2.0
--------------------------
**Library - Chore**
- [PR #1024](https://github.com/twilio/twilio-node/pull/1024): adding contentType in post and put. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Events**
- Add `status` and `documentation_url` to Event Types

**Lookups**
- Removed unused `fraud` lookups in V1 only to facilitate rest proxy migration

**Numbers**
- Add date_created field to the Get Port In Request API
- Rename the `status_last_time_updated_timestamp` field to `last_updated` in the Get Port In Phone Number API **(breaking change)**
- Add Rejection reason and rejection reason code to the Get Port In Phone Number API
- Remove the carrier information from the Portability API

**Proxy**
- Change property `type` from enum to ienum

**Trusthub**
- Add skipMessagingUseCase field in compliance_tollfree_inquiry.


[2024-06-06] Version 5.1.1
--------------------------
**Api**
Expand Down
2 changes: 1 addition & 1 deletion src/rest/api/v2010/account/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export class CallInstance {
*/
duration: string;
/**
* The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
* The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value.
*/
price: string;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/rest/api/v2010/account/recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export class RecordingInstance {
priceUnit: string;
status: RecordingStatus;
/**
* The number of channels in the final recording file. Can be: `1` or `2`. You can split a call with two legs into two separate recording channels if you record using [TwiML Dial](https://www.twilio.com/docs/voice/twiml/dial#record) or the [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls#manage-your-outbound-call).
* The number of channels in the final recording file. Can be: `1` or `2`.
*/
channels: number;
source: RecordingSource;
Expand Down
201 changes: 182 additions & 19 deletions src/rest/content/v1/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,188 @@ import { isValidPathParam } from "../../../base/utility";
import { ApprovalCreateListInstance } from "./content/approvalCreate";
import { ApprovalFetchListInstance } from "./content/approvalFetch";

export class AuthenticationAction {
"type": AuthenticationActionType;
"copyCodeText": string;
}

export type AuthenticationActionType = "COPY_CODE";

export class CallToActionAction {
"type": CallToActionActionType;
"title": string;
"url"?: string;
"phone"?: string;
"id"?: string;
}

export type CallToActionActionType = "URL" | "PHONE_NUMBER";

export class CardAction {
"type": CardActionType;
"title": string;
"url"?: string;
"phone"?: string;
"id"?: string;
}

export type CardActionType = "URL" | "PHONE_NUMBER" | "QUICK_REPLY";

export class CatalogItem {
"id"?: string;
"sectionTitle"?: string;
"name"?: string;
"mediaUrl"?: string;
"price"?: number;
"description"?: string;
}

/**
* Content creation request body
*/
export class ContentCreateRequest {
/**
* User defined name of the content
*/
"friendlyName"?: string;
/**
* Key value pairs of variable name to value
*/
"variables"?: { [key: string]: string };
/**
* Language code for the content
*/
"language": string;
"types": Types;
}

export class ListItem {
"id": string;
"item": string;
"description"?: string;
}

export class QuickReplyAction {
"type": QuickReplyActionType;
"title": string;
"id"?: string;
}

export type QuickReplyActionType = "QUICK_REPLY";

/**
* twilio/call-to-action buttons let recipients tap to trigger actions such as launching a website or making a phone call.
*/
export class TwilioCallToAction {
"body"?: string;
"actions"?: Array<CallToActionAction>;
}

/**
* twilio/card is a structured template which can be used to send a series of related information. It must include a title and at least one additional field.
*/
export class TwilioCard {
"title": string;
"subtitle"?: string;
"media"?: Array<string>;
"actions"?: Array<CardAction>;
}

/**
* twilio/catalog type lets recipients view list of catalog products, ask questions about products, order products.
*/
export class TwilioCatalog {
"title"?: string;
"body": string;
"subtitle"?: string;
"id"?: string;
"items"?: Array<CatalogItem>;
"dynamicItems"?: string;
}

/**
* twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
*/
export class TwilioListPicker {
"body": string;
"button": string;
"items": Array<ListItem>;
}

/**
* twilio/location type contains a location pin and an optional label, which can be used to enhance delivery notifications or connect recipients to physical experiences you offer.
*/
export class TwilioLocation {
"latitude": number;
"longitude": number;
"label"?: string;
}

/**
* twilio/media is used to send file attachments, or to send long text via MMS in the US and Canada. As such, the twilio/media type must contain at least ONE of text or media content.
*/
export class TwilioMedia {
"body"?: string;
"media": Array<string>;
}

/**
* twilio/quick-reply templates let recipients tap, rather than type, to respond to the message.
*/
export class TwilioQuickReply {
"body": string;
"actions": Array<QuickReplyAction>;
}

/**
* Type containing only plain text-based content
*/
export class TwilioText {
"body": string;
}

/**
* Content types
*/
export class Types {
"twilioText"?: TwilioText | null;
"twilioMedia"?: TwilioMedia | null;
"twilioLocation"?: TwilioLocation | null;
"twilioListPicker"?: TwilioListPicker | null;
"twilioCallToAction"?: TwilioCallToAction | null;
"twilioQuickReply"?: TwilioQuickReply | null;
"twilioCard"?: TwilioCard | null;
"twilioCatalog"?: TwilioCatalog | null;
"whatsappCard"?: WhatsappCard | null;
"whatsappAuthentication"?: WhatsappAuthentication | null;
}

/**
* whatsApp/authentication templates let companies deliver WA approved one-time-password button.
*/
export class WhatsappAuthentication {
"addSecurityRecommendation"?: boolean;
"codeExpirationMinutes"?: number;
"actions": Array<AuthenticationAction>;
}

/**
* whatsapp/card is a structured template which can be used to send a series of related information. It must include a body and at least one additional field.
*/
export class WhatsappCard {
"body": string;
"footer"?: string;
"media"?: Array<string>;
"headerText"?: string;
"actions"?: Array<CardAction>;
}

/**
* Options to pass to create a ContentInstance
*/
export interface ContentListInstanceCreateOptions {
/** */
body?: object;
contentCreateRequest: ContentCreateRequest;
}
/**
* Options to pass to each
Expand Down Expand Up @@ -250,7 +426,7 @@ export class ContentInstance {
*/
variables: any;
/**
* The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
* The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
*/
types: any;
/**
Expand Down Expand Up @@ -344,16 +520,6 @@ export interface ContentListInstance {
(sid: string): ContentContext;
get(sid: string): ContentContext;

/**
* Create a ContentInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed ContentInstance
*/
create(
callback?: (error: Error | null, item?: ContentInstance) => any
): Promise<ContentInstance>;
/**
* Create a ContentInstance
*
Expand All @@ -363,7 +529,7 @@ export interface ContentListInstance {
* @returns Resolves to processed ContentInstance
*/
create(
params: object,
params: ContentCreateRequest,
callback?: (error: Error | null, item?: ContentInstance) => any
): Promise<ContentInstance>;

Expand Down Expand Up @@ -455,14 +621,11 @@ export function ContentListInstance(version: V1): ContentListInstance {
instance._uri = `/Content`;

instance.create = function create(
params?: object | ((error: Error | null, items: ContentInstance) => any),
params: ContentCreateRequest,
callback?: (error: Error | null, items: ContentInstance) => any
): Promise<ContentInstance> {
if (params instanceof Function) {
callback = params;
params = {};
} else {
params = params || {};
if (params === null || params === undefined) {
throw new Error('Required parameter "params" missing.');
}

let data: any = {};
Expand Down
Loading

0 comments on commit d079a99

Please sign in to comment.