Skip to content

Commit

Permalink
[Librarian] Regenerated @ 2264f28906b87ae1f1aedbf72f8dc0e4b57a545a
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Mar 12, 2024
1 parent dfb418d commit e3f6d44
Show file tree
Hide file tree
Showing 37 changed files with 5,360 additions and 42 deletions.
31 changes: 31 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
twilio-node changelog
=====================

[2024-03-12] Version 5.0.0
--------------------------
**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md###-2024-03-07-4xx-to-5xx) for detailed migration notes.

**Library - Feature**
- [PR #1011](https://github.com/twilio/twilio-node/pull/1011): Merge branch '5.0.0-rc' into main. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! **(breaking change)**

**Api**
- Correct precedence documentation for application_sid vs status_callback in message creation
- Mark MaxPrice as deprecated

**Flex**
- Making `plugins` visibility to public

**Messaging**
- Add new `errors` attribute to the Brand Registration resource.
- Mark `brand_feedback` attribute as deprecated.
- Mark `failure_reason` attribute as deprecated.
- The new `errors` attribute is expected to provide additional information about Brand registration failures and feedback (if any has been provided by The Campaign Registry). Consumers should use this attribute instead of `brand_feedback` and `failure_reason`.

**Numbers**
- Correcting mount_name for porting port in fetch API

**Trusthub**
- Add new field in statusCallbackUrl in compliance_registration.
- Add new field in isvRegisteringForSelfOrTenant in compliance_registration.

**Twiml**
- Expanded description of Action parameter for Message verb


[2024-02-27] Version 4.23.0
---------------------------
**Library - Chore**
Expand Down
14 changes: 0 additions & 14 deletions src/rest/api/v2010/account/authorizedConnectApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ interface AuthorizedConnectAppResource {
connect_app_friendly_name: string;
connect_app_homepage_url: string;
connect_app_sid: string;
date_created: Date;
date_updated: Date;
permissions: Array<AuthorizedConnectAppPermission>;
uri: string;
}
Expand All @@ -182,8 +180,6 @@ export class AuthorizedConnectAppInstance {
this.connectAppFriendlyName = payload.connect_app_friendly_name;
this.connectAppHomepageUrl = payload.connect_app_homepage_url;
this.connectAppSid = payload.connect_app_sid;
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
this.permissions = payload.permissions;
this.uri = payload.uri;

Expand Down Expand Up @@ -217,14 +213,6 @@ export class AuthorizedConnectAppInstance {
* The SID that we assigned to the Connect App.
*/
connectAppSid: string;
/**
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
*/
dateCreated: Date;
/**
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
*/
dateUpdated: Date;
/**
* The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`.
*/
Expand Down Expand Up @@ -271,8 +259,6 @@ export class AuthorizedConnectAppInstance {
connectAppFriendlyName: this.connectAppFriendlyName,
connectAppHomepageUrl: this.connectAppHomepageUrl,
connectAppSid: this.connectAppSid,
dateCreated: this.dateCreated,
dateUpdated: this.dateUpdated,
permissions: this.permissions,
uri: this.uri,
};
Expand Down
4 changes: 2 additions & 2 deletions src/rest/api/v2010/account/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export interface MessageListInstanceCreateOptions {
to: string;
/** The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). */
statusCallback?: string;
/** The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App\\\'s `message_status_callback` URL. */
/** The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App\\\'s `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. */
applicationSid?: string;
/** The maximum price in US dollars that you are willing to pay for this Message\\\'s delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. */
/** [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. */
maxPrice?: number;
/** Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. */
provideFeedback?: boolean;
Expand Down
225 changes: 225 additions & 0 deletions src/rest/content/v1/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,170 @@ import V1 from "../V1";
const deserialize = require("../../../base/deserialize");
const serialize = require("../../../base/serialize");
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";

/**
* 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/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;
"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 {
/** */
contentCreateRequest: ContentCreateRequest;
}
/**
* Options to pass to each
*/
Expand Down Expand Up @@ -58,6 +220,7 @@ export interface ContentListInstancePageOptions {
}

export interface ContentContext {
approvalCreate: ApprovalCreateListInstance;
approvalFetch: ApprovalFetchListInstance;

/**
Expand Down Expand Up @@ -97,6 +260,7 @@ export class ContentContextImpl implements ContentContext {
protected _solution: ContentContextSolution;
protected _uri: string;

protected _approvalCreate?: ApprovalCreateListInstance;
protected _approvalFetch?: ApprovalFetchListInstance;

constructor(protected _version: V1, sid: string) {
Expand All @@ -108,6 +272,13 @@ export class ContentContextImpl implements ContentContext {
this._uri = `/Content/${sid}`;
}

get approvalCreate(): ApprovalCreateListInstance {
this._approvalCreate =
this._approvalCreate ||
ApprovalCreateListInstance(this._version, this._solution.sid);
return this._approvalCreate;
}

get approvalFetch(): ApprovalFetchListInstance {
this._approvalFetch =
this._approvalFetch ||
Expand Down Expand Up @@ -278,6 +449,13 @@ export class ContentInstance {
return this._proxy.fetch(callback);
}

/**
* Access the approvalCreate.
*/
approvalCreate(): ApprovalCreateListInstance {
return this._proxy.approvalCreate;
}

/**
* Access the approvalFetch.
*/
Expand Down Expand Up @@ -320,6 +498,19 @@ export interface ContentListInstance {
(sid: string): ContentContext;
get(sid: string): ContentContext;

/**
* Create a ContentInstance
*
* @param params - Body for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed ContentInstance
*/
create(
params: ContentCreateRequest,
callback?: (error: Error | null, item?: ContentInstance) => any
): Promise<ContentInstance>;

/**
* Streams ContentInstance records from the API.
*
Expand Down Expand Up @@ -407,6 +598,40 @@ export function ContentListInstance(version: V1): ContentListInstance {
instance._solution = {};
instance._uri = `/Content`;

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

let data: any = {};

data = params;

const headers: any = {};
headers["Content-Type"] = "application/json";

let operationVersion = version,
operationPromise = operationVersion.create({
uri: instance._uri,
method: "post",
data,
headers,
});

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

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

instance.page = function page(
params?:
| ContentListInstancePageOptions
Expand Down
Loading

0 comments on commit e3f6d44

Please sign in to comment.