From 99798e813b294f11621fd4a6f7a9f5744e9cff1c Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 3 Nov 2022 14:35:25 -0500 Subject: [PATCH] fix: properly serialize various parameters Also fix double accountSid name. --- lib/rest/api/v2010/account/incomingPhoneNumber.ts | 8 ++++---- lib/rest/events/v1/subscription.ts | 2 +- lib/rest/lookups/v1/phoneNumber.ts | 2 +- lib/rest/proxy/v1/service/session.ts | 2 +- lib/rest/verify/v2/service/entity/challenge.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber.ts b/lib/rest/api/v2010/account/incomingPhoneNumber.ts index 815307cc7d..affc250404 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber.ts +++ b/lib/rest/api/v2010/account/incomingPhoneNumber.ts @@ -50,7 +50,7 @@ type IncomingPhoneNumberVoiceReceiveMode = 'voice'|'fax'; /** * Options to pass to update a IncomingPhoneNumberInstance * - * @property { string } [accountSid2] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * @property { string } [accountSid] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * @property { string } [apiVersion] The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * @property { string } [friendlyName] A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @property { string } [smsApplicationSid] The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. @@ -75,7 +75,7 @@ type IncomingPhoneNumberVoiceReceiveMode = 'voice'|'fax'; * @property { string } [bundleSid] The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ export interface IncomingPhoneNumberContextUpdateOptions { - "accountSid2"?: string; + "accountSid"?: string; "apiVersion"?: string; "friendlyName"?: string; "smsApplicationSid"?: string; @@ -336,8 +336,8 @@ export class IncomingPhoneNumberContextImpl implements IncomingPhoneNumberContex let data: any = {}; - if (params["accountSid2"] !== undefined) - data["AccountSid"] = params["accountSid2"]; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; if (params["apiVersion"] !== undefined) data["ApiVersion"] = params["apiVersion"]; if (params["friendlyName"] !== undefined) diff --git a/lib/rest/events/v1/subscription.ts b/lib/rest/events/v1/subscription.ts index 78430132f0..f8d50ce88f 100644 --- a/lib/rest/events/v1/subscription.ts +++ b/lib/rest/events/v1/subscription.ts @@ -564,7 +564,7 @@ export function SubscriptionListInstance(version: V1): SubscriptionListInstance data["SinkSid"] = params["sinkSid"]; - data["Types"] = serialize.map(params["types"], (e => (e))); + data["Types"] = serialize.map(params["types"], (e => serialize.object(e))); const headers: any = {}; diff --git a/lib/rest/lookups/v1/phoneNumber.ts b/lib/rest/lookups/v1/phoneNumber.ts index 4f5d1fcc4c..4e02ff8901 100644 --- a/lib/rest/lookups/v1/phoneNumber.ts +++ b/lib/rest/lookups/v1/phoneNumber.ts @@ -97,7 +97,7 @@ export class PhoneNumberContextImpl implements PhoneNumberContext { if (params["addOns"] !== undefined) data["AddOns"] = serialize.map(params["addOns"], (e => (e))); if (params["addOnsData"] !== undefined) - data["AddOnsData"] = serialize.prefixedCollapsibleMap(params["addOnsData"], "AddOns"); + data = {...data, ...serialize.prefixedCollapsibleMap(params["addOnsData"], "AddOns")}; diff --git a/lib/rest/proxy/v1/service/session.ts b/lib/rest/proxy/v1/service/session.ts index 1029035123..d9ce028a17 100644 --- a/lib/rest/proxy/v1/service/session.ts +++ b/lib/rest/proxy/v1/service/session.ts @@ -644,7 +644,7 @@ export function SessionListInstance(version: V1, serviceSid: string): SessionLis if (params["status"] !== undefined) data["Status"] = params["status"]; if (params["participants"] !== undefined) - data["Participants"] = serialize.map(params["participants"], (e => (e))); + data["Participants"] = serialize.map(params["participants"], (e => serialize.object(e))); const headers: any = {}; diff --git a/lib/rest/verify/v2/service/entity/challenge.ts b/lib/rest/verify/v2/service/entity/challenge.ts index c3a3d62138..9bf318a4a2 100644 --- a/lib/rest/verify/v2/service/entity/challenge.ts +++ b/lib/rest/verify/v2/service/entity/challenge.ts @@ -615,7 +615,7 @@ export function ChallengeListInstance(version: V2, serviceSid: string, identity: if (params["details.message"] !== undefined) data["Details.Message"] = params["details.message"]; if (params["details.fields"] !== undefined) - data["Details.Fields"] = serialize.map(params["details.fields"], (e => (e))); + data["Details.Fields"] = serialize.map(params["details.fields"], (e => serialize.object(e))); if (params["hiddenDetails"] !== undefined) data["HiddenDetails"] = serialize.object(params["hiddenDetails"]); if (params["authPayload"] !== undefined)