From f5f0458ce275438e098da0054d78164ce7acc32e Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 14 Mar 2024 14:47:00 +0000 Subject: [PATCH] [Librarian] Regenerated @ 84df4a97cab4aa96362a9d21aaf3909bbd2dbf5a --- CHANGES.md | 6 + src/rest/Oauth.ts | 5 + src/rest/OauthBase.ts | 33 +++ src/rest/Twilio.ts | 8 + src/rest/api/v2010/account/call.ts | 32 +++ src/rest/api/v2010/account/conference.ts | 32 +++ src/rest/api/v2010/account/message.ts | 16 ++ src/rest/content/v1/content.ts | 22 ++ .../numbers/v2/regulatoryCompliance/bundle.ts | 20 ++ src/rest/oauth/V1.ts | 46 ++++ src/rest/oauth/v1/authorize.ts | 169 +++++++++++++++ src/rest/oauth/v1/token.ts | 199 ++++++++++++++++++ .../customerProfilesEntityAssignments.ts | 8 + .../trustProductsEntityAssignments.ts | 8 + 14 files changed, 604 insertions(+) create mode 100644 src/rest/Oauth.ts create mode 100644 src/rest/OauthBase.ts create mode 100644 src/rest/oauth/V1.ts create mode 100644 src/rest/oauth/v1/authorize.ts create mode 100644 src/rest/oauth/v1/token.ts diff --git a/CHANGES.md b/CHANGES.md index 4055df8632..e2762e3482 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ twilio-node changelog ===================== +[2024-03-14] Version 5.0.1 +-------------------------- +**Oauth** +- Add new APIs for vendor authorize and token endpoints + + [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. diff --git a/src/rest/Oauth.ts b/src/rest/Oauth.ts new file mode 100644 index 0000000000..62ea7c5e57 --- /dev/null +++ b/src/rest/Oauth.ts @@ -0,0 +1,5 @@ +import OauthBase from "./OauthBase"; + +class Oauth extends OauthBase {} + +export = Oauth; diff --git a/src/rest/OauthBase.ts b/src/rest/OauthBase.ts new file mode 100644 index 0000000000..513dd037f3 --- /dev/null +++ b/src/rest/OauthBase.ts @@ -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 "./oauth/V1"; + +class OauthBase extends Domain { + _v1?: V1; + + /** + * Initialize oauth domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any) { + super(twilio, "https://oauth.twilio.com"); + } + + get v1(): V1 { + this._v1 = this._v1 || new V1(this); + return this._v1; + } +} + +export = OauthBase; diff --git a/src/rest/Twilio.ts b/src/rest/Twilio.ts index d8c5b45544..c7fba2893e 100644 --- a/src/rest/Twilio.ts +++ b/src/rest/Twilio.ts @@ -30,6 +30,7 @@ import Microvisor from "./Microvisor"; import Monitor from "./Monitor"; import Notify from "./Notify"; import Numbers from "./Numbers"; +import Oauth from "./Oauth"; import Preview from "./Preview"; import Pricing from "./Pricing"; import Proxy from "./Proxy"; @@ -117,6 +118,8 @@ class Twilio extends Client { _notify?: Notify; /** (Twilio.Numbers) - numbers domain */ _numbers?: Numbers; + /** (Twilio.Oauth) - oauth domain */ + _oauth?: Oauth; /** (Twilio.Preview) - preview domain */ _preview?: Preview; /** (Twilio.Pricing) - pricing domain */ @@ -185,6 +188,7 @@ class Twilio extends Client { this.monitor; this.notify; this.numbers; + this.oauth; this.preview; this.pricing; this.proxy; @@ -311,6 +315,10 @@ class Twilio extends Client { get numbers(): Numbers { return this._numbers ?? (this._numbers = new (require("./Numbers"))(this)); } + /** Getter for (Twilio.Oauth) domain */ + get oauth(): Oauth { + return this._oauth ?? (this._oauth = new (require("./Oauth"))(this)); + } /** Getter for (Twilio.Preview) domain */ get preview(): Preview { return this._preview ?? (this._preview = new (require("./Preview"))(this)); diff --git a/src/rest/api/v2010/account/call.ts b/src/rest/api/v2010/account/call.ts index 536daecfd1..32545b8278 100644 --- a/src/rest/api/v2010/account/call.ts +++ b/src/rest/api/v2010/account/call.ts @@ -154,8 +154,16 @@ 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 */ @@ -180,8 +188,16 @@ 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 */ @@ -202,8 +218,16 @@ 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 */ @@ -1110,8 +1134,16 @@ 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; diff --git a/src/rest/api/v2010/account/conference.ts b/src/rest/api/v2010/account/conference.ts index 16ada28ffc..1aa02947ef 100644 --- a/src/rest/api/v2010/account/conference.ts +++ b/src/rest/api/v2010/account/conference.ts @@ -50,8 +50,16 @@ export interface ConferenceContextUpdateOptions { export interface ConferenceListInstanceEachOptions { /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedAfter?: Date; /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ dateUpdated?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedBefore?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedAfter?: Date; /** The string that identifies the Conference resources to read. */ friendlyName?: string; /** The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ @@ -72,8 +80,16 @@ export interface ConferenceListInstanceEachOptions { export interface ConferenceListInstanceOptions { /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedAfter?: Date; /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ dateUpdated?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedBefore?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedAfter?: Date; /** The string that identifies the Conference resources to read. */ friendlyName?: string; /** The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ @@ -90,8 +106,16 @@ export interface ConferenceListInstanceOptions { export interface ConferenceListInstancePageOptions { /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedAfter?: Date; /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ dateUpdated?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedBefore?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedAfter?: Date; /** The string that identifies the Conference resources to read. */ friendlyName?: string; /** The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ @@ -593,8 +617,16 @@ export function ConferenceListInstance( if (params["dateCreated"] !== undefined) data["DateCreated"] = serialize.iso8601Date(params["dateCreated"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreated<"] = serialize.iso8601Date(params["dateCreatedBefore"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreated>"] = serialize.iso8601Date(params["dateCreatedAfter"]); if (params["dateUpdated"] !== undefined) data["DateUpdated"] = serialize.iso8601Date(params["dateUpdated"]); + if (params["dateUpdatedBefore"] !== undefined) + data["DateUpdated<"] = serialize.iso8601Date(params["dateUpdatedBefore"]); + if (params["dateUpdatedAfter"] !== undefined) + data["DateUpdated>"] = serialize.iso8601Date(params["dateUpdatedAfter"]); if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"]; if (params["status"] !== undefined) data["Status"] = params["status"]; diff --git a/src/rest/api/v2010/account/message.ts b/src/rest/api/v2010/account/message.ts index 37e26c5db6..8cdd876d1e 100644 --- a/src/rest/api/v2010/account/message.ts +++ b/src/rest/api/v2010/account/message.ts @@ -124,6 +124,10 @@ export interface MessageListInstanceEachOptions { from?: string; /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ dateSent?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentBefore?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentAfter?: 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 */ @@ -144,6 +148,10 @@ export interface MessageListInstanceOptions { from?: string; /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ dateSent?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentBefore?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentAfter?: 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 */ @@ -160,6 +168,10 @@ export interface MessageListInstancePageOptions { from?: string; /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ dateSent?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentBefore?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentAfter?: 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 */ @@ -852,6 +864,10 @@ export function MessageListInstance( if (params["from"] !== undefined) data["From"] = params["from"]; if (params["dateSent"] !== undefined) data["DateSent"] = serialize.iso8601DateTime(params["dateSent"]); + if (params["dateSentBefore"] !== undefined) + data["DateSent<"] = serialize.iso8601DateTime(params["dateSentBefore"]); + if (params["dateSentAfter"] !== undefined) + data["DateSent>"] = serialize.iso8601DateTime(params["dateSentAfter"]); if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"]; if (params.pageNumber !== undefined) data["Page"] = params.pageNumber; diff --git a/src/rest/content/v1/content.ts b/src/rest/content/v1/content.ts index 3be70208b7..f0bd69cb14 100644 --- a/src/rest/content/v1/content.ts +++ b/src/rest/content/v1/content.ts @@ -49,6 +49,15 @@ export class CardAction { 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 */ @@ -100,6 +109,18 @@ export class TwilioCard { "actions"?: Array; } +/** + * 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; + "dynamicItems"?: string; +} + /** * twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection. */ @@ -152,6 +173,7 @@ export class Types { "twilioCallToAction"?: TwilioCallToAction | null; "twilioQuickReply"?: TwilioQuickReply | null; "twilioCard"?: TwilioCard | null; + "twilioCatalog"?: TwilioCatalog | null; "whatsappCard"?: WhatsappCard | null; "whatsappAuthentication"?: WhatsappAuthentication | null; } diff --git a/src/rest/numbers/v2/regulatoryCompliance/bundle.ts b/src/rest/numbers/v2/regulatoryCompliance/bundle.ts index 50cd9c6205..aa07f2f6b8 100644 --- a/src/rest/numbers/v2/regulatoryCompliance/bundle.ts +++ b/src/rest/numbers/v2/regulatoryCompliance/bundle.ts @@ -93,6 +93,10 @@ export interface BundleListInstanceEachOptions { sortDirection?: BundleSortDirection; /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ validUntilDate?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateBefore?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateAfter?: 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 */ @@ -125,6 +129,10 @@ export interface BundleListInstanceOptions { sortDirection?: BundleSortDirection; /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ validUntilDate?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateBefore?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateAfter?: 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 */ @@ -153,6 +161,10 @@ export interface BundleListInstancePageOptions { sortDirection?: BundleSortDirection; /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ validUntilDate?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateBefore?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateAfter?: 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 */ @@ -771,6 +783,14 @@ export function BundleListInstance(version: V2): BundleListInstance { data["ValidUntilDate"] = serialize.iso8601DateTime( params["validUntilDate"] ); + if (params["validUntilDateBefore"] !== undefined) + data["ValidUntilDate<"] = serialize.iso8601DateTime( + params["validUntilDateBefore"] + ); + if (params["validUntilDateAfter"] !== undefined) + data["ValidUntilDate>"] = serialize.iso8601DateTime( + params["validUntilDateAfter"] + ); if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"]; if (params.pageNumber !== undefined) data["Page"] = params.pageNumber; diff --git a/src/rest/oauth/V1.ts b/src/rest/oauth/V1.ts new file mode 100644 index 0000000000..eb9f485e7d --- /dev/null +++ b/src/rest/oauth/V1.ts @@ -0,0 +1,46 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Oauth + * 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 OauthBase from "../OauthBase"; +import Version from "../../base/Version"; +import { AuthorizeListInstance } from "./v1/authorize"; +import { TokenListInstance } from "./v1/token"; + +export default class V1 extends Version { + /** + * Initialize the V1 version of Oauth + * + * @param domain - The Twilio (Twilio.Oauth) domain + */ + constructor(domain: OauthBase) { + super(domain, "v1"); + } + + /** authorize - { Twilio.Oauth.V1.AuthorizeListInstance } resource */ + protected _authorize?: AuthorizeListInstance; + /** token - { Twilio.Oauth.V1.TokenListInstance } resource */ + protected _token?: TokenListInstance; + + /** Getter for authorize resource */ + get authorize(): AuthorizeListInstance { + this._authorize = this._authorize || AuthorizeListInstance(this); + return this._authorize; + } + + /** Getter for token resource */ + get token(): TokenListInstance { + this._token = this._token || TokenListInstance(this); + return this._token; + } +} diff --git a/src/rest/oauth/v1/authorize.ts b/src/rest/oauth/v1/authorize.ts new file mode 100644 index 0000000000..651e95b6b3 --- /dev/null +++ b/src/rest/oauth/v1/authorize.ts @@ -0,0 +1,169 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Oauth + * 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 fetch a AuthorizeInstance + */ +export interface AuthorizeListInstanceFetchOptions { + /** Response Type */ + responseType?: string; + /** The Client Identifier */ + clientId?: string; + /** The url to which response will be redirected to */ + redirectUri?: string; + /** The scope of the access request */ + scope?: string; + /** An opaque value which can be used to maintain state between the request and callback */ + state?: string; +} + +export interface AuthorizeSolution {} + +export interface AuthorizeListInstance { + _version: V1; + _solution: AuthorizeSolution; + _uri: string; + + /** + * Fetch a AuthorizeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizeInstance + */ + fetch( + callback?: (error: Error | null, item?: AuthorizeInstance) => any + ): Promise; + /** + * Fetch a AuthorizeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizeInstance + */ + fetch( + params: AuthorizeListInstanceFetchOptions, + callback?: (error: Error | null, item?: AuthorizeInstance) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export function AuthorizeListInstance(version: V1): AuthorizeListInstance { + const instance = {} as AuthorizeListInstance; + + instance._version = version; + instance._solution = {}; + instance._uri = `/authorize`; + + instance.fetch = function fetch( + params?: + | AuthorizeListInstanceFetchOptions + | ((error: Error | null, items: AuthorizeInstance) => any), + callback?: (error: Error | null, items: AuthorizeInstance) => any + ): Promise { + if (params instanceof Function) { + callback = params; + params = {}; + } else { + params = params || {}; + } + + let data: any = {}; + + if (params["responseType"] !== undefined) + data["ResponseType"] = params["responseType"]; + if (params["clientId"] !== undefined) data["ClientId"] = params["clientId"]; + if (params["redirectUri"] !== undefined) + data["RedirectUri"] = params["redirectUri"]; + if (params["scope"] !== undefined) data["Scope"] = params["scope"]; + if (params["state"] !== undefined) data["State"] = params["state"]; + + const headers: any = {}; + + let operationVersion = version, + operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + + operationPromise = operationPromise.then( + (payload) => new AuthorizeInstance(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; +} + +interface AuthorizePayload extends AuthorizeResource {} + +interface AuthorizeResource { + redirect_to: string; +} + +export class AuthorizeInstance { + constructor(protected _version: V1, payload: AuthorizeResource) { + this.redirectTo = payload.redirect_to; + } + + /** + * The callback URL + */ + redirectTo: string; + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + redirectTo: this.redirectTo, + }; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} diff --git a/src/rest/oauth/v1/token.ts b/src/rest/oauth/v1/token.ts new file mode 100644 index 0000000000..fb2bc71ac1 --- /dev/null +++ b/src/rest/oauth/v1/token.ts @@ -0,0 +1,199 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Oauth + * 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 create a TokenInstance + */ +export interface TokenListInstanceCreateOptions { + /** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */ + grantType: string; + /** A 34 character string that uniquely identifies this OAuth App. */ + clientId: string; + /** The credential for confidential OAuth App. */ + clientSecret: string; + /** JWT token related to the authorization code grant type. */ + code?: string; + /** The redirect uri */ + redirectUri?: string; + /** The targeted audience uri */ + audience?: string; +} + +export interface TokenSolution {} + +export interface TokenListInstance { + _version: V1; + _solution: TokenSolution; + _uri: string; + + /** + * Create a TokenInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TokenInstance + */ + create( + params: TokenListInstanceCreateOptions, + callback?: (error: Error | null, item?: TokenInstance) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export function TokenListInstance(version: V1): TokenListInstance { + const instance = {} as TokenListInstance; + + instance._version = version; + instance._solution = {}; + instance._uri = `/token`; + + instance.create = function create( + params: TokenListInstanceCreateOptions, + callback?: (error: Error | null, items: TokenInstance) => any + ): Promise { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + + if (params["grantType"] === null || params["grantType"] === undefined) { + throw new Error("Required parameter \"params['grantType']\" missing."); + } + + if (params["clientId"] === null || params["clientId"] === undefined) { + throw new Error("Required parameter \"params['clientId']\" missing."); + } + + if ( + params["clientSecret"] === null || + params["clientSecret"] === undefined + ) { + throw new Error("Required parameter \"params['clientSecret']\" missing."); + } + + let data: any = {}; + + data["GrantType"] = params["grantType"]; + + data["ClientId"] = params["clientId"]; + + data["ClientSecret"] = params["clientSecret"]; + if (params["code"] !== undefined) data["Code"] = params["code"]; + if (params["redirectUri"] !== undefined) + data["RedirectUri"] = params["redirectUri"]; + if (params["audience"] !== undefined) data["Audience"] = params["audience"]; + + 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 TokenInstance(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; +} + +interface TokenPayload extends TokenResource {} + +interface TokenResource { + access_token: string; + refresh_token: string; + id_token: string; + token_type: string; + expires_in: Date; +} + +export class TokenInstance { + constructor(protected _version: V1, payload: TokenResource) { + this.accessToken = payload.access_token; + this.refreshToken = payload.refresh_token; + this.idToken = payload.id_token; + this.tokenType = payload.token_type; + this.expiresIn = deserialize.iso8601DateTime(payload.expires_in); + } + + /** + * Token which carries the necessary information to access a Twilio resource directly. + */ + accessToken: string; + /** + * Token which carries the information necessary to get a new access token. + */ + refreshToken: string; + /** + * Token which carries the information necessary of user profile. + */ + idToken: string; + /** + * Token type + */ + tokenType: string; + expiresIn: Date; + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accessToken: this.accessToken, + refreshToken: this.refreshToken, + idToken: this.idToken, + tokenType: this.tokenType, + expiresIn: this.expiresIn, + }; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} diff --git a/src/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.ts b/src/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.ts index 22663eeed0..a938f6f512 100644 --- a/src/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.ts +++ b/src/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.ts @@ -31,6 +31,8 @@ export interface CustomerProfilesEntityAssignmentsListInstanceCreateOptions { * Options to pass to each */ export interface CustomerProfilesEntityAssignmentsListInstanceEachOptions { + /** A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ + objectType?: string; /** 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 */ @@ -48,6 +50,8 @@ export interface CustomerProfilesEntityAssignmentsListInstanceEachOptions { * Options to pass to list */ export interface CustomerProfilesEntityAssignmentsListInstanceOptions { + /** A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ + objectType?: string; /** 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 */ @@ -58,6 +62,8 @@ export interface CustomerProfilesEntityAssignmentsListInstanceOptions { * Options to pass to page */ export interface CustomerProfilesEntityAssignmentsListInstancePageOptions { + /** A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ + objectType?: string; /** 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 */ @@ -519,6 +525,8 @@ export function CustomerProfilesEntityAssignmentsListInstance( let data: any = {}; + if (params["objectType"] !== undefined) + data["ObjectType"] = params["objectType"]; if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"]; if (params.pageNumber !== undefined) data["Page"] = params.pageNumber; diff --git a/src/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.ts b/src/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.ts index ae6860fc92..c2b688a518 100644 --- a/src/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.ts +++ b/src/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.ts @@ -31,6 +31,8 @@ export interface TrustProductsEntityAssignmentsListInstanceCreateOptions { * Options to pass to each */ export interface TrustProductsEntityAssignmentsListInstanceEachOptions { + /** A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ + objectType?: string; /** 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 */ @@ -48,6 +50,8 @@ export interface TrustProductsEntityAssignmentsListInstanceEachOptions { * Options to pass to list */ export interface TrustProductsEntityAssignmentsListInstanceOptions { + /** A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ + objectType?: string; /** 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 */ @@ -58,6 +62,8 @@ export interface TrustProductsEntityAssignmentsListInstanceOptions { * Options to pass to page */ export interface TrustProductsEntityAssignmentsListInstancePageOptions { + /** A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ + objectType?: string; /** 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 */ @@ -518,6 +524,8 @@ export function TrustProductsEntityAssignmentsListInstance( let data: any = {}; + if (params["objectType"] !== undefined) + data["ObjectType"] = params["objectType"]; if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"]; if (params.pageNumber !== undefined) data["Page"] = params.pageNumber;