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: serialize objects properly #815

Merged
merged 2 commits into from
Nov 2, 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
2 changes: 1 addition & 1 deletion lib/rest/api/v2010/account/call/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export function PaymentListInstance(version: V2010, accountSid: string, callSid:
if (params["description"] !== undefined) data["Description"] = params["description"];
if (params["input"] !== undefined) data["Input"] = params["input"];
if (params["minPostalCodeLength"] !== undefined) data["MinPostalCodeLength"] = params["minPostalCodeLength"];
if (params["parameter"] !== undefined) data["Parameter"] = params["parameter"];
if (params["parameter"] !== undefined) data["Parameter"] = serialize.object(params["parameter"]);
if (params["paymentConnector"] !== undefined) data["PaymentConnector"] = params["paymentConnector"];
if (params["paymentMethod"] !== undefined) data["PaymentMethod"] = params["paymentMethod"];
if (params["postalCode"] !== undefined) data["PostalCode"] = serialize.bool(params["postalCode"]);
Expand Down
8 changes: 4 additions & 4 deletions lib/rest/autopilot/v1/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ export class AssistantContextImpl implements AssistantContext {
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["callbackUrl"] !== undefined) data["CallbackUrl"] = params["callbackUrl"];
if (params["callbackEvents"] !== undefined) data["CallbackEvents"] = params["callbackEvents"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = params["styleSheet"];
if (params["defaults"] !== undefined) data["Defaults"] = params["defaults"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = serialize.object(params["styleSheet"]);
if (params["defaults"] !== undefined) data["Defaults"] = serialize.object(params["defaults"]);
if (params["developmentStage"] !== undefined) data["DevelopmentStage"] = params["developmentStage"];

const headers: any = {};
Expand Down Expand Up @@ -725,8 +725,8 @@ export function AssistantListInstance(version: V1): AssistantListInstance {
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["callbackUrl"] !== undefined) data["CallbackUrl"] = params["callbackUrl"];
if (params["callbackEvents"] !== undefined) data["CallbackEvents"] = params["callbackEvents"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = params["styleSheet"];
if (params["defaults"] !== undefined) data["Defaults"] = params["defaults"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = serialize.object(params["styleSheet"]);
if (params["defaults"] !== undefined) data["Defaults"] = serialize.object(params["defaults"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/autopilot/v1/assistant/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class DefaultsContextImpl implements DefaultsContext {

const data: any = {};

if (params["defaults"] !== undefined) data["Defaults"] = params["defaults"];
if (params["defaults"] !== undefined) data["Defaults"] = serialize.object(params["defaults"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/autopilot/v1/assistant/styleSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class StyleSheetContextImpl implements StyleSheetContext {

const data: any = {};

if (params["styleSheet"] !== undefined) data["StyleSheet"] = params["styleSheet"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = serialize.object(params["styleSheet"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/autopilot/v1/assistant/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class TaskContextImpl implements TaskContext {

if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"];
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["actions"] !== undefined) data["Actions"] = params["actions"];
if (params["actions"] !== undefined) data["Actions"] = serialize.object(params["actions"]);
if (params["actionsUrl"] !== undefined) data["ActionsUrl"] = params["actionsUrl"];

const headers: any = {};
Expand Down Expand Up @@ -611,7 +611,7 @@ export function TaskListInstance(version: V1, assistantSid: string): TaskListIns

data["UniqueName"] = params["uniqueName"];
if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"];
if (params["actions"] !== undefined) data["Actions"] = params["actions"];
if (params["actions"] !== undefined) data["Actions"] = serialize.object(params["actions"]);
if (params["actionsUrl"] !== undefined) data["ActionsUrl"] = params["actionsUrl"];

const headers: any = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/autopilot/v1/assistant/task/taskActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class TaskActionsContextImpl implements TaskActionsContext {

const data: any = {};

if (params["actions"] !== undefined) data["Actions"] = params["actions"];
if (params["actions"] !== undefined) data["Actions"] = serialize.object(params["actions"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/events/v1/sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ export function SinkListInstance(version: V1): SinkListInstance {
const data: any = {};

data["Description"] = params["description"];
data["SinkConfiguration"] = params["sinkConfiguration"];
data["SinkConfiguration"] = serialize.object(params["sinkConfiguration"]);
data["SinkType"] = params["sinkType"];

const headers: any = {};
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/flexApi/v1/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ export function InteractionListInstance(version: V1): InteractionListInstance {

const data: any = {};

data["Channel"] = params["channel"];
data["Routing"] = params["routing"];
data["Channel"] = serialize.object(params["channel"]);
data["Routing"] = serialize.object(params["routing"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/flexApi/v1/interaction/interactionChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class InteractionChannelContextImpl implements InteractionChannelContext
const data: any = {};

data["Status"] = params["status"];
if (params["routing"] !== undefined) data["Routing"] = params["routing"];
if (params["routing"] !== undefined) data["Routing"] = serialize.object(params["routing"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export function InteractionChannelInviteListInstance(version: V1, interactionSid

const data: any = {};

data["Routing"] = params["routing"];
data["Routing"] = serialize.object(params["routing"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export function InteractionChannelParticipantListInstance(version: V1, interacti
const data: any = {};

data["Type"] = params["type"];
data["MediaProperties"] = params["mediaProperties"];
data["MediaProperties"] = serialize.object(params["mediaProperties"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/media/v1/mediaProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export function MediaProcessorListInstance(version: V1): MediaProcessorListInsta

data["Extension"] = params["extension"];
data["ExtensionContext"] = params["extensionContext"];
if (params["extensionEnvironment"] !== undefined) data["ExtensionEnvironment"] = params["extensionEnvironment"];
if (params["extensionEnvironment"] !== undefined) data["ExtensionEnvironment"] = serialize.object(params["extensionEnvironment"]);
if (params["statusCallback"] !== undefined) data["StatusCallback"] = params["statusCallback"];
if (params["statusCallbackMethod"] !== undefined) data["StatusCallbackMethod"] = params["statusCallbackMethod"];
if (params["maxDuration"] !== undefined) data["MaxDuration"] = params["maxDuration"];
Expand Down
14 changes: 7 additions & 7 deletions lib/rest/notify/v1/service/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ export function NotificationListInstance(version: V1, serviceSid: string): Notif
if (params["title"] !== undefined) data["Title"] = params["title"];
if (params["sound"] !== undefined) data["Sound"] = params["sound"];
if (params["action"] !== undefined) data["Action"] = params["action"];
if (params["data"] !== undefined) data["Data"] = params["data"];
if (params["apn"] !== undefined) data["Apn"] = params["apn"];
if (params["gcm"] !== undefined) data["Gcm"] = params["gcm"];
if (params["sms"] !== undefined) data["Sms"] = params["sms"];
if (params["facebookMessenger"] !== undefined) data["FacebookMessenger"] = params["facebookMessenger"];
if (params["fcm"] !== undefined) data["Fcm"] = params["fcm"];
if (params["data"] !== undefined) data["Data"] = serialize.object(params["data"]);
if (params["apn"] !== undefined) data["Apn"] = serialize.object(params["apn"]);
if (params["gcm"] !== undefined) data["Gcm"] = serialize.object(params["gcm"]);
if (params["sms"] !== undefined) data["Sms"] = serialize.object(params["sms"]);
if (params["facebookMessenger"] !== undefined) data["FacebookMessenger"] = serialize.object(params["facebookMessenger"]);
if (params["fcm"] !== undefined) data["Fcm"] = serialize.object(params["fcm"]);
if (params["segment"] !== undefined) data["Segment"] = serialize.map(params["segment"], ((e) => e));
if (params["alexa"] !== undefined) data["Alexa"] = params["alexa"];
if (params["alexa"] !== undefined) data["Alexa"] = serialize.object(params["alexa"]);
if (params["toBinding"] !== undefined) data["ToBinding"] = serialize.map(params["toBinding"], ((e) => e));
if (params["deliveryCallbackUrl"] !== undefined) data["DeliveryCallbackUrl"] = params["deliveryCallbackUrl"];
if (params["identity"] !== undefined) data["Identity"] = serialize.map(params["identity"], ((e) => e));
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/numbers/v2/regulatoryCompliance/endUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class EndUserContextImpl implements EndUserContext {
const data: any = {};

if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"];
if (params["attributes"] !== undefined) data["Attributes"] = params["attributes"];
if (params["attributes"] !== undefined) data["Attributes"] = serialize.object(params["attributes"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down Expand Up @@ -530,7 +530,7 @@ export function EndUserListInstance(version: V2): EndUserListInstance {

data["FriendlyName"] = params["friendlyName"];
data["Type"] = params["type"];
if (params["attributes"] !== undefined) data["Attributes"] = params["attributes"];
if (params["attributes"] !== undefined) data["Attributes"] = serialize.object(params["attributes"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class SupportingDocumentContextImpl implements SupportingDocumentContext
const data: any = {};

if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"];
if (params["attributes"] !== undefined) data["Attributes"] = params["attributes"];
if (params["attributes"] !== undefined) data["Attributes"] = serialize.object(params["attributes"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down Expand Up @@ -551,7 +551,7 @@ export function SupportingDocumentListInstance(version: V2): SupportingDocumentL

data["FriendlyName"] = params["friendlyName"];
data["Type"] = params["type"];
if (params["attributes"] !== undefined) data["Attributes"] = params["attributes"];
if (params["attributes"] !== undefined) data["Attributes"] = serialize.object(params["attributes"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/preview/marketplace/installedAddOn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class InstalledAddOnContextImpl implements InstalledAddOnContext {

const data: any = {};

if (params["configuration"] !== undefined) data["Configuration"] = params["configuration"];
if (params["configuration"] !== undefined) data["Configuration"] = serialize.object(params["configuration"]);
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];

const headers: any = {};
Expand Down Expand Up @@ -562,7 +562,7 @@ export function InstalledAddOnListInstance(version: Marketplace): InstalledAddOn

data["AvailableAddOnSid"] = params["availableAddOnSid"];
data["AcceptTermsOfService"] = serialize.bool(params["acceptTermsOfService"]);
if (params["configuration"] !== undefined) data["Configuration"] = params["configuration"];
if (params["configuration"] !== undefined) data["Configuration"] = serialize.object(params["configuration"]);
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];

const headers: any = {};
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/preview/sync/service/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class DocumentContextImpl implements DocumentContext {

const data: any = {};

data["Data"] = params["data"];
data["Data"] = serialize.object(params["data"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down Expand Up @@ -521,7 +521,7 @@ export function DocumentListInstance(version: Sync, serviceSid: string): Documen
const data: any = {};

if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["data"] !== undefined) data["Data"] = params["data"];
if (params["data"] !== undefined) data["Data"] = serialize.object(params["data"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/preview/sync/service/syncList/syncListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class SyncListItemContextImpl implements SyncListItemContext {

const data: any = {};

data["Data"] = params["data"];
data["Data"] = serialize.object(params["data"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down Expand Up @@ -557,7 +557,7 @@ export function SyncListItemListInstance(version: Sync, serviceSid: string, list

const data: any = {};

data["Data"] = params["data"];
data["Data"] = serialize.object(params["data"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/preview/sync/service/syncMap/syncMapItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export class SyncMapItemContextImpl implements SyncMapItemContext {

const data: any = {};

data["Data"] = params["data"];
data["Data"] = serialize.object(params["data"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down Expand Up @@ -564,7 +564,7 @@ export function SyncMapItemListInstance(version: Sync, serviceSid: string, mapSi
const data: any = {};

data["Key"] = params["key"];
data["Data"] = params["data"];
data["Data"] = serialize.object(params["data"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
12 changes: 6 additions & 6 deletions lib/rest/preview/understand/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ export class AssistantContextImpl implements AssistantContext {
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["callbackUrl"] !== undefined) data["CallbackUrl"] = params["callbackUrl"];
if (params["callbackEvents"] !== undefined) data["CallbackEvents"] = params["callbackEvents"];
if (params["fallbackActions"] !== undefined) data["FallbackActions"] = params["fallbackActions"];
if (params["initiationActions"] !== undefined) data["InitiationActions"] = params["initiationActions"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = params["styleSheet"];
if (params["fallbackActions"] !== undefined) data["FallbackActions"] = serialize.object(params["fallbackActions"]);
if (params["initiationActions"] !== undefined) data["InitiationActions"] = serialize.object(params["initiationActions"]);
if (params["styleSheet"] !== undefined) data["StyleSheet"] = serialize.object(params["styleSheet"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down Expand Up @@ -707,9 +707,9 @@ export function AssistantListInstance(version: Understand): AssistantListInstanc
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["callbackUrl"] !== undefined) data["CallbackUrl"] = params["callbackUrl"];
if (params["callbackEvents"] !== undefined) data["CallbackEvents"] = params["callbackEvents"];
if (params["fallbackActions"] !== undefined) data["FallbackActions"] = params["fallbackActions"];
if (params["initiationActions"] !== undefined) data["InitiationActions"] = params["initiationActions"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = params["styleSheet"];
if (params["fallbackActions"] !== undefined) data["FallbackActions"] = serialize.object(params["fallbackActions"]);
if (params["initiationActions"] !== undefined) data["InitiationActions"] = serialize.object(params["initiationActions"]);
if (params["styleSheet"] !== undefined) data["StyleSheet"] = serialize.object(params["styleSheet"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class AssistantFallbackActionsContextImpl implements AssistantFallbackAct

const data: any = {};

if (params["fallbackActions"] !== undefined) data["FallbackActions"] = params["fallbackActions"];
if (params["fallbackActions"] !== undefined) data["FallbackActions"] = serialize.object(params["fallbackActions"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class AssistantInitiationActionsContextImpl implements AssistantInitiatio

const data: any = {};

if (params["initiationActions"] !== undefined) data["InitiationActions"] = params["initiationActions"];
if (params["initiationActions"] !== undefined) data["InitiationActions"] = serialize.object(params["initiationActions"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/preview/understand/assistant/styleSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class StyleSheetContextImpl implements StyleSheetContext {

const data: any = {};

if (params["styleSheet"] !== undefined) data["StyleSheet"] = params["styleSheet"];
if (params["styleSheet"] !== undefined) data["StyleSheet"] = serialize.object(params["styleSheet"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/preview/understand/assistant/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class TaskContextImpl implements TaskContext {

if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"];
if (params["uniqueName"] !== undefined) data["UniqueName"] = params["uniqueName"];
if (params["actions"] !== undefined) data["Actions"] = params["actions"];
if (params["actions"] !== undefined) data["Actions"] = serialize.object(params["actions"]);
if (params["actionsUrl"] !== undefined) data["ActionsUrl"] = params["actionsUrl"];

const headers: any = {};
Expand Down Expand Up @@ -605,7 +605,7 @@ export function TaskListInstance(version: Understand, assistantSid: string): Tas

data["UniqueName"] = params["uniqueName"];
if (params["friendlyName"] !== undefined) data["FriendlyName"] = params["friendlyName"];
if (params["actions"] !== undefined) data["Actions"] = params["actions"];
if (params["actions"] !== undefined) data["Actions"] = serialize.object(params["actions"]);
if (params["actionsUrl"] !== undefined) data["ActionsUrl"] = params["actionsUrl"];

const headers: any = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/preview/understand/assistant/task/taskActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class TaskActionsContextImpl implements TaskActionsContext {

const data: any = {};

if (params["actions"] !== undefined) data["Actions"] = params["actions"];
if (params["actions"] !== undefined) data["Actions"] = serialize.object(params["actions"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/studio/v1/flow/engagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export function EngagementListInstance(version: V1, flowSid: string): Engagement

data["To"] = params["to"];
data["From"] = params["from"];
if (params["parameters"] !== undefined) data["Parameters"] = params["parameters"];
if (params["parameters"] !== undefined) data["Parameters"] = serialize.object(params["parameters"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded"
Expand Down
Loading