Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Merge branch '5.0.0-rc' into main #1011

Merged
merged 10 commits into from
Mar 12, 2024
10 changes: 10 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

_All `MAJOR` version bumps will have upgrade notes posted here._

## [2024-03-07] 4.x.x to 5.x.x

---
### Overview

#### Twilio Node Helper Library’s major version 5.0.0 is now available. We ensured that you can upgrade to Node helper Library 5.0.0 version without any breaking changes of existing apis

Behind the scenes Node Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages.
We're pleased to inform you that version 5.0.0 adds support for the application/json content type in the request body.

## [2023-01-25] 3.x.x to 4.x.x

---
Expand Down
10 changes: 8 additions & 2 deletions src/base/RequestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,14 @@ class RequestClient {
validateStatus: (status) => status >= 100 && status < 600,
};

if (opts.data) {
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
if (opts.data && options.headers) {
if (
options.headers["Content-Type"] === "application/x-www-form-urlencoded"
) {
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
} else if (options.headers["Content-Type"] === "application/json") {
options.data = opts.data;
}
}

if (opts.params) {
Expand Down
13 changes: 13 additions & 0 deletions src/rest/PreviewMessaging.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import PreviewMessagingBase from "./PreviewMessagingBase";
import { MessageListInstance } from "./previewMessaging/v1/message";

class PreviewMessaging extends PreviewMessagingBase {
/**
* @deprecated - Use v1.messages; instead
*/
get messages(): MessageListInstance {
console.warn("messages is deprecated. Use v1.messages; instead.");
return this.v1.messages;
}
}
export = PreviewMessaging;
33 changes: 33 additions & 0 deletions src/rest/PreviewMessagingBase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import Domain from "../base/Domain";
import V1 from "./previewMessaging/V1";

class PreviewMessagingBase extends Domain {
_v1?: V1;

/**
* Initialize previewMessaging domain
*
* @param twilio - The twilio client
*/
constructor(twilio: any) {
super(twilio, "https://preview.messaging.twilio.com");
}

get v1(): V1 {
this._v1 = this._v1 || new V1(this);
return this._v1;
}
}

export = PreviewMessagingBase;
11 changes: 11 additions & 0 deletions src/rest/Twilio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Intelligence from "./Intelligence";
import IpMessaging from "./IpMessaging";
import Lookups from "./Lookups";
import Media from "./Media";
import PreviewMessaging from "./PreviewMessaging";
import Messaging from "./Messaging";
import Microvisor from "./Microvisor";
import Monitor from "./Monitor";
Expand Down Expand Up @@ -104,6 +105,8 @@ class Twilio extends Client {
_lookups?: Lookups;
/** (Twilio.Media) - media domain */
_media?: Media;
/** (Twilio.PreviewMessaging) - previewMessaging domain */
_previewMessaging?: PreviewMessaging;
/** (Twilio.Messaging) - messaging domain */
_messaging?: Messaging;
/** (Twilio.Microvisor) - microvisor domain */
Expand Down Expand Up @@ -176,6 +179,7 @@ class Twilio extends Client {
this.ipMessaging;
this.lookups;
this.media;
this.previewMessaging;
this.messaging;
this.microvisor;
this.monitor;
Expand Down Expand Up @@ -275,6 +279,13 @@ class Twilio extends Client {
get media(): Media {
return this._media ?? (this._media = new (require("./Media"))(this));
}
/** Getter for (Twilio.PreviewMessaging) domain */
get previewMessaging(): PreviewMessaging {
return (
this._previewMessaging ??
(this._previewMessaging = new (require("./PreviewMessaging"))(this))
);
}
/** Getter for (Twilio.Messaging) domain */
get messaging(): Messaging {
return (
Expand Down
14 changes: 14 additions & 0 deletions src/rest/api/v2010/account/authorizedConnectApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ 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 @@ -180,6 +182,8 @@ 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 @@ -213,6 +217,14 @@ 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 @@ -259,6 +271,8 @@ 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
32 changes: 0 additions & 32 deletions src/rest/api/v2010/account/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,8 @@ export interface CallListInstanceEachOptions {
status?: CallStatus;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTime?: Date;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTimeBefore?: Date;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTimeAfter?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTime?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTimeBefore?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTimeAfter?: Date;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
pageSize?: number;
/** Function to process each record. If this and a positional callback are passed, this one will be used */
Expand All @@ -188,16 +180,8 @@ export interface CallListInstanceOptions {
status?: CallStatus;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTime?: Date;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTimeBefore?: Date;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTimeAfter?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTime?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTimeBefore?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTimeAfter?: Date;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
pageSize?: number;
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
Expand All @@ -218,16 +202,8 @@ export interface CallListInstancePageOptions {
status?: CallStatus;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTime?: Date;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTimeBefore?: Date;
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
startTimeAfter?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTime?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTimeBefore?: Date;
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
endTimeAfter?: Date;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
pageSize?: number;
/** Page Number, this value is simply for client state */
Expand Down Expand Up @@ -1134,16 +1110,8 @@ export function CallListInstance(
if (params["status"] !== undefined) data["Status"] = params["status"];
if (params["startTime"] !== undefined)
data["StartTime"] = serialize.iso8601DateTime(params["startTime"]);
if (params["startTimeBefore"] !== undefined)
data["StartTime<"] = serialize.iso8601DateTime(params["startTimeBefore"]);
if (params["startTimeAfter"] !== undefined)
data["StartTime>"] = serialize.iso8601DateTime(params["startTimeAfter"]);
if (params["endTime"] !== undefined)
data["EndTime"] = serialize.iso8601DateTime(params["endTime"]);
if (params["endTimeBefore"] !== undefined)
data["EndTime<"] = serialize.iso8601DateTime(params["endTimeBefore"]);
if (params["endTimeAfter"] !== undefined)
data["EndTime>"] = serialize.iso8601DateTime(params["endTimeAfter"]);
if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"];

if (params.pageNumber !== undefined) data["Page"] = params.pageNumber;
Expand Down
Loading
Loading