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

fix: properly serialize various parameters #817

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/rest/api/v2010/account/incomingPhoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/events/v1/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/lookups/v1/phoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")};



Expand Down
2 changes: 1 addition & 1 deletion lib/rest/proxy/v1/service/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/verify/v2/service/entity/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down