From 973e7d5a9b2fd83e7a0186bb5d5e74f46751574a Mon Sep 17 00:00:00 2001 From: RJPearson94 Date: Fri, 9 Jul 2021 03:30:40 +0100 Subject: [PATCH] chore: regenerate SDK for generator changes This change supports the multiple PR's to fix https://github.com/twilio/twilio-oai-generator/issues/49 where the SDK panics when trying to update a Flex Configuration. --- rest/accounts/v1/credentials_aws.go | 9 +++------ rest/accounts/v1/credentials_public_keys.go | 9 +++------ rest/api/v2010/accounts.go | 9 +++------ rest/api/v2010/accounts_addresses.go | 9 +++------ ...ccounts_addresses_dependent_phone_numbers.go | 3 +-- rest/api/v2010/accounts_applications.go | 9 +++------ .../v2010/accounts_authorized_connect_apps.go | 3 +-- .../v2010/accounts_available_phone_numbers.go | 3 +-- .../accounts_available_phone_numbers_local.go | 3 +-- ...vailable_phone_numbers_machine_to_machine.go | 3 +-- .../accounts_available_phone_numbers_mobile.go | 3 +-- ...accounts_available_phone_numbers_national.go | 3 +-- ...ounts_available_phone_numbers_shared_cost.go | 3 +-- ...ccounts_available_phone_numbers_toll_free.go | 3 +-- .../accounts_available_phone_numbers_voip.go | 3 +-- rest/api/v2010/accounts_calls.go | 17 +++++++---------- rest/api/v2010/accounts_calls_events.go | 3 +-- rest/api/v2010/accounts_calls_feedback.go | 3 +-- .../v2010/accounts_calls_feedback_summary.go | 3 +-- rest/api/v2010/accounts_calls_notifications.go | 7 +++---- rest/api/v2010/accounts_calls_payments.go | 6 ++---- rest/api/v2010/accounts_calls_recordings.go | 13 +++++-------- rest/api/v2010/accounts_conferences.go | 14 ++++++-------- .../v2010/accounts_conferences_participants.go | 9 +++------ .../v2010/accounts_conferences_recordings.go | 10 ++++------ rest/api/v2010/accounts_connect_apps.go | 6 ++---- .../v2010/accounts_incoming_phone_numbers.go | 9 +++------ ...s_incoming_phone_numbers_assigned_add_ons.go | 6 ++---- ...phone_numbers_assigned_add_ons_extensions.go | 3 +-- .../accounts_incoming_phone_numbers_local.go | 6 ++---- .../accounts_incoming_phone_numbers_mobile.go | 6 ++---- ...accounts_incoming_phone_numbers_toll_free.go | 6 ++---- rest/api/v2010/accounts_keys.go | 9 +++------ rest/api/v2010/accounts_messages.go | 13 +++++-------- rest/api/v2010/accounts_messages_feedback.go | 3 +-- rest/api/v2010/accounts_messages_media.go | 7 +++---- rest/api/v2010/accounts_notifications.go | 7 +++---- rest/api/v2010/accounts_outgoing_caller_ids.go | 9 +++------ rest/api/v2010/accounts_queues.go | 9 +++------ rest/api/v2010/accounts_queues_members.go | 6 ++---- rest/api/v2010/accounts_recordings.go | 7 +++---- .../v2010/accounts_recordings_add_on_results.go | 3 +-- ...counts_recordings_add_on_results_payloads.go | 3 +-- .../v2010/accounts_recordings_transcriptions.go | 3 +-- rest/api/v2010/accounts_signing_keys.go | 9 +++------ rest/api/v2010/accounts_sip_credential_lists.go | 9 +++------ ...accounts_sip_credential_lists_credentials.go | 9 +++------ rest/api/v2010/accounts_sip_domains.go | 9 +++------ ...mains_auth_calls_credential_list_mappings.go | 6 ++---- ...uth_calls_ip_access_control_list_mappings.go | 6 ++---- ...th_registrations_credential_list_mappings.go | 6 ++---- ...unts_sip_domains_credential_list_mappings.go | 6 ++---- ...p_domains_ip_access_control_list_mappings.go | 6 ++---- .../accounts_sipip_access_control_lists.go | 9 +++------ ...s_sipip_access_control_lists_ip_addresses.go | 9 +++------ rest/api/v2010/accounts_sms_short_codes.go | 6 ++---- rest/api/v2010/accounts_tokens.go | 3 +-- rest/api/v2010/accounts_transcriptions.go | 3 +-- rest/api/v2010/accounts_usage_records.go | 3 +-- .../v2010/accounts_usage_records_all_time.go | 3 +-- rest/api/v2010/accounts_usage_records_daily.go | 3 +-- .../v2010/accounts_usage_records_last_month.go | 3 +-- .../api/v2010/accounts_usage_records_monthly.go | 3 +-- .../v2010/accounts_usage_records_this_month.go | 3 +-- rest/api/v2010/accounts_usage_records_today.go | 3 +-- rest/api/v2010/accounts_usage_records_yearly.go | 3 +-- .../v2010/accounts_usage_records_yesterday.go | 3 +-- rest/api/v2010/accounts_usage_triggers.go | 9 +++------ rest/autopilot/v1/assistants.go | 9 +++------ rest/autopilot/v1/assistants_defaults.go | 3 +-- rest/autopilot/v1/assistants_field_types.go | 9 +++------ .../v1/assistants_field_types_field_values.go | 6 ++---- rest/autopilot/v1/assistants_model_builds.go | 9 +++------ rest/autopilot/v1/assistants_queries.go | 9 +++------ rest/autopilot/v1/assistants_restore.go | 3 +-- rest/autopilot/v1/assistants_style_sheet.go | 3 +-- rest/autopilot/v1/assistants_tasks.go | 9 +++------ rest/autopilot/v1/assistants_tasks_actions.go | 3 +-- rest/autopilot/v1/assistants_tasks_fields.go | 6 ++---- rest/autopilot/v1/assistants_tasks_samples.go | 9 +++------ rest/autopilot/v1/assistants_webhooks.go | 9 +++------ rest/bulkexports/v1/exports_configuration.go | 3 +-- rest/bulkexports/v1/exports_days.go | 3 +-- rest/bulkexports/v1/exports_jobs.go | 6 ++---- rest/chat/v1/credentials.go | 9 +++------ rest/chat/v1/services.go | 9 +++------ rest/chat/v1/services_channels.go | 9 +++------ rest/chat/v1/services_channels_invites.go | 6 ++---- rest/chat/v1/services_channels_members.go | 9 +++------ rest/chat/v1/services_channels_messages.go | 9 +++------ rest/chat/v1/services_roles.go | 9 +++------ rest/chat/v1/services_users.go | 9 +++------ rest/chat/v1/services_users_channels.go | 3 +-- rest/chat/v2/credentials.go | 9 +++------ rest/chat/v2/services.go | 9 +++------ rest/chat/v2/services_bindings.go | 3 +-- rest/chat/v2/services_channels.go | 12 +++--------- rest/chat/v2/services_channels_invites.go | 6 ++---- rest/chat/v2/services_channels_members.go | 12 +++--------- rest/chat/v2/services_channels_messages.go | 12 +++--------- rest/chat/v2/services_channels_webhooks.go | 9 +++------ rest/chat/v2/services_roles.go | 9 +++------ rest/chat/v2/services_users.go | 11 +++-------- rest/chat/v2/services_users_bindings.go | 3 +-- rest/chat/v2/services_users_channels.go | 6 ++---- rest/conversations/v1/configuration.go | 3 +-- rest/conversations/v1/configuration_webhooks.go | 3 +-- rest/conversations/v1/conversations.go | 12 +++--------- rest/conversations/v1/conversations_messages.go | 12 +++--------- .../v1/conversations_messages_receipts.go | 3 +-- .../v1/conversations_participants.go | 12 +++--------- rest/conversations/v1/conversations_webhooks.go | 9 +++------ rest/conversations/v1/credentials.go | 9 +++------ rest/conversations/v1/roles.go | 9 +++------ rest/conversations/v1/services.go | 6 ++---- rest/conversations/v1/services_bindings.go | 3 +-- rest/conversations/v1/services_configuration.go | 3 +-- .../v1/services_configuration_notifications.go | 3 +-- rest/conversations/v1/services_conversations.go | 12 +++--------- .../v1/services_conversations_messages.go | 12 +++--------- .../services_conversations_messages_receipts.go | 3 +-- .../v1/services_conversations_participants.go | 12 +++--------- .../v1/services_conversations_webhooks.go | 9 +++------ rest/conversations/v1/services_roles.go | 9 +++------ rest/conversations/v1/services_users.go | 12 +++--------- rest/conversations/v1/users.go | 12 +++--------- rest/events/v1/schemas_versions.go | 3 +-- rest/events/v1/sinks.go | 9 +++------ rest/events/v1/sinks_validate.go | 3 +-- rest/events/v1/subscriptions.go | 9 +++------ .../v1/subscriptions_subscribed_events.go | 9 +++------ rest/events/v1/types.go | 3 +-- rest/fax/v1/faxes.go | 9 +++------ rest/fax/v1/faxes_media.go | 3 +-- rest/flex/v1/channels.go | 6 ++---- rest/flex/v1/configuration.go | 3 +-- rest/flex/v1/flex_flows.go | 9 +++------ rest/flex/v1/web_channels.go | 9 +++------ rest/frontline/v1/users.go | 3 +-- rest/insights/v1/video_rooms.go | 3 +-- rest/insights/v1/video_rooms_participants.go | 3 +-- rest/insights/v1/voice_events.go | 3 +-- rest/insights/v1/voice_metrics.go | 3 +-- rest/insights/v1/voice_summary.go | 3 +-- rest/ip_messaging/v1/credentials.go | 9 +++------ rest/ip_messaging/v1/services.go | 9 +++------ rest/ip_messaging/v1/services_channels.go | 9 +++------ .../v1/services_channels_invites.go | 6 ++---- .../v1/services_channels_members.go | 9 +++------ .../v1/services_channels_messages.go | 9 +++------ rest/ip_messaging/v1/services_roles.go | 9 +++------ rest/ip_messaging/v1/services_users.go | 9 +++------ rest/ip_messaging/v1/services_users_channels.go | 3 +-- rest/ip_messaging/v2/credentials.go | 9 +++------ rest/ip_messaging/v2/services.go | 9 +++------ rest/ip_messaging/v2/services_bindings.go | 3 +-- rest/ip_messaging/v2/services_channels.go | 12 +++--------- .../v2/services_channels_invites.go | 6 ++---- .../v2/services_channels_members.go | 12 +++--------- .../v2/services_channels_messages.go | 12 +++--------- .../v2/services_channels_webhooks.go | 9 +++------ rest/ip_messaging/v2/services_roles.go | 9 +++------ rest/ip_messaging/v2/services_users.go | 11 +++-------- rest/ip_messaging/v2/services_users_bindings.go | 3 +-- rest/ip_messaging/v2/services_users_channels.go | 6 ++---- rest/lookups/v1/phone_numbers.go | 3 +-- rest/messaging/v1/a2p_brand_registrations.go | 6 ++---- rest/messaging/v1/deactivations.go | 3 +-- rest/messaging/v1/services.go | 9 +++------ rest/messaging/v1/services_alpha_senders.go | 6 ++---- rest/messaging/v1/services_compliance_usa2p.go | 6 ++---- rest/messaging/v1/services_phone_numbers.go | 6 ++---- .../v1/services_preregistered_usa2p.go | 3 +-- rest/messaging/v1/services_short_codes.go | 6 ++---- rest/monitor/v1/alerts.go | 3 +-- rest/monitor/v1/events.go | 3 +-- rest/notify/v1/credentials.go | 9 +++------ rest/notify/v1/services.go | 9 +++------ rest/notify/v1/services_bindings.go | 6 ++---- rest/notify/v1/services_notifications.go | 3 +-- .../numbers/v2/regulatory_compliance_bundles.go | 9 +++------ ...regulatory_compliance_bundles_evaluations.go | 3 +-- ...atory_compliance_bundles_item_assignments.go | 6 ++---- .../v2/regulatory_compliance_end_user_types.go | 3 +-- .../v2/regulatory_compliance_end_users.go | 9 +++------ .../v2/regulatory_compliance_regulations.go | 3 +-- ...tory_compliance_supporting_document_types.go | 3 +-- ...egulatory_compliance_supporting_documents.go | 9 +++------ rest/pricing/v1/messaging_countries.go | 3 +-- rest/pricing/v1/phone_numbers_countries.go | 3 +-- rest/pricing/v1/voice_countries.go | 3 +-- rest/pricing/v2/voice_countries.go | 3 +-- rest/pricing/v2/voice_numbers.go | 3 +-- rest/proxy/v1/services.go | 9 +++------ rest/proxy/v1/services_phone_numbers.go | 9 +++------ rest/proxy/v1/services_sessions.go | 9 +++------ rest/proxy/v1/services_sessions_interactions.go | 3 +-- rest/proxy/v1/services_sessions_participants.go | 6 ++---- ...essions_participants_message_interactions.go | 6 ++---- rest/proxy/v1/services_short_codes.go | 9 +++------ rest/serverless/v1/services.go | 9 +++------ rest/serverless/v1/services_assets.go | 9 +++------ rest/serverless/v1/services_assets_versions.go | 3 +-- rest/serverless/v1/services_builds.go | 6 ++---- rest/serverless/v1/services_environments.go | 6 ++---- .../v1/services_environments_deployments.go | 6 ++---- .../serverless/v1/services_environments_logs.go | 3 +-- .../v1/services_environments_variables.go | 9 +++------ rest/serverless/v1/services_functions.go | 9 +++------ .../v1/services_functions_versions.go | 3 +-- rest/studio/v1/flows.go | 3 +-- rest/studio/v1/flows_engagements.go | 6 ++---- rest/studio/v1/flows_engagements_steps.go | 3 +-- rest/studio/v1/flows_executions.go | 9 +++------ rest/studio/v1/flows_executions_steps.go | 3 +-- rest/studio/v2/flows.go | 9 +++------ rest/studio/v2/flows_executions.go | 9 +++------ rest/studio/v2/flows_executions_steps.go | 3 +-- rest/studio/v2/flows_revisions.go | 3 +-- rest/studio/v2/flows_test_users.go | 3 +-- rest/studio/v2/flows_validate.go | 3 +-- rest/supersim/v1/commands.go | 6 ++---- rest/supersim/v1/fleets.go | 9 +++------ rest/supersim/v1/network_access_profiles.go | 9 +++------ .../v1/network_access_profiles_networks.go | 6 ++---- rest/supersim/v1/networks.go | 3 +-- rest/supersim/v1/sims.go | 9 +++------ rest/supersim/v1/sims_billing_periods.go | 3 +-- rest/supersim/v1/sms_commands.go | 6 ++---- rest/supersim/v1/usage_records.go | 3 +-- rest/sync/v1/services.go | 9 +++------ rest/sync/v1/services_documents.go | 10 +++------- rest/sync/v1/services_documents_permissions.go | 6 ++---- rest/sync/v1/services_lists.go | 9 +++------ rest/sync/v1/services_lists_items.go | 11 +++-------- rest/sync/v1/services_lists_permissions.go | 6 ++---- rest/sync/v1/services_maps.go | 9 +++------ rest/sync/v1/services_maps_items.go | 11 +++-------- rest/sync/v1/services_maps_permissions.go | 6 ++---- rest/sync/v1/services_streams.go | 9 +++------ rest/sync/v1/services_streams_messages.go | 3 +-- rest/taskrouter/v1/workspaces.go | 9 +++------ rest/taskrouter/v1/workspaces_activities.go | 9 +++------ .../v1/workspaces_cumulative_statistics.go | 3 +-- rest/taskrouter/v1/workspaces_events.go | 3 +-- .../v1/workspaces_real_time_statistics.go | 3 +-- rest/taskrouter/v1/workspaces_statistics.go | 3 +-- rest/taskrouter/v1/workspaces_task_channels.go | 9 +++------ rest/taskrouter/v1/workspaces_task_queues.go | 9 +++------ ...kspaces_task_queues_cumulative_statistics.go | 3 +-- ...rkspaces_task_queues_real_time_statistics.go | 3 +-- .../v1/workspaces_task_queues_statistics.go | 6 ++---- rest/taskrouter/v1/workspaces_tasks.go | 11 +++-------- .../v1/workspaces_tasks_reservations.go | 6 ++---- rest/taskrouter/v1/workspaces_workers.go | 9 +++------ .../v1/workspaces_workers_channels.go | 6 ++---- .../workspaces_workers_cumulative_statistics.go | 3 +-- .../workspaces_workers_real_time_statistics.go | 3 +-- .../v1/workspaces_workers_reservations.go | 6 ++---- .../v1/workspaces_workers_statistics.go | 6 ++---- rest/taskrouter/v1/workspaces_workflows.go | 9 +++------ ...orkspaces_workflows_cumulative_statistics.go | 3 +-- ...workspaces_workflows_real_time_statistics.go | 3 +-- .../v1/workspaces_workflows_statistics.go | 3 +-- rest/trunking/v1/trunks.go | 9 +++------ rest/trunking/v1/trunks_credential_lists.go | 6 ++---- .../v1/trunks_ip_access_control_lists.go | 6 ++---- rest/trunking/v1/trunks_origination_urls.go | 9 +++------ rest/trunking/v1/trunks_phone_numbers.go | 6 ++---- rest/trunking/v1/trunks_recording.go | 3 +-- rest/trusthub/v1/customer_profiles.go | 9 +++------ ...mer_profiles_channel_endpoint_assignments.go | 6 ++---- .../v1/customer_profiles_entity_assignments.go | 6 ++---- .../v1/customer_profiles_evaluations.go | 6 ++---- rest/trusthub/v1/end_user_types.go | 3 +-- rest/trusthub/v1/end_users.go | 9 +++------ rest/trusthub/v1/policies.go | 3 +-- rest/trusthub/v1/supporting_document_types.go | 3 +-- rest/trusthub/v1/supporting_documents.go | 9 +++------ rest/trusthub/v1/trust_products.go | 9 +++------ ...ust_products_channel_endpoint_assignments.go | 6 ++---- .../v1/trust_products_entity_assignments.go | 6 ++---- rest/trusthub/v1/trust_products_evaluations.go | 6 ++---- rest/verify/v2/attempts.go | 3 +-- rest/verify/v2/services.go | 9 +++------ rest/verify/v2/services_access_tokens.go | 3 +-- rest/verify/v2/services_entities.go | 6 ++---- rest/verify/v2/services_entities_challenges.go | 9 +++------ ...ervices_entities_challenges_notifications.go | 3 +-- rest/verify/v2/services_entities_factors.go | 9 +++------ .../v2/services_messaging_configurations.go | 9 +++------ rest/verify/v2/services_rate_limits.go | 9 +++------ rest/verify/v2/services_rate_limits_buckets.go | 9 +++------ rest/verify/v2/services_verification_check.go | 3 +-- rest/verify/v2/services_verifications.go | 6 ++---- rest/verify/v2/services_webhooks.go | 9 +++------ rest/video/v1/composition_hooks.go | 9 +++------ rest/video/v1/composition_settings_default.go | 3 +-- rest/video/v1/compositions.go | 6 ++---- rest/video/v1/recording_settings_default.go | 3 +-- rest/video/v1/recordings.go | 3 +-- rest/video/v1/rooms.go | 9 +++------ rest/video/v1/rooms_participants.go | 6 ++---- .../v1/rooms_participants_published_tracks.go | 3 +-- .../v1/rooms_participants_subscribe_rules.go | 3 +-- .../v1/rooms_participants_subscribed_tracks.go | 3 +-- rest/video/v1/rooms_recording_rules.go | 3 +-- rest/video/v1/rooms_recordings.go | 3 +-- rest/voice/v1/byoc_trunks.go | 9 +++------ rest/voice/v1/connection_policies.go | 9 +++------ rest/voice/v1/connection_policies_targets.go | 9 +++------ .../dialing_permissions_bulk_country_updates.go | 3 +-- rest/voice/v1/dialing_permissions_countries.go | 3 +-- ...ions_countries_high_risk_special_prefixes.go | 3 +-- rest/voice/v1/ip_records.go | 9 +++------ rest/voice/v1/settings.go | 3 +-- rest/voice/v1/source_ip_mappings.go | 9 +++------ rest/wireless/v1/commands.go | 6 ++---- rest/wireless/v1/rate_plans.go | 9 +++------ rest/wireless/v1/sims.go | 6 ++---- rest/wireless/v1/sims_data_sessions.go | 3 +-- rest/wireless/v1/sims_usage_records.go | 3 +-- rest/wireless/v1/usage_records.go | 3 +-- 323 files changed, 672 insertions(+), 1375 deletions(-) diff --git a/rest/accounts/v1/credentials_aws.go b/rest/accounts/v1/credentials_aws.go index d672c65f5..a139bda86 100644 --- a/rest/accounts/v1/credentials_aws.go +++ b/rest/accounts/v1/credentials_aws.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac path := "/v1/Credentials/AWS" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -58,6 +56,7 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -131,11 +130,10 @@ func (c *ApiService) ListCredentialAws(params *ListCredentialAwsParams) (*ListCr path := "/v1/Credentials/AWS" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -169,11 +167,10 @@ func (c *ApiService) UpdateCredentialAws(Sid string, params *UpdateCredentialAws path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/accounts/v1/credentials_public_keys.go b/rest/accounts/v1/credentials_public_keys.go index 887649634..29a41eba2 100644 --- a/rest/accounts/v1/credentials_public_keys.go +++ b/rest/accounts/v1/credentials_public_keys.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey path := "/v1/Credentials/PublicKeys" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -58,6 +56,7 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey if params != nil && params.PublicKey != nil { data.Set("PublicKey", *params.PublicKey) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -131,11 +130,10 @@ func (c *ApiService) ListCredentialPublicKey(params *ListCredentialPublicKeyPara path := "/v1/Credentials/PublicKeys" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -169,11 +167,10 @@ func (c *ApiService) UpdateCredentialPublicKey(Sid string, params *UpdateCredent path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts.go b/rest/api/v2010/accounts.go index d022c96b0..c45b9032d 100644 --- a/rest/api/v2010/accounts.go +++ b/rest/api/v2010/accounts.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateAccount(params *CreateAccountParams) (*ApiV2010Accoun path := "/2010-04-01/Accounts.json" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -107,8 +106,6 @@ func (c *ApiService) ListAccount(params *ListAccountParams) (*ListAccountRespons path := "/2010-04-01/Accounts.json" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -118,6 +115,7 @@ func (c *ApiService) ListAccount(params *ListAccountParams) (*ListAccountRespons if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -157,14 +155,13 @@ func (c *ApiService) UpdateAccount(Sid string, params *UpdateAccountParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_addresses.go b/rest/api/v2010/accounts_addresses.go index 64626ed83..c3bee47b8 100644 --- a/rest/api/v2010/accounts_addresses.go +++ b/rest/api/v2010/accounts_addresses.go @@ -93,8 +93,6 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Accoun } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AutoCorrectAddress != nil { data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) } @@ -122,6 +120,7 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Accoun if params != nil && params.Street != nil { data.Set("Street", *params.Street) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -253,8 +252,6 @@ func (c *ApiService) ListAddress(params *ListAddressParams) (*ListAddressRespons } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CustomerName != nil { data.Set("CustomerName", *params.CustomerName) } @@ -267,6 +264,7 @@ func (c *ApiService) ListAddress(params *ListAddressParams) (*ListAddressRespons if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -352,8 +350,6 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AutoCorrectAddress != nil { data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) } @@ -378,6 +374,7 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap if params != nil && params.Street != nil { data.Set("Street", *params.Street) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go index 4e38b0962..cea2fc62d 100644 --- a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go +++ b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go @@ -46,11 +46,10 @@ func (c *ApiService) ListDependentPhoneNumber(AddressSid string, params *ListDep path = strings.Replace(path, "{"+"AddressSid"+"}", AddressSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_applications.go b/rest/api/v2010/accounts_applications.go index 295b6f2f5..a01bbecc9 100644 --- a/rest/api/v2010/accounts_applications.go +++ b/rest/api/v2010/accounts_applications.go @@ -130,8 +130,6 @@ func (c *ApiService) CreateApplication(params *CreateApplicationParams) (*ApiV20 } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiVersion != nil { data.Set("ApiVersion", *params.ApiVersion) } @@ -177,6 +175,7 @@ func (c *ApiService) CreateApplication(params *CreateApplicationParams) (*ApiV20 if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -299,14 +298,13 @@ func (c *ApiService) ListApplication(params *ListApplicationParams) (*ListApplic } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -435,8 +433,6 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiVersion != nil { data.Set("ApiVersion", *params.ApiVersion) } @@ -482,6 +478,7 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_authorized_connect_apps.go b/rest/api/v2010/accounts_authorized_connect_apps.go index e0f1c07c6..7068725d9 100644 --- a/rest/api/v2010/accounts_authorized_connect_apps.go +++ b/rest/api/v2010/accounts_authorized_connect_apps.go @@ -85,11 +85,10 @@ func (c *ApiService) ListAuthorizedConnectApp(params *ListAuthorizedConnectAppPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers.go b/rest/api/v2010/accounts_available_phone_numbers.go index 73a1003de..48426caa2 100644 --- a/rest/api/v2010/accounts_available_phone_numbers.go +++ b/rest/api/v2010/accounts_available_phone_numbers.go @@ -83,11 +83,10 @@ func (c *ApiService) ListAvailablePhoneNumberCountry(params *ListAvailablePhoneN } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_local.go b/rest/api/v2010/accounts_available_phone_numbers_local.go index 19d995140..cac995d8a 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_local.go +++ b/rest/api/v2010/accounts_available_phone_numbers_local.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberLocal(CountryCode string, params *L path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberLocal(CountryCode string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go b/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go index 43c64df51..32d137240 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go +++ b/rest/api/v2010/accounts_available_phone_numbers_machine_to_machine.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberMachineToMachine(CountryCode string path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberMachineToMachine(CountryCode string if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_mobile.go b/rest/api/v2010/accounts_available_phone_numbers_mobile.go index d22d0a556..17f9991b4 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_available_phone_numbers_mobile.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberMobile(CountryCode string, params * path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberMobile(CountryCode string, params * if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_national.go b/rest/api/v2010/accounts_available_phone_numbers_national.go index 967421851..4bfd0c70a 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_national.go +++ b/rest/api/v2010/accounts_available_phone_numbers_national.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberNational(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberNational(CountryCode string, params if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go b/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go index 006366e9f..04de0d935 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go +++ b/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberSharedCost(CountryCode string, para path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberSharedCost(CountryCode string, para if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_toll_free.go b/rest/api/v2010/accounts_available_phone_numbers_toll_free.go index 1b2a48894..c0f42fe13 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_available_phone_numbers_toll_free.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberTollFree(CountryCode string, params path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberTollFree(CountryCode string, params if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_available_phone_numbers_voip.go b/rest/api/v2010/accounts_available_phone_numbers_voip.go index 4425af187..c94863e90 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_voip.go +++ b/rest/api/v2010/accounts_available_phone_numbers_voip.go @@ -154,8 +154,6 @@ func (c *ApiService) ListAvailablePhoneNumberVoip(CountryCode string, params *Li path = strings.Replace(path, "{"+"CountryCode"+"}", CountryCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCode != nil { data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) } @@ -213,6 +211,7 @@ func (c *ApiService) ListAvailablePhoneNumberVoip(CountryCode string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls.go b/rest/api/v2010/accounts_calls.go index fe3850c4c..b1228f40a 100644 --- a/rest/api/v2010/accounts_calls.go +++ b/rest/api/v2010/accounts_calls.go @@ -245,8 +245,6 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010AccountCall, } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApplicationSid != nil { data.Set("ApplicationSid", *params.ApplicationSid) } @@ -353,6 +351,7 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010AccountCall, if params != nil && params.Url != nil { data.Set("Url", *params.Url) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -457,15 +456,15 @@ type ListCallParams struct { // 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 *time.Time `json:"StartTime,omitempty"` // 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 *time.Time `json:"StartTime<,omitempty"` + StartTimeBefore *time.Time `json:"StartTime<,omitempty"` // 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 *time.Time `json:"StartTime>,omitempty"` + StartTimeAfter *time.Time `json:"StartTime>,omitempty"` // 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 *time.Time `json:"EndTime,omitempty"` // 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 *time.Time `json:"EndTime<,omitempty"` + EndTimeBefore *time.Time `json:"EndTime<,omitempty"` // 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 *time.Time `json:"EndTime>,omitempty"` + EndTimeAfter *time.Time `json:"EndTime>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -529,8 +528,6 @@ func (c *ApiService) ListCall(params *ListCallParams) (*ListCallResponse, error) } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.To != nil { data.Set("To", *params.To) } @@ -564,6 +561,7 @@ func (c *ApiService) ListCall(params *ListCallParams) (*ListCallResponse, error) if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -650,8 +648,6 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FallbackMethod != nil { data.Set("FallbackMethod", *params.FallbackMethod) } @@ -676,6 +672,7 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 if params != nil && params.Url != nil { data.Set("Url", *params.Url) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_events.go b/rest/api/v2010/accounts_calls_events.go index f788a3ff8..9812c2af9 100644 --- a/rest/api/v2010/accounts_calls_events.go +++ b/rest/api/v2010/accounts_calls_events.go @@ -47,11 +47,10 @@ func (c *ApiService) ListCallEvent(CallSid string, params *ListCallEventParams) path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_feedback.go b/rest/api/v2010/accounts_calls_feedback.go index fcb06a127..23d42c133 100644 --- a/rest/api/v2010/accounts_calls_feedback.go +++ b/rest/api/v2010/accounts_calls_feedback.go @@ -92,8 +92,6 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Issue != nil { for _, item := range *params.Issue { data.Add("Issue", item) @@ -102,6 +100,7 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba if params != nil && params.QualityScore != nil { data.Set("QualityScore", fmt.Sprint(*params.QualityScore)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_feedback_summary.go b/rest/api/v2010/accounts_calls_feedback_summary.go index 6b332c3ed..e34e7ef1d 100644 --- a/rest/api/v2010/accounts_calls_feedback_summary.go +++ b/rest/api/v2010/accounts_calls_feedback_summary.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint(*params.EndDate)) } @@ -87,6 +85,7 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary if params != nil && params.StatusCallbackMethod != nil { data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_notifications.go b/rest/api/v2010/accounts_calls_notifications.go index ad04a5296..42fd664bc 100644 --- a/rest/api/v2010/accounts_calls_notifications.go +++ b/rest/api/v2010/accounts_calls_notifications.go @@ -67,9 +67,9 @@ type ListCallNotificationParams struct { // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. MessageDate *string `json:"MessageDate,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateBefore *string `json:"MessageDate<,omitempty"` + MessageDateBefore *string `json:"MessageDate<,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateAfter *string `json:"MessageDate>,omitempty"` + MessageDateAfter *string `json:"MessageDate>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -109,8 +109,6 @@ func (c *ApiService) ListCallNotification(CallSid string, params *ListCallNotifi path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Log != nil { data.Set("Log", fmt.Sprint(*params.Log)) } @@ -126,6 +124,7 @@ func (c *ApiService) ListCallNotification(CallSid string, params *ListCallNotifi if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_payments.go b/rest/api/v2010/accounts_calls_payments.go index 6f8d3172b..fea685686 100644 --- a/rest/api/v2010/accounts_calls_payments.go +++ b/rest/api/v2010/accounts_calls_payments.go @@ -137,8 +137,6 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BankAccountType != nil { data.Set("BankAccountType", *params.BankAccountType) } @@ -193,6 +191,7 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams if params != nil && params.ValidCardTypes != nil { data.Set("ValidCardTypes", *params.ValidCardTypes) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -256,8 +255,6 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Capture != nil { data.Set("Capture", *params.Capture) } @@ -270,6 +267,7 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_calls_recordings.go b/rest/api/v2010/accounts_calls_recordings.go index e223a6a1a..f5deef24b 100644 --- a/rest/api/v2010/accounts_calls_recordings.go +++ b/rest/api/v2010/accounts_calls_recordings.go @@ -77,8 +77,6 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.RecordingChannels != nil { data.Set("RecordingChannels", *params.RecordingChannels) } @@ -99,6 +97,7 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor if params != nil && params.Trim != nil { data.Set("Trim", *params.Trim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -197,9 +196,9 @@ type ListCallRecordingParams struct { // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. DateCreated *string `json:"DateCreated,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedBefore *string `json:"DateCreated<,omitempty"` + DateCreatedBefore *string `json:"DateCreated<,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedAfter *string `json:"DateCreated>,omitempty"` + DateCreatedAfter *string `json:"DateCreated>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -236,8 +235,6 @@ func (c *ApiService) ListCallRecording(CallSid string, params *ListCallRecording path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } @@ -250,6 +247,7 @@ func (c *ApiService) ListCallRecording(CallSid string, params *ListCallRecording if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -301,14 +299,13 @@ func (c *ApiService) UpdateCallRecording(CallSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PauseBehavior != nil { data.Set("PauseBehavior", *params.PauseBehavior) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_conferences.go b/rest/api/v2010/accounts_conferences.go index b4983aea7..70f80d9cc 100644 --- a/rest/api/v2010/accounts_conferences.go +++ b/rest/api/v2010/accounts_conferences.go @@ -65,15 +65,15 @@ type ListConferenceParams struct { // 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 *string `json:"DateCreated,omitempty"` // 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 *string `json:"DateCreated<,omitempty"` + DateCreatedBefore *string `json:"DateCreated<,omitempty"` // 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 *string `json:"DateCreated>,omitempty"` + DateCreatedAfter *string `json:"DateCreated>,omitempty"` // 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 *string `json:"DateUpdated,omitempty"` // 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 *string `json:"DateUpdated<,omitempty"` + DateUpdatedBefore *string `json:"DateUpdated<,omitempty"` // 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 *string `json:"DateUpdated>,omitempty"` + DateUpdatedAfter *string `json:"DateUpdated>,omitempty"` // The string that identifies the Conference resources to read. FriendlyName *string `json:"FriendlyName,omitempty"` // The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. @@ -133,8 +133,6 @@ func (c *ApiService) ListConference(params *ListConferenceParams) (*ListConferen } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } @@ -162,6 +160,7 @@ func (c *ApiService) ListConference(params *ListConferenceParams) (*ListConferen if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -217,8 +216,6 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AnnounceMethod != nil { data.Set("AnnounceMethod", *params.AnnounceMethod) } @@ -228,6 +225,7 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_conferences_participants.go b/rest/api/v2010/accounts_conferences_participants.go index c715898d2..5472339b0 100644 --- a/rest/api/v2010/accounts_conferences_participants.go +++ b/rest/api/v2010/accounts_conferences_participants.go @@ -268,8 +268,6 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beep != nil { data.Set("Beep", *params.Beep) } @@ -392,6 +390,7 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti if params != nil && params.WaitUrl != nil { data.Set("WaitUrl", *params.WaitUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -529,8 +528,6 @@ func (c *ApiService) ListParticipant(ConferenceSid string, params *ListParticipa path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Muted != nil { data.Set("Muted", fmt.Sprint(*params.Muted)) } @@ -543,6 +540,7 @@ func (c *ApiService) ListParticipant(ConferenceSid string, params *ListParticipa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -654,8 +652,6 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AnnounceMethod != nil { data.Set("AnnounceMethod", *params.AnnounceMethod) } @@ -692,6 +688,7 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par if params != nil && params.WaitUrl != nil { data.Set("WaitUrl", *params.WaitUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_conferences_recordings.go b/rest/api/v2010/accounts_conferences_recordings.go index a262c6ea3..1f05433a7 100644 --- a/rest/api/v2010/accounts_conferences_recordings.go +++ b/rest/api/v2010/accounts_conferences_recordings.go @@ -101,9 +101,9 @@ type ListConferenceRecordingParams struct { // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. DateCreated *string `json:"DateCreated,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedBefore *string `json:"DateCreated<,omitempty"` + DateCreatedBefore *string `json:"DateCreated<,omitempty"` // The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. - DateCreatedAfter *string `json:"DateCreated>,omitempty"` + DateCreatedAfter *string `json:"DateCreated>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -140,8 +140,6 @@ func (c *ApiService) ListConferenceRecording(ConferenceSid string, params *ListC path = strings.Replace(path, "{"+"ConferenceSid"+"}", ConferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) } @@ -154,6 +152,7 @@ func (c *ApiService) ListConferenceRecording(ConferenceSid string, params *ListC if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -205,14 +204,13 @@ func (c *ApiService) UpdateConferenceRecording(ConferenceSid string, Sid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PauseBehavior != nil { data.Set("PauseBehavior", *params.PauseBehavior) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_connect_apps.go b/rest/api/v2010/accounts_connect_apps.go index b37082cc0..cca23978e 100644 --- a/rest/api/v2010/accounts_connect_apps.go +++ b/rest/api/v2010/accounts_connect_apps.go @@ -119,11 +119,10 @@ func (c *ApiService) ListConnectApp(params *ListConnectAppParams) (*ListConnectA } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -210,8 +209,6 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthorizeRedirectUrl != nil { data.Set("AuthorizeRedirectUrl", *params.AuthorizeRedirectUrl) } @@ -238,6 +235,7 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams data.Add("Permissions", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers.go b/rest/api/v2010/accounts_incoming_phone_numbers.go index f20c69354..ee4f17179 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers.go @@ -184,8 +184,6 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -258,6 +256,7 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -398,8 +397,6 @@ func (c *ApiService) ListIncomingPhoneNumber(params *ListIncomingPhoneNumberPara } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -415,6 +412,7 @@ func (c *ApiService) ListIncomingPhoneNumber(params *ListIncomingPhoneNumberPara if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -591,8 +589,6 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -662,6 +658,7 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go index 604bc160b..923d36f6e 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateIncomingPhoneNumberAssignedAddOn(ResourceSid string, path = strings.Replace(path, "{"+"ResourceSid"+"}", ResourceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.InstalledAddOnSid != nil { data.Set("InstalledAddOnSid", *params.InstalledAddOnSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -171,11 +170,10 @@ func (c *ApiService) ListIncomingPhoneNumberAssignedAddOn(ResourceSid string, pa path = strings.Replace(path, "{"+"ResourceSid"+"}", ResourceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go index aa1edef8c..034ce4fa5 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_assigned_add_ons_extensions.go @@ -89,11 +89,10 @@ func (c *ApiService) ListIncomingPhoneNumberAssignedAddOnExtension(ResourceSid s path = strings.Replace(path, "{"+"AssignedAddOnSid"+"}", AssignedAddOnSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_local.go b/rest/api/v2010/accounts_incoming_phone_numbers_local.go index 6eb847bec..74e8d1a2b 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_local.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_local.go @@ -176,8 +176,6 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -247,6 +245,7 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -313,8 +312,6 @@ func (c *ApiService) ListIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -330,6 +327,7 @@ func (c *ApiService) ListIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go index 65608cf83..ea8c79337 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go @@ -176,8 +176,6 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -247,6 +245,7 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -313,8 +312,6 @@ func (c *ApiService) ListIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -330,6 +327,7 @@ func (c *ApiService) ListIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go b/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go index dfedbe199..3668483aa 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go @@ -176,8 +176,6 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressSid != nil { data.Set("AddressSid", *params.AddressSid) } @@ -247,6 +245,7 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -313,8 +312,6 @@ func (c *ApiService) ListIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beta != nil { data.Set("Beta", fmt.Sprint(*params.Beta)) } @@ -330,6 +327,7 @@ func (c *ApiService) ListIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_keys.go b/rest/api/v2010/accounts_keys.go index 8ac3942f1..9de55ea03 100644 --- a/rest/api/v2010/accounts_keys.go +++ b/rest/api/v2010/accounts_keys.go @@ -45,11 +45,10 @@ func (c *ApiService) CreateNewKey(params *CreateNewKeyParams) (*ApiV2010AccountN } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListKey(params *ListKeyParams) (*ListKeyResponse, error) { } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -211,11 +209,10 @@ func (c *ApiService) UpdateKey(Sid string, params *UpdateKeyParams) (*ApiV2010Ac path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_messages.go b/rest/api/v2010/accounts_messages.go index 45332745a..0f9d12f9b 100644 --- a/rest/api/v2010/accounts_messages.go +++ b/rest/api/v2010/accounts_messages.go @@ -137,8 +137,6 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Accoun } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddressRetention != nil { data.Set("AddressRetention", *params.AddressRetention) } @@ -191,6 +189,7 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Accoun if params != nil && params.ValidityPeriod != nil { data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -291,9 +290,9 @@ type ListMessageParams struct { // The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. DateSent *time.Time `json:"DateSent,omitempty"` // The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. - DateSentBefore *time.Time `json:"DateSent<,omitempty"` + DateSentBefore *time.Time `json:"DateSent<,omitempty"` // The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. - DateSentAfter *time.Time `json:"DateSent>,omitempty"` + DateSentAfter *time.Time `json:"DateSent>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -337,8 +336,6 @@ func (c *ApiService) ListMessage(params *ListMessageParams) (*ListMessageRespons } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.To != nil { data.Set("To", *params.To) } @@ -357,6 +354,7 @@ func (c *ApiService) ListMessage(params *ListMessageParams) (*ListMessageRespons if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -401,11 +399,10 @@ func (c *ApiService) UpdateMessage(Sid string, params *UpdateMessageParams) (*Ap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Body != nil { data.Set("Body", *params.Body) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_messages_feedback.go b/rest/api/v2010/accounts_messages_feedback.go index 5fd550431..e3584ab4f 100644 --- a/rest/api/v2010/accounts_messages_feedback.go +++ b/rest/api/v2010/accounts_messages_feedback.go @@ -45,11 +45,10 @@ func (c *ApiService) CreateMessageFeedback(MessageSid string, params *CreateMess path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Outcome != nil { data.Set("Outcome", *params.Outcome) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_messages_media.go b/rest/api/v2010/accounts_messages_media.go index f170e9696..34098e3be 100644 --- a/rest/api/v2010/accounts_messages_media.go +++ b/rest/api/v2010/accounts_messages_media.go @@ -102,9 +102,9 @@ type ListMediaParams struct { // Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. DateCreated *time.Time `json:"DateCreated,omitempty"` // Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. - DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` + DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` // Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. - DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` + DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -141,8 +141,6 @@ func (c *ApiService) ListMedia(MessageSid string, params *ListMediaParams) (*Lis path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) } @@ -155,6 +153,7 @@ func (c *ApiService) ListMedia(MessageSid string, params *ListMediaParams) (*Lis if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_notifications.go b/rest/api/v2010/accounts_notifications.go index b6ef5ff1b..adf272e48 100644 --- a/rest/api/v2010/accounts_notifications.go +++ b/rest/api/v2010/accounts_notifications.go @@ -67,9 +67,9 @@ type ListNotificationParams struct { // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. MessageDate *string `json:"MessageDate,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateBefore *string `json:"MessageDate<,omitempty"` + MessageDateBefore *string `json:"MessageDate<,omitempty"` // Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. - MessageDateAfter *string `json:"MessageDate>,omitempty"` + MessageDateAfter *string `json:"MessageDate>,omitempty"` // How many resources to return in each list page. The default is 50, and the maximum is 1000. PageSize *int `json:"PageSize,omitempty"` } @@ -109,8 +109,6 @@ func (c *ApiService) ListNotification(params *ListNotificationParams) (*ListNoti } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Log != nil { data.Set("Log", fmt.Sprint(*params.Log)) } @@ -126,6 +124,7 @@ func (c *ApiService) ListNotification(params *ListNotificationParams) (*ListNoti if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_outgoing_caller_ids.go b/rest/api/v2010/accounts_outgoing_caller_ids.go index feed8fac2..a93c852ce 100644 --- a/rest/api/v2010/accounts_outgoing_caller_ids.go +++ b/rest/api/v2010/accounts_outgoing_caller_ids.go @@ -75,8 +75,6 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallDelay != nil { data.Set("CallDelay", fmt.Sprint(*params.CallDelay)) } @@ -95,6 +93,7 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara if params != nil && params.StatusCallbackMethod != nil { data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -223,8 +222,6 @@ func (c *ApiService) ListOutgoingCallerId(params *ListOutgoingCallerIdParams) (* } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PhoneNumber != nil { data.Set("PhoneNumber", *params.PhoneNumber) } @@ -234,6 +231,7 @@ func (c *ApiService) ListOutgoingCallerId(params *ListOutgoingCallerIdParams) (* if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -278,11 +276,10 @@ func (c *ApiService) UpdateOutgoingCallerId(Sid string, params *UpdateOutgoingCa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_queues.go b/rest/api/v2010/accounts_queues.go index 1a4cad9ee..3348a7fdf 100644 --- a/rest/api/v2010/accounts_queues.go +++ b/rest/api/v2010/accounts_queues.go @@ -52,14 +52,13 @@ func (c *ApiService) CreateQueue(params *CreateQueueParams) (*ApiV2010AccountQue } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.MaxSize != nil { data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -176,11 +175,10 @@ func (c *ApiService) ListQueue(params *ListQueueParams) (*ListQueueResponse, err } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -231,14 +229,13 @@ func (c *ApiService) UpdateQueue(Sid string, params *UpdateQueueParams) (*ApiV20 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.MaxSize != nil { data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_queues_members.go b/rest/api/v2010/accounts_queues_members.go index c2118a6c5..7922808db 100644 --- a/rest/api/v2010/accounts_queues_members.go +++ b/rest/api/v2010/accounts_queues_members.go @@ -87,11 +87,10 @@ func (c *ApiService) ListMember(QueueSid string, params *ListMemberParams) (*Lis path = strings.Replace(path, "{"+"QueueSid"+"}", QueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -143,14 +142,13 @@ func (c *ApiService) UpdateMember(QueueSid string, CallSid string, params *Updat path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Method != nil { data.Set("Method", *params.Method) } if params != nil && params.Url != nil { data.Set("Url", *params.Url) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_recordings.go b/rest/api/v2010/accounts_recordings.go index 0ac44edc3..4c453a757 100644 --- a/rest/api/v2010/accounts_recordings.go +++ b/rest/api/v2010/accounts_recordings.go @@ -100,9 +100,9 @@ type ListRecordingParams struct { // Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. DateCreated *time.Time `json:"DateCreated,omitempty"` // Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. - DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` + DateCreatedBefore *time.Time `json:"DateCreated<,omitempty"` // Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. - DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` + DateCreatedAfter *time.Time `json:"DateCreated>,omitempty"` // The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. CallSid *string `json:"CallSid,omitempty"` // The Conference SID that identifies the conference associated with the recording to read. @@ -150,8 +150,6 @@ func (c *ApiService) ListRecording(params *ListRecordingParams) (*ListRecordingR } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreated != nil { data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) } @@ -170,6 +168,7 @@ func (c *ApiService) ListRecording(params *ListRecordingParams) (*ListRecordingR if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_recordings_add_on_results.go b/rest/api/v2010/accounts_recordings_add_on_results.go index 7b7aff960..ed31d58cb 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results.go +++ b/rest/api/v2010/accounts_recordings_add_on_results.go @@ -122,11 +122,10 @@ func (c *ApiService) ListRecordingAddOnResult(ReferenceSid string, params *ListR path = strings.Replace(path, "{"+"ReferenceSid"+"}", ReferenceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_recordings_add_on_results_payloads.go b/rest/api/v2010/accounts_recordings_add_on_results_payloads.go index 4089d65a9..06063c24d 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results_payloads.go +++ b/rest/api/v2010/accounts_recordings_add_on_results_payloads.go @@ -125,11 +125,10 @@ func (c *ApiService) ListRecordingAddOnResultPayload(ReferenceSid string, AddOnR path = strings.Replace(path, "{"+"AddOnResultSid"+"}", AddOnResultSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_recordings_transcriptions.go b/rest/api/v2010/accounts_recordings_transcriptions.go index fbeb620f3..cec866594 100644 --- a/rest/api/v2010/accounts_recordings_transcriptions.go +++ b/rest/api/v2010/accounts_recordings_transcriptions.go @@ -119,11 +119,10 @@ func (c *ApiService) ListRecordingTranscription(RecordingSid string, params *Lis path = strings.Replace(path, "{"+"RecordingSid"+"}", RecordingSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_signing_keys.go b/rest/api/v2010/accounts_signing_keys.go index ced0b11a8..3f005a6c8 100644 --- a/rest/api/v2010/accounts_signing_keys.go +++ b/rest/api/v2010/accounts_signing_keys.go @@ -46,11 +46,10 @@ func (c *ApiService) CreateNewSigningKey(params *CreateNewSigningKeyParams) (*Ap } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -164,11 +163,10 @@ func (c *ApiService) ListSigningKey(params *ListSigningKeyParams) (*ListSigningK } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -212,11 +210,10 @@ func (c *ApiService) UpdateSigningKey(Sid string, params *UpdateSigningKeyParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_credential_lists.go b/rest/api/v2010/accounts_sip_credential_lists.go index d06f96c21..f0865d7ad 100644 --- a/rest/api/v2010/accounts_sip_credential_lists.go +++ b/rest/api/v2010/accounts_sip_credential_lists.go @@ -46,11 +46,10 @@ func (c *ApiService) CreateSipCredentialList(params *CreateSipCredentialListPara } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -167,11 +166,10 @@ func (c *ApiService) ListSipCredentialList(params *ListSipCredentialListParams) } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -216,11 +214,10 @@ func (c *ApiService) UpdateSipCredentialList(Sid string, params *UpdateSipCreden path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_credential_lists_credentials.go b/rest/api/v2010/accounts_sip_credential_lists_credentials.go index 8362310b2..866dad8f4 100644 --- a/rest/api/v2010/accounts_sip_credential_lists_credentials.go +++ b/rest/api/v2010/accounts_sip_credential_lists_credentials.go @@ -53,14 +53,13 @@ func (c *ApiService) CreateSipCredential(CredentialListSid string, params *Creat path = strings.Replace(path, "{"+"CredentialListSid"+"}", CredentialListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Password != nil { data.Set("Password", *params.Password) } if params != nil && params.Username != nil { data.Set("Username", *params.Username) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) ListSipCredential(CredentialListSid string, params *ListSip path = strings.Replace(path, "{"+"CredentialListSid"+"}", CredentialListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -230,11 +228,10 @@ func (c *ApiService) UpdateSipCredential(CredentialListSid string, Sid string, p path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Password != nil { data.Set("Password", *params.Password) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains.go b/rest/api/v2010/accounts_sip_domains.go index 7eb6b9010..c29289144 100644 --- a/rest/api/v2010/accounts_sip_domains.go +++ b/rest/api/v2010/accounts_sip_domains.go @@ -118,8 +118,6 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Ac } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ByocTrunkSid != nil { data.Set("ByocTrunkSid", *params.ByocTrunkSid) } @@ -159,6 +157,7 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Ac if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -275,11 +274,10 @@ func (c *ApiService) ListSipDomain(params *ListSipDomainParams) (*ListSipDomainR } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -396,8 +394,6 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ByocTrunkSid != nil { data.Set("ByocTrunkSid", *params.ByocTrunkSid) } @@ -437,6 +433,7 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go b/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go index 038deeec7..8d9f4cb97 100644 --- a/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_auth_calls_credential_list_mappings.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateSipAuthCallsCredentialListMapping(DomainSid string, p path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -171,11 +170,10 @@ func (c *ApiService) ListSipAuthCallsCredentialListMapping(DomainSid string, par path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go b/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go index 9c4a00acf..1e9cd04af 100644 --- a/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_auth_calls_ip_access_control_list_mappings.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateSipAuthCallsIpAccessControlListMapping(DomainSid stri path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -171,11 +170,10 @@ func (c *ApiService) ListSipAuthCallsIpAccessControlListMapping(DomainSid string path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go b/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go index 9a6986ccc..e482f1cd4 100644 --- a/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_auth_registrations_credential_list_mappings.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateSipAuthRegistrationsCredentialListMapping(DomainSid s path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -171,11 +170,10 @@ func (c *ApiService) ListSipAuthRegistrationsCredentialListMapping(DomainSid str path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go b/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go index b6f97a6f2..e40a8c269 100644 --- a/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateSipCredentialListMapping(DomainSid string, params *Cr path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -171,11 +170,10 @@ func (c *ApiService) ListSipCredentialListMapping(DomainSid string, params *List path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go b/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go index ca6fcaa59..04281cae3 100644 --- a/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_ip_access_control_list_mappings.go @@ -47,11 +47,10 @@ func (c *ApiService) CreateSipIpAccessControlListMapping(DomainSid string, param path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -171,11 +170,10 @@ func (c *ApiService) ListSipIpAccessControlListMapping(DomainSid string, params path = strings.Replace(path, "{"+"DomainSid"+"}", DomainSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sipip_access_control_lists.go b/rest/api/v2010/accounts_sipip_access_control_lists.go index 5686d4311..aa06f5803 100644 --- a/rest/api/v2010/accounts_sipip_access_control_lists.go +++ b/rest/api/v2010/accounts_sipip_access_control_lists.go @@ -46,11 +46,10 @@ func (c *ApiService) CreateSipIpAccessControlList(params *CreateSipIpAccessContr } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -167,11 +166,10 @@ func (c *ApiService) ListSipIpAccessControlList(params *ListSipIpAccessControlLi } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -216,11 +214,10 @@ func (c *ApiService) UpdateSipIpAccessControlList(Sid string, params *UpdateSipI path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go b/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go index c81c36f1a..afd747d75 100644 --- a/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go +++ b/rest/api/v2010/accounts_sipip_access_control_lists_ip_addresses.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C path = strings.Replace(path, "{"+"IpAccessControlListSid"+"}", IpAccessControlListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CidrPrefixLength != nil { data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } @@ -70,6 +68,7 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C if params != nil && params.IpAddress != nil { data.Set("IpAddress", *params.IpAddress) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -189,11 +188,10 @@ func (c *ApiService) ListSipIpAddress(IpAccessControlListSid string, params *Lis path = strings.Replace(path, "{"+"IpAccessControlListSid"+"}", IpAccessControlListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -251,8 +249,6 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CidrPrefixLength != nil { data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } @@ -262,6 +258,7 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin if params != nil && params.IpAddress != nil { data.Set("IpAddress", *params.IpAddress) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_sms_short_codes.go b/rest/api/v2010/accounts_sms_short_codes.go index f7d081e6b..d778b56df 100644 --- a/rest/api/v2010/accounts_sms_short_codes.go +++ b/rest/api/v2010/accounts_sms_short_codes.go @@ -97,8 +97,6 @@ func (c *ApiService) ListShortCode(params *ListShortCodeParams) (*ListShortCodeR } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -108,6 +106,7 @@ func (c *ApiService) ListShortCode(params *ListShortCodeParams) (*ListShortCodeR if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -182,8 +181,6 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiVersion != nil { data.Set("ApiVersion", *params.ApiVersion) } @@ -202,6 +199,7 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) if params != nil && params.SmsUrl != nil { data.Set("SmsUrl", *params.SmsUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_tokens.go b/rest/api/v2010/accounts_tokens.go index afa4e8957..c3c3dc55a 100644 --- a/rest/api/v2010/accounts_tokens.go +++ b/rest/api/v2010/accounts_tokens.go @@ -45,11 +45,10 @@ func (c *ApiService) CreateToken(params *CreateTokenParams) (*ApiV2010AccountTok } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_transcriptions.go b/rest/api/v2010/accounts_transcriptions.go index 140df15da..759b08ebb 100644 --- a/rest/api/v2010/accounts_transcriptions.go +++ b/rest/api/v2010/accounts_transcriptions.go @@ -119,11 +119,10 @@ func (c *ApiService) ListTranscription(params *ListTranscriptionParams) (*ListTr } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records.go b/rest/api/v2010/accounts_usage_records.go index 4f8e1c63b..5b6eaa7ed 100644 --- a/rest/api/v2010/accounts_usage_records.go +++ b/rest/api/v2010/accounts_usage_records.go @@ -69,8 +69,6 @@ func (c *ApiService) ListUsageRecord(params *ListUsageRecordParams) (*ListUsageR } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -86,6 +84,7 @@ func (c *ApiService) ListUsageRecord(params *ListUsageRecordParams) (*ListUsageR if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_all_time.go b/rest/api/v2010/accounts_usage_records_all_time.go index 29ee18ae2..36f9d263e 100644 --- a/rest/api/v2010/accounts_usage_records_all_time.go +++ b/rest/api/v2010/accounts_usage_records_all_time.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordAllTime(params *ListUsageRecordAllTimeParams } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordAllTime(params *ListUsageRecordAllTimeParams if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_daily.go b/rest/api/v2010/accounts_usage_records_daily.go index be4f62448..8d00cf06c 100644 --- a/rest/api/v2010/accounts_usage_records_daily.go +++ b/rest/api/v2010/accounts_usage_records_daily.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordDaily(params *ListUsageRecordDailyParams) (* } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordDaily(params *ListUsageRecordDailyParams) (* if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_last_month.go b/rest/api/v2010/accounts_usage_records_last_month.go index a7d94e157..c31398b2e 100644 --- a/rest/api/v2010/accounts_usage_records_last_month.go +++ b/rest/api/v2010/accounts_usage_records_last_month.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordLastMonth(params *ListUsageRecordLastMonthPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordLastMonth(params *ListUsageRecordLastMonthPa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_monthly.go b/rest/api/v2010/accounts_usage_records_monthly.go index 29e5f4269..fc80ed0c8 100644 --- a/rest/api/v2010/accounts_usage_records_monthly.go +++ b/rest/api/v2010/accounts_usage_records_monthly.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordMonthly(params *ListUsageRecordMonthlyParams } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordMonthly(params *ListUsageRecordMonthlyParams if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_this_month.go b/rest/api/v2010/accounts_usage_records_this_month.go index 87b05f18a..c0b03504d 100644 --- a/rest/api/v2010/accounts_usage_records_this_month.go +++ b/rest/api/v2010/accounts_usage_records_this_month.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordThisMonth(params *ListUsageRecordThisMonthPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordThisMonth(params *ListUsageRecordThisMonthPa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_today.go b/rest/api/v2010/accounts_usage_records_today.go index 8617b306e..609fa7577 100644 --- a/rest/api/v2010/accounts_usage_records_today.go +++ b/rest/api/v2010/accounts_usage_records_today.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordToday(params *ListUsageRecordTodayParams) (* } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordToday(params *ListUsageRecordTodayParams) (* if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_yearly.go b/rest/api/v2010/accounts_usage_records_yearly.go index 6dbdc35c3..9cd0f51f6 100644 --- a/rest/api/v2010/accounts_usage_records_yearly.go +++ b/rest/api/v2010/accounts_usage_records_yearly.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordYearly(params *ListUsageRecordYearlyParams) } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordYearly(params *ListUsageRecordYearlyParams) if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_records_yesterday.go b/rest/api/v2010/accounts_usage_records_yesterday.go index 65a0767d3..aed188d76 100644 --- a/rest/api/v2010/accounts_usage_records_yesterday.go +++ b/rest/api/v2010/accounts_usage_records_yesterday.go @@ -68,8 +68,6 @@ func (c *ApiService) ListUsageRecordYesterday(params *ListUsageRecordYesterdayPa } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Category != nil { data.Set("Category", *params.Category) } @@ -85,6 +83,7 @@ func (c *ApiService) ListUsageRecordYesterday(params *ListUsageRecordYesterdayPa if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/api/v2010/accounts_usage_triggers.go b/rest/api/v2010/accounts_usage_triggers.go index 7316b2a8e..422bc7688 100644 --- a/rest/api/v2010/accounts_usage_triggers.go +++ b/rest/api/v2010/accounts_usage_triggers.go @@ -82,8 +82,6 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -105,6 +103,7 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV if params != nil && params.UsageCategory != nil { data.Set("UsageCategory", *params.UsageCategory) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -238,8 +237,6 @@ func (c *ApiService) ListUsageTrigger(params *ListUsageTriggerParams) (*ListUsag } data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Recurring != nil { data.Set("Recurring", *params.Recurring) } @@ -252,6 +249,7 @@ func (c *ApiService) ListUsageTrigger(params *ListUsageTriggerParams) (*ListUsag if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -308,8 +306,6 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -319,6 +315,7 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants.go b/rest/autopilot/v1/assistants.go index 7fec05a76..84ed5be04 100644 --- a/rest/autopilot/v1/assistants.go +++ b/rest/autopilot/v1/assistants.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateAssistant(params *CreateAssistantParams) (*AutopilotV path := "/v1/Assistants" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackEvents != nil { data.Set("CallbackEvents", *params.CallbackEvents) } @@ -105,6 +103,7 @@ func (c *ApiService) CreateAssistant(params *CreateAssistantParams) (*AutopilotV if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -175,11 +174,10 @@ func (c *ApiService) ListAssistant(params *ListAssistantParams) (*ListAssistantR path := "/v1/Assistants" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -254,8 +252,6 @@ func (c *ApiService) UpdateAssistant(Sid string, params *UpdateAssistantParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackEvents != nil { data.Set("CallbackEvents", *params.CallbackEvents) } @@ -292,6 +288,7 @@ func (c *ApiService) UpdateAssistant(Sid string, params *UpdateAssistantParams) if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_defaults.go b/rest/autopilot/v1/assistants_defaults.go index 51d3c875b..f02abf1ae 100644 --- a/rest/autopilot/v1/assistants_defaults.go +++ b/rest/autopilot/v1/assistants_defaults.go @@ -56,8 +56,6 @@ func (c *ApiService) UpdateDefaults(AssistantSid string, params *UpdateDefaultsP path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Defaults != nil { v, err := json.Marshal(params.Defaults) @@ -67,6 +65,7 @@ func (c *ApiService) UpdateDefaults(AssistantSid string, params *UpdateDefaultsP data.Set("Defaults", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_field_types.go b/rest/autopilot/v1/assistants_field_types.go index a0411db2e..a29a57c26 100644 --- a/rest/autopilot/v1/assistants_field_types.go +++ b/rest/autopilot/v1/assistants_field_types.go @@ -41,14 +41,13 @@ func (c *ApiService) CreateFieldType(AssistantSid string, params *CreateFieldTyp path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -122,11 +121,10 @@ func (c *ApiService) ListFieldType(AssistantSid string, params *ListFieldTypePar path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -166,14 +164,13 @@ func (c *ApiService) UpdateFieldType(AssistantSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_field_types_field_values.go b/rest/autopilot/v1/assistants_field_types_field_values.go index bf0c0ee46..77efeb678 100644 --- a/rest/autopilot/v1/assistants_field_types_field_values.go +++ b/rest/autopilot/v1/assistants_field_types_field_values.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateFieldValue(AssistantSid string, FieldTypeSid string, path = strings.Replace(path, "{"+"FieldTypeSid"+"}", FieldTypeSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -59,6 +57,7 @@ func (c *ApiService) CreateFieldValue(AssistantSid string, FieldTypeSid string, if params != nil && params.Value != nil { data.Set("Value", *params.Value) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,14 +140,13 @@ func (c *ApiService) ListFieldValue(AssistantSid string, FieldTypeSid string, pa path = strings.Replace(path, "{"+"FieldTypeSid"+"}", FieldTypeSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_model_builds.go b/rest/autopilot/v1/assistants_model_builds.go index 79fd8b74b..4544a904c 100644 --- a/rest/autopilot/v1/assistants_model_builds.go +++ b/rest/autopilot/v1/assistants_model_builds.go @@ -41,14 +41,13 @@ func (c *ApiService) CreateModelBuild(AssistantSid string, params *CreateModelBu path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -122,11 +121,10 @@ func (c *ApiService) ListModelBuild(AssistantSid string, params *ListModelBuildP path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -160,11 +158,10 @@ func (c *ApiService) UpdateModelBuild(AssistantSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_queries.go b/rest/autopilot/v1/assistants_queries.go index 643d31d58..8b1e75a8c 100644 --- a/rest/autopilot/v1/assistants_queries.go +++ b/rest/autopilot/v1/assistants_queries.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateQuery(AssistantSid string, params *CreateQueryParams) path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateQuery(AssistantSid string, params *CreateQueryParams) if params != nil && params.Tasks != nil { data.Set("Tasks", *params.Tasks) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -164,8 +163,6 @@ func (c *ApiService) ListQuery(AssistantSid string, params *ListQueryParams) (*L path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -181,6 +178,7 @@ func (c *ApiService) ListQuery(AssistantSid string, params *ListQueryParams) (*L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -220,14 +218,13 @@ func (c *ApiService) UpdateQuery(AssistantSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SampleSid != nil { data.Set("SampleSid", *params.SampleSid) } if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_restore.go b/rest/autopilot/v1/assistants_restore.go index 8a65717f4..8576e8219 100644 --- a/rest/autopilot/v1/assistants_restore.go +++ b/rest/autopilot/v1/assistants_restore.go @@ -31,11 +31,10 @@ func (c *ApiService) UpdateRestoreAssistant(params *UpdateRestoreAssistantParams path := "/v1/Assistants/Restore" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Assistant != nil { data.Set("Assistant", *params.Assistant) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_style_sheet.go b/rest/autopilot/v1/assistants_style_sheet.go index b8b2f0cb2..7c3c6e2cb 100644 --- a/rest/autopilot/v1/assistants_style_sheet.go +++ b/rest/autopilot/v1/assistants_style_sheet.go @@ -58,8 +58,6 @@ func (c *ApiService) UpdateStyleSheet(AssistantSid string, params *UpdateStyleSh path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.StyleSheet != nil { v, err := json.Marshal(params.StyleSheet) @@ -69,6 +67,7 @@ func (c *ApiService) UpdateStyleSheet(AssistantSid string, params *UpdateStyleSh data.Set("StyleSheet", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks.go b/rest/autopilot/v1/assistants_tasks.go index 4af2ad929..e2b10275d 100644 --- a/rest/autopilot/v1/assistants_tasks.go +++ b/rest/autopilot/v1/assistants_tasks.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateTask(AssistantSid string, params *CreateTaskParams) ( path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Actions != nil { v, err := json.Marshal(params.Actions) @@ -73,6 +71,7 @@ func (c *ApiService) CreateTask(AssistantSid string, params *CreateTaskParams) ( if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -146,11 +145,10 @@ func (c *ApiService) ListTask(AssistantSid string, params *ListTaskParams) (*Lis path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -202,8 +200,6 @@ func (c *ApiService) UpdateTask(AssistantSid string, Sid string, params *UpdateT path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Actions != nil { v, err := json.Marshal(params.Actions) @@ -222,6 +218,7 @@ func (c *ApiService) UpdateTask(AssistantSid string, Sid string, params *UpdateT if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks_actions.go b/rest/autopilot/v1/assistants_tasks_actions.go index 30ae2160b..62ef70a4b 100644 --- a/rest/autopilot/v1/assistants_tasks_actions.go +++ b/rest/autopilot/v1/assistants_tasks_actions.go @@ -60,8 +60,6 @@ func (c *ApiService) UpdateTaskActions(AssistantSid string, TaskSid string, para path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Actions != nil { v, err := json.Marshal(params.Actions) @@ -71,6 +69,7 @@ func (c *ApiService) UpdateTaskActions(AssistantSid string, TaskSid string, para data.Set("Actions", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks_fields.go b/rest/autopilot/v1/assistants_tasks_fields.go index e8b20ea7b..4d6e71dff 100644 --- a/rest/autopilot/v1/assistants_tasks_fields.go +++ b/rest/autopilot/v1/assistants_tasks_fields.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateField(AssistantSid string, TaskSid string, params *Cr path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FieldType != nil { data.Set("FieldType", *params.FieldType) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) ListField(AssistantSid string, TaskSid string, params *List path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_tasks_samples.go b/rest/autopilot/v1/assistants_tasks_samples.go index 97462e193..8a4a3bfe9 100644 --- a/rest/autopilot/v1/assistants_tasks_samples.go +++ b/rest/autopilot/v1/assistants_tasks_samples.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateSample(AssistantSid string, TaskSid string, params *C path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -59,6 +57,7 @@ func (c *ApiService) CreateSample(AssistantSid string, TaskSid string, params *C if params != nil && params.TaggedText != nil { data.Set("TaggedText", *params.TaggedText) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,14 +140,13 @@ func (c *ApiService) ListSample(AssistantSid string, TaskSid string, params *Lis path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -195,8 +193,6 @@ func (c *ApiService) UpdateSample(AssistantSid string, TaskSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Language != nil { data.Set("Language", *params.Language) } @@ -206,6 +202,7 @@ func (c *ApiService) UpdateSample(AssistantSid string, TaskSid string, Sid strin if params != nil && params.TaggedText != nil { data.Set("TaggedText", *params.TaggedText) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/autopilot/v1/assistants_webhooks.go b/rest/autopilot/v1/assistants_webhooks.go index a2e5b1852..faf2e1dc2 100644 --- a/rest/autopilot/v1/assistants_webhooks.go +++ b/rest/autopilot/v1/assistants_webhooks.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateWebhook(AssistantSid string, params *CreateWebhookPar path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Events != nil { data.Set("Events", *params.Events) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateWebhook(AssistantSid string, params *CreateWebhookPar if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -140,11 +139,10 @@ func (c *ApiService) ListWebhook(AssistantSid string, params *ListWebhookParams) path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -196,8 +194,6 @@ func (c *ApiService) UpdateWebhook(AssistantSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Events != nil { data.Set("Events", *params.Events) } @@ -210,6 +206,7 @@ func (c *ApiService) UpdateWebhook(AssistantSid string, Sid string, params *Upda if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/bulkexports/v1/exports_configuration.go b/rest/bulkexports/v1/exports_configuration.go index bbb15a91b..97a80acf8 100644 --- a/rest/bulkexports/v1/exports_configuration.go +++ b/rest/bulkexports/v1/exports_configuration.go @@ -71,8 +71,6 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -82,6 +80,7 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/bulkexports/v1/exports_days.go b/rest/bulkexports/v1/exports_days.go index 76db12436..7602ad922 100644 --- a/rest/bulkexports/v1/exports_days.go +++ b/rest/bulkexports/v1/exports_days.go @@ -55,11 +55,10 @@ func (c *ApiService) ListDay(ResourceType string, params *ListDayParams) (*ListD path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/bulkexports/v1/exports_jobs.go b/rest/bulkexports/v1/exports_jobs.go index 9b7e46595..7da0e151c 100644 --- a/rest/bulkexports/v1/exports_jobs.go +++ b/rest/bulkexports/v1/exports_jobs.go @@ -65,8 +65,6 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -85,6 +83,7 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -156,11 +155,10 @@ func (c *ApiService) ListExportCustomJob(ResourceType string, params *ListExport path = strings.Replace(path, "{"+"ResourceType"+"}", ResourceType, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/credentials.go b/rest/chat/v1/credentials.go index e611594f4..159d1c433 100644 --- a/rest/chat/v1/credentials.go +++ b/rest/chat/v1/credentials.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListCredential(params *ListCredentialParams) (*ListCredenti path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -230,8 +228,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -250,6 +246,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services.go b/rest/chat/v1/services.go index bbb47513b..6362decaa 100644 --- a/rest/chat/v1/services.go +++ b/rest/chat/v1/services.go @@ -34,11 +34,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV1Service, path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -109,11 +108,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -464,8 +462,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -630,6 +626,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels.go b/rest/chat/v1/services_channels.go index a6b403f16..98b6983ae 100644 --- a/rest/chat/v1/services_channels.go +++ b/rest/chat/v1/services_channels.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -146,8 +145,6 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -156,6 +153,7 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -201,8 +199,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -212,6 +208,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels_invites.go b/rest/chat/v1/services_channels_invites.go index 34d01572f..bed60ed51 100644 --- a/rest/chat/v1/services_channels_invites.go +++ b/rest/chat/v1/services_channels_invites.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,8 +131,6 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -142,6 +139,7 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels_members.go b/rest/chat/v1/services_channels_members.go index cf370e69b..6034c30bb 100644 --- a/rest/chat/v1/services_channels_members.go +++ b/rest/chat/v1/services_channels_members.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,8 +131,6 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -142,6 +139,7 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -182,14 +180,13 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_channels_messages.go b/rest/chat/v1/services_channels_messages.go index eafe13cbf..834e9619d 100644 --- a/rest/chat/v1/services_channels_messages.go +++ b/rest/chat/v1/services_channels_messages.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -59,6 +57,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.From != nil { data.Set("From", *params.From) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,14 +140,13 @@ func (c *ApiService) ListMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -189,14 +187,13 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } if params != nil && params.Body != nil { data.Set("Body", *params.Body) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_roles.go b/rest/chat/v1/services_roles.go index c08332e68..12d880b99 100644 --- a/rest/chat/v1/services_roles.go +++ b/rest/chat/v1/services_roles.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -133,11 +132,10 @@ func (c *ApiService) ListRole(ServiceSid string, params *ListRoleParams) (*ListR path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -171,13 +169,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_users.go b/rest/chat/v1/services_users.go index 8458f28a4..9227f7fec 100644 --- a/rest/chat/v1/services_users.go +++ b/rest/chat/v1/services_users.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -140,11 +139,10 @@ func (c *ApiService) ListUser(ServiceSid string, params *ListUserParams) (*ListU path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -190,8 +188,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -201,6 +197,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v1/services_users_channels.go b/rest/chat/v1/services_users_channels.go index e9ba3813e..f24ffd021 100644 --- a/rest/chat/v1/services_users_channels.go +++ b/rest/chat/v1/services_users_channels.go @@ -37,11 +37,10 @@ func (c *ApiService) ListUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/credentials.go b/rest/chat/v2/credentials.go index afc7efcca..2035da8b3 100644 --- a/rest/chat/v2/credentials.go +++ b/rest/chat/v2/credentials.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListCredential(params *ListCredentialParams) (*ListCredenti path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -230,8 +228,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -250,6 +246,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services.go b/rest/chat/v2/services.go index 377b35e4a..de60ca105 100644 --- a/rest/chat/v2/services.go +++ b/rest/chat/v2/services.go @@ -34,11 +34,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV2Service, path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -109,11 +108,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -326,8 +324,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -423,6 +419,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch if params != nil && params.WebhookMethod != nil { data.Set("WebhookMethod", *params.WebhookMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_bindings.go b/rest/chat/v2/services_bindings.go index 5c5f85451..0db0b2da9 100644 --- a/rest/chat/v2/services_bindings.go +++ b/rest/chat/v2/services_bindings.go @@ -88,8 +88,6 @@ func (c *ApiService) ListBinding(ServiceSid string, params *ListBindingParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -103,6 +101,7 @@ func (c *ApiService) ListBinding(ServiceSid string, params *ListBindingParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_channels.go b/rest/chat/v2/services_channels.go index 129db186f..04409ffa5 100644 --- a/rest/chat/v2/services_channels.go +++ b/rest/chat/v2/services_channels.go @@ -78,8 +78,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -101,7 +99,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -139,7 +137,6 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -199,8 +196,6 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -209,6 +204,7 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -278,8 +274,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -298,7 +292,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_channels_invites.go b/rest/chat/v2/services_channels_invites.go index 5de919e65..abe7a77f7 100644 --- a/rest/chat/v2/services_channels_invites.go +++ b/rest/chat/v2/services_channels_invites.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,8 +131,6 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -142,6 +139,7 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_channels_members.go b/rest/chat/v2/services_channels_members.go index 5af23ace7..8e71d65b5 100644 --- a/rest/chat/v2/services_channels_members.go +++ b/rest/chat/v2/services_channels_members.go @@ -79,8 +79,6 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -102,7 +100,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,7 +139,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -203,8 +200,6 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -213,6 +208,7 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -283,8 +279,6 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -303,7 +297,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_channels_messages.go b/rest/chat/v2/services_channels_messages.go index 120d8dee6..9b7bcf74d 100644 --- a/rest/chat/v2/services_channels_messages.go +++ b/rest/chat/v2/services_channels_messages.go @@ -79,8 +79,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -102,7 +100,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,7 +139,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -203,14 +200,13 @@ func (c *ApiService) ListMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -281,8 +277,6 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -301,7 +295,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str if params != nil && params.LastUpdatedBy != nil { data.Set("LastUpdatedBy", *params.LastUpdatedBy) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_channels_webhooks.go b/rest/chat/v2/services_channels_webhooks.go index 1beee7889..8bdcb1711 100644 --- a/rest/chat/v2/services_channels_webhooks.go +++ b/rest/chat/v2/services_channels_webhooks.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -99,6 +97,7 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -175,11 +174,10 @@ func (c *ApiService) ListChannelWebhook(ServiceSid string, ChannelSid string, pa path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -244,8 +242,6 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -268,6 +264,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_roles.go b/rest/chat/v2/services_roles.go index bb1e822d9..998529ef2 100644 --- a/rest/chat/v2/services_roles.go +++ b/rest/chat/v2/services_roles.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -133,11 +132,10 @@ func (c *ApiService) ListRole(ServiceSid string, params *ListRoleParams) (*ListR path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -171,13 +169,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_users.go b/rest/chat/v2/services_users.go index 0345ffd02..f5ed8fecc 100644 --- a/rest/chat/v2/services_users.go +++ b/rest/chat/v2/services_users.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -73,7 +71,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -150,11 +148,10 @@ func (c *ApiService) ListUser(ServiceSid string, params *ListUserParams) (*ListU path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -206,8 +203,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -217,7 +212,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/chat/v2/services_users_bindings.go b/rest/chat/v2/services_users_bindings.go index 054c889fd..9abe5cec7 100644 --- a/rest/chat/v2/services_users_bindings.go +++ b/rest/chat/v2/services_users_bindings.go @@ -85,8 +85,6 @@ func (c *ApiService) ListUserBinding(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -95,6 +93,7 @@ func (c *ApiService) ListUserBinding(ServiceSid string, UserSid string, params * if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/chat/v2/services_users_channels.go b/rest/chat/v2/services_users_channels.go index 6799f9e76..020fb2e5f 100644 --- a/rest/chat/v2/services_users_channels.go +++ b/rest/chat/v2/services_users_channels.go @@ -82,11 +82,10 @@ func (c *ApiService) ListUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -133,8 +132,6 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } @@ -144,6 +141,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe if params != nil && params.NotificationLevel != nil { data.Set("NotificationLevel", *params.NotificationLevel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/configuration.go b/rest/conversations/v1/configuration.go index 846850b4b..a1584cb59 100644 --- a/rest/conversations/v1/configuration.go +++ b/rest/conversations/v1/configuration.go @@ -72,8 +72,6 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co path := "/v1/Configuration" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DefaultChatServiceSid != nil { data.Set("DefaultChatServiceSid", *params.DefaultChatServiceSid) } @@ -86,6 +84,7 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co if params != nil && params.DefaultMessagingServiceSid != nil { data.Set("DefaultMessagingServiceSid", *params.DefaultMessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/configuration_webhooks.go b/rest/conversations/v1/configuration_webhooks.go index dd814202b..88d00e555 100644 --- a/rest/conversations/v1/configuration_webhooks.go +++ b/rest/conversations/v1/configuration_webhooks.go @@ -76,8 +76,6 @@ func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebho path := "/v1/Configuration/Webhooks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Filters != nil { for _, item := range *params.Filters { data.Add("Filters", item) @@ -95,6 +93,7 @@ func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebho if params != nil && params.Target != nil { data.Set("Target", *params.Target) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/conversations.go b/rest/conversations/v1/conversations.go index 36e6827f0..e3b4210d2 100644 --- a/rest/conversations/v1/conversations.go +++ b/rest/conversations/v1/conversations.go @@ -90,8 +90,6 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv path := "/v1/Conversations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -119,7 +117,7 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -157,7 +155,6 @@ func (c *ApiService) DeleteConversation(Sid string, params *DeleteConversationPa data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -211,11 +208,10 @@ func (c *ApiService) ListConversation(params *ListConversationParams) (*ListConv path := "/v1/Conversations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -303,8 +299,6 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -332,7 +326,7 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/conversations_messages.go b/rest/conversations/v1/conversations_messages.go index 991a97b1c..4b9a14f35 100644 --- a/rest/conversations/v1/conversations_messages.go +++ b/rest/conversations/v1/conversations_messages.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -93,7 +91,7 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -132,7 +130,6 @@ func (c *ApiService) DeleteConversationMessage(ConversationSid string, Sid strin data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -188,11 +185,10 @@ func (c *ApiService) ListConversationMessage(ConversationSid string, params *Lis path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -257,8 +253,6 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -274,7 +268,7 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin if params != nil && params.DateUpdated != nil { data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/conversations_messages_receipts.go b/rest/conversations/v1/conversations_messages_receipts.go index 0ef2802c7..e8742b868 100644 --- a/rest/conversations/v1/conversations_messages_receipts.go +++ b/rest/conversations/v1/conversations_messages_receipts.go @@ -62,11 +62,10 @@ func (c *ApiService) ListConversationMessageReceipt(ConversationSid string, Mess path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/conversations_participants.go b/rest/conversations/v1/conversations_participants.go index e0924494a..37ee51749 100644 --- a/rest/conversations/v1/conversations_participants.go +++ b/rest/conversations/v1/conversations_participants.go @@ -85,8 +85,6 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -111,7 +109,7 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -150,7 +148,6 @@ func (c *ApiService) DeleteConversationParticipant(ConversationSid string, Sid s data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -206,11 +203,10 @@ func (c *ApiService) ListConversationParticipant(ConversationSid string, params path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -299,8 +295,6 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -328,7 +322,7 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/conversations_webhooks.go b/rest/conversations/v1/conversations_webhooks.go index ac0408529..f26fb49f6 100644 --- a/rest/conversations/v1/conversations_webhooks.go +++ b/rest/conversations/v1/conversations_webhooks.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -99,6 +97,7 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par if params != nil && params.Target != nil { data.Set("Target", *params.Target) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -175,11 +174,10 @@ func (c *ApiService) ListConversationScopedWebhook(ConversationSid string, param path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -238,8 +236,6 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -259,6 +255,7 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/credentials.go b/rest/conversations/v1/credentials.go index 2e20b3de1..afa6a3e8a 100644 --- a/rest/conversations/v1/credentials.go +++ b/rest/conversations/v1/credentials.go @@ -71,8 +71,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -94,6 +92,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -167,11 +166,10 @@ func (c *ApiService) ListCredential(params *ListCredentialParams) (*ListCredenti path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -241,8 +239,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -264,6 +260,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/roles.go b/rest/conversations/v1/roles.go index 5730c7c9f..3e9ee0e64 100644 --- a/rest/conversations/v1/roles.go +++ b/rest/conversations/v1/roles.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, path := "/v1/Roles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -133,11 +132,10 @@ func (c *ApiService) ListRole(params *ListRoleParams) (*ListRoleResponse, error) path := "/v1/Roles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -171,13 +169,12 @@ func (c *ApiService) UpdateRole(Sid string, params *UpdateRoleParams) (*Conversa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services.go b/rest/conversations/v1/services.go index 9570fa993..3cf5c46f2 100644 --- a/rest/conversations/v1/services.go +++ b/rest/conversations/v1/services.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ConversationsV path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_bindings.go b/rest/conversations/v1/services_bindings.go index 21f2472ce..b196ab22c 100644 --- a/rest/conversations/v1/services_bindings.go +++ b/rest/conversations/v1/services_bindings.go @@ -91,8 +91,6 @@ func (c *ApiService) ListServiceBinding(ChatServiceSid string, params *ListServi path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -106,6 +104,7 @@ func (c *ApiService) ListServiceBinding(ChatServiceSid string, params *ListServi if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_configuration.go b/rest/conversations/v1/services_configuration.go index e003dc97a..18a11702d 100644 --- a/rest/conversations/v1/services_configuration.go +++ b/rest/conversations/v1/services_configuration.go @@ -77,8 +77,6 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DefaultChatServiceRoleSid != nil { data.Set("DefaultChatServiceRoleSid", *params.DefaultChatServiceRoleSid) } @@ -91,6 +89,7 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U if params != nil && params.ReachabilityEnabled != nil { data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_configuration_notifications.go b/rest/conversations/v1/services_configuration_notifications.go index ed9247911..da021aa49 100644 --- a/rest/conversations/v1/services_configuration_notifications.go +++ b/rest/conversations/v1/services_configuration_notifications.go @@ -119,8 +119,6 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AddedToConversationEnabled != nil { data.Set("AddedToConversation.Enabled", fmt.Sprint(*params.AddedToConversationEnabled)) } @@ -154,6 +152,7 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up if params != nil && params.RemovedFromConversationTemplate != nil { data.Set("RemovedFromConversation.Template", *params.RemovedFromConversationTemplate) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_conversations.go b/rest/conversations/v1/services_conversations.go index 82fef7ec9..5532d63f7 100644 --- a/rest/conversations/v1/services_conversations.go +++ b/rest/conversations/v1/services_conversations.go @@ -91,8 +91,6 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -120,7 +118,7 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -159,7 +157,6 @@ func (c *ApiService) DeleteServiceConversation(ChatServiceSid string, Sid string data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -215,11 +212,10 @@ func (c *ApiService) ListServiceConversation(ChatServiceSid string, params *List path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -308,8 +304,6 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -337,7 +331,7 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/services_conversations_messages.go b/rest/conversations/v1/services_conversations_messages.go index fce161786..71c348465 100644 --- a/rest/conversations/v1/services_conversations_messages.go +++ b/rest/conversations/v1/services_conversations_messages.go @@ -74,8 +74,6 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -94,7 +92,7 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -134,7 +132,6 @@ func (c *ApiService) DeleteServiceConversationMessage(ChatServiceSid string, Con data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -192,11 +189,10 @@ func (c *ApiService) ListServiceConversationMessage(ChatServiceSid string, Conve path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -262,8 +258,6 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -279,7 +273,7 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con if params != nil && params.DateUpdated != nil { data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/services_conversations_messages_receipts.go b/rest/conversations/v1/services_conversations_messages_receipts.go index a70299f16..4f40fd510 100644 --- a/rest/conversations/v1/services_conversations_messages_receipts.go +++ b/rest/conversations/v1/services_conversations_messages_receipts.go @@ -64,11 +64,10 @@ func (c *ApiService) ListServiceConversationMessageReceipt(ChatServiceSid string path = strings.Replace(path, "{"+"MessageSid"+"}", MessageSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_conversations_participants.go b/rest/conversations/v1/services_conversations_participants.go index 9b5b4625b..1dd9951f1 100644 --- a/rest/conversations/v1/services_conversations_participants.go +++ b/rest/conversations/v1/services_conversations_participants.go @@ -86,8 +86,6 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -112,7 +110,7 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -152,7 +150,6 @@ func (c *ApiService) DeleteServiceConversationParticipant(ChatServiceSid string, data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -210,11 +207,10 @@ func (c *ApiService) ListServiceConversationParticipant(ChatServiceSid string, C path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -304,8 +300,6 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -333,7 +327,7 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/services_conversations_webhooks.go b/rest/conversations/v1/services_conversations_webhooks.go index 066d99d74..8eaf6b21a 100644 --- a/rest/conversations/v1/services_conversations_webhooks.go +++ b/rest/conversations/v1/services_conversations_webhooks.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -100,6 +98,7 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin if params != nil && params.Target != nil { data.Set("Target", *params.Target) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -179,11 +178,10 @@ func (c *ApiService) ListServiceConversationScopedWebhook(ChatServiceSid string, path = strings.Replace(path, "{"+"ConversationSid"+"}", ConversationSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -243,8 +241,6 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -264,6 +260,7 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_roles.go b/rest/conversations/v1/services_roles.go index 7634a7881..6a866a795 100644 --- a/rest/conversations/v1/services_roles.go +++ b/rest/conversations/v1/services_roles.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -61,6 +59,7 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -137,11 +136,10 @@ func (c *ApiService) ListServiceRole(ChatServiceSid string, params *ListServiceR path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -176,13 +174,12 @@ func (c *ApiService) UpdateServiceRole(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/conversations/v1/services_users.go b/rest/conversations/v1/services_users.go index a4c91bb59..2e7513d6e 100644 --- a/rest/conversations/v1/services_users.go +++ b/rest/conversations/v1/services_users.go @@ -60,8 +60,6 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -74,7 +72,7 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -113,7 +111,6 @@ func (c *ApiService) DeleteServiceUser(ChatServiceSid string, Sid string, params data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -169,11 +166,10 @@ func (c *ApiService) ListServiceUser(ChatServiceSid string, params *ListServiceU path = strings.Replace(path, "{"+"ChatServiceSid"+"}", ChatServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -226,8 +222,6 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -237,7 +231,7 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/conversations/v1/users.go b/rest/conversations/v1/users.go index 14855b598..93a37edd7 100644 --- a/rest/conversations/v1/users.go +++ b/rest/conversations/v1/users.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, path := "/v1/Users" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -73,7 +71,7 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -111,7 +109,6 @@ func (c *ApiService) DeleteUser(Sid string, params *DeleteUserParams) error { data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -165,11 +162,10 @@ func (c *ApiService) ListUser(params *ListUserParams) (*ListUserResponse, error) path := "/v1/Users" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -221,8 +217,6 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -232,7 +226,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/events/v1/schemas_versions.go b/rest/events/v1/schemas_versions.go index 7e7d97587..d3c00cef0 100644 --- a/rest/events/v1/schemas_versions.go +++ b/rest/events/v1/schemas_versions.go @@ -60,11 +60,10 @@ func (c *ApiService) ListSchemaVersion(Id string, params *ListSchemaVersionParam path = strings.Replace(path, "{"+"Id"+"}", Id, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/sinks.go b/rest/events/v1/sinks.go index 5968d175e..a5490af2c 100644 --- a/rest/events/v1/sinks.go +++ b/rest/events/v1/sinks.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) path := "/v1/Sinks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } @@ -64,6 +62,7 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) if params != nil && params.SinkType != nil { data.Set("SinkType", *params.SinkType) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -149,8 +148,6 @@ func (c *ApiService) ListSink(params *ListSinkParams) (*ListSinkResponse, error) path := "/v1/Sinks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.InUse != nil { data.Set("InUse", fmt.Sprint(*params.InUse)) } @@ -160,6 +157,7 @@ func (c *ApiService) ListSink(params *ListSinkParams) (*ListSinkResponse, error) if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -193,11 +191,10 @@ func (c *ApiService) UpdateSink(Sid string, params *UpdateSinkParams) (*EventsV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/sinks_validate.go b/rest/events/v1/sinks_validate.go index 3da6c6190..50771f071 100644 --- a/rest/events/v1/sinks_validate.go +++ b/rest/events/v1/sinks_validate.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateSinkValidate(Sid string, params *CreateSinkValidatePa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TestId != nil { data.Set("TestId", *params.TestId) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/subscriptions.go b/rest/events/v1/subscriptions.go index 95df38d18..7b33aa46d 100644 --- a/rest/events/v1/subscriptions.go +++ b/rest/events/v1/subscriptions.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even path := "/v1/Subscriptions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } @@ -66,6 +64,7 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even data.Add("Types", string(v)) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -145,14 +144,13 @@ func (c *ApiService) ListSubscription(params *ListSubscriptionParams) (*ListSubs path := "/v1/Subscriptions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SinkSid != nil { data.Set("SinkSid", *params.SinkSid) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -192,14 +190,13 @@ func (c *ApiService) UpdateSubscription(Sid string, params *UpdateSubscriptionPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } if params != nil && params.SinkSid != nil { data.Set("SinkSid", *params.SinkSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/subscriptions_subscribed_events.go b/rest/events/v1/subscriptions_subscribed_events.go index fa3104317..2ffb1bbeb 100644 --- a/rest/events/v1/subscriptions_subscribed_events.go +++ b/rest/events/v1/subscriptions_subscribed_events.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateSubscribedEvent(SubscriptionSid string, params *Creat path = strings.Replace(path, "{"+"SubscriptionSid"+"}", SubscriptionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SchemaVersion != nil { data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) } if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) ListSubscribedEvent(SubscriptionSid string, params *ListSub path = strings.Replace(path, "{"+"SubscriptionSid"+"}", SubscriptionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -165,11 +163,10 @@ func (c *ApiService) UpdateSubscribedEvent(SubscriptionSid string, Type string, path = strings.Replace(path, "{"+"Type"+"}", Type, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SchemaVersion != nil { data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/events/v1/types.go b/rest/events/v1/types.go index eda1351d1..f81e69b17 100644 --- a/rest/events/v1/types.go +++ b/rest/events/v1/types.go @@ -64,14 +64,13 @@ func (c *ApiService) ListEventType(params *ListEventTypeParams) (*ListEventTypeR path := "/v1/Types" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SchemaId != nil { data.Set("SchemaId", *params.SchemaId) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/fax/v1/faxes.go b/rest/fax/v1/faxes.go index cd6f4e975..d8f6ae83c 100644 --- a/rest/fax/v1/faxes.go +++ b/rest/fax/v1/faxes.go @@ -84,8 +84,6 @@ func (c *ApiService) CreateFax(params *CreateFaxParams) (*FaxV1Fax, error) { path := "/v1/Faxes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -113,6 +111,7 @@ func (c *ApiService) CreateFax(params *CreateFaxParams) (*FaxV1Fax, error) { if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -210,8 +209,6 @@ func (c *ApiService) ListFax(params *ListFaxParams) (*ListFaxResponse, error) { path := "/v1/Faxes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -227,6 +224,7 @@ func (c *ApiService) ListFax(params *ListFaxParams) (*ListFaxResponse, error) { if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -260,11 +258,10 @@ func (c *ApiService) UpdateFax(Sid string, params *UpdateFaxParams) (*FaxV1Fax, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/fax/v1/faxes_media.go b/rest/fax/v1/faxes_media.go index e4b5648dc..187a45d42 100644 --- a/rest/fax/v1/faxes_media.go +++ b/rest/fax/v1/faxes_media.go @@ -79,11 +79,10 @@ func (c *ApiService) ListFaxMedia(FaxSid string, params *ListFaxMediaParams) (*L path = strings.Replace(path, "{"+"FaxSid"+"}", FaxSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/flex/v1/channels.go b/rest/flex/v1/channels.go index 67badc5f5..ec56f3802 100644 --- a/rest/flex/v1/channels.go +++ b/rest/flex/v1/channels.go @@ -88,8 +88,6 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, path := "/v1/Channels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChatFriendlyName != nil { data.Set("ChatFriendlyName", *params.ChatFriendlyName) } @@ -120,6 +118,7 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, if params != nil && params.TaskSid != nil { data.Set("TaskSid", *params.TaskSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -190,11 +189,10 @@ func (c *ApiService) ListChannel(params *ListChannelParams) (*ListChannelRespons path := "/v1/Channels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/flex/v1/configuration.go b/rest/flex/v1/configuration.go index a3e606691..403592549 100644 --- a/rest/flex/v1/configuration.go +++ b/rest/flex/v1/configuration.go @@ -31,11 +31,10 @@ func (c *ApiService) FetchConfiguration(params *FetchConfigurationParams) (*Flex path := "/v1/Configuration" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UiVersion != nil { data.Set("UiVersion", *params.UiVersion) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/flex/v1/flex_flows.go b/rest/flex/v1/flex_flows.go index 4f2e85f1b..805619361 100644 --- a/rest/flex/v1/flex_flows.go +++ b/rest/flex/v1/flex_flows.go @@ -130,8 +130,6 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl path := "/v1/FlexFlows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelType != nil { data.Set("ChannelType", *params.ChannelType) } @@ -183,6 +181,7 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl if params != nil && params.LongLived != nil { data.Set("LongLived", fmt.Sprint(*params.LongLived)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -259,14 +258,13 @@ func (c *ApiService) ListFlexFlow(params *ListFlexFlowParams) (*ListFlexFlowResp path := "/v1/FlexFlows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -395,8 +393,6 @@ func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelType != nil { data.Set("ChannelType", *params.ChannelType) } @@ -448,6 +444,7 @@ func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (* if params != nil && params.LongLived != nil { data.Set("LongLived", fmt.Sprint(*params.LongLived)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/flex/v1/web_channels.go b/rest/flex/v1/web_channels.go index 73251c056..0855f3482 100644 --- a/rest/flex/v1/web_channels.go +++ b/rest/flex/v1/web_channels.go @@ -64,8 +64,6 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We path := "/v1/WebChannels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChatFriendlyName != nil { data.Set("ChatFriendlyName", *params.ChatFriendlyName) } @@ -84,6 +82,7 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We if params != nil && params.PreEngagementData != nil { data.Set("PreEngagementData", *params.PreEngagementData) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -154,11 +153,10 @@ func (c *ApiService) ListWebChannel(params *ListWebChannelParams) (*ListWebChann path := "/v1/WebChannels" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -197,14 +195,13 @@ func (c *ApiService) UpdateWebChannel(Sid string, params *UpdateWebChannelParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChatStatus != nil { data.Set("ChatStatus", *params.ChatStatus) } if params != nil && params.PostEngagementData != nil { data.Set("PostEngagementData", *params.PostEngagementData) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/frontline/v1/users.go b/rest/frontline/v1/users.go index 79013ec5e..0c0e3d6e0 100644 --- a/rest/frontline/v1/users.go +++ b/rest/frontline/v1/users.go @@ -70,8 +70,6 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Avatar != nil { data.Set("Avatar", *params.Avatar) } @@ -81,6 +79,7 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin if params != nil && params.State != nil { data.Set("State", *params.State) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/insights/v1/video_rooms.go b/rest/insights/v1/video_rooms.go index cd5c138af..1a068a6cf 100644 --- a/rest/insights/v1/video_rooms.go +++ b/rest/insights/v1/video_rooms.go @@ -89,8 +89,6 @@ func (c *ApiService) ListVideoRoomSummary(params *ListVideoRoomSummaryParams) (* path := "/v1/Video/Rooms" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.RoomType != nil { for _, item := range *params.RoomType { data.Add("RoomType", item) @@ -113,6 +111,7 @@ func (c *ApiService) ListVideoRoomSummary(params *ListVideoRoomSummaryParams) (* if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/insights/v1/video_rooms_participants.go b/rest/insights/v1/video_rooms_participants.go index 6098b1340..0ea8985d6 100644 --- a/rest/insights/v1/video_rooms_participants.go +++ b/rest/insights/v1/video_rooms_participants.go @@ -60,11 +60,10 @@ func (c *ApiService) ListVideoParticipantSummary(RoomSid string, params *ListVid path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/insights/v1/voice_events.go b/rest/insights/v1/voice_events.go index b835bd0ac..634142b92 100644 --- a/rest/insights/v1/voice_events.go +++ b/rest/insights/v1/voice_events.go @@ -41,14 +41,13 @@ func (c *ApiService) ListEvent(CallSid string, params *ListEventParams) (*ListEv path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Edge != nil { data.Set("Edge", *params.Edge) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/insights/v1/voice_metrics.go b/rest/insights/v1/voice_metrics.go index cac3ef97d..58ae95cdf 100644 --- a/rest/insights/v1/voice_metrics.go +++ b/rest/insights/v1/voice_metrics.go @@ -47,8 +47,6 @@ func (c *ApiService) ListMetric(CallSid string, params *ListMetricParams) (*List path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Edge != nil { data.Set("Edge", *params.Edge) } @@ -58,6 +56,7 @@ func (c *ApiService) ListMetric(CallSid string, params *ListMetricParams) (*List if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/insights/v1/voice_summary.go b/rest/insights/v1/voice_summary.go index 3c0e43060..aa0c1ec69 100644 --- a/rest/insights/v1/voice_summary.go +++ b/rest/insights/v1/voice_summary.go @@ -34,11 +34,10 @@ func (c *ApiService) FetchSummary(CallSid string, params *FetchSummaryParams) (* path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ProcessingState != nil { data.Set("ProcessingState", *params.ProcessingState) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/credentials.go b/rest/ip_messaging/v1/credentials.go index 36ef24a02..59f6744a0 100644 --- a/rest/ip_messaging/v1/credentials.go +++ b/rest/ip_messaging/v1/credentials.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListCredential(params *ListCredentialParams) (*ListCredenti path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -230,8 +228,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -250,6 +246,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services.go b/rest/ip_messaging/v1/services.go index 6010d8f67..42cee83b5 100644 --- a/rest/ip_messaging/v1/services.go +++ b/rest/ip_messaging/v1/services.go @@ -34,11 +34,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV1S path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -109,11 +108,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -464,8 +462,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -630,6 +626,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels.go b/rest/ip_messaging/v1/services_channels.go index 53bb78ea9..8221eb99f 100644 --- a/rest/ip_messaging/v1/services_channels.go +++ b/rest/ip_messaging/v1/services_channels.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -146,8 +145,6 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -156,6 +153,7 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -201,8 +199,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -212,6 +208,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels_invites.go b/rest/ip_messaging/v1/services_channels_invites.go index 35f0b499e..e6bf1b88f 100644 --- a/rest/ip_messaging/v1/services_channels_invites.go +++ b/rest/ip_messaging/v1/services_channels_invites.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,8 +131,6 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -142,6 +139,7 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels_members.go b/rest/ip_messaging/v1/services_channels_members.go index 76b921bb5..a417205d5 100644 --- a/rest/ip_messaging/v1/services_channels_members.go +++ b/rest/ip_messaging/v1/services_channels_members.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,8 +131,6 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -142,6 +139,7 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -182,14 +180,13 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_channels_messages.go b/rest/ip_messaging/v1/services_channels_messages.go index 42db00b43..f04fbc01a 100644 --- a/rest/ip_messaging/v1/services_channels_messages.go +++ b/rest/ip_messaging/v1/services_channels_messages.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -59,6 +57,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.From != nil { data.Set("From", *params.From) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,14 +140,13 @@ func (c *ApiService) ListMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -189,14 +187,13 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } if params != nil && params.Body != nil { data.Set("Body", *params.Body) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_roles.go b/rest/ip_messaging/v1/services_roles.go index 330ea48ea..ce055e3b1 100644 --- a/rest/ip_messaging/v1/services_roles.go +++ b/rest/ip_messaging/v1/services_roles.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -133,11 +132,10 @@ func (c *ApiService) ListRole(ServiceSid string, params *ListRoleParams) (*ListR path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -171,13 +169,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_users.go b/rest/ip_messaging/v1/services_users.go index a4bb71c67..750ab39a6 100644 --- a/rest/ip_messaging/v1/services_users.go +++ b/rest/ip_messaging/v1/services_users.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -140,11 +139,10 @@ func (c *ApiService) ListUser(ServiceSid string, params *ListUserParams) (*ListU path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -190,8 +188,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -201,6 +197,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v1/services_users_channels.go b/rest/ip_messaging/v1/services_users_channels.go index 81349ee71..213a99614 100644 --- a/rest/ip_messaging/v1/services_users_channels.go +++ b/rest/ip_messaging/v1/services_users_channels.go @@ -36,11 +36,10 @@ func (c *ApiService) ListUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/credentials.go b/rest/ip_messaging/v2/credentials.go index 8d946a523..48935b967 100644 --- a/rest/ip_messaging/v2/credentials.go +++ b/rest/ip_messaging/v2/credentials.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListCredential(params *ListCredentialParams) (*ListCredenti path := "/v2/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -230,8 +228,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -250,6 +246,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services.go b/rest/ip_messaging/v2/services.go index 8a8079f36..468820a95 100644 --- a/rest/ip_messaging/v2/services.go +++ b/rest/ip_messaging/v2/services.go @@ -34,11 +34,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV2S path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -109,11 +108,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -326,8 +324,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConsumptionReportInterval != nil { data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) } @@ -423,6 +419,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip if params != nil && params.WebhookMethod != nil { data.Set("WebhookMethod", *params.WebhookMethod) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_bindings.go b/rest/ip_messaging/v2/services_bindings.go index afd73844f..3c338ea7b 100644 --- a/rest/ip_messaging/v2/services_bindings.go +++ b/rest/ip_messaging/v2/services_bindings.go @@ -88,8 +88,6 @@ func (c *ApiService) ListBinding(ServiceSid string, params *ListBindingParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -103,6 +101,7 @@ func (c *ApiService) ListBinding(ServiceSid string, params *ListBindingParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_channels.go b/rest/ip_messaging/v2/services_channels.go index 5c3cae014..da3435911 100644 --- a/rest/ip_messaging/v2/services_channels.go +++ b/rest/ip_messaging/v2/services_channels.go @@ -78,8 +78,6 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -101,7 +99,7 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -139,7 +137,6 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -199,8 +196,6 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Type != nil { for _, item := range *params.Type { data.Add("Type", item) @@ -209,6 +204,7 @@ func (c *ApiService) ListChannel(ServiceSid string, params *ListChannelParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -278,8 +274,6 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -298,7 +292,7 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_channels_invites.go b/rest/ip_messaging/v2/services_channels_invites.go index 2fd34c770..d68ec82ac 100644 --- a/rest/ip_messaging/v2/services_channels_invites.go +++ b/rest/ip_messaging/v2/services_channels_invites.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -132,8 +131,6 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -142,6 +139,7 @@ func (c *ApiService) ListInvite(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_channels_members.go b/rest/ip_messaging/v2/services_channels_members.go index b137b5519..7eca5305d 100644 --- a/rest/ip_messaging/v2/services_channels_members.go +++ b/rest/ip_messaging/v2/services_channels_members.go @@ -79,8 +79,6 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -102,7 +100,7 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,7 +139,6 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -203,8 +200,6 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { for _, item := range *params.Identity { data.Add("Identity", item) @@ -213,6 +208,7 @@ func (c *ApiService) ListMember(ServiceSid string, ChannelSid string, params *Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -283,8 +279,6 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -303,7 +297,7 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_channels_messages.go b/rest/ip_messaging/v2/services_channels_messages.go index 1a88145f7..a971b0e30 100644 --- a/rest/ip_messaging/v2/services_channels_messages.go +++ b/rest/ip_messaging/v2/services_channels_messages.go @@ -79,8 +79,6 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -102,7 +100,7 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params if params != nil && params.MediaSid != nil { data.Set("MediaSid", *params.MediaSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,7 +139,6 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -203,14 +200,13 @@ func (c *ApiService) ListMessage(ServiceSid string, ChannelSid string, params *L path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -281,8 +277,6 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -301,7 +295,7 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str if params != nil && params.LastUpdatedBy != nil { data.Set("LastUpdatedBy", *params.LastUpdatedBy) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_channels_webhooks.go b/rest/ip_messaging/v2/services_channels_webhooks.go index 657b6c64a..4fd1ec700 100644 --- a/rest/ip_messaging/v2/services_channels_webhooks.go +++ b/rest/ip_messaging/v2/services_channels_webhooks.go @@ -72,8 +72,6 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -99,6 +97,7 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -175,11 +174,10 @@ func (c *ApiService) ListChannelWebhook(ServiceSid string, ChannelSid string, pa path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -244,8 +242,6 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ConfigurationFilters != nil { for _, item := range *params.ConfigurationFilters { data.Add("Configuration.Filters", item) @@ -268,6 +264,7 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, if params != nil && params.ConfigurationUrl != nil { data.Set("Configuration.Url", *params.ConfigurationUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_roles.go b/rest/ip_messaging/v2/services_roles.go index 3139f5f1e..3d5197d09 100644 --- a/rest/ip_messaging/v2/services_roles.go +++ b/rest/ip_messaging/v2/services_roles.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -60,6 +58,7 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -133,11 +132,10 @@ func (c *ApiService) ListRole(ServiceSid string, params *ListRoleParams) (*ListR path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -171,13 +169,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Permission != nil { for _, item := range *params.Permission { data.Add("Permission", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_users.go b/rest/ip_messaging/v2/services_users.go index f0fa81a16..09e9de5f9 100644 --- a/rest/ip_messaging/v2/services_users.go +++ b/rest/ip_messaging/v2/services_users.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -73,7 +71,7 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -150,11 +148,10 @@ func (c *ApiService) ListUser(ServiceSid string, params *ListUserParams) (*ListU path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -206,8 +203,6 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -217,7 +212,7 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse if params != nil && params.RoleSid != nil { data.Set("RoleSid", *params.RoleSid) } - + headers := make(map[string]interface{}) if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } diff --git a/rest/ip_messaging/v2/services_users_bindings.go b/rest/ip_messaging/v2/services_users_bindings.go index 2b8896881..3fa109a07 100644 --- a/rest/ip_messaging/v2/services_users_bindings.go +++ b/rest/ip_messaging/v2/services_users_bindings.go @@ -85,8 +85,6 @@ func (c *ApiService) ListUserBinding(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingType != nil { for _, item := range *params.BindingType { data.Add("BindingType", item) @@ -95,6 +93,7 @@ func (c *ApiService) ListUserBinding(ServiceSid string, UserSid string, params * if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/ip_messaging/v2/services_users_channels.go b/rest/ip_messaging/v2/services_users_channels.go index 418167222..05e57db45 100644 --- a/rest/ip_messaging/v2/services_users_channels.go +++ b/rest/ip_messaging/v2/services_users_channels.go @@ -80,11 +80,10 @@ func (c *ApiService) ListUserChannel(ServiceSid string, UserSid string, params * path = strings.Replace(path, "{"+"UserSid"+"}", UserSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -131,8 +130,6 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe path = strings.Replace(path, "{"+"ChannelSid"+"}", ChannelSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LastConsumedMessageIndex != nil { data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) } @@ -142,6 +139,7 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe if params != nil && params.NotificationLevel != nil { data.Set("NotificationLevel", *params.NotificationLevel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/lookups/v1/phone_numbers.go b/rest/lookups/v1/phone_numbers.go index 5dc145df2..03e05a000 100644 --- a/rest/lookups/v1/phone_numbers.go +++ b/rest/lookups/v1/phone_numbers.go @@ -52,8 +52,6 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb path = strings.Replace(path, "{"+"PhoneNumber"+"}", PhoneNumber, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CountryCode != nil { data.Set("CountryCode", *params.CountryCode) } @@ -76,6 +74,7 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb data.Set("AddOnsData", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/a2p_brand_registrations.go b/rest/messaging/v1/a2p_brand_registrations.go index 64f31e24b..49ae91040 100644 --- a/rest/messaging/v1/a2p_brand_registrations.go +++ b/rest/messaging/v1/a2p_brand_registrations.go @@ -40,14 +40,13 @@ func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsPa path := "/v1/a2p/BrandRegistrations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.A2pProfileBundleSid != nil { data.Set("A2pProfileBundleSid", *params.A2pProfileBundleSid) } if params != nil && params.CustomerProfileBundleSid != nil { data.Set("CustomerProfileBundleSid", *params.CustomerProfileBundleSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -101,11 +100,10 @@ func (c *ApiService) ListBrandRegistrations(params *ListBrandRegistrationsParams path := "/v1/a2p/BrandRegistrations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/deactivations.go b/rest/messaging/v1/deactivations.go index 68eaf720a..c11c3a11f 100644 --- a/rest/messaging/v1/deactivations.go +++ b/rest/messaging/v1/deactivations.go @@ -32,11 +32,10 @@ func (c *ApiService) FetchDeactivation(params *FetchDeactivationParams) error { path := "/v1/Deactivations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Date != nil { data.Set("Date", fmt.Sprint(*params.Date)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services.go b/rest/messaging/v1/services.go index 4cf10aa10..ad421bd91 100644 --- a/rest/messaging/v1/services.go +++ b/rest/messaging/v1/services.go @@ -118,8 +118,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCodeGeomatch != nil { data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) } @@ -165,6 +163,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser if params != nil && params.ValidityPeriod != nil { data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -235,11 +234,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -356,8 +354,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Me path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AreaCodeGeomatch != nil { data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) } @@ -403,6 +399,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Me if params != nil && params.ValidityPeriod != nil { data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_alpha_senders.go b/rest/messaging/v1/services_alpha_senders.go index 97869be4d..294321195 100644 --- a/rest/messaging/v1/services_alpha_senders.go +++ b/rest/messaging/v1/services_alpha_senders.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateAlphaSender(ServiceSid string, params *CreateAlphaSen path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AlphaSender != nil { data.Set("AlphaSender", *params.AlphaSender) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListAlphaSender(ServiceSid string, params *ListAlphaSenderP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_compliance_usa2p.go b/rest/messaging/v1/services_compliance_usa2p.go index 175a276a1..823a41afb 100644 --- a/rest/messaging/v1/services_compliance_usa2p.go +++ b/rest/messaging/v1/services_compliance_usa2p.go @@ -65,8 +65,6 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BrandRegistrationSid != nil { data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) } @@ -87,6 +85,7 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre if params != nil && params.UsAppToPersonUsecase != nil { data.Set("UsAppToPersonUsecase", *params.UsAppToPersonUsecase) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -160,11 +159,10 @@ func (c *ApiService) ListUsAppToPerson(MessagingServiceSid string, params *ListU path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_phone_numbers.go b/rest/messaging/v1/services_phone_numbers.go index c40b460c2..ae44cf126 100644 --- a/rest/messaging/v1/services_phone_numbers.go +++ b/rest/messaging/v1/services_phone_numbers.go @@ -35,11 +35,10 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PhoneNumberSid != nil { data.Set("PhoneNumberSid", *params.PhoneNumberSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListPhoneNumber(ServiceSid string, params *ListPhoneNumberP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_preregistered_usa2p.go b/rest/messaging/v1/services_preregistered_usa2p.go index cc7c85a84..a134a3653 100644 --- a/rest/messaging/v1/services_preregistered_usa2p.go +++ b/rest/messaging/v1/services_preregistered_usa2p.go @@ -37,14 +37,13 @@ func (c *ApiService) CreateExternalCampaign(params *CreateExternalCampaignParams path := "/v1/Services/PreregisteredUsa2p" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CampaignId != nil { data.Set("CampaignId", *params.CampaignId) } if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/messaging/v1/services_short_codes.go b/rest/messaging/v1/services_short_codes.go index 7279e6149..09c48d180 100644 --- a/rest/messaging/v1/services_short_codes.go +++ b/rest/messaging/v1/services_short_codes.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ShortCodeSid != nil { data.Set("ShortCodeSid", *params.ShortCodeSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListShortCode(ServiceSid string, params *ListShortCodeParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/monitor/v1/alerts.go b/rest/monitor/v1/alerts.go index 2ba1ad544..5ef038f79 100644 --- a/rest/monitor/v1/alerts.go +++ b/rest/monitor/v1/alerts.go @@ -75,8 +75,6 @@ func (c *ApiService) ListAlert(params *ListAlertParams) (*ListAlertResponse, err path := "/v1/Alerts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.LogLevel != nil { data.Set("LogLevel", *params.LogLevel) } @@ -89,6 +87,7 @@ func (c *ApiService) ListAlert(params *ListAlertParams) (*ListAlertResponse, err if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/monitor/v1/events.go b/rest/monitor/v1/events.go index f6560915c..ae5972d58 100644 --- a/rest/monitor/v1/events.go +++ b/rest/monitor/v1/events.go @@ -94,8 +94,6 @@ func (c *ApiService) ListEvent(params *ListEventParams) (*ListEventResponse, err path := "/v1/Events" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActorSid != nil { data.Set("ActorSid", *params.ActorSid) } @@ -117,6 +115,7 @@ func (c *ApiService) ListEvent(params *ListEventParams) (*ListEventResponse, err if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/notify/v1/credentials.go b/rest/notify/v1/credentials.go index 33cba97b4..98c471b5e 100644 --- a/rest/notify/v1/credentials.go +++ b/rest/notify/v1/credentials.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListCredential(params *ListCredentialParams) (*ListCredenti path := "/v1/Credentials" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -230,8 +228,6 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ApiKey != nil { data.Set("ApiKey", *params.ApiKey) } @@ -250,6 +246,7 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams if params != nil && params.Secret != nil { data.Set("Secret", *params.Secret) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/notify/v1/services.go b/rest/notify/v1/services.go index 36f030750..3c1d5144f 100644 --- a/rest/notify/v1/services.go +++ b/rest/notify/v1/services.go @@ -112,8 +112,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AlexaSkillId != nil { data.Set("AlexaSkillId", *params.AlexaSkillId) } @@ -156,6 +154,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -232,14 +231,13 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -350,8 +348,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*No path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AlexaSkillId != nil { data.Set("AlexaSkillId", *params.AlexaSkillId) } @@ -394,6 +390,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*No if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/notify/v1/services_bindings.go b/rest/notify/v1/services_bindings.go index 3c5749274..a0bdbef93 100644 --- a/rest/notify/v1/services_bindings.go +++ b/rest/notify/v1/services_bindings.go @@ -71,8 +71,6 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Address != nil { data.Set("Address", *params.Address) } @@ -96,6 +94,7 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam data.Add("Tag", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -193,8 +192,6 @@ func (c *ApiService) ListBinding(ServiceSid string, params *ListBindingParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.StartDate != nil { data.Set("StartDate", fmt.Sprint(*params.StartDate)) } @@ -214,6 +211,7 @@ func (c *ApiService) ListBinding(ServiceSid string, params *ListBindingParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/notify/v1/services_notifications.go b/rest/notify/v1/services_notifications.go index 689396410..d43fafe22 100644 --- a/rest/notify/v1/services_notifications.go +++ b/rest/notify/v1/services_notifications.go @@ -137,8 +137,6 @@ func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotific path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Action != nil { data.Set("Action", *params.Action) } @@ -243,6 +241,7 @@ func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotific if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_bundles.go b/rest/numbers/v2/regulatory_compliance_bundles.go index 9dff60ceb..ce5f5e6ea 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles.go +++ b/rest/numbers/v2/regulatory_compliance_bundles.go @@ -71,8 +71,6 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Regulat path := "/v2/RegulatoryCompliance/Bundles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -94,6 +92,7 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Regulat if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -197,8 +196,6 @@ func (c *ApiService) ListBundle(params *ListBundleParams) (*ListBundleResponse, path := "/v2/RegulatoryCompliance/Bundles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -217,6 +214,7 @@ func (c *ApiService) ListBundle(params *ListBundleParams) (*ListBundleResponse, if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -268,8 +266,6 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -282,6 +278,7 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go index 4a7972fb8..ea822ba73 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go @@ -83,11 +83,10 @@ func (c *ApiService) ListEvaluation(BundleSid string, params *ListEvaluationPara path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go index 6ff790a52..f7a797af8 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateItemAssignment(BundleSid string, params *CreateItemAs path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListItemAssignment(BundleSid string, params *ListItemAssign path = strings.Replace(path, "{"+"BundleSid"+"}", BundleSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_end_user_types.go b/rest/numbers/v2/regulatory_compliance_end_user_types.go index 334fc0490..33cdb83f0 100644 --- a/rest/numbers/v2/regulatory_compliance_end_user_types.go +++ b/rest/numbers/v2/regulatory_compliance_end_user_types.go @@ -58,11 +58,10 @@ func (c *ApiService) ListEndUserType(params *ListEndUserTypeParams) (*ListEndUse path := "/v2/RegulatoryCompliance/EndUserTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_end_users.go b/rest/numbers/v2/regulatory_compliance_end_users.go index 5d48b5f66..2a1427867 100644 --- a/rest/numbers/v2/regulatory_compliance_end_users.go +++ b/rest/numbers/v2/regulatory_compliance_end_users.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2Regul path := "/v2/RegulatoryCompliance/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -64,6 +62,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2Regul if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -137,11 +136,10 @@ func (c *ApiService) ListEndUser(params *ListEndUserParams) (*ListEndUserRespons path := "/v2/RegulatoryCompliance/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -181,8 +179,6 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -195,6 +191,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_regulations.go b/rest/numbers/v2/regulatory_compliance_regulations.go index 30511b512..c26b20b0d 100644 --- a/rest/numbers/v2/regulatory_compliance_regulations.go +++ b/rest/numbers/v2/regulatory_compliance_regulations.go @@ -76,8 +76,6 @@ func (c *ApiService) ListRegulation(params *ListRegulationParams) (*ListRegulati path := "/v2/RegulatoryCompliance/Regulations" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndUserType != nil { data.Set("EndUserType", *params.EndUserType) } @@ -90,6 +88,7 @@ func (c *ApiService) ListRegulation(params *ListRegulationParams) (*ListRegulati if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go index 498a04551..334bd0ccf 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go @@ -58,11 +58,10 @@ func (c *ApiService) ListSupportingDocumentType(params *ListSupportingDocumentTy path := "/v2/RegulatoryCompliance/SupportingDocumentTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/numbers/v2/regulatory_compliance_supporting_documents.go b/rest/numbers/v2/regulatory_compliance_supporting_documents.go index c92916d54..b2a07715d 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_documents.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_documents.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa path := "/v2/RegulatoryCompliance/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -64,6 +62,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -137,11 +136,10 @@ func (c *ApiService) ListSupportingDocument(params *ListSupportingDocumentParams path := "/v2/RegulatoryCompliance/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -181,8 +179,6 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -195,6 +191,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/pricing/v1/messaging_countries.go b/rest/pricing/v1/messaging_countries.go index 0db18735b..4d96a591a 100644 --- a/rest/pricing/v1/messaging_countries.go +++ b/rest/pricing/v1/messaging_countries.go @@ -56,11 +56,10 @@ func (c *ApiService) ListMessagingCountry(params *ListMessagingCountryParams) (* path := "/v1/Messaging/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/pricing/v1/phone_numbers_countries.go b/rest/pricing/v1/phone_numbers_countries.go index 3a397867e..4f6b017ad 100644 --- a/rest/pricing/v1/phone_numbers_countries.go +++ b/rest/pricing/v1/phone_numbers_countries.go @@ -56,11 +56,10 @@ func (c *ApiService) ListPhoneNumberCountry(params *ListPhoneNumberCountryParams path := "/v1/PhoneNumbers/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/pricing/v1/voice_countries.go b/rest/pricing/v1/voice_countries.go index b4de007d3..3a35718d9 100644 --- a/rest/pricing/v1/voice_countries.go +++ b/rest/pricing/v1/voice_countries.go @@ -56,11 +56,10 @@ func (c *ApiService) ListVoiceCountry(params *ListVoiceCountryParams) (*ListVoic path := "/v1/Voice/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/pricing/v2/voice_countries.go b/rest/pricing/v2/voice_countries.go index 8062dbfe3..ee04d5d78 100644 --- a/rest/pricing/v2/voice_countries.go +++ b/rest/pricing/v2/voice_countries.go @@ -57,11 +57,10 @@ func (c *ApiService) ListVoiceCountry(params *ListVoiceCountryParams) (*ListVoic path := "/v2/Voice/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/pricing/v2/voice_numbers.go b/rest/pricing/v2/voice_numbers.go index 10bc2bcd5..a6bb70367 100644 --- a/rest/pricing/v2/voice_numbers.go +++ b/rest/pricing/v2/voice_numbers.go @@ -35,11 +35,10 @@ func (c *ApiService) FetchVoiceNumber(DestinationNumber string, params *FetchVoi path = strings.Replace(path, "{"+"DestinationNumber"+"}", DestinationNumber, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.OriginationNumber != nil { data.Set("OriginationNumber", *params.OriginationNumber) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services.go b/rest/proxy/v1/services.go index 168f522ab..ffa1aa876 100644 --- a/rest/proxy/v1/services.go +++ b/rest/proxy/v1/services.go @@ -77,8 +77,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackUrl != nil { data.Set("CallbackUrl", *params.CallbackUrl) } @@ -103,6 +101,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -176,11 +175,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -256,8 +254,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackUrl != nil { data.Set("CallbackUrl", *params.CallbackUrl) } @@ -282,6 +278,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_phone_numbers.go b/rest/proxy/v1/services_phone_numbers.go index d6da4ad36..886d16fcb 100644 --- a/rest/proxy/v1/services_phone_numbers.go +++ b/rest/proxy/v1/services_phone_numbers.go @@ -48,8 +48,6 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } @@ -59,6 +57,7 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum if params != nil && params.Sid != nil { data.Set("Sid", *params.Sid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -135,11 +134,10 @@ func (c *ApiService) ListPhoneNumber(ServiceSid string, params *ListPhoneNumberP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -174,11 +172,10 @@ func (c *ApiService) UpdatePhoneNumber(ServiceSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_sessions.go b/rest/proxy/v1/services_sessions.go index d39a726e4..48ff5cf27 100644 --- a/rest/proxy/v1/services_sessions.go +++ b/rest/proxy/v1/services_sessions.go @@ -73,8 +73,6 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateExpiry != nil { data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) } @@ -104,6 +102,7 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -180,11 +179,10 @@ func (c *ApiService) ListSession(ServiceSid string, params *ListSessionParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -237,8 +235,6 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateExpiry != nil { data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) } @@ -251,6 +247,7 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_sessions_interactions.go b/rest/proxy/v1/services_sessions_interactions.go index e6d3f33cb..e4add06b9 100644 --- a/rest/proxy/v1/services_sessions_interactions.go +++ b/rest/proxy/v1/services_sessions_interactions.go @@ -82,11 +82,10 @@ func (c *ApiService) ListInteraction(ServiceSid string, SessionSid string, param path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_sessions_participants.go b/rest/proxy/v1/services_sessions_participants.go index bb469770c..7ecb59599 100644 --- a/rest/proxy/v1/services_sessions_participants.go +++ b/rest/proxy/v1/services_sessions_participants.go @@ -61,8 +61,6 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FailOnParticipantConflict != nil { data.Set("FailOnParticipantConflict", fmt.Sprint(*params.FailOnParticipantConflict)) } @@ -78,6 +76,7 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par if params != nil && params.ProxyIdentifierSid != nil { data.Set("ProxyIdentifierSid", *params.ProxyIdentifierSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -157,11 +156,10 @@ func (c *ApiService) ListParticipant(ServiceSid string, SessionSid string, param path = strings.Replace(path, "{"+"SessionSid"+"}", SessionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_sessions_participants_message_interactions.go b/rest/proxy/v1/services_sessions_participants_message_interactions.go index bcc837370..0468cae3f 100644 --- a/rest/proxy/v1/services_sessions_participants_message_interactions.go +++ b/rest/proxy/v1/services_sessions_participants_message_interactions.go @@ -44,8 +44,6 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Body != nil { data.Set("Body", *params.Body) } @@ -54,6 +52,7 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri data.Add("MediaUrl", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListMessageInteraction(ServiceSid string, SessionSid string path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/proxy/v1/services_short_codes.go b/rest/proxy/v1/services_short_codes.go index a647b6dc8..c48cde057 100644 --- a/rest/proxy/v1/services_short_codes.go +++ b/rest/proxy/v1/services_short_codes.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sid != nil { data.Set("Sid", *params.Sid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListShortCode(ServiceSid string, params *ListShortCodeParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -156,11 +154,10 @@ func (c *ApiService) UpdateShortCode(ServiceSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsReserved != nil { data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services.go b/rest/serverless/v1/services.go index da6ed8e8d..e01d37f27 100644 --- a/rest/serverless/v1/services.go +++ b/rest/serverless/v1/services.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -140,11 +139,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -190,8 +188,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -201,6 +197,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se if params != nil && params.UiEditable != nil { data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_assets.go b/rest/serverless/v1/services_assets.go index e206cd220..57bd5b70b 100644 --- a/rest/serverless/v1/services_assets.go +++ b/rest/serverless/v1/services_assets.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateAsset(ServiceSid string, params *CreateAssetParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListAsset(ServiceSid string, params *ListAssetParams) (*Lis path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -156,11 +154,10 @@ func (c *ApiService) UpdateAsset(ServiceSid string, Sid string, params *UpdateAs path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_assets_versions.go b/rest/serverless/v1/services_assets_versions.go index 38513ecd1..a12eac5aa 100644 --- a/rest/serverless/v1/services_assets_versions.go +++ b/rest/serverless/v1/services_assets_versions.go @@ -62,11 +62,10 @@ func (c *ApiService) ListAssetVersion(ServiceSid string, AssetSid string, params path = strings.Replace(path, "{"+"AssetSid"+"}", AssetSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_builds.go b/rest/serverless/v1/services_builds.go index 302ce2d92..44cbe3fd0 100644 --- a/rest/serverless/v1/services_builds.go +++ b/rest/serverless/v1/services_builds.go @@ -54,8 +54,6 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssetVersions != nil { for _, item := range *params.AssetVersions { data.Add("AssetVersions", item) @@ -72,6 +70,7 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( if params != nil && params.Runtime != nil { data.Set("Runtime", *params.Runtime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -148,11 +147,10 @@ func (c *ApiService) ListBuild(ServiceSid string, params *ListBuildParams) (*Lis path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_environments.go b/rest/serverless/v1/services_environments.go index 03249755c..ed828a7a9 100644 --- a/rest/serverless/v1/services_environments.go +++ b/rest/serverless/v1/services_environments.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateEnvironment(ServiceSid string, params *CreateEnvironm path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DomainSuffix != nil { data.Set("DomainSuffix", *params.DomainSuffix) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) ListEnvironment(ServiceSid string, params *ListEnvironmentP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_environments_deployments.go b/rest/serverless/v1/services_environments_deployments.go index 5c5bb63cd..aa3e70280 100644 --- a/rest/serverless/v1/services_environments_deployments.go +++ b/rest/serverless/v1/services_environments_deployments.go @@ -37,11 +37,10 @@ func (c *ApiService) CreateDeployment(ServiceSid string, EnvironmentSid string, path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BuildSid != nil { data.Set("BuildSid", *params.BuildSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -101,11 +100,10 @@ func (c *ApiService) ListDeployment(ServiceSid string, EnvironmentSid string, pa path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_environments_logs.go b/rest/serverless/v1/services_environments_logs.go index 254b9d286..ed394fe15 100644 --- a/rest/serverless/v1/services_environments_logs.go +++ b/rest/serverless/v1/services_environments_logs.go @@ -81,8 +81,6 @@ func (c *ApiService) ListLog(ServiceSid string, EnvironmentSid string, params *L path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FunctionSid != nil { data.Set("FunctionSid", *params.FunctionSid) } @@ -95,6 +93,7 @@ func (c *ApiService) ListLog(ServiceSid string, EnvironmentSid string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_environments_variables.go b/rest/serverless/v1/services_environments_variables.go index f2ebdf946..4d80681c4 100644 --- a/rest/serverless/v1/services_environments_variables.go +++ b/rest/serverless/v1/services_environments_variables.go @@ -43,14 +43,13 @@ func (c *ApiService) CreateVariable(ServiceSid string, EnvironmentSid string, pa path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Key != nil { data.Set("Key", *params.Key) } if params != nil && params.Value != nil { data.Set("Value", *params.Value) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -130,11 +129,10 @@ func (c *ApiService) ListVariable(ServiceSid string, EnvironmentSid string, para path = strings.Replace(path, "{"+"EnvironmentSid"+"}", EnvironmentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -176,14 +174,13 @@ func (c *ApiService) UpdateVariable(ServiceSid string, EnvironmentSid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Key != nil { data.Set("Key", *params.Key) } if params != nil && params.Value != nil { data.Set("Value", *params.Value) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_functions.go b/rest/serverless/v1/services_functions.go index 88d25a1dc..f0ad4e5a6 100644 --- a/rest/serverless/v1/services_functions.go +++ b/rest/serverless/v1/services_functions.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateFunction(ServiceSid string, params *CreateFunctionPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListFunction(ServiceSid string, params *ListFunctionParams) path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -156,11 +154,10 @@ func (c *ApiService) UpdateFunction(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/serverless/v1/services_functions_versions.go b/rest/serverless/v1/services_functions_versions.go index 819f0a33f..ec53ca145 100644 --- a/rest/serverless/v1/services_functions_versions.go +++ b/rest/serverless/v1/services_functions_versions.go @@ -62,11 +62,10 @@ func (c *ApiService) ListFunctionVersion(ServiceSid string, FunctionSid string, path = strings.Replace(path, "{"+"FunctionSid"+"}", FunctionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v1/flows.go b/rest/studio/v1/flows.go index d94a60e1d..8af6f3fcc 100644 --- a/rest/studio/v1/flows.go +++ b/rest/studio/v1/flows.go @@ -76,11 +76,10 @@ func (c *ApiService) ListFlow(params *ListFlowParams) (*ListFlowResponse, error) path := "/v1/Flows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v1/flows_engagements.go b/rest/studio/v1/flows_engagements.go index 4c0e9c1fc..3f565ee44 100644 --- a/rest/studio/v1/flows_engagements.go +++ b/rest/studio/v1/flows_engagements.go @@ -48,8 +48,6 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -65,6 +63,7 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -141,11 +140,10 @@ func (c *ApiService) ListEngagement(FlowSid string, params *ListEngagementParams path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v1/flows_engagements_steps.go b/rest/studio/v1/flows_engagements_steps.go index 5126f93f2..d9f8438ae 100644 --- a/rest/studio/v1/flows_engagements_steps.go +++ b/rest/studio/v1/flows_engagements_steps.go @@ -62,11 +62,10 @@ func (c *ApiService) ListStep(FlowSid string, EngagementSid string, params *List path = strings.Replace(path, "{"+"EngagementSid"+"}", EngagementSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v1/flows_executions.go b/rest/studio/v1/flows_executions.go index e3dcf295d..c614f2384 100644 --- a/rest/studio/v1/flows_executions.go +++ b/rest/studio/v1/flows_executions.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -66,6 +64,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -154,8 +153,6 @@ func (c *ApiService) ListExecution(FlowSid string, params *ListExecutionParams) path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreatedFrom != nil { data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) } @@ -165,6 +162,7 @@ func (c *ApiService) ListExecution(FlowSid string, params *ListExecutionParams) if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -199,11 +197,10 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v1/flows_executions_steps.go b/rest/studio/v1/flows_executions_steps.go index 4028369de..172197c9a 100644 --- a/rest/studio/v1/flows_executions_steps.go +++ b/rest/studio/v1/flows_executions_steps.go @@ -62,11 +62,10 @@ func (c *ApiService) ListExecutionStep(FlowSid string, ExecutionSid string, para path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows.go b/rest/studio/v2/flows.go index 5016d29cb..d1857153e 100644 --- a/rest/studio/v2/flows.go +++ b/rest/studio/v2/flows.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) path := "/v2/Flows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommitMessage != nil { data.Set("CommitMessage", *params.CommitMessage) } @@ -73,6 +71,7 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -146,11 +145,10 @@ func (c *ApiService) ListFlow(params *ListFlowParams) (*ListFlowResponse, error) path := "/v2/Flows" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -202,8 +200,6 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommitMessage != nil { data.Set("CommitMessage", *params.CommitMessage) } @@ -222,6 +218,7 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_executions.go b/rest/studio/v2/flows_executions.go index 0d3d1e3d3..55a7968f7 100644 --- a/rest/studio/v2/flows_executions.go +++ b/rest/studio/v2/flows_executions.go @@ -49,8 +49,6 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.From != nil { data.Set("From", *params.From) } @@ -66,6 +64,7 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -154,8 +153,6 @@ func (c *ApiService) ListExecution(FlowSid string, params *ListExecutionParams) path = strings.Replace(path, "{"+"FlowSid"+"}", FlowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreatedFrom != nil { data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) } @@ -165,6 +162,7 @@ func (c *ApiService) ListExecution(FlowSid string, params *ListExecutionParams) if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -199,11 +197,10 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_executions_steps.go b/rest/studio/v2/flows_executions_steps.go index 75a86f1fa..b5fa6e9c8 100644 --- a/rest/studio/v2/flows_executions_steps.go +++ b/rest/studio/v2/flows_executions_steps.go @@ -62,11 +62,10 @@ func (c *ApiService) ListExecutionStep(FlowSid string, ExecutionSid string, para path = strings.Replace(path, "{"+"ExecutionSid"+"}", ExecutionSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_revisions.go b/rest/studio/v2/flows_revisions.go index 17aa8461d..62f82ce7c 100644 --- a/rest/studio/v2/flows_revisions.go +++ b/rest/studio/v2/flows_revisions.go @@ -60,11 +60,10 @@ func (c *ApiService) ListFlowRevision(Sid string, params *ListFlowRevisionParams path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_test_users.go b/rest/studio/v2/flows_test_users.go index 2df11ebf0..87dab7db6 100644 --- a/rest/studio/v2/flows_test_users.go +++ b/rest/studio/v2/flows_test_users.go @@ -58,13 +58,12 @@ func (c *ApiService) UpdateTestUser(Sid string, params *UpdateTestUserParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TestUsers != nil { for _, item := range *params.TestUsers { data.Add("TestUsers", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/studio/v2/flows_validate.go b/rest/studio/v2/flows_validate.go index 6969c8c1c..ae526b21a 100644 --- a/rest/studio/v2/flows_validate.go +++ b/rest/studio/v2/flows_validate.go @@ -50,8 +50,6 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud path := "/v2/Flows/Validate" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommitMessage != nil { data.Set("CommitMessage", *params.CommitMessage) } @@ -70,6 +68,7 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/commands.go b/rest/supersim/v1/commands.go index 65b578da7..27ee9ce86 100644 --- a/rest/supersim/v1/commands.go +++ b/rest/supersim/v1/commands.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*SupersimV1Comm path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*SupersimV1Comm if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -140,8 +139,6 @@ func (c *ApiService) ListCommand(params *ListCommandParams) (*ListCommandRespons path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -154,6 +151,7 @@ func (c *ApiService) ListCommand(params *ListCommandParams) (*ListCommandRespons if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/fleets.go b/rest/supersim/v1/fleets.go index c625770e2..b8743797e 100644 --- a/rest/supersim/v1/fleets.go +++ b/rest/supersim/v1/fleets.go @@ -89,8 +89,6 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e path := "/v1/Fleets" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommandsEnabled != nil { data.Set("CommandsEnabled", fmt.Sprint(*params.CommandsEnabled)) } @@ -121,6 +119,7 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -182,14 +181,13 @@ func (c *ApiService) ListFleet(params *ListFleetParams) (*ListFleetResponse, err path := "/v1/Fleets" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.NetworkAccessProfile != nil { data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -253,8 +251,6 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CommandsMethod != nil { data.Set("CommandsMethod", *params.CommandsMethod) } @@ -273,6 +269,7 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/network_access_profiles.go b/rest/supersim/v1/network_access_profiles.go index ae3afacef..529267b4e 100644 --- a/rest/supersim/v1/network_access_profiles.go +++ b/rest/supersim/v1/network_access_profiles.go @@ -41,8 +41,6 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi path := "/v1/NetworkAccessProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Networks != nil { for _, item := range *params.Networks { data.Add("Networks", item) @@ -51,6 +49,7 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -106,11 +105,10 @@ func (c *ApiService) ListNetworkAccessProfile(params *ListNetworkAccessProfilePa path := "/v1/NetworkAccessProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -144,11 +142,10 @@ func (c *ApiService) UpdateNetworkAccessProfile(Sid string, params *UpdateNetwor path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/network_access_profiles_networks.go b/rest/supersim/v1/network_access_profiles_networks.go index 381f15a79..d9b01c171 100644 --- a/rest/supersim/v1/network_access_profiles_networks.go +++ b/rest/supersim/v1/network_access_profiles_networks.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateNetworkAccessProfileNetwork(NetworkAccessProfileSid s path = strings.Replace(path, "{"+"NetworkAccessProfileSid"+"}", NetworkAccessProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Network != nil { data.Set("Network", *params.Network) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListNetworkAccessProfileNetwork(NetworkAccessProfileSid str path = strings.Replace(path, "{"+"NetworkAccessProfileSid"+"}", NetworkAccessProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/networks.go b/rest/supersim/v1/networks.go index 41ae6831f..8fb0e82bb 100644 --- a/rest/supersim/v1/networks.go +++ b/rest/supersim/v1/networks.go @@ -76,8 +76,6 @@ func (c *ApiService) ListNetwork(params *ListNetworkParams) (*ListNetworkRespons path := "/v1/Networks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsoCountry != nil { data.Set("IsoCountry", *params.IsoCountry) } @@ -90,6 +88,7 @@ func (c *ApiService) ListNetwork(params *ListNetworkParams) (*ListNetworkRespons if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/sims.go b/rest/supersim/v1/sims.go index 816ec9b9b..e6c696d21 100644 --- a/rest/supersim/v1/sims.go +++ b/rest/supersim/v1/sims.go @@ -41,14 +41,13 @@ func (c *ApiService) CreateSim(params *CreateSimParams) (*SupersimV1Sim, error) path := "/v1/Sims" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Iccid != nil { data.Set("Iccid", *params.Iccid) } if params != nil && params.RegistrationCode != nil { data.Set("RegistrationCode", *params.RegistrationCode) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -122,8 +121,6 @@ func (c *ApiService) ListSim(params *ListSimParams) (*ListSimResponse, error) { path := "/v1/Sims" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -136,6 +133,7 @@ func (c *ApiService) ListSim(params *ListSimParams) (*ListSimResponse, error) { if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -199,8 +197,6 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -219,6 +215,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/sims_billing_periods.go b/rest/supersim/v1/sims_billing_periods.go index a66522124..20a1bf4fa 100644 --- a/rest/supersim/v1/sims_billing_periods.go +++ b/rest/supersim/v1/sims_billing_periods.go @@ -36,11 +36,10 @@ func (c *ApiService) ListBillingPeriod(SimSid string, params *ListBillingPeriodP path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/sms_commands.go b/rest/supersim/v1/sms_commands.go index 50b3bcecc..c9b9f4df6 100644 --- a/rest/supersim/v1/sms_commands.go +++ b/rest/supersim/v1/sms_commands.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim path := "/v1/SmsCommands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -140,8 +139,6 @@ func (c *ApiService) ListSmsCommand(params *ListSmsCommandParams) (*ListSmsComma path := "/v1/SmsCommands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -154,6 +151,7 @@ func (c *ApiService) ListSmsCommand(params *ListSmsCommandParams) (*ListSmsComma if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/supersim/v1/usage_records.go b/rest/supersim/v1/usage_records.go index 84a7b4d35..600b5e82f 100644 --- a/rest/supersim/v1/usage_records.go +++ b/rest/supersim/v1/usage_records.go @@ -83,8 +83,6 @@ func (c *ApiService) ListUsageRecord(params *ListUsageRecordParams) (*ListUsageR path := "/v1/UsageRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -112,6 +110,7 @@ func (c *ApiService) ListUsageRecord(params *ListUsageRecordParams) (*ListUsageR if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services.go b/rest/sync/v1/services.go index 9a4726b50..1fe694c48 100644 --- a/rest/sync/v1/services.go +++ b/rest/sync/v1/services.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AclEnabled != nil { data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, if params != nil && params.WebhooksFromRestEnabled != nil { data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v1/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -236,8 +234,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Sy path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AclEnabled != nil { data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) } @@ -259,6 +255,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Sy if params != nil && params.WebhooksFromRestEnabled != nil { data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_documents.go b/rest/sync/v1/services_documents.go index 039c39016..177cd1373 100644 --- a/rest/sync/v1/services_documents.go +++ b/rest/sync/v1/services_documents.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Data != nil { v, err := json.Marshal(params.Data) @@ -64,6 +62,7 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -137,11 +136,10 @@ func (c *ApiService) ListDocument(ServiceSid string, params *ListDocumentParams) path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -187,8 +185,6 @@ func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Data != nil { v, err := json.Marshal(params.Data) @@ -201,7 +197,7 @@ func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *Updat if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/sync/v1/services_documents_permissions.go b/rest/sync/v1/services_documents_permissions.go index 6258db2ce..1ed85917e 100644 --- a/rest/sync/v1/services_documents_permissions.go +++ b/rest/sync/v1/services_documents_permissions.go @@ -82,11 +82,10 @@ func (c *ApiService) ListDocumentPermission(ServiceSid string, DocumentSid strin path = strings.Replace(path, "{"+"DocumentSid"+"}", DocumentSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -134,8 +133,6 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Manage != nil { data.Set("Manage", fmt.Sprint(*params.Manage)) } @@ -145,6 +142,7 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str if params != nil && params.Write != nil { data.Set("Write", fmt.Sprint(*params.Write)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_lists.go b/rest/sync/v1/services_lists.go index 5897850d1..f293d0ce9 100644 --- a/rest/sync/v1/services_lists.go +++ b/rest/sync/v1/services_lists.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -58,6 +56,7 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -131,11 +130,10 @@ func (c *ApiService) ListSyncList(ServiceSid string, params *ListSyncListParams) path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -175,14 +173,13 @@ func (c *ApiService) UpdateSyncList(ServiceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_lists_items.go b/rest/sync/v1/services_lists_items.go index adff655eb..5b233510a 100644 --- a/rest/sync/v1/services_lists_items.go +++ b/rest/sync/v1/services_lists_items.go @@ -54,8 +54,6 @@ func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, param path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -74,6 +72,7 @@ func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, param if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -109,7 +108,6 @@ func (c *ApiService) DeleteSyncListItem(ServiceSid string, ListSid string, Index data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -183,8 +181,6 @@ func (c *ApiService) ListSyncListItem(ServiceSid string, ListSid string, params path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } @@ -197,6 +193,7 @@ func (c *ApiService) ListSyncListItem(ServiceSid string, ListSid string, params if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -255,8 +252,6 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index path = strings.Replace(path, "{"+"Index"+"}", fmt.Sprint(Index), -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -275,7 +270,7 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/sync/v1/services_lists_permissions.go b/rest/sync/v1/services_lists_permissions.go index 3982875b7..c52546f66 100644 --- a/rest/sync/v1/services_lists_permissions.go +++ b/rest/sync/v1/services_lists_permissions.go @@ -82,11 +82,10 @@ func (c *ApiService) ListSyncListPermission(ServiceSid string, ListSid string, p path = strings.Replace(path, "{"+"ListSid"+"}", ListSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -134,8 +133,6 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Manage != nil { data.Set("Manage", fmt.Sprint(*params.Manage)) } @@ -145,6 +142,7 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, if params != nil && params.Write != nil { data.Set("Write", fmt.Sprint(*params.Write)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_maps.go b/rest/sync/v1/services_maps.go index 9a0b4f025..109522d1a 100644 --- a/rest/sync/v1/services_maps.go +++ b/rest/sync/v1/services_maps.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -58,6 +56,7 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -131,11 +130,10 @@ func (c *ApiService) ListSyncMap(ServiceSid string, params *ListSyncMapParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -175,14 +173,13 @@ func (c *ApiService) UpdateSyncMap(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_maps_items.go b/rest/sync/v1/services_maps_items.go index c58b01402..f7a11f6a0 100644 --- a/rest/sync/v1/services_maps_items.go +++ b/rest/sync/v1/services_maps_items.go @@ -60,8 +60,6 @@ func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -83,6 +81,7 @@ func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,7 +117,6 @@ func (c *ApiService) DeleteSyncMapItem(ServiceSid string, MapSid string, Key str data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -192,8 +190,6 @@ func (c *ApiService) ListSyncMapItem(ServiceSid string, MapSid string, params *L path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Order != nil { data.Set("Order", *params.Order) } @@ -206,6 +202,7 @@ func (c *ApiService) ListSyncMapItem(ServiceSid string, MapSid string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -264,8 +261,6 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str path = strings.Replace(path, "{"+"Key"+"}", Key, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CollectionTtl != nil { data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) } @@ -284,7 +279,7 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/sync/v1/services_maps_permissions.go b/rest/sync/v1/services_maps_permissions.go index 95d3934cb..6289923e3 100644 --- a/rest/sync/v1/services_maps_permissions.go +++ b/rest/sync/v1/services_maps_permissions.go @@ -82,11 +82,10 @@ func (c *ApiService) ListSyncMapPermission(ServiceSid string, MapSid string, par path = strings.Replace(path, "{"+"MapSid"+"}", MapSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -134,8 +133,6 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Manage != nil { data.Set("Manage", fmt.Sprint(*params.Manage)) } @@ -145,6 +142,7 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I if params != nil && params.Write != nil { data.Set("Write", fmt.Sprint(*params.Write)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_streams.go b/rest/sync/v1/services_streams.go index 30c7dca85..a86af18bb 100644 --- a/rest/sync/v1/services_streams.go +++ b/rest/sync/v1/services_streams.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateSyncStream(ServiceSid string, params *CreateSyncStrea path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) ListSyncStream(ServiceSid string, params *ListSyncStreamPar path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -165,11 +163,10 @@ func (c *ApiService) UpdateSyncStream(ServiceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/sync/v1/services_streams_messages.go b/rest/sync/v1/services_streams_messages.go index c373b8217..2317e3932 100644 --- a/rest/sync/v1/services_streams_messages.go +++ b/rest/sync/v1/services_streams_messages.go @@ -36,8 +36,6 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa path = strings.Replace(path, "{"+"StreamSid"+"}", StreamSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Data != nil { v, err := json.Marshal(params.Data) @@ -47,6 +45,7 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa data.Set("Data", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces.go b/rest/taskrouter/v1/workspaces.go index a0dbf6385..5243a206b 100644 --- a/rest/taskrouter/v1/workspaces.go +++ b/rest/taskrouter/v1/workspaces.go @@ -64,8 +64,6 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter path := "/v1/Workspaces" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EventCallbackUrl != nil { data.Set("EventCallbackUrl", *params.EventCallbackUrl) } @@ -84,6 +82,7 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter if params != nil && params.Template != nil { data.Set("Template", *params.Template) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -160,14 +159,13 @@ func (c *ApiService) ListWorkspace(params *ListWorkspaceParams) (*ListWorkspaceR path := "/v1/Workspaces" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -236,8 +234,6 @@ func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DefaultActivitySid != nil { data.Set("DefaultActivitySid", *params.DefaultActivitySid) } @@ -259,6 +255,7 @@ func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) if params != nil && params.TimeoutActivitySid != nil { data.Set("TimeoutActivitySid", *params.TimeoutActivitySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_activities.go b/rest/taskrouter/v1/workspaces_activities.go index 6d4e1efbc..a49f2e43f 100644 --- a/rest/taskrouter/v1/workspaces_activities.go +++ b/rest/taskrouter/v1/workspaces_activities.go @@ -41,14 +41,13 @@ func (c *ApiService) CreateActivity(WorkspaceSid string, params *CreateActivityP path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Available != nil { data.Set("Available", fmt.Sprint(*params.Available)) } if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -134,8 +133,6 @@ func (c *ApiService) ListActivity(WorkspaceSid string, params *ListActivityParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -145,6 +142,7 @@ func (c *ApiService) ListActivity(WorkspaceSid string, params *ListActivityParam if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -178,11 +176,10 @@ func (c *ApiService) UpdateActivity(WorkspaceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_cumulative_statistics.go index 99be31dba..d46e4fbf1 100644 --- a/rest/taskrouter/v1/workspaces_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_cumulative_statistics.go @@ -60,8 +60,6 @@ func (c *ApiService) FetchWorkspaceCumulativeStatistics(WorkspaceSid string, par path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -77,6 +75,7 @@ func (c *ApiService) FetchWorkspaceCumulativeStatistics(WorkspaceSid string, par if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_events.go b/rest/taskrouter/v1/workspaces_events.go index 69242cddb..18be0e663 100644 --- a/rest/taskrouter/v1/workspaces_events.go +++ b/rest/taskrouter/v1/workspaces_events.go @@ -125,8 +125,6 @@ func (c *ApiService) ListEvent(WorkspaceSid string, params *ListEventParams) (*L path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -163,6 +161,7 @@ func (c *ApiService) ListEvent(WorkspaceSid string, params *ListEventParams) (*L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_real_time_statistics.go b/rest/taskrouter/v1/workspaces_real_time_statistics.go index ec357923d..ceb5424df 100644 --- a/rest/taskrouter/v1/workspaces_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_real_time_statistics.go @@ -34,11 +34,10 @@ func (c *ApiService) FetchWorkspaceRealTimeStatistics(WorkspaceSid string, param path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_statistics.go b/rest/taskrouter/v1/workspaces_statistics.go index 5d01426ef..8eaec979f 100644 --- a/rest/taskrouter/v1/workspaces_statistics.go +++ b/rest/taskrouter/v1/workspaces_statistics.go @@ -60,8 +60,6 @@ func (c *ApiService) FetchWorkspaceStatistics(WorkspaceSid string, params *Fetch path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -77,6 +75,7 @@ func (c *ApiService) FetchWorkspaceStatistics(WorkspaceSid string, params *Fetch if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_channels.go b/rest/taskrouter/v1/workspaces_task_channels.go index ffe344539..d96b57fa7 100644 --- a/rest/taskrouter/v1/workspaces_task_channels.go +++ b/rest/taskrouter/v1/workspaces_task_channels.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelOptimizedRouting != nil { data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) } @@ -58,6 +56,7 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -131,11 +130,10 @@ func (c *ApiService) ListTaskChannel(WorkspaceSid string, params *ListTaskChanne path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -175,14 +173,13 @@ func (c *ApiService) UpdateTaskChannel(WorkspaceSid string, Sid string, params * path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelOptimizedRouting != nil { data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) } if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues.go b/rest/taskrouter/v1/workspaces_task_queues.go index de116ba45..892e0d502 100644 --- a/rest/taskrouter/v1/workspaces_task_queues.go +++ b/rest/taskrouter/v1/workspaces_task_queues.go @@ -65,8 +65,6 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentActivitySid != nil { data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) } @@ -85,6 +83,7 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu if params != nil && params.TaskOrder != nil { data.Set("TaskOrder", *params.TaskOrder) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -176,8 +175,6 @@ func (c *ApiService) ListTaskQueue(WorkspaceSid string, params *ListTaskQueuePar path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } @@ -190,6 +187,7 @@ func (c *ApiService) ListTaskQueue(WorkspaceSid string, params *ListTaskQueuePar if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -253,8 +251,6 @@ func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *Up path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentActivitySid != nil { data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) } @@ -273,6 +269,7 @@ func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *Up if params != nil && params.TaskOrder != nil { data.Set("TaskOrder", *params.TaskOrder) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go index 54e2d6ee1..065aeccbb 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchTaskQueueCumulativeStatistics(WorkspaceSid string, Tas path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchTaskQueueCumulativeStatistics(WorkspaceSid string, Tas if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go index 004dc5875..c2dcce0ae 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go @@ -35,11 +35,10 @@ func (c *ApiService) FetchTaskQueueRealTimeStatistics(WorkspaceSid string, TaskQ path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_task_queues_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_statistics.go index f49327f3a..1a909653a 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchTaskQueueStatistics(WorkspaceSid string, TaskQueueSid path = strings.Replace(path, "{"+"TaskQueueSid"+"}", TaskQueueSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchTaskQueueStatistics(WorkspaceSid string, TaskQueueSid if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -146,8 +145,6 @@ func (c *ApiService) ListTaskQueuesStatistics(WorkspaceSid string, params *ListT path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -169,6 +166,7 @@ func (c *ApiService) ListTaskQueuesStatistics(WorkspaceSid string, params *ListT if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_tasks.go b/rest/taskrouter/v1/workspaces_tasks.go index 85b344a89..6dc38a1f1 100644 --- a/rest/taskrouter/v1/workspaces_tasks.go +++ b/rest/taskrouter/v1/workspaces_tasks.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) ( path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { data.Set("Attributes", *params.Attributes) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) ( if params != nil && params.WorkflowSid != nil { data.Set("WorkflowSid", *params.WorkflowSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -110,7 +109,6 @@ func (c *ApiService) DeleteTask(WorkspaceSid string, Sid string, params *DeleteT data := url.Values{} headers := make(map[string]interface{}) - if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -218,8 +216,6 @@ func (c *ApiService) ListTask(WorkspaceSid string, params *ListTaskParams) (*Lis path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Priority != nil { data.Set("Priority", fmt.Sprint(*params.Priority)) } @@ -252,6 +248,7 @@ func (c *ApiService) ListTask(WorkspaceSid string, params *ListTaskParams) (*Lis if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -315,8 +312,6 @@ func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateT path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentStatus != nil { data.Set("AssignmentStatus", *params.AssignmentStatus) } @@ -332,7 +327,7 @@ func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateT if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } - + headers := make(map[string]interface{}) if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } diff --git a/rest/taskrouter/v1/workspaces_tasks_reservations.go b/rest/taskrouter/v1/workspaces_tasks_reservations.go index 3ff9d348a..e480714bb 100644 --- a/rest/taskrouter/v1/workspaces_tasks_reservations.go +++ b/rest/taskrouter/v1/workspaces_tasks_reservations.go @@ -66,14 +66,13 @@ func (c *ApiService) ListTaskReservation(WorkspaceSid string, TaskSid string, pa path = strings.Replace(path, "{"+"TaskSid"+"}", TaskSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ReservationStatus != nil { data.Set("ReservationStatus", *params.ReservationStatus) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -420,8 +419,6 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beep != nil { data.Set("Beep", *params.Beep) } @@ -587,6 +584,7 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, if params != nil && params.WorkerActivitySid != nil { data.Set("WorkerActivitySid", *params.WorkerActivitySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers.go b/rest/taskrouter/v1/workspaces_workers.go index 32c079d2e..95dfb5299 100644 --- a/rest/taskrouter/v1/workspaces_workers.go +++ b/rest/taskrouter/v1/workspaces_workers.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActivitySid != nil { data.Set("ActivitySid", *params.ActivitySid) } @@ -58,6 +56,7 @@ func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParam if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -173,8 +172,6 @@ func (c *ApiService) ListWorker(WorkspaceSid string, params *ListWorkerParams) ( path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActivityName != nil { data.Set("ActivityName", *params.ActivityName) } @@ -199,6 +196,7 @@ func (c *ApiService) ListWorker(WorkspaceSid string, params *ListWorkerParams) ( if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -250,8 +248,6 @@ func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *Updat path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ActivitySid != nil { data.Set("ActivitySid", *params.ActivitySid) } @@ -264,6 +260,7 @@ func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *Updat if params != nil && params.RejectPendingReservations != nil { data.Set("RejectPendingReservations", fmt.Sprint(*params.RejectPendingReservations)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_channels.go b/rest/taskrouter/v1/workspaces_workers_channels.go index fad7f9892..1a28651f6 100644 --- a/rest/taskrouter/v1/workspaces_workers_channels.go +++ b/rest/taskrouter/v1/workspaces_workers_channels.go @@ -60,11 +60,10 @@ func (c *ApiService) ListWorkerChannel(WorkspaceSid string, WorkerSid string, pa path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -105,14 +104,13 @@ func (c *ApiService) UpdateWorkerChannel(WorkspaceSid string, WorkerSid string, path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Available != nil { data.Set("Available", fmt.Sprint(*params.Available)) } if params != nil && params.Capacity != nil { data.Set("Capacity", fmt.Sprint(*params.Capacity)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go index af1489f12..2a0e00e37 100644 --- a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go @@ -54,8 +54,6 @@ func (c *ApiService) FetchWorkersCumulativeStatistics(WorkspaceSid string, param path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -68,6 +66,7 @@ func (c *ApiService) FetchWorkersCumulativeStatistics(WorkspaceSid string, param if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go index bb6aad86e..0c8db00e5 100644 --- a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go @@ -34,11 +34,10 @@ func (c *ApiService) FetchWorkersRealTimeStatistics(WorkspaceSid string, params path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_reservations.go b/rest/taskrouter/v1/workspaces_workers_reservations.go index 50819e7df..d86291706 100644 --- a/rest/taskrouter/v1/workspaces_workers_reservations.go +++ b/rest/taskrouter/v1/workspaces_workers_reservations.go @@ -66,14 +66,13 @@ func (c *ApiService) ListWorkerReservation(WorkspaceSid string, WorkerSid string path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ReservationStatus != nil { data.Set("ReservationStatus", *params.ReservationStatus) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -408,8 +407,6 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Beep != nil { data.Set("Beep", *params.Beep) } @@ -569,6 +566,7 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri if params != nil && params.WorkerActivitySid != nil { data.Set("WorkerActivitySid", *params.WorkerActivitySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_statistics.go b/rest/taskrouter/v1/workspaces_workers_statistics.go index 95eec0426..e97d127ef 100644 --- a/rest/taskrouter/v1/workspaces_workers_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_statistics.go @@ -55,8 +55,6 @@ func (c *ApiService) FetchWorkerInstanceStatistics(WorkspaceSid string, WorkerSi path = strings.Replace(path, "{"+"WorkerSid"+"}", WorkerSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -69,6 +67,7 @@ func (c *ApiService) FetchWorkerInstanceStatistics(WorkspaceSid string, WorkerSi if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -137,8 +136,6 @@ func (c *ApiService) FetchWorkerStatistics(WorkspaceSid string, params *FetchWor path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -160,6 +157,7 @@ func (c *ApiService) FetchWorkerStatistics(WorkspaceSid string, params *FetchWor if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows.go b/rest/taskrouter/v1/workspaces_workflows.go index a300c6800..648121e09 100644 --- a/rest/taskrouter/v1/workspaces_workflows.go +++ b/rest/taskrouter/v1/workspaces_workflows.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentCallbackUrl != nil { data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP if params != nil && params.TaskReservationTimeout != nil { data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -155,14 +154,13 @@ func (c *ApiService) ListWorkflow(WorkspaceSid string, params *ListWorkflowParam path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -226,8 +224,6 @@ func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *Upd path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AssignmentCallbackUrl != nil { data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) } @@ -246,6 +242,7 @@ func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *Upd if params != nil && params.TaskReservationTimeout != nil { data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go index e01f9bf4d..55786b732 100644 --- a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchWorkflowCumulativeStatistics(WorkspaceSid string, Work path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EndDate != nil { data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchWorkflowCumulativeStatistics(WorkspaceSid string, Work if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go index f93708f3d..c8ef29c37 100644 --- a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go @@ -35,11 +35,10 @@ func (c *ApiService) FetchWorkflowRealTimeStatistics(WorkspaceSid string, Workfl path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.TaskChannel != nil { data.Set("TaskChannel", *params.TaskChannel) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/taskrouter/v1/workspaces_workflows_statistics.go b/rest/taskrouter/v1/workspaces_workflows_statistics.go index c39188cf9..7c4f91834 100644 --- a/rest/taskrouter/v1/workspaces_workflows_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_statistics.go @@ -61,8 +61,6 @@ func (c *ApiService) FetchWorkflowStatistics(WorkspaceSid string, WorkflowSid st path = strings.Replace(path, "{"+"WorkflowSid"+"}", WorkflowSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Minutes != nil { data.Set("Minutes", fmt.Sprint(*params.Minutes)) } @@ -78,6 +76,7 @@ func (c *ApiService) FetchWorkflowStatistics(WorkspaceSid string, WorkflowSid st if params != nil && params.SplitByWaitTime != nil { data.Set("SplitByWaitTime", *params.SplitByWaitTime) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks.go b/rest/trunking/v1/trunks.go index 403ebd35d..3abff94dd 100644 --- a/rest/trunking/v1/trunks.go +++ b/rest/trunking/v1/trunks.go @@ -70,8 +70,6 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e path := "/v1/Trunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -93,6 +91,7 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e if params != nil && params.TransferMode != nil { data.Set("TransferMode", *params.TransferMode) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -163,11 +162,10 @@ func (c *ApiService) ListTrunk(params *ListTrunkParams) (*ListTrunkResponse, err path := "/v1/Trunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -236,8 +234,6 @@ func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*Trunki path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -259,6 +255,7 @@ func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*Trunki if params != nil && params.TransferMode != nil { data.Set("TransferMode", *params.TransferMode) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_credential_lists.go b/rest/trunking/v1/trunks_credential_lists.go index 7dc54a7c6..4bf1a979d 100644 --- a/rest/trunking/v1/trunks_credential_lists.go +++ b/rest/trunking/v1/trunks_credential_lists.go @@ -35,11 +35,10 @@ func (c *ApiService) CreateCredentialList(TrunkSid string, params *CreateCredent path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CredentialListSid != nil { data.Set("CredentialListSid", *params.CredentialListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListCredentialList(TrunkSid string, params *ListCredentialL path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_ip_access_control_lists.go b/rest/trunking/v1/trunks_ip_access_control_lists.go index e8ef5f317..38909a460 100644 --- a/rest/trunking/v1/trunks_ip_access_control_lists.go +++ b/rest/trunking/v1/trunks_ip_access_control_lists.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateIpAccessControlList(TrunkSid string, params *CreateIp path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpAccessControlListSid != nil { data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -116,11 +115,10 @@ func (c *ApiService) ListIpAccessControlList(TrunkSid string, params *ListIpAcce path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_origination_urls.go b/rest/trunking/v1/trunks_origination_urls.go index d91fe9d5e..4d0886ec0 100644 --- a/rest/trunking/v1/trunks_origination_urls.go +++ b/rest/trunking/v1/trunks_origination_urls.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -149,11 +148,10 @@ func (c *ApiService) ListOriginationUrl(TrunkSid string, params *ListOrigination path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -211,8 +209,6 @@ func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -228,6 +224,7 @@ func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *U if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_phone_numbers.go b/rest/trunking/v1/trunks_phone_numbers.go index 7f2048b5c..d51cf5cbd 100644 --- a/rest/trunking/v1/trunks_phone_numbers.go +++ b/rest/trunking/v1/trunks_phone_numbers.go @@ -35,11 +35,10 @@ func (c *ApiService) CreatePhoneNumber(TrunkSid string, params *CreatePhoneNumbe path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PhoneNumberSid != nil { data.Set("PhoneNumberSid", *params.PhoneNumberSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -113,11 +112,10 @@ func (c *ApiService) ListPhoneNumber(TrunkSid string, params *ListPhoneNumberPar path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trunking/v1/trunks_recording.go b/rest/trunking/v1/trunks_recording.go index e850ce4e2..703e81b7f 100644 --- a/rest/trunking/v1/trunks_recording.go +++ b/rest/trunking/v1/trunks_recording.go @@ -62,14 +62,13 @@ func (c *ApiService) UpdateRecording(TrunkSid string, params *UpdateRecordingPar path = strings.Replace(path, "{"+"TrunkSid"+"}", TrunkSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Mode != nil { data.Set("Mode", *params.Mode) } if params != nil && params.Trim != nil { data.Set("Trim", *params.Trim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/customer_profiles.go b/rest/trusthub/v1/customer_profiles.go index e708b43e0..2e03cc1a4 100644 --- a/rest/trusthub/v1/customer_profiles.go +++ b/rest/trusthub/v1/customer_profiles.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) path := "/v1/CustomerProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -158,8 +157,6 @@ func (c *ApiService) ListCustomerProfile(params *ListCustomerProfileParams) (*Li path := "/v1/CustomerProfiles" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -172,6 +169,7 @@ func (c *ApiService) ListCustomerProfile(params *ListCustomerProfileParams) (*Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -223,8 +221,6 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -237,6 +233,7 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go index abe90b886..7f777f382 100644 --- a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateCustomerProfileChannelEndpointAssignment(CustomerProf path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } if params != nil && params.ChannelEndpointType != nil { data.Set("ChannelEndpointType", *params.ChannelEndpointType) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -138,8 +137,6 @@ func (c *ApiService) ListCustomerProfileChannelEndpointAssignment(CustomerProfil path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } @@ -149,6 +146,7 @@ func (c *ApiService) ListCustomerProfileChannelEndpointAssignment(CustomerProfil if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/customer_profiles_entity_assignments.go b/rest/trusthub/v1/customer_profiles_entity_assignments.go index a1bec63a9..5dd5a6e7d 100644 --- a/rest/trusthub/v1/customer_profiles_entity_assignments.go +++ b/rest/trusthub/v1/customer_profiles_entity_assignments.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateCustomerProfileEntityAssignment(CustomerProfileSid st path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListCustomerProfileEntityAssignment(CustomerProfileSid stri path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/customer_profiles_evaluations.go b/rest/trusthub/v1/customer_profiles_evaluations.go index 99fbb74fd..a05e9949f 100644 --- a/rest/trusthub/v1/customer_profiles_evaluations.go +++ b/rest/trusthub/v1/customer_profiles_evaluations.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateCustomerProfileEvaluation(CustomerProfileSid string, path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PolicySid != nil { data.Set("PolicySid", *params.PolicySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -98,11 +97,10 @@ func (c *ApiService) ListCustomerProfileEvaluation(CustomerProfileSid string, pa path = strings.Replace(path, "{"+"CustomerProfileSid"+"}", CustomerProfileSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/end_user_types.go b/rest/trusthub/v1/end_user_types.go index 1c623ae91..83aef9235 100644 --- a/rest/trusthub/v1/end_user_types.go +++ b/rest/trusthub/v1/end_user_types.go @@ -58,11 +58,10 @@ func (c *ApiService) ListEndUserType(params *ListEndUserTypeParams) (*ListEndUse path := "/v1/EndUserTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/end_users.go b/rest/trusthub/v1/end_users.go index 7cd347d2d..f1c666b11 100644 --- a/rest/trusthub/v1/end_users.go +++ b/rest/trusthub/v1/end_users.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU path := "/v1/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -64,6 +62,7 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -137,11 +136,10 @@ func (c *ApiService) ListEndUser(params *ListEndUserParams) (*ListEndUserRespons path := "/v1/EndUsers" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -181,8 +179,6 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -195,6 +191,7 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/policies.go b/rest/trusthub/v1/policies.go index 43423aec0..e09a6441f 100644 --- a/rest/trusthub/v1/policies.go +++ b/rest/trusthub/v1/policies.go @@ -58,11 +58,10 @@ func (c *ApiService) ListPolicies(params *ListPoliciesParams) (*ListPoliciesResp path := "/v1/Policies" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/supporting_document_types.go b/rest/trusthub/v1/supporting_document_types.go index ccb3321d1..c35b35f61 100644 --- a/rest/trusthub/v1/supporting_document_types.go +++ b/rest/trusthub/v1/supporting_document_types.go @@ -58,11 +58,10 @@ func (c *ApiService) ListSupportingDocumentType(params *ListSupportingDocumentTy path := "/v1/SupportingDocumentTypes" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/supporting_documents.go b/rest/trusthub/v1/supporting_documents.go index c482ea2e6..e09437e1f 100644 --- a/rest/trusthub/v1/supporting_documents.go +++ b/rest/trusthub/v1/supporting_documents.go @@ -47,8 +47,6 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa path := "/v1/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -64,6 +62,7 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa if params != nil && params.Type != nil { data.Set("Type", *params.Type) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -137,11 +136,10 @@ func (c *ApiService) ListSupportingDocument(params *ListSupportingDocumentParams path := "/v1/SupportingDocuments" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -181,8 +179,6 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Attributes != nil { v, err := json.Marshal(params.Attributes) @@ -195,6 +191,7 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/trust_products.go b/rest/trusthub/v1/trust_products.go index 32c7ee774..5fbf63e99 100644 --- a/rest/trusthub/v1/trust_products.go +++ b/rest/trusthub/v1/trust_products.go @@ -53,8 +53,6 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus path := "/v1/TrustProducts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -67,6 +65,7 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -158,8 +157,6 @@ func (c *ApiService) ListTrustProduct(params *ListTrustProductParams) (*ListTrus path := "/v1/TrustProducts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -172,6 +169,7 @@ func (c *ApiService) ListTrustProduct(params *ListTrustProductParams) (*ListTrus if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -223,8 +221,6 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Email != nil { data.Set("Email", *params.Email) } @@ -237,6 +233,7 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa if params != nil && params.StatusCallback != nil { data.Set("StatusCallback", *params.StatusCallback) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go index a24c924d7..765bba4b5 100644 --- a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateTrustProductChannelEndpointAssignment(TrustProductSid path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } if params != nil && params.ChannelEndpointType != nil { data.Set("ChannelEndpointType", *params.ChannelEndpointType) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -138,8 +137,6 @@ func (c *ApiService) ListTrustProductChannelEndpointAssignment(TrustProductSid s path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ChannelEndpointSid != nil { data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) } @@ -149,6 +146,7 @@ func (c *ApiService) ListTrustProductChannelEndpointAssignment(TrustProductSid s if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/trust_products_entity_assignments.go b/rest/trusthub/v1/trust_products_entity_assignments.go index 4e3728e22..c0b898557 100644 --- a/rest/trusthub/v1/trust_products_entity_assignments.go +++ b/rest/trusthub/v1/trust_products_entity_assignments.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateTrustProductEntityAssignment(TrustProductSid string, path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.ObjectSid != nil { data.Set("ObjectSid", *params.ObjectSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListTrustProductEntityAssignment(TrustProductSid string, pa path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/trusthub/v1/trust_products_evaluations.go b/rest/trusthub/v1/trust_products_evaluations.go index 2fb2bf215..ff5215dfa 100644 --- a/rest/trusthub/v1/trust_products_evaluations.go +++ b/rest/trusthub/v1/trust_products_evaluations.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateTrustProductEvaluation(TrustProductSid string, params path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PolicySid != nil { data.Set("PolicySid", *params.PolicySid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -98,11 +97,10 @@ func (c *ApiService) ListTrustProductEvaluation(TrustProductSid string, params * path = strings.Replace(path, "{"+"TrustProductSid"+"}", TrustProductSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/attempts.go b/rest/verify/v2/attempts.go index 67a6ea962..0e29ecbd3 100644 --- a/rest/verify/v2/attempts.go +++ b/rest/verify/v2/attempts.go @@ -77,8 +77,6 @@ func (c *ApiService) ListVerificationAttempt(params *ListVerificationAttemptPara path := "/v2/Attempts" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DateCreatedAfter != nil { data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) } @@ -91,6 +89,7 @@ func (c *ApiService) ListVerificationAttempt(params *ListVerificationAttemptPara if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services.go b/rest/verify/v2/services.go index b4f30ebe9..594ac55d2 100644 --- a/rest/verify/v2/services.go +++ b/rest/verify/v2/services.go @@ -125,8 +125,6 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CodeLength != nil { data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) } @@ -175,6 +173,7 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic if params != nil && params.TtsName != nil { data.Set("TtsName", *params.TtsName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -248,11 +247,10 @@ func (c *ApiService) ListService(params *ListServiceParams) (*ListServiceRespons path := "/v2/Services" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -376,8 +374,6 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CodeLength != nil { data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) } @@ -426,6 +422,7 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve if params != nil && params.TtsName != nil { data.Set("TtsName", *params.TtsName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_access_tokens.go b/rest/verify/v2/services_access_tokens.go index 880a34914..ea41c4547 100644 --- a/rest/verify/v2/services_access_tokens.go +++ b/rest/verify/v2/services_access_tokens.go @@ -41,14 +41,13 @@ func (c *ApiService) CreateAccessToken(ServiceSid string, params *CreateAccessTo path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FactorType != nil { data.Set("FactorType", *params.FactorType) } if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities.go b/rest/verify/v2/services_entities.go index 6581372c1..7c89c3dec 100644 --- a/rest/verify/v2/services_entities.go +++ b/rest/verify/v2/services_entities.go @@ -36,11 +36,10 @@ func (c *ApiService) CreateEntity(ServiceSid string, params *CreateEntityParams) path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Identity != nil { data.Set("Identity", *params.Identity) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -117,11 +116,10 @@ func (c *ApiService) ListEntity(ServiceSid string, params *ListEntityParams) (*L path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities_challenges.go b/rest/verify/v2/services_entities_challenges.go index 0731c1cde..3b5568be2 100644 --- a/rest/verify/v2/services_entities_challenges.go +++ b/rest/verify/v2/services_entities_challenges.go @@ -68,8 +68,6 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthPayload != nil { data.Set("AuthPayload", *params.AuthPayload) } @@ -102,6 +100,7 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params data.Set("HiddenDetails", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -173,8 +172,6 @@ func (c *ApiService) ListChallenge(ServiceSid string, Identity string, params *L path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FactorSid != nil { data.Set("FactorSid", *params.FactorSid) } @@ -184,6 +181,7 @@ func (c *ApiService) ListChallenge(ServiceSid string, Identity string, params *L if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -219,11 +217,10 @@ func (c *ApiService) UpdateChallenge(ServiceSid string, Identity string, Sid str path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthPayload != nil { data.Set("AuthPayload", *params.AuthPayload) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities_challenges_notifications.go b/rest/verify/v2/services_entities_challenges_notifications.go index dd02a5724..801d3a266 100644 --- a/rest/verify/v2/services_entities_challenges_notifications.go +++ b/rest/verify/v2/services_entities_challenges_notifications.go @@ -38,11 +38,10 @@ func (c *ApiService) CreateNotification(ServiceSid string, Identity string, Chal path = strings.Replace(path, "{"+"ChallengeSid"+"}", ChallengeSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Ttl != nil { data.Set("Ttl", fmt.Sprint(*params.Ttl)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_entities_factors.go b/rest/verify/v2/services_entities_factors.go index 88278f254..20dcc520f 100644 --- a/rest/verify/v2/services_entities_factors.go +++ b/rest/verify/v2/services_entities_factors.go @@ -109,8 +109,6 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.BindingAlg != nil { data.Set("Binding.Alg", *params.BindingAlg) } @@ -150,6 +148,7 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -229,11 +228,10 @@ func (c *ApiService) ListFactor(ServiceSid string, Identity string, params *List path = strings.Replace(path, "{"+"Identity"+"}", Identity, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -311,8 +309,6 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AuthPayload != nil { data.Set("AuthPayload", *params.AuthPayload) } @@ -337,6 +333,7 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_messaging_configurations.go b/rest/verify/v2/services_messaging_configurations.go index eb88ff69c..b4c868464 100644 --- a/rest/verify/v2/services_messaging_configurations.go +++ b/rest/verify/v2/services_messaging_configurations.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateMessagingConfiguration(ServiceSid string, params *Cre path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Country != nil { data.Set("Country", *params.Country) } if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) ListMessagingConfiguration(ServiceSid string, params *ListM path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -165,11 +163,10 @@ func (c *ApiService) UpdateMessagingConfiguration(ServiceSid string, Country str path = strings.Replace(path, "{"+"Country"+"}", Country, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.MessagingServiceSid != nil { data.Set("MessagingServiceSid", *params.MessagingServiceSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_rate_limits.go b/rest/verify/v2/services_rate_limits.go index a5c5c5ba3..565b85c75 100644 --- a/rest/verify/v2/services_rate_limits.go +++ b/rest/verify/v2/services_rate_limits.go @@ -42,14 +42,13 @@ func (c *ApiService) CreateRateLimit(ServiceSid string, params *CreateRateLimitP path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -126,11 +125,10 @@ func (c *ApiService) ListRateLimit(ServiceSid string, params *ListRateLimitParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -165,11 +163,10 @@ func (c *ApiService) UpdateRateLimit(ServiceSid string, Sid string, params *Upda path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Description != nil { data.Set("Description", *params.Description) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_rate_limits_buckets.go b/rest/verify/v2/services_rate_limits_buckets.go index 944f04d09..53478398a 100644 --- a/rest/verify/v2/services_rate_limits_buckets.go +++ b/rest/verify/v2/services_rate_limits_buckets.go @@ -43,14 +43,13 @@ func (c *ApiService) CreateBucket(ServiceSid string, RateLimitSid string, params path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Interval != nil { data.Set("Interval", fmt.Sprint(*params.Interval)) } if params != nil && params.Max != nil { data.Set("Max", fmt.Sprint(*params.Max)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -130,11 +129,10 @@ func (c *ApiService) ListBucket(ServiceSid string, RateLimitSid string, params * path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -176,14 +174,13 @@ func (c *ApiService) UpdateBucket(ServiceSid string, RateLimitSid string, Sid st path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Interval != nil { data.Set("Interval", fmt.Sprint(*params.Interval)) } if params != nil && params.Max != nil { data.Set("Max", fmt.Sprint(*params.Max)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_verification_check.go b/rest/verify/v2/services_verification_check.go index 8297a68b5..3b3335700 100644 --- a/rest/verify/v2/services_verification_check.go +++ b/rest/verify/v2/services_verification_check.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Amount != nil { data.Set("Amount", *params.Amount) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe if params != nil && params.VerificationSid != nil { data.Set("VerificationSid", *params.VerificationSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_verifications.go b/rest/verify/v2/services_verifications.go index e1271d96d..385b28f11 100644 --- a/rest/verify/v2/services_verifications.go +++ b/rest/verify/v2/services_verifications.go @@ -101,8 +101,6 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Amount != nil { data.Set("Amount", *params.Amount) } @@ -151,6 +149,7 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific if params != nil && params.To != nil { data.Set("To", *params.To) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -209,11 +208,10 @@ func (c *ApiService) UpdateVerification(ServiceSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/verify/v2/services_webhooks.go b/rest/verify/v2/services_webhooks.go index b7e607c10..7f8433e9d 100644 --- a/rest/verify/v2/services_webhooks.go +++ b/rest/verify/v2/services_webhooks.go @@ -54,8 +54,6 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EventTypes != nil { for _, item := range *params.EventTypes { data.Add("EventTypes", item) @@ -70,6 +68,7 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -146,11 +145,10 @@ func (c *ApiService) ListWebhook(ServiceSid string, params *ListWebhookParams) ( path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -202,8 +200,6 @@ func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *Update path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EventTypes != nil { for _, item := range *params.EventTypes { data.Add("EventTypes", item) @@ -218,6 +214,7 @@ func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *Update if params != nil && params.WebhookUrl != nil { data.Set("WebhookUrl", *params.WebhookUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/composition_hooks.go b/rest/video/v1/composition_hooks.go index 0c8379614..19026feb1 100644 --- a/rest/video/v1/composition_hooks.go +++ b/rest/video/v1/composition_hooks.go @@ -89,8 +89,6 @@ func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) path := "/v1/CompositionHooks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AudioSources != nil { for _, item := range *params.AudioSources { data.Add("AudioSources", item) @@ -131,6 +129,7 @@ func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) data.Set("VideoLayout", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -228,8 +227,6 @@ func (c *ApiService) ListCompositionHook(params *ListCompositionHookParams) (*Li path := "/v1/CompositionHooks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -245,6 +242,7 @@ func (c *ApiService) ListCompositionHook(params *ListCompositionHookParams) (*Li if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -331,8 +329,6 @@ func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateComposition path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AudioSources != nil { for _, item := range *params.AudioSources { data.Add("AudioSources", item) @@ -373,6 +369,7 @@ func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateComposition data.Set("VideoLayout", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/composition_settings_default.go b/rest/video/v1/composition_settings_default.go index faee0033b..9d9fa70bc 100644 --- a/rest/video/v1/composition_settings_default.go +++ b/rest/video/v1/composition_settings_default.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings path := "/v1/CompositionSettings/Default" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AwsCredentialsSid != nil { data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) } @@ -82,6 +80,7 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/compositions.go b/rest/video/v1/compositions.go index 300dfffff..c9ed34b5e 100644 --- a/rest/video/v1/compositions.go +++ b/rest/video/v1/compositions.go @@ -83,8 +83,6 @@ func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV path := "/v1/Compositions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AudioSources != nil { for _, item := range *params.AudioSources { data.Add("AudioSources", item) @@ -122,6 +120,7 @@ func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV data.Set("VideoLayout", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -219,8 +218,6 @@ func (c *ApiService) ListComposition(params *ListCompositionParams) (*ListCompos path := "/v1/Compositions" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -236,6 +233,7 @@ func (c *ApiService) ListComposition(params *ListCompositionParams) (*ListCompos if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/recording_settings_default.go b/rest/video/v1/recording_settings_default.go index 4b7d59899..c7bbe7e3a 100644 --- a/rest/video/v1/recording_settings_default.go +++ b/rest/video/v1/recording_settings_default.go @@ -62,8 +62,6 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara path := "/v1/RecordingSettings/Default" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AwsCredentialsSid != nil { data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) } @@ -82,6 +80,7 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/recordings.go b/rest/video/v1/recordings.go index d7b6ae108..b806e7641 100644 --- a/rest/video/v1/recordings.go +++ b/rest/video/v1/recordings.go @@ -113,8 +113,6 @@ func (c *ApiService) ListRecording(params *ListRecordingParams) (*ListRecordingR path := "/v1/Recordings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -138,6 +136,7 @@ func (c *ApiService) ListRecording(params *ListRecordingParams) (*ListRecordingR if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms.go b/rest/video/v1/rooms.go index fdf88f371..b555bc664 100644 --- a/rest/video/v1/rooms.go +++ b/rest/video/v1/rooms.go @@ -89,8 +89,6 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) path := "/v1/Rooms" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.EnableTurn != nil { data.Set("EnableTurn", fmt.Sprint(*params.EnableTurn)) } @@ -129,6 +127,7 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) data.Add("VideoCodecs", item) } } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -206,8 +205,6 @@ func (c *ApiService) ListRoom(params *ListRoomParams) (*ListRoomResponse, error) path := "/v1/Rooms" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -223,6 +220,7 @@ func (c *ApiService) ListRoom(params *ListRoomParams) (*ListRoomResponse, error) if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -255,11 +253,10 @@ func (c *ApiService) UpdateRoom(Sid string, params *UpdateRoomParams) (*VideoV1R path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants.go b/rest/video/v1/rooms_participants.go index 1d8aa3f82..061268c07 100644 --- a/rest/video/v1/rooms_participants.go +++ b/rest/video/v1/rooms_participants.go @@ -83,8 +83,6 @@ func (c *ApiService) ListRoomParticipant(RoomSid string, params *ListRoomPartici path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -100,6 +98,7 @@ func (c *ApiService) ListRoomParticipant(RoomSid string, params *ListRoomPartici if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -133,11 +132,10 @@ func (c *ApiService) UpdateRoomParticipant(RoomSid string, Sid string, params *U path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants_published_tracks.go b/rest/video/v1/rooms_participants_published_tracks.go index b28719ed9..c16642120 100644 --- a/rest/video/v1/rooms_participants_published_tracks.go +++ b/rest/video/v1/rooms_participants_published_tracks.go @@ -62,11 +62,10 @@ func (c *ApiService) ListRoomParticipantPublishedTrack(RoomSid string, Participa path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants_subscribe_rules.go b/rest/video/v1/rooms_participants_subscribe_rules.go index dd9ca2695..e78030b0e 100644 --- a/rest/video/v1/rooms_participants_subscribe_rules.go +++ b/rest/video/v1/rooms_participants_subscribe_rules.go @@ -60,8 +60,6 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Rules != nil { v, err := json.Marshal(params.Rules) @@ -71,6 +69,7 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip data.Set("Rules", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_participants_subscribed_tracks.go b/rest/video/v1/rooms_participants_subscribed_tracks.go index 581267686..f8dd95fb7 100644 --- a/rest/video/v1/rooms_participants_subscribed_tracks.go +++ b/rest/video/v1/rooms_participants_subscribed_tracks.go @@ -62,11 +62,10 @@ func (c *ApiService) ListRoomParticipantSubscribedTrack(RoomSid string, Particip path = strings.Replace(path, "{"+"ParticipantSid"+"}", ParticipantSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_recording_rules.go b/rest/video/v1/rooms_recording_rules.go index ed00f0442..2898dc1d7 100644 --- a/rest/video/v1/rooms_recording_rules.go +++ b/rest/video/v1/rooms_recording_rules.go @@ -58,8 +58,6 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Rules != nil { v, err := json.Marshal(params.Rules) @@ -69,6 +67,7 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR data.Set("Rules", string(v)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/video/v1/rooms_recordings.go b/rest/video/v1/rooms_recordings.go index bda4b1e2d..cda8c318a 100644 --- a/rest/video/v1/rooms_recordings.go +++ b/rest/video/v1/rooms_recordings.go @@ -101,8 +101,6 @@ func (c *ApiService) ListRoomRecording(RoomSid string, params *ListRoomRecording path = strings.Replace(path, "{"+"RoomSid"+"}", RoomSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -118,6 +116,7 @@ func (c *ApiService) ListRoomRecording(RoomSid string, params *ListRoomRecording if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/byoc_trunks.go b/rest/voice/v1/byoc_trunks.go index a044c6e29..1437cb75e 100644 --- a/rest/voice/v1/byoc_trunks.go +++ b/rest/voice/v1/byoc_trunks.go @@ -88,8 +88,6 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo path := "/v1/ByocTrunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -120,6 +118,7 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -190,11 +189,10 @@ func (c *ApiService) ListByocTrunk(params *ListByocTrunkParams) (*ListByocTrunkR path := "/v1/ByocTrunks" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -281,8 +279,6 @@ func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CnamLookupEnabled != nil { data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) } @@ -313,6 +309,7 @@ func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/connection_policies.go b/rest/voice/v1/connection_policies.go index 68b5ddf86..69e86c958 100644 --- a/rest/voice/v1/connection_policies.go +++ b/rest/voice/v1/connection_policies.go @@ -34,11 +34,10 @@ func (c *ApiService) CreateConnectionPolicy(params *CreateConnectionPolicyParams path := "/v1/ConnectionPolicies" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -109,11 +108,10 @@ func (c *ApiService) ListConnectionPolicy(params *ListConnectionPolicyParams) (* path := "/v1/ConnectionPolicies" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -146,11 +144,10 @@ func (c *ApiService) UpdateConnectionPolicy(Sid string, params *UpdateConnection path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/connection_policies_targets.go b/rest/voice/v1/connection_policies_targets.go index f24fc1344..2f17909b3 100644 --- a/rest/voice/v1/connection_policies_targets.go +++ b/rest/voice/v1/connection_policies_targets.go @@ -59,8 +59,6 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -76,6 +74,7 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -149,11 +148,10 @@ func (c *ApiService) ListConnectionPolicyTarget(ConnectionPolicySid string, para path = strings.Replace(path, "{"+"ConnectionPolicySid"+"}", ConnectionPolicySid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -211,8 +209,6 @@ func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Si path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Enabled != nil { data.Set("Enabled", fmt.Sprint(*params.Enabled)) } @@ -228,6 +224,7 @@ func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Si if params != nil && params.Weight != nil { data.Set("Weight", fmt.Sprint(*params.Weight)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/dialing_permissions_bulk_country_updates.go b/rest/voice/v1/dialing_permissions_bulk_country_updates.go index 3f7abb4a4..8e942ec92 100644 --- a/rest/voice/v1/dialing_permissions_bulk_country_updates.go +++ b/rest/voice/v1/dialing_permissions_bulk_country_updates.go @@ -32,11 +32,10 @@ func (c *ApiService) CreateDialingPermissionsCountryBulkUpdate(params *CreateDia path := "/v1/DialingPermissions/BulkCountryUpdates" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.UpdateRequest != nil { data.Set("UpdateRequest", *params.UpdateRequest) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/dialing_permissions_countries.go b/rest/voice/v1/dialing_permissions_countries.go index 4c1ede4d4..c78642946 100644 --- a/rest/voice/v1/dialing_permissions_countries.go +++ b/rest/voice/v1/dialing_permissions_countries.go @@ -94,8 +94,6 @@ func (c *ApiService) ListDialingPermissionsCountry(params *ListDialingPermission path := "/v1/DialingPermissions/Countries" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IsoCode != nil { data.Set("IsoCode", *params.IsoCode) } @@ -117,6 +115,7 @@ func (c *ApiService) ListDialingPermissionsCountry(params *ListDialingPermission if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go b/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go index ee7733689..658882f1b 100644 --- a/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go +++ b/rest/voice/v1/dialing_permissions_countries_high_risk_special_prefixes.go @@ -36,11 +36,10 @@ func (c *ApiService) ListDialingPermissionsHrsPrefixes(IsoCode string, params *L path = strings.Replace(path, "{"+"IsoCode"+"}", IsoCode, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/ip_records.go b/rest/voice/v1/ip_records.go index 70e37cb64..46c3dd50b 100644 --- a/rest/voice/v1/ip_records.go +++ b/rest/voice/v1/ip_records.go @@ -46,8 +46,6 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec path := "/v1/IpRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CidrPrefixLength != nil { data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) } @@ -57,6 +55,7 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec if params != nil && params.IpAddress != nil { data.Set("IpAddress", *params.IpAddress) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -127,11 +126,10 @@ func (c *ApiService) ListIpRecord(params *ListIpRecordParams) (*ListIpRecordResp path := "/v1/IpRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -164,11 +162,10 @@ func (c *ApiService) UpdateIpRecord(Sid string, params *UpdateIpRecordParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/settings.go b/rest/voice/v1/settings.go index 1f20b744b..ff0040815 100644 --- a/rest/voice/v1/settings.go +++ b/rest/voice/v1/settings.go @@ -55,11 +55,10 @@ func (c *ApiService) UpdateDialingPermissionsSettings(params *UpdateDialingPermi path := "/v1/Settings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DialingPermissionsInheritance != nil { data.Set("DialingPermissionsInheritance", fmt.Sprint(*params.DialingPermissionsInheritance)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/voice/v1/source_ip_mappings.go b/rest/voice/v1/source_ip_mappings.go index 375603dcf..040334742 100644 --- a/rest/voice/v1/source_ip_mappings.go +++ b/rest/voice/v1/source_ip_mappings.go @@ -40,14 +40,13 @@ func (c *ApiService) CreateSourceIpMapping(params *CreateSourceIpMappingParams) path := "/v1/SourceIpMappings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.IpRecordSid != nil { data.Set("IpRecordSid", *params.IpRecordSid) } if params != nil && params.SipDomainSid != nil { data.Set("SipDomainSid", *params.SipDomainSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -118,11 +117,10 @@ func (c *ApiService) ListSourceIpMapping(params *ListSourceIpMappingParams) (*Li path := "/v1/SourceIpMappings" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -155,11 +153,10 @@ func (c *ApiService) UpdateSourceIpMapping(Sid string, params *UpdateSourceIpMap path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.SipDomainSid != nil { data.Set("SipDomainSid", *params.SipDomainSid) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/commands.go b/rest/wireless/v1/commands.go index 1f5ecf35d..a1a728bc2 100644 --- a/rest/wireless/v1/commands.go +++ b/rest/wireless/v1/commands.go @@ -71,8 +71,6 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.CallbackMethod != nil { data.Set("CallbackMethod", *params.CallbackMethod) } @@ -94,6 +92,7 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -191,8 +190,6 @@ func (c *ApiService) ListCommand(params *ListCommandParams) (*ListCommandRespons path := "/v1/Commands" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Sim != nil { data.Set("Sim", *params.Sim) } @@ -208,6 +205,7 @@ func (c *ApiService) ListCommand(params *ListCommandParams) (*ListCommandRespons if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/rate_plans.go b/rest/wireless/v1/rate_plans.go index 2c4722a84..df95765b8 100644 --- a/rest/wireless/v1/rate_plans.go +++ b/rest/wireless/v1/rate_plans.go @@ -94,8 +94,6 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra path := "/v1/RatePlans" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.DataEnabled != nil { data.Set("DataEnabled", fmt.Sprint(*params.DataEnabled)) } @@ -131,6 +129,7 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra if params != nil && params.VoiceEnabled != nil { data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { @@ -201,11 +200,10 @@ func (c *ApiService) ListRatePlan(params *ListRatePlanParams) (*ListRatePlanResp path := "/v1/RatePlans" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -244,14 +242,13 @@ func (c *ApiService) UpdateRatePlan(Sid string, params *UpdateRatePlanParams) (* path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.FriendlyName != nil { data.Set("FriendlyName", *params.FriendlyName) } if params != nil && params.UniqueName != nil { data.Set("UniqueName", *params.UniqueName) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/sims.go b/rest/wireless/v1/sims.go index 25fc62c98..ca87fea97 100644 --- a/rest/wireless/v1/sims.go +++ b/rest/wireless/v1/sims.go @@ -106,8 +106,6 @@ func (c *ApiService) ListSim(params *ListSimParams) (*ListSimResponse, error) { path := "/v1/Sims" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.Status != nil { data.Set("Status", *params.Status) } @@ -126,6 +124,7 @@ func (c *ApiService) ListSim(params *ListSimParams) (*ListSimResponse, error) { if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { @@ -261,8 +260,6 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.AccountSid != nil { data.Set("AccountSid", *params.AccountSid) } @@ -317,6 +314,7 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 if params != nil && params.VoiceUrl != nil { data.Set("VoiceUrl", *params.VoiceUrl) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/sims_data_sessions.go b/rest/wireless/v1/sims_data_sessions.go index 7337f478f..2abf83804 100644 --- a/rest/wireless/v1/sims_data_sessions.go +++ b/rest/wireless/v1/sims_data_sessions.go @@ -35,11 +35,10 @@ func (c *ApiService) ListDataSession(SimSid string, params *ListDataSessionParam path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/sims_usage_records.go b/rest/wireless/v1/sims_usage_records.go index 2515f5456..05512175f 100644 --- a/rest/wireless/v1/sims_usage_records.go +++ b/rest/wireless/v1/sims_usage_records.go @@ -54,8 +54,6 @@ func (c *ApiService) ListUsageRecord(SimSid string, params *ListUsageRecordParam path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1) data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.End != nil { data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) } @@ -68,6 +66,7 @@ func (c *ApiService) ListUsageRecord(SimSid string, params *ListUsageRecordParam if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { diff --git a/rest/wireless/v1/usage_records.go b/rest/wireless/v1/usage_records.go index 46b439dc2..a1f6b26de 100644 --- a/rest/wireless/v1/usage_records.go +++ b/rest/wireless/v1/usage_records.go @@ -52,8 +52,6 @@ func (c *ApiService) ListAccountUsageRecord(params *ListAccountUsageRecordParams path := "/v1/UsageRecords" data := url.Values{} - headers := make(map[string]interface{}) - if params != nil && params.End != nil { data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) } @@ -66,6 +64,7 @@ func (c *ApiService) ListAccountUsageRecord(params *ListAccountUsageRecordParams if params != nil && params.PageSize != nil { data.Set("PageSize", fmt.Sprint(*params.PageSize)) } + headers := make(map[string]interface{}) resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil {